From c58d0a4944d113e952d580e855356a23b7f5e645 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 30 Apr 2021 21:58:14 +0000 Subject: [PATCH] --- ayanova/src/components/work-order-address.vue | 3 +- ayanova/src/components/work-order-header.vue | 38 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ayanova/src/components/work-order-address.vue b/ayanova/src/components/work-order-address.vue index 9a52a3da..4e00f360 100644 --- a/ayanova/src/components/work-order-address.vue +++ b/ayanova/src/components/work-order-address.vue @@ -10,7 +10,7 @@ $ayiEdit -

{{ displayServiceAddress }}

+ {{ displayServiceAddress }} @@ -67,6 +67,7 @@ export default { if (!window.$gz.util.stringIsNullOrEmpty(this.value.country)) { ret += this.value.country + " "; } + return ret; } } diff --git a/ayanova/src/components/work-order-header.vue b/ayanova/src/components/work-order-header.vue index 5d3b8525..53695e08 100644 --- a/ayanova/src/components/work-order-header.vue +++ b/ayanova/src/components/work-order-header.vue @@ -127,7 +127,43 @@ export default { //------ Addresses res = await window.$gz.api.get(`customer/address/${custId}`); if (res.data) { - console.log("woheaderfldvalchng-address:", res.data); + //Addresses are considered non-empty if the PostAddress or Address field is not empty + + //Set Billing address + if ( + !window.$gz.util.stringIsNullOrEmpty( + res.data.headofficepost.postAddress + ) + ) { + //Use head office bill to address + this.value.postAddress = res.data.headofficepost.postAddress; + this.value.postCity = res.data.headofficepost.postCity; + this.value.postRegion = res.data.headofficepost.postRegion; + this.value.postCountry = res.data.headofficepost.postCountry; + this.value.postCode = res.data.headofficepost.postCode; + } else { + //Use customer postal address, if it's empty then it's empty + this.value.postAddress = res.data.customerpost.postAddress; + this.value.postCity = res.data.customerpost.postCity; + this.value.postRegion = res.data.customerpost.postRegion; + this.value.postCountry = res.data.customerpost.postCountry; + this.value.postCode = res.data.customerpost.postCode; + } + + //Set service address + if ( + !window.$gz.util.stringIsNullOrEmpty( + res.data.customerphys.address + ) + ) { + //Use head office bill to address + this.value.address = res.data.customerphys.address; + this.value.city = res.data.customerphys.city; + this.value.region = res.data.customerphys.region; + this.value.country = res.data.customerphys.country; + this.value.latitude = res.data.customerphys.latitude; + this.value.longitude = res.data.customerphys.longitude; + } } } }