mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Make sure we default to the correct tax rate
This commit is contained in:
parent
5ad67f55e1
commit
24d2357799
@ -1485,7 +1485,7 @@
|
||||
model.addTaxRate();
|
||||
@foreach ($taxRates as $taxRate)
|
||||
model.addTaxRate({{ $taxRate }});
|
||||
@endforeach
|
||||
@endforeach
|
||||
@if ($invoice)
|
||||
var invoice = {{ $invoice }};
|
||||
ko.mapping.fromJS(invoice, model.invoice().mapping, model.invoice);
|
||||
@ -1501,6 +1501,11 @@
|
||||
model.invoice().addItem();
|
||||
//model.addTaxRate();
|
||||
@endif
|
||||
// Add the first tax rate for new invoices
|
||||
if(model.invoice_taxes() && model.tax_rates().length > 0) {
|
||||
var tax = model.tax_rates()[0];
|
||||
model.invoice().tax(tax);
|
||||
}
|
||||
@endif
|
||||
|
||||
model.invoice().tax(model.getTaxRate(model.invoice().tax_name(), model.invoice().tax_rate()));
|
||||
|
Loading…
Reference in New Issue
Block a user