# Invoicing

Once you have completed [setting preferences](install-preferences.md) in QBI and linked objects you are ready to Invoice.

When QBI is started, unless there are errors or missing settings it will by default show a list of work orders available to be invoiced:

![main Work orders ready to invoice](img/main-work-order-list.png)

## Problem work orders

In the image above you can see by the red exclamation circle icon in the row header at the left that the first three work orders have some issues to be fixed before they can be invoiced.

Usually this is caused by some objects on the work order that have not yet been linked to QuickBooks so QBI doesn't know how to invoice those objects yet or a price that varies between QuickBooks and AyaNova.

This can be avoided by ensuring you have linked all AyaNova objects to QuickBooks objects _before_ getting here, however it's not unusual for a new item to be created in AyaNova so this provides a quick way to resolve these issues when they arise.

To fix these problems use the "Fix problems" menu option:

![main fix problems](img/main-menu-invoice-fix-problems-item.png)

This will open the "Fix problems" form:

![main fix problems form](img/fix-problems.png)

This form shows all the problems found on the problem work orders previously seen.

To fix each problem, click on the button in the "Fix" column for each item.

### Missing link problems

If the issue is a missing link the fix will be to Link or if it's a Customer optionally Export that customer to QuickBooks.

Clicking on the Fix button will open the "Resolve AyaNova object" dialog box where you can link (or import if it's a Customer) the unmatched object:

![resolve ayanova object](img/fix-problems-resolve-dialog.png)

Here you can select the QuickBooks object to link to the AyaNova object or in the case of a Customer an extra button is displayed allowing you to Export the Customer to QuickBooks.

Fixing this problem will cause it to be removed from the problem table.

### Price mismatch problems

If the issue is a Part price that is different in AyaNova than it is in the linked QuickBooks Item you can use the "Resolve AyaNova object price" dialog box to fix this particular issue:

![fix price mismatch](img/fix-problems-price-dialog.png)

There are four possible ways to resolve this issue.

Note that the first two just change the workorder price and do not affect the AyaNova object or the QuickBooks item for other use - whereas the last two actually change the price of the item as well as the workorder price.

#### Use the workorder price as it is; even though it's different

Keep the retail price as it is in the AyaNova service workorder, and invoice out at that AyaNova retail price in the QuickBooks invoice.

_Temporary fix_ - this setting is only kept until QBI is closed so if selected, but you close QBI before invoicing, you will need to select this again when you open QBI again as QBI will note again that there is a difference.

#### Set the workorder item's price to the QuickBooks price

Update the retail price and cost in the AyaNova service workorder to that of the QuickBooks Item, and invoice out at the QuickBooks retail price.

_Permanent fix_ - this changes the workorder item part price in AyaNova immediately and saves it so it's still set this way even if you close QBI before invoicing.

#### Set the AyaNova object's default price to be the QuickBooks price from now on

Updates the retail price in the AyaNova service workorder to that of QuickBooks part, _and_ updates the AyaNova Part's default retail price in the AyaNova Part object to that of the QuickBooks object, and invoices out at the QuickBooks retail price.

_Parmanent fix_ - this change survives restarting QBI before invoicing.

#### Set the QuickBooks object's default price to be the AyaNova price from now on

Leaves the retail price as is in AyaNova service workorder, updates the default retail price of the QuickBooks object to that of the AyaNova Part's retail price, and invoices out at that AyaNova retail price in the QuickBooks invoice.

Note that only QuickBooks items that are of Inventory type can have their default price changed in this way.

_Parmanent fix_ - this change survives restarting QBI before invoicing.

## Ready to invoice work orders

Work orders displayed without a red error icon in their row header are ready to be invoiced.

You must select the work orders you wish to invoice by clicking on the row header.

An entire row must be selected, it is not sufficient to select a single cell in the table.

Rows are selected by clicking on their row header:

![select rows](img/main-invoice-grid-select-rows.png)

Individual rows can be selected by holding down the Control key while clicking on each separate row to be selected.

You can also click on a row selector and drag up or down to select mutltiple contiguous rows.

If you simply want to select _all_ rows you can click on the header row selector at the top:

![select all rows](img/main-invoice-grid-select-all.png)

Problem work orders will not be attempted to be invoiced even if selected so it's acceptable to simply select all Work orders regardless of their status and invoice them out, the problem ones will be ignored.

You have two choices when invoicing you can invoice out one Work order per Invoice or combine multiple work orders for the same Customer into a single invoice per Customer:

### Invoice multiple work orders per invoice

To invoice all selected work orders for the same Customer to a single invoice choose the following menu item:

![invoice multiple](img/main-menu-invoice-selected-multiple-item.png)

QBI will use the least possible number of Invoices to invoice out all the selected Work orders that are ready for invoicing to their Customers.

This means if there are 10 separate work orders for a single Customer a single Invoice will be created with the charges from all ten work orders.

### Invoice one work order per invoice

To invoice all selected work orders, each to their own individual separate invoice choose the following menu item:

![invoice one](img/main-menu-invoice-selected-one-item.png)

QBI will create one Invoice for each work order that is ready for invoicing.

## No invoiceable work orders found

If QBI doesn't find _any_ Work orders ready to Invoice you will instead see the "No invoiceable Work orders found..." display:

![main No invoiceable work orders found](img/main-no-invoiceable-workorders.png)

The message will show your particular requirements for work orders to be available for invoicing that were set during setting preferences and may differ from that seen above.

Work orders will be available and displayed if they have:

-   an empty "Invoice number" field
-   a matching [Work order status](https://www.ayanova.com/docs/svc-work-order-status/) set as the one selected in the [Billable Work order status](install-preferences.md#billable-work-order-status) preferences setting

### Refresh invoices

QBI doesn't keep a live connection to AyaNova so if you make changes in AyaNova to work orders so that they will meet the requirements above, you will need to tell QBI to check AyaNova again for those work orders by using the "Refresh invoices" menu item:

![main menu refresh invoices](img/main-menu-invoice-refresh-invoices-item.png)

## How specific items are handled when invoicing

### Taxes

QBI does not and can not use the tax code selected in your AyaNova service workorder billable items.

QBI does not import or export tax codes between AyaNova and QuickBooks

An invoice in QuickBooks created by QBI for an AyaNova service workorder billable items uses the tax codes set up for the QuickBooks Customer itself (i.e. Customer) and doesn't refer in any way to the tax code selected in the AyaNova service workorder.

If an invoice in QuickBooks has an incorrect tax code or codes, check what is set for that QuickBooks Customer.

### Parts

A part in an AyaNova workorder that is serialized will have the AyaNova part's serial number display under the invoiced part in the QuickBooks invoice.

The Description field from a part in an AyaNova workorder will now also display under the invoiced part in a QuickBooks invoice unless it is empty or contains the exact same serial number of that in the Serial Number field in the workorder's part.

### Travel and Service rates

AyaNova QBI will take by default the AyaNova Service Rate's or Travel Rates Retail Charge price no matter what is the Rate set for the linked item in QuickBooks.

This is because a large majority of users will have multiple AyaNova rates all at different retail prices linked to one QuickBooks item that is used for billing out service.

You are not notified if there is a discrepancy between the AyaNova rate's Retail Charge and the linked QuickBooks item's Rate.

### Expenses

AyaNova QBI will use the QuickBooks item [selected in Preferences](install-preferences.md#expenses) as the item to use when billing Expenses.

AyaNova QBI will take the AyaNova service workorder Expenses Charge Amount price no matter what is the Rate set for the linked item in QuickBooks.

You are not notified if there is a discrepancy between the AyaNova service workorder Expenses Charge Amount price and the linked QuickBooks item's Rate.

Also note that QBI takes the Charge Amount only, as QBI does not transfer the taxes identified on service Work orders.

The Charge Amount is transferred to the QuickBooks invoice, and the default tax as set in QuickBooks is applied. Therefore ensure that the tax setting in QuickBooks for the Expenses is set correctly - or edit the invoice after QBI creates it - or for future charges, edit the QuickBooks item tax setting default.

### Outside service charges

AyaNova QBI will use the QuickBooks item [selected in Preferences](install-preferences.md#outside-service) as the item to use when billing Outside services.

AyaNova QBI will take the AyaNova service workorder Net price no matter what is the Rate set for the linked item in QuickBooks.

You are not notified if there is a discrepancy between the AyaNova service workorder outside service Net Amount and the linked QuickBooks item's Rate.

Also note that QBI takes the Net Amount only, as QBI does not transfer the taxes identified on service Work orders.

The Net Amount is transferred to the QuickBooks invoice, and the default tax as set in QuickBooks is applied. Therefore ensure that the tax setting in QuickBooks for the Outside services is set correctly - or edit the invoice after QBI creates it - or for future charges, edit the QuickBooks item tax setting default.

## What happens when QBI invoices

### QBI display screen

The listed billable Work orders will no longer display in the list as they have now been invoiced.

![main No invoiceable work orders found](img/main-no-invoiceable-workorders.png)

### In the QuickBooks invoice

Workorder header descriptive text (if applicable) is placed before any charges

Billable items for that service workorder are then listed

-   Parts are listed first followed by Service, Travel, Expenses, Loans and Outside Service charges.
-   If multiple workorder items with the same parts or labor etc, all billable items are billed out individually.

    For example, if billing out the same labor rate in multiple workorder items in the same workorder, each billable amount per labor item is listed separately

Additional Descriptive Text set in QBI is then listed for that service workorder (if set to use Descriptive Text)

If multiple Work orders are billed on the same invoice, than the next workorder billable information is listed starting with workorder header descriptive text if applicable and so on as above

### In the AyaNova service workorder:

AyaNova service workorder(s) have the following fields updated

-   Workorder Status in the workorder header area is updated to the status set in Preferences for Post billing workorder status
-   The Invoice #: field is filled with the QuickBooks invoice number
