File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,10 @@ class invoice extends Base {
2020 this . invoiceVAT = this . config . get ( 'invoiceVAT' ) ;
2121 this . invoiceCurrencyMaxUnit = this . config . get ( 'invoiceCurrencyMaxUnit' ) ;
2222 this . totalhForInvoice = ( this . spent - this . spentFree ) / 3600.0 ;
23- this . totalForInvoiceExkl = this . totalhForInvoice * this . invoiceCurrencyPerHour ;
24- this . totalForInvoiceMwst = this . totalForInvoiceExkl * this . invoiceVAT ;
25- this . totalForInvoice = this . totalForInvoiceExkl + this . totalForInvoiceMwst ;
26- // round
27- this . totalForInvoice = Math . round ( this . totalForInvoice / this . invoiceCurrencyMaxUnit ) * this . invoiceCurrencyMaxUnit ;
23+ // round subtotals to 0.01 and total to invoiceCurrencyMaxUnit.
24+ this . totalForInvoiceExkl = Math . round ( this . totalhForInvoice * this . invoiceCurrencyPerHour * 100 ) * 0.01 ;
25+ this . totalForInvoiceMwst = Math . round ( this . totalhForInvoice * this . invoiceCurrencyPerHour * this . invoiceVAT * 100 ) * 0.01 ;
26+ this . totalForInvoice = Math . round ( ( this . totalForInvoiceExkl + this . totalForInvoiceMwst ) / this . invoiceCurrencyMaxUnit ) * this . invoiceCurrencyMaxUnit ;
2827 }
2928
3029
You can’t perform that action at this time.
0 commit comments