Menu Object
 
Syntax
 
Menu.FinRunInvoice WorkOrderNumber, InvoiceDate [, IsCreditNote][, AllowZeroAmount][, isProForma][, CommercialDiscount][, OpenInEditor][, TemplateCode]
 
Description
Programmatically generates an invoice for the specified work order. WorkOrderNumber and InvoiceDate are required. The optional parameters control the invoice type, amount handling, and document behaviour.
 
Parameter
Description
WorkOrderNumber
Required. Work order number for which the invoice is generated.
InvoiceDate
Required. The invoice date.
IsCreditNote
Optional. When True, a credit note is generated instead of an invoice. Default value False.
AllowZeroAmount
Optional. When True, an invoice is created even when the total amount is zero. Default value False.
isProForma
Optional. When True, a pro-forma invoice is generated. Default value False.
CommercialDiscount
Optional. Commercial discount percentage applied to the invoice total. Default value 0 (no discount).
OpenInEditor
Optional. When True, the generated invoice document is opened in the document editor immediately after creation. Default value False.
TemplateCode
Optional. Code of the document template to use for the invoice layout. When empty, the default template is used.
See Also
Example
 
Sub Main
    Menu.FinRunInvoice WorkOrderNumber:=10045, InvoiceDate:=Now
End Sub