Merge branch 'release/2023-07-07' into feature/payroll

This commit is contained in:
Patrick Fic
2023-07-06 13:23:25 -07:00
16 changed files with 564 additions and 30 deletions

View File

@@ -140,7 +140,10 @@ const generateBillLine = (billLine, responsibilityCenters, jobClass) => {
const findTaxCode = (billLine, taxcode) => {
const {
applicable_taxes: { local, state, federal },
} = billLine;
} =
billLine.applicable_taxes === null
? { applicable_taxes: { local: false, state: false, federal: false } }
: billLine;
const t = taxcode.filter(
(t) =>
!!t.local === !!local &&

View File

@@ -262,10 +262,10 @@ const generateInvoiceQbxml = (
RefNumber: jobs_by_pk.ro_number,
BillAddress: {
Addr1: jobs_by_pk.ownr_co_nm
? jobs_by_pk.ownr_co_nm.substring(0, 30)
: `${`${jobs_by_pk.ownr_ln || ""} ${
jobs_by_pk.ownr_fn || ""
}`.substring(0, 30)}`,
? jobs_by_pk.ownr_co_nm.substring(0, 30).trim()
: `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`
.substring(0, 30)
.trim()}`,
Addr2: jobs_by_pk.ownr_addr1,
Addr3: jobs_by_pk.ownr_addr2,
City: jobs_by_pk.ownr_city,
@@ -274,10 +274,10 @@ const generateInvoiceQbxml = (
},
ShipAddress: {
Addr1: jobs_by_pk.ownr_co_nm
? jobs_by_pk.ownr_co_nm.substring(0, 30)
: `${`${jobs_by_pk.ownr_ln || ""} ${
jobs_by_pk.ownr_fn || ""
}`.substring(0, 30)}`,
? jobs_by_pk.ownr_co_nm.substring(0, 30).trim()
: `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`
.substring(0, 30)
.trim()}`,
Addr2: jobs_by_pk.ownr_addr1,
Addr3: jobs_by_pk.ownr_addr2,
City: jobs_by_pk.ownr_city,

View File

@@ -21,9 +21,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => {
? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${
jobs_by_pk.owner.accountingid || ""
}`
: `${`${jobs_by_pk.ownr_ln || ""} ${
jobs_by_pk.ownr_fn || ""
}`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}`
: `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`
.substring(0, 30)
.trim()} #${jobs_by_pk.owner.accountingid || ""}`
)
.trim()
.replace(":", " ");
@@ -39,9 +39,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => {
? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${
jobs_by_pk.owner.accountingid || ""
}`
: `${`${jobs_by_pk.ownr_ln || ""} ${
jobs_by_pk.ownr_fn || ""
}`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}`
: `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`
.substring(0, 30)
.trim()} #${jobs_by_pk.owner.accountingid || ""}`
)
.trim()
.replace(":", " ");