# \_invoiceUpdate

Update an invoice.

### Parameters

#### id

The ID of the Job.

#### discount

Float value to discount.

#### pandp

Float value of Postage and Packaging.

#### discount\_vat

Float value how much VAT to discount.

#### pandp\_vat

Float value how much VAT is on Postage and Packaging.

#### doc\_no

Number of the invoice.

#### order\_no

Optional. If this invoice is for a PurchaseOrder, what is the PurchaseOrder's number.

#### rows

Array of invoice rows. Each row has 6 columns:

* Text description.
* Net price of that item.
* Amount of items.
* Net total (net price \* amt).
* How much tax to apply.
* Gross total (net total + tax percentage).

#### invoice\_number

Optional text field.

#### notes

Optional text.

#### cdate

Date of the invoice.

### Example

```
FM_api('Job_invoiceUpdate',	['id' => '222402',
                                     'discount' => '.1',
                                     'pandp' => '13.99',
                                     'discount_vat' => '.05',
                                     'pandp_vat' => '2.99',
                                     'doc_no' => 'test001',
                                     'order_no' => '',
                                     'rows' => [['item 001',
                                                 '1.99',
                                                 '10',
                                                 '19.9',
                                                 '34.5',
                                                 '26.77']],
                                     'invoice_number' => '0001',
                                     'notes' => 'This is an invoice note',
                                     'cdate' => date('Y-m-d')]);
```

### Result

#### On Success

```
{'ok':1}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/job/_invoiceupdate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
