CSR-2266 | Get bill-to earlier in flow

This commit is contained in:
Scott Kiener 2024-10-28 15:49:45 -04:00
parent 472b228911
commit 8baa213004
6 changed files with 21 additions and 5 deletions

View file

@ -375,6 +375,7 @@ export default {
},
false
);
await this.getAndSaveBillToAccountNumber();
return await this.navigateForward(carsFound);
},

View file

@ -323,6 +323,7 @@ export default {
false
);
await this.getAndSaveBillToAccountNumber();
return await this.navigateForward();
},
lookupVin(plate, state) {

View file

@ -198,6 +198,7 @@ export default {
},
false
);
await this.getAndSaveBillToAccountNumber();
if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true;

View file

@ -345,7 +345,8 @@ export default {
},
false
);
await this.getAndSaveBillToAccountNumber();
return await this.navigateForward();
}

View file

@ -42,5 +42,19 @@ export default {
};
return vinLookupMethods[vinSelection] || null;
},
async getAndSaveBillToAccountNumber() {
const pageName = this.$options?.name;
const billToAccountNumber = await this.dispatchStoreActionWithLogging(
storeActions.GET_BILL_TO_ACCOUNT_NUMBER,
{},
pageName,
false
);
await this.dispatchStoreAction(
this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
billToAccountNumber,
false
);
},
},
};

View file

@ -2804,10 +2804,8 @@ export const actions = {
pageNameToLog,
}
) {
// Cash orders default to 87291 - update if/when more detailed
// billToAccountNumbers are needed for cash
if (parentAccountNumber == applicationConfig.CASH_PARENT_ACCOUNT_NUMBER) {
return applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER;
if (!parentAccountNumber) {
parentAccountNumber = applicationConfig.CASH_PARENT_ACCOUNT_NUMBER;
}
const queryString =
`ParentAccountNumber=${parentAccountNumber}` +