Skip to content

Commit

Permalink
Merge pull request #11 from orottier/patch-1
Browse files Browse the repository at this point in the history
Update .vat-taxrate with the current VAT percentage
  • Loading branch information
mpociot committed Jan 14, 2016
2 parents 8cf4224 + af2cf48 commit 5dc8660
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,13 @@ So your form will look like this:
<a name="extra-fields" />
### Extra fields

To display the live tax calculation, you can use the classes `vat-subtotal`, `vat-taxes` and `vat-total` on any DOM element and VAT Calculator JS will automatically set the inner HTML content for you.
To display the live tax calculation, you can use the classes `vat-subtotal`, `vat-taxrate`, `vat-taxes` and `vat-total` on any DOM element and VAT Calculator JS will automatically set the inner HTML content for you.

Example:

```html
<strong>Subtotal</strong>: € <span class="vat-subtotal"></span>
<strong>Tax rate</strong>: <span class="vat-taxrate"></span>%
<strong>Taxes</strong>: € <span class="vat-taxes"></span>
<strong>Total</strong>: € <span class="vat-total"></span>
```
Expand Down
3 changes: 2 additions & 1 deletion src/public/js/vat_calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
setHTML('total', response.gross_price.toFixed(2));
setHTML('subtotal', response.net_price.toFixed(2));
setHTML('taxes', response.tax_value.toFixed(2));
setHTML('taxrate', (100*response.tax_rate).toFixed(0));
if (successCallback && typeof(successCallback) === 'function') {
successCallback(response);
}
Expand Down Expand Up @@ -231,4 +232,4 @@
} else {
window.onload = bindCalculatorEvents;
}
}).call(this);
}).call(this);

0 comments on commit 5dc8660

Please sign in to comment.