generate state salesTax

This commit is contained in:
Azgaar 2021-08-11 22:08:08 +03:00
parent 0fb6363f2a
commit c92862b316
4 changed files with 15 additions and 10 deletions

View file

@ -141,13 +141,13 @@ function editBurg(id) {
function getExport(dealsArray) {
if (!dealsArray.length) return 'no';
const totalIncome = d3.sum(dealsArray.map((deal) => deal.burgIncome));
const totalIncome = rn(d3.sum(dealsArray.map((deal) => deal.burgIncome)));
const exported = dealsArray.map((deal) => {
const {resourceId, quantity, burgIncome} = deal;
const {name, unit, icon} = Resources.get(resourceId);
const unitName = quantity > 1 ? unit + 's' : unit;
return `<span data-tip="${name}: ${quantity} ${unitName}. Income: ${burgIncome}">
return `<span data-tip="${name}: ${quantity} ${unitName}. Income: ${rn(burgIncome)}">
<svg class="resIcon"><use href="#${icon}"></svg>
<span style="margin: 0 0.2em 0 -0.2em">${quantity}</span>
</span>`;