Files
InvoiceShelf/resources/scripts/admin/stub/invoice.js
Fabio Ribeiro d69a56e2d5 feat: Tax included (#370)
* feat: Tax included

* Added a toggle switch in tax settings to enable the feature.
* Database migration adding tax_included field into estimates, invoices
  and recurring invoices table.
* Toggle switch to enable and store the tax_included by estimates,
  invoices and recurring invoices.
* In case of tax included enabled, total taxes will be recalculated and
  the invoices, estimates and recurring invoices total won't be sum with
  taxes.
* Apply tax included when discount_per_item/tax_per_item item is enabled.
* Custom component to show the net total when tax included is enabled.
* Update invoice and estimates pdfs with net total.

* chore: Tax included by default

A switch button inside the tax settings to enable the tax included by
default in invoices, estimates and recurring invoices.
2025-08-28 10:28:24 +02:00

41 lines
822 B
JavaScript
Vendored

import Guid from 'guid'
import invoiceItemStub from './invoice-item'
import taxStub from './tax'
export default function () {
return {
id: null,
invoice_number: '',
customer: null,
customer_id: null,
template_name: null,
invoice_date: '',
due_date: '',
notes: '',
discount: 0,
discount_type: 'fixed',
discount_val: 0,
reference_number: null,
tax: 0,
sub_total: 0,
total: 0,
tax_per_item: null,
tax_included: false,
sales_tax_type: null,
sales_tax_address_type: null,
discount_per_item: null,
taxes: [],
items: [
{
...invoiceItemStub,
id: Guid.raw(),
taxes: [{ ...taxStub, id: Guid.raw() }],
},
],
customFields: [],
fields: [],
selectedNote: null,
selectedCurrency: '',
}
}