Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Payment "The amount field is required." #15

Open
timwhite opened this issue Jul 30, 2019 · 3 comments
Open

Payment "The amount field is required." #15

timwhite opened this issue Jul 30, 2019 · 3 comments

Comments

@timwhite
Copy link

I believe this is similar issue to #4
I've exported from Invoice Plane, and when attempting to import to InvoiceNinja I get the following errors.

The following records failed to import, they either already exist or are missing required fields.
{"invoice_id":2,"type":"payment","error":"The amount field is required."}
{"invoice_id":9,"type":"payment","error":"The amount field is required."}
{"invoice_id":14,"type":"payment","error":"The amount field is required."}
{"invoice_id":116,"type":"payment","error":"The amount field is required."}
{"invoice_id":121,"type":"payment","error":"The amount field is required."}
{"invoice_id":122,"type":"payment","error":"The amount field is required."}
{"invoice_id":129,"type":"payment","error":"The amount field is required."}
{"invoice_id":134,"type":"payment","error":"The amount field is required."}
{"invoice_id":146,"type":"payment","error":"The amount field is required."}
{"invoice_id":155,"type":"payment","error":"The amount field is required."}
{"invoice_id":158,"type":"payment","error":"The amount field is required."}
{"invoice_id":159,"type":"payment","error":"The amount field is required."}

What is odd, is that some of those payments exist in the JSON file, and they do have the amount field! Checking in InvoiceNinja, those payments have failed to import. (There are payments that are missing, which is fine, but there should only be about 6 missing payments)

For example, invoice_id 2 and 9 payments:

"invoices": [
                {
                    "client_id": 5,
                    "invoice_number": "0257",
                    "amount": "15.00",
                    "po_number": "",
                    "terms": "",
                    "public_notes": "",
                    "invoice_date": "2015-07-01",
                    "due_date": null,
                    "invoice_status_id": 6,
                    "is_amount_discount": null,
                    "discount": 0,
                    "tax_name1": "",
                    "tax_rate1": 0,
                    "tax_name2": "",
                    "tax_rate2": 0,
                    "invoice_design_id": 1,
                    "is_public": 1,
                    "invoice_items": [
                        {
                            "product_key": "XXXXX",
                            "notes": "XXXXX",
                            "cost": "15.00",
                            "qty": "1.00",
                            "tax_name1": "",
                            "tax_rate1": 0,
                            "invoice_item_type_id": 1,
                            "discount": "0.00"
                        }
                    ],
                    "payments": [
                        {
                            "id": 2,
                            "amount": 15,
                            "payment_date": "2015-07-09",
                            "client_id": 5,
                            "invoice_id": 2,
                            "payment_type_id": 3
                        }
                    ]
                },


{
                    "client_id": 5,
                    "invoice_number": "0269",
                    "amount": "15.00",
                    "po_number": "",
                    "terms": "",
                    "public_notes": "",
                    "invoice_date": "2015-09-01",
                    "due_date": null,
                    "invoice_status_id": 6,
                    "is_amount_discount": null,
                    "discount": 0,
                    "tax_name1": "",
                    "tax_rate1": 0,
                    "tax_name2": "",
                    "tax_rate2": 0,
                    "invoice_design_id": 1,
                    "is_public": 1,
                    "invoice_items": [
                        {
                            "product_key": "XXXXX",
                            "notes": "XXXXX",
                            "cost": "15.00",
                            "qty": "1.00",
                            "tax_name1": "",
                            "tax_rate1": 0,
                            "invoice_item_type_id": 1,
                            "discount": "0.00"
                        }
                    ],
                    "payments": [
                        {
                            "id": 9,
                            "amount": 15,
                            "payment_date": "2015-09-09",
                            "client_id": 5,
                            "invoice_id": 14,
                            "payment_type_id": 3
                        }
                    ]
                },
@timwhite
Copy link
Author

Hmmm. On further inspection, it does appear that the payments have imported. I'll do more digging to work out if it's a false error message then.

@timwhite
Copy link
Author

The best I can work out, it's a false positive. Happy to provide you (privately) my json export so you can do some testing and work out why. Otherwise, feel free to close the issue.

@tkintenn
Copy link

I had this same issue with mine... but they did import.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants