diff --git a/docs/bill_of_lading_v1.md b/docs/bill_of_lading_v1.md index 70db7c06..1e062f9f 100644 --- a/docs/bill_of_lading_v1.md +++ b/docs/bill_of_lading_v1.md @@ -6,7 +6,7 @@ parentDoc: 6357abb22e33070016cbda4b --- The .NET 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 @@ -36,6 +36,55 @@ System.Console.WriteLine(response.Document.ToString()); // System.Console.WriteLine(response.Document.Inference.Prediction.ToString()); ``` + +**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. diff --git a/docs/energy_bill_fra_v1.md b/docs/energy_bill_fra_v1.md index 1597abf3..53ba210e 100644 --- a/docs/energy_bill_fra_v1.md +++ b/docs/energy_bill_fra_v1.md @@ -6,7 +6,7 @@ parentDoc: 6357abb22e33070016cbda4b --- The .NET 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 @@ -36,6 +36,66 @@ System.Console.WriteLine(response.Document.ToString()); // System.Console.WriteLine(response.Document.Inference.Prediction.ToString()); ``` + +**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. diff --git a/docs/expense_receipts_v5.md b/docs/expense_receipts_v5.md index b73d74e3..a96c5fd8 100644 --- a/docs/expense_receipts_v5.md +++ b/docs/expense_receipts_v5.md @@ -54,7 +54,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 @@ -68,7 +68,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 @@ -88,7 +88,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 @@ -102,7 +102,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 diff --git a/docs/financial_document_v1.md b/docs/financial_document_v1.md index d5e03a71..96dd2ec7 100644 --- a/docs/financial_document_v1.md +++ b/docs/financial_document_v1.md @@ -386,6 +386,20 @@ foreach (var LineItemsElem in result.Document.Inference.Prediction.LineItems) System.Console.WriteLine(result.Document.Inference.Prediction.Locale.Value); ``` +## Payment Date +**PaymentDate**: The date on which the payment is due / fullfilled. + +```csharp +System.Console.WriteLine(result.Document.Inference.Prediction.PaymentDate.Value); +``` + +## Purchase Order Number +**PoNumber**: The purchase order number. + +```csharp +System.Console.WriteLine(result.Document.Inference.Prediction.PoNumber.Value); +``` + ## Receipt Number **ReceiptNumber**: The receipt number or identifier only if document is a receipt. diff --git a/docs/invoices_v4.md b/docs/invoices_v4.md index 7c6da282..4386d023 100644 --- a/docs/invoices_v4.md +++ b/docs/invoices_v4.md @@ -101,7 +101,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 @@ -145,7 +145,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 @@ -348,6 +348,20 @@ foreach (var LineItemsElem in result.Document.Inference.Prediction.LineItems) System.Console.WriteLine(result.Document.Inference.Prediction.Locale.Value); ``` +## Payment Date +**PaymentDate**: The date on which the payment is due/ was full-filled. + +```csharp +System.Console.WriteLine(result.Document.Inference.Prediction.PaymentDate.Value); +``` + +## Purchase Order Number +**PoNumber**: The purchase order number. + +```csharp +System.Console.WriteLine(result.Document.Inference.Prediction.PoNumber.Value); +``` + ## Reference Numbers **ReferenceNumbers**: List of Reference numbers, including PO number. diff --git a/docs/nutrition_facts_v1.md b/docs/nutrition_facts_v1.md index 7701452a..b51f3053 100644 --- a/docs/nutrition_facts_v1.md +++ b/docs/nutrition_facts_v1.md @@ -6,7 +6,7 @@ parentDoc: 6357abb22e33070016cbda4b --- The .NET 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 @@ -36,6 +36,85 @@ System.Console.WriteLine(response.Document.ToString()); // System.Console.WriteLine(response.Document.Inference.Prediction.ToString()); ``` + +**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. diff --git a/docs/payslip_fra_v2.md b/docs/payslip_fra_v2.md index fd6ed224..acd94b18 100644 --- a/docs/payslip_fra_v2.md +++ b/docs/payslip_fra_v2.md @@ -6,7 +6,7 @@ parentDoc: 6357abb22e33070016cbda4b --- The .NET OCR SDK supports the [Payslip API](https://platform.mindee.com/mindee/payslip_fra). -The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/payslip_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/payslip_fra/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. ![Payslip sample](https://github.com/mindee/client-lib-test-data/blob/main/products/payslip_fra/default_sample.jpg?raw=true) # Quick-Start @@ -36,6 +36,82 @@ System.Console.WriteLine(response.Document.ToString()); // System.Console.WriteLine(response.Document.Inference.Prediction.ToString()); ``` + +**Output (RST):** +```rst +######## +Document +######## +:Mindee ID: 972edba5-25aa-49d0-8431-e2557ddd788e +:Filename: default_sample.jpg + +Inference +######### +:Product: mindee/payslip_fra v2.0 +:Rotation applied: No + +Prediction +========== +:Employee: + :Address: 52 RUE DES FLEURS 33500 LIBOURNE FRANCE + :Date of Birth: + :First Name: Jean Luc + :Last Name: Picard + :Phone Number: + :Registration Number: + :Social Security Number: 123456789012345 +:Employer: + :Address: 1 RUE DU TONNOT 25210 DOUBS + :Company ID: 12345678901234 + :Company Site: + :NAF Code: 1234A + :Name: DEMO COMPANY + :Phone Number: + :URSSAF Number: +:Bank Account Details: + :Bank Name: + :IBAN: + :SWIFT: +:Employment: + :Category: Cadre + :Coefficient: 600.00 + :Collective Agreement: Construction -- Promotion + :Job Title: Directeur Régional du Développement + :Position Level: + :Start Date: 2022-05-01 +:Salary Details: + +--------------+-----------+--------------------------------------+-----------+ + | Amount | Base | Description | Rate | + +==============+===========+======================================+===========+ + | 6666.67 | | Salaire de base | | + +--------------+-----------+--------------------------------------+-----------+ + | 9.30 | | Part patronale Mutuelle NR | | + +--------------+-----------+--------------------------------------+-----------+ + | 508.30 | | Avantages en nature voiture | | + +--------------+-----------+--------------------------------------+-----------+ +:Pay Detail: + :Gross Salary: 7184.27 + :Gross Salary YTD: 18074.81 + :Income Tax Rate: 17.60 + :Income Tax Withheld: 1030.99 + :Net Paid: 3868.32 + :Net Paid Before Tax: 4899.31 + :Net Taxable: 5857.90 + :Net Taxable YTD: 14752.73 + :Total Cost Employer: 10486.94 + :Total Taxes and Deductions: 1650.36 +:PTO: + :Accrued This Period: 6.17 + :Balance End of Period: 6.17 + :Used This Period: +:Pay Period: + :End Date: 2023-03-31 + :Month: 03 + :Payment Date: 2023-03-29 + :Start Date: 2023-03-01 + :Year: 2023 +``` + # Field Types ## Standard Fields These fields are generic and used in several products. diff --git a/docs/us_mail_v2.md b/docs/us_mail_v2.md index 30fba020..f753f885 100644 --- a/docs/us_mail_v2.md +++ b/docs/us_mail_v2.md @@ -42,7 +42,7 @@ System.Console.WriteLine(response.Document.ToString()); :Sender Name: zed :Sender Address: :City: Dallas - :Complete Address: 54321 Elm Street, Dallas, Texas ... + :Complete Address: 54321 Elm Street, Dallas, Texas 54321 :Postal Code: 54321 :State: TX :Street: 54321 Elm Street diff --git a/src/Mindee/Product/FinancialDocument/FinancialDocumentV1Document.cs b/src/Mindee/Product/FinancialDocument/FinancialDocumentV1Document.cs index 688d381b..6b62e5f1 100644 --- a/src/Mindee/Product/FinancialDocument/FinancialDocumentV1Document.cs +++ b/src/Mindee/Product/FinancialDocument/FinancialDocumentV1Document.cs @@ -8,7 +8,7 @@ namespace Mindee.Product.FinancialDocument { /// - /// Financial Document API version 1.9 document data. + /// Financial Document API version 1.10 document data. /// public class FinancialDocumentV1Document : IPrediction { @@ -91,6 +91,18 @@ public class FinancialDocumentV1Document : IPrediction [JsonPropertyName("locale")] public Locale Locale { get; set; } + /// + /// The date on which the payment is due / fullfilled. + /// + [JsonPropertyName("payment_date")] + public DateField PaymentDate { get; set; } + + /// + /// The purchase order number. + /// + [JsonPropertyName("po_number")] + public StringField PoNumber { get; set; } + /// /// The receipt number or identifier only if document is a receipt. /// @@ -214,11 +226,13 @@ public override string ToString() StringBuilder result = new StringBuilder(); result.Append($":Locale: {Locale}\n"); result.Append($":Invoice Number: {InvoiceNumber}\n"); + result.Append($":Purchase Order Number: {PoNumber}\n"); result.Append($":Receipt Number: {ReceiptNumber}\n"); result.Append($":Document Number: {DocumentNumber}\n"); result.Append($":Reference Numbers: {referenceNumbers}\n"); result.Append($":Purchase Date: {Date}\n"); result.Append($":Due Date: {DueDate}\n"); + result.Append($":Payment Date: {PaymentDate}\n"); result.Append($":Total Net: {TotalNet}\n"); result.Append($":Total Amount: {TotalAmount}\n"); result.Append($":Taxes:{Taxes}"); diff --git a/src/Mindee/Product/Invoice/InvoiceV4Document.cs b/src/Mindee/Product/Invoice/InvoiceV4Document.cs index 3fae9bd7..04676de7 100644 --- a/src/Mindee/Product/Invoice/InvoiceV4Document.cs +++ b/src/Mindee/Product/Invoice/InvoiceV4Document.cs @@ -8,7 +8,7 @@ namespace Mindee.Product.Invoice { /// - /// Invoice API version 4.7 document data. + /// Invoice API version 4.8 document data. /// public class InvoiceV4Document : IPrediction { @@ -79,6 +79,18 @@ public class InvoiceV4Document : IPrediction [JsonPropertyName("locale")] public Locale Locale { get; set; } + /// + /// The date on which the payment is due/ was full-filled. + /// + [JsonPropertyName("payment_date")] + public DateField PaymentDate { get; set; } + + /// + /// The purchase order number. + /// + [JsonPropertyName("po_number")] + public StringField PoNumber { get; set; } + /// /// List of Reference numbers, including PO number. /// @@ -178,9 +190,11 @@ public override string ToString() StringBuilder result = new StringBuilder(); result.Append($":Locale: {Locale}\n"); result.Append($":Invoice Number: {InvoiceNumber}\n"); + result.Append($":Purchase Order Number: {PoNumber}\n"); result.Append($":Reference Numbers: {referenceNumbers}\n"); result.Append($":Purchase Date: {Date}\n"); result.Append($":Due Date: {DueDate}\n"); + result.Append($":Payment Date: {PaymentDate}\n"); result.Append($":Total Net: {TotalNet}\n"); result.Append($":Total Amount: {TotalAmount}\n"); result.Append($":Total Tax: {TotalTax}\n"); diff --git a/tests/Mindee.UnitTests/Product/Invoice/InvoiceV4Test.cs b/tests/Mindee.UnitTests/Product/Invoice/InvoiceV4Test.cs index 0830dc3b..e36e34a1 100644 --- a/tests/Mindee.UnitTests/Product/Invoice/InvoiceV4Test.cs +++ b/tests/Mindee.UnitTests/Product/Invoice/InvoiceV4Test.cs @@ -13,9 +13,11 @@ public async Task Predict_CheckEmpty() var docPrediction = response.Document.Inference.Prediction; Assert.Null(docPrediction.Locale.Value); Assert.Null(docPrediction.InvoiceNumber.Value); + Assert.Null(docPrediction.PoNumber.Value); Assert.Empty(docPrediction.ReferenceNumbers); Assert.Null(docPrediction.Date.Value); Assert.Null(docPrediction.DueDate.Value); + Assert.Null(docPrediction.PaymentDate.Value); Assert.Null(docPrediction.TotalNet.Value); Assert.Null(docPrediction.TotalAmount.Value); Assert.Null(docPrediction.TotalTax.Value); diff --git a/tests/resources b/tests/resources index 43984fb9..e93f49c8 160000 --- a/tests/resources +++ b/tests/resources @@ -1 +1 @@ -Subproject commit 43984fb924bb22e1182a5eb218fafddf4ce0ec4d +Subproject commit e93f49c8a78ba3d71c35a8fe2219d973cfcb1334