xeth_sdi
04/09/2023, 9:38 AMTyn Guardian
04/09/2023, 2:03 PMbattk
04/09/2023, 3:32 PMxeth_sdi
04/10/2023, 9:35 AMconst setTransactionSummary = (transactionR... by Yoav Zinger
Yoav Zinger12:29
const setTransactionSummary = (transactionRecord, transaction, totalPrice) => {
if (transaction.salesTax) {
if (transaction.shippingFee) {
const taxRate = transaction.shippingFee.salesTaxRate.taxRate * 100;
transactionRecord.setValue({ fieldId: "shippingtax1rate", value: taxRate })
}
const salesTaxAmount = transaction.salesTax.amount;
const total = salesTaxAmount + totalPrice;
log.debug("before setValue total")
transactionRecord.setValue({ fieldId: 'total', value: total });
log.debug("after setValue total")
log.debug("before setValue salesTaxAmount")
transactionRecord.setValue({ fieldId: 'taxtotal', value: salesTaxAmount });
log.debug("after setValue salesTaxAmount")
}
log.debug("before transactionRecord.save()")
transactionRecord.save();
log.debug("after transactionRecord.save()")
}
xeth_sdi
04/10/2023, 10:08 AMTyn Guardian
04/10/2023, 10:54 PMsalesTaxAmount + totalPrice;
like
parseFloat(salesTaxAmount) + parseFloat(totalPrice);