+ {(fields, { add, remove }) => {
+ return (
+
+ {fields.map((field, index) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ remove(field.name);
+ }}
+ />
+
+
+ ))}
+
+
+
+
+ );
+ }}
+
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 00f8f8708..4a1d5c9bc 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -171,6 +171,7 @@
"addspeedprint": "Add Speed Print",
"addtemplate": "Add Template",
"newlaborrate": "New Labor Rate",
+ "newsalestaxcode": "New Sales Tax Code",
"newstatus": "Add Status",
"testrender": "Test Render"
},
@@ -334,6 +335,14 @@
"pap": "OEM Partial",
"par": "Recored",
"pas": "Sublet",
+ "refund": "Refund",
+ "sales_tax_codes": {
+ "code": "Code",
+ "description": "Description",
+ "federal": "Federal Tax Applies",
+ "local": "Local Tax Applies",
+ "state": "State Tax Applies"
+ },
"state_tax": "State Tax",
"tow": "Towing"
},
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index eb4a2650e..8be8c1397 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -171,6 +171,7 @@
"addspeedprint": "",
"addtemplate": "",
"newlaborrate": "",
+ "newsalestaxcode": "",
"newstatus": "",
"testrender": ""
},
@@ -334,6 +335,14 @@
"pap": "",
"par": "",
"pas": "",
+ "refund": "",
+ "sales_tax_codes": {
+ "code": "",
+ "description": "",
+ "federal": "",
+ "local": "",
+ "state": ""
+ },
"state_tax": "",
"tow": ""
},
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index f0ba5a32e..614ff696a 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -171,6 +171,7 @@
"addspeedprint": "",
"addtemplate": "",
"newlaborrate": "",
+ "newsalestaxcode": "",
"newstatus": "",
"testrender": ""
},
@@ -334,6 +335,14 @@
"pap": "",
"par": "",
"pas": "",
+ "refund": "",
+ "sales_tax_codes": {
+ "code": "",
+ "description": "",
+ "federal": "",
+ "local": "",
+ "state": ""
+ },
"state_tax": "",
"tow": ""
},
diff --git a/server/accounting/qbxml/qbxml-payables.js b/server/accounting/qbxml/qbxml-payables.js
index 0e392eed2..622315936 100644
--- a/server/accounting/qbxml/qbxml-payables.js
+++ b/server/accounting/qbxml/qbxml-payables.js
@@ -91,6 +91,10 @@ const generateBill = (bill) => {
};
const generateBillLine = (billLine, responsibilityCenters) => {
+ console.log(
+ " findTaxCode(billLine, responsibilityCenters.sales_tax_codes)",
+ findTaxCode(billLine, responsibilityCenters.sales_tax_codes)
+ );
return {
AccountRef: {
FullName: responsibilityCenters.costs.find(
@@ -100,6 +104,9 @@ const generateBillLine = (billLine, responsibilityCenters) => {
Amount: Dinero({
amount: Math.round(billLine.actual_cost * 100),
}).toFormat(DineroQbFormat),
+ SalesTaxCodeRef: {
+ FullName: findTaxCode(billLine, responsibilityCenters.sales_tax_codes),
+ },
};
};
@@ -109,3 +116,20 @@ const generateBillLine = (billLine, responsibilityCenters) => {
// Amount: invoice.amount,
// },
// ],
+
+const findTaxCode = (billLine, taxcode) => {
+ const {
+ applicable_taxes: { local, state, federal },
+ } = billLine;
+ const t = taxcode.filter(
+ (t) => t.local === local && t.state === state && t.federal === federal
+ );
+ if (t.length === 1) {
+ console.log(t);
+ return t[0].code;
+ } else if (t.length > 1) {
+ return "Multiple Tax Codes Match";
+ } else {
+ return "No Tax Code Matches";
+ }
+};