Tax
@@ -432,18 +500,22 @@ export default withI18n()(
''
),
lineItems: [{}],
+ discountValue: selector(state, 'discountValue'),
+ discountType: selector(state, 'discountType'),
+ discount: selector(state, 'discount'),
},
}))(
reduxForm({
form: 'invoice',
onSubmit: async (data, dispatch, props) => {
const { lineItems, taxRates } = props;
- const { subTotal, taxTotal, total } = totals(lineItems, taxRates);
+ const { subTotal, taxTotal, total, discount } = totals(lineItems, taxRates);
return await dispatch({
type: 'invoices/save',
data: {
...data,
subTotal: subTotal.format(),
+ discount: discount.format(),
taxTotal: taxTotal.format(),
total: total.format(),
},
diff --git a/src/pages/invoices/$id/pdf.js b/src/pages/invoices/$id/pdf.js
index ce11a7a..813784c 100644
--- a/src/pages/invoices/$id/pdf.js
+++ b/src/pages/invoices/$id/pdf.js
@@ -239,6 +239,22 @@ class Invoice extends Component {
/>
|
+ { invoice.discount > 0 &&