Skip to content

Commit

Permalink
✨ add support for financial document v1.10 & invoice v4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Oct 10, 2024
1 parent f6be180 commit 92e8dd0
Show file tree
Hide file tree
Showing 13 changed files with 361 additions and 19 deletions.
51 changes: 50 additions & 1 deletion docs/bill_of_lading_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 658193df8e029d002ad9c89b
---
The PHP OCR SDK supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg) can be used for testing purposes.
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Bill of Lading sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -27,6 +27,55 @@ $apiResponse = $mindeeClient->enqueueAndParse(BillOfLadingV1::class, $inputSourc

echo $apiResponse->document;
```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 3b5250a1-b52c-4e0b-bc3e-2f0146b04e29
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/bill_of_lading v1.1
:Rotation applied: No
Prediction
==========
:Bill of Lading Number: XYZ123456
:Shipper:
:Address: 123 OCEAN DRIVE, SHANGHAI, CHINA
:Email:
:Name: GLOBAL FREIGHT SOLUTIONS INC.
:Phone: 86-21-12345678
:Consignee:
:Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
:Email:
:Name: PACIFIC TRADING CO.
:Phone: 65-65432100
:Notify Party:
:Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
:Email:
:Name: PACIFIC TRADING CO.
:Phone: 65-65432100
:Carrier:
:Name: GLOBAL SHIPPING CO.,LTD.
:Professional Number:
:SCAC:
:Items:
+--------------------------------------+--------------+-------------+------------------+----------+-------------+
| Description | Gross Weight | Measurement | Measurement Unit | Quantity | Weight Unit |
+======================================+==============+=============+==================+==========+=============+
| ELECTRONIC COMPONENTS\nP/N: 12345... | 500.00 | 1.50 | cbm | 1.00 | kgs |
+--------------------------------------+--------------+-------------+------------------+----------+-------------+
:Port of Loading: SHANGHAI, CHINA
:Port of Discharge: LOS ANGELES, USA
:Place of Delivery: LOS ANGELES, USA
:Date of issue: 2022-09-30
:Departure Date:
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
62 changes: 61 additions & 1 deletion docs/energy_bill_fra_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 658193df8e029d002ad9c89b
---
The PHP OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg) can be used for testing purposes.
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -27,6 +27,66 @@ $apiResponse = $mindeeClient->enqueueAndParse(EnergyBillV1::class, $inputSource)

echo $apiResponse->document;
```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 17f0ccef-e3fe-4a28-838d-d704489d6ce7
:Filename: default_sample.pdf
Inference
#########
:Product: mindee/energy_bill_fra v1.0
:Rotation applied: No
Prediction
==========
:Invoice Number: 10123590373
:Contract ID: 1234567890
:Delivery Point: 98765432109876
:Invoice Date: 2021-01-29
:Due Date: 2021-02-15
:Total Before Taxes: 1241.03
:Total Taxes: 238.82
:Total Amount: 1479.85
:Energy Supplier:
:Address: TSA 12345, 12345 DEMOCITY CEDEX, 75001 PARIS
:Name: EDF
:Energy Consumer:
:Address: 12 AVENUE DES RÊVES, RDC A 123 COUR FAUSSE A, 75000 PARIS
:Name: John Doe
:Subscription:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Energy Usage:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Consommation (HT) | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | 10.47 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Taxes and Contributions:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 2.25 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Départementale sur la Conso Final... | 2020-12-31 | 2020-11-28 | 20.00 | 13.98 | 0.3315 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Communale sur la Conso Finale Ele... | 2021-01-27 | 2021-01-01 | 20.00 | 28.56 | 0.6545 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Contribution Tarifaire d'Achemine... | 2020-12-31 | 2020-11-28 | 20.00 | 27.96 | 0.663 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Meter Details:
:Meter Number: 620
:Meter Type: electricity
:Unit of Measure: kWh
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
8 changes: 4 additions & 4 deletions docs/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Prediction
==========
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory: restaurant
:Purchase Subcategory:
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand All @@ -59,7 +59,7 @@ Prediction
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: clachan
:Supplier Name: Clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
Expand All @@ -79,7 +79,7 @@ Page 0
------
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory: restaurant
:Purchase Subcategory:
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand All @@ -93,7 +93,7 @@ Page 0
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: clachan
:Supplier Name: Clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
Expand Down
14 changes: 14 additions & 0 deletions docs/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,20 @@ foreach ($result->document->inference->prediction->lineItems as $lineItemsElem)
echo $result->document->inference->prediction->locale->value;
```

## Payment Date
**paymentDate** : The date on which the payment is due / fullfilled.

```php
echo $result->document->inference->prediction->paymentDate->value;
```

## Purchase Order Number
**poNumber** : The purchase order number.

```php
echo $result->document->inference->prediction->poNumber->value;
```

## Receipt Number
**receiptNumber** : The receipt number or identifier only if document is a receipt.

Expand Down
18 changes: 16 additions & 2 deletions docs/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Prediction
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: i_doi@example.com
:Supplier Email: ldoi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand Down Expand Up @@ -127,7 +127,7 @@ Page 0
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: i_doi@example.com
:Supplier Email: ldoi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand Down Expand Up @@ -328,6 +328,20 @@ foreach ($result->document->inference->prediction->lineItems as $lineItemsElem)
echo $result->document->inference->prediction->locale->value;
```

## Payment Date
**paymentDate** : The date on which the payment is due/ was full-filled.

```php
echo $result->document->inference->prediction->paymentDate->value;
```

## Purchase Order Number
**poNumber** : The purchase order number.

```php
echo $result->document->inference->prediction->poNumber->value;
```

## Reference Numbers
**referenceNumbers** : List of Reference numbers, including PO number.

Expand Down
81 changes: 80 additions & 1 deletion docs/nutrition_facts_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 658193df8e029d002ad9c89b
---
The PHP OCR SDK supports the [Nutrition Facts Label API](https://platform.mindee.com/mindee/nutrition_facts).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg) can be used for testing purposes.
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Nutrition Facts Label sample](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -27,6 +27,85 @@ $apiResponse = $mindeeClient->enqueueAndParse(NutritionFactsLabelV1::class, $inp

echo $apiResponse->document;
```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 38a12fe0-5d69-4ca4-9b30-12f1b659311c
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/nutrition_facts v1.0
:Rotation applied: No
Prediction
==========
:Serving per Box: 2.00
:Serving Size:
:Amount: 228.00
:Unit: g
:Calories:
:Daily Value:
:Per 100g:
:Per Serving: 250.00
:Total Fat:
:Daily Value:
:Per 100g:
:Per Serving: 12.00
:Saturated Fat:
:Daily Value: 15.00
:Per 100g:
:Per Serving: 3.00
:Trans Fat:
:Daily Value:
:Per 100g:
:Per Serving: 3.00
:Cholesterol:
:Daily Value: 10.00
:Per 100g:
:Per Serving: 30.00
:Total Carbohydrate:
:Daily Value: 10.00
:Per 100g:
:Per Serving: 31.00
:Dietary Fiber:
:Daily Value: 0.00
:Per 100g:
:Per Serving: 0.00
:Total Sugars:
:Daily Value:
:Per 100g:
:Per Serving: 5.00
:Added Sugars:
:Daily Value:
:Per 100g:
:Per Serving:
:Protein:
:Daily Value:
:Per 100g:
:Per Serving: 5.00
:sodium:
:Daily Value: 20.00
:Per 100g:
:Per Serving: 470.00
:Unit: mg
:nutrients:
+-------------+----------------------+----------+-------------+------+
| Daily Value | Name | Per 100g | Per Serving | Unit |
+=============+======================+==========+=============+======+
| 12.00 | Vitamin A | | 4.00 | mcg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Vitamin C | | 2.00 | mg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Calcium | | 45.60 | mg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Iron | | 0.90 | mg |
+-------------+----------------------+----------+-------------+------+
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
Loading

0 comments on commit 92e8dd0

Please sign in to comment.