General
Invoices sometimes need credit invoice pairs to even out the income expectations.
To users, this is simply one button on the invoice called ‘Credit invoice’ and it will copy the invoice, convert it to the minus and add a relation to the parent invoice. We are using settings about layout editor, dynamic field formulas, dynamic field, and module tools. If those are new to you please visit the pages and get yourself familiar with them along with steps to build the process.
Start
- From additional settings the from the Row-Level Functions (Quotes, Sales Orders, Invoices): Enable inventory row field formulas
- Go to the invoice layout editor
- Activate the Original Invoice ID -field on the Invoice module
- Activate or create type field to invoice with values: Invoice and CreditInvoice
- Extra: type can be dynamic condition and if the value is not credit invoice then the original invoice id field can be not visible.
- Create dynamic field formulas
I) On create the type field you created is Invoice if original invoice id is empty
II) On create to quantity row field{if $type=='creditinvoice'&&$row.qty>0}{$row.qty|default:1 * -1}{else}{$row.qty}{/if}
/note that type and value needs to match the ones you created on step 3
Go to the Module tool -settings - Create a new tool to Invoice: Link to other module use the Invoice as the target module
- Use in minimum this parameters:
copy_inventory_rows_from={$ID}&original_invoice_id={$ID}&type=creditinvoice
note that type and value needs to match the ones you created on step 3.
Any other fields that should be copied from the original invoice like account id, contact id, description etc…
The process is ready to use and it is always wise to test it before starting to use it with live data.
Did something go wrong?
- Are the formulas active?
- Are the fields visible on all needed user profiles?
- Check the spelling of your formulas and parameters