CASH-152: update endpoints
This commit is contained in:
parent
f1ca66a365
commit
edc9abe000
2 changed files with 32 additions and 0 deletions
|
|
@ -72,6 +72,10 @@ const endpoints = {
|
||||||
url: "/parts/api/v1/parts/mobile-fee",
|
url: "/parts/api/v1/parts/mobile-fee",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
|
GetPricingByDayUpchargePart: {
|
||||||
|
url: "/parts/api/v1/parts/get-pricing-by-day-part-number",
|
||||||
|
method: "GET",
|
||||||
|
},
|
||||||
GetServicePackageDiscountPart: {
|
GetServicePackageDiscountPart: {
|
||||||
url: "/parts/api/v1/parts/service-package-discount",
|
url: "/parts/api/v1/parts/service-package-discount",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,34 @@ export function getSubTotal(lineItemsObject) {
|
||||||
export function getSalesTax(lineItemsObject) {
|
export function getSalesTax(lineItemsObject) {
|
||||||
// this is amountDue minus subTotal
|
// this is amountDue minus subTotal
|
||||||
return (((getAmountDue(lineItemsObject) - getSubTotal(lineItemsObject)) * 100) / 100).toFixed(2);
|
return (((getAmountDue(lineItemsObject) - getSubTotal(lineItemsObject)) * 100) / 100).toFixed(2);
|
||||||
|
export async function getPriceUpchargeByDayPart(pageNameToLog) {
|
||||||
|
// Get the Pricing By Day Part
|
||||||
|
const basePriceByDayPart = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.GET_PRICING_BY_DAY_UPCHARGE_PART,
|
||||||
|
null,
|
||||||
|
pageNameToLog,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
basePriceByDayPart?.data === null ||
|
||||||
|
basePriceByDayPart?.data === undefined ||
|
||||||
|
basePriceByDayPart?.data === ""
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the Pricing By Day Base Part price
|
||||||
|
const pricingResults = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
|
{
|
||||||
|
availableLineItems: [basePriceByDayPart?.data],
|
||||||
|
},
|
||||||
|
pageNameToLog,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
return pricingResults[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPriceUpchargeByDayPart(pageNameToLog) {
|
export async function getPriceUpchargeByDayPart(pageNameToLog) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue