- {{att.name}}
+ {{att.name}}
@@ -501,7 +501,7 @@
- {{rel.name}}
+ {{rel.name}}
{{rel.relationshipType}}
@if(rel.relationshipType == 'dependency'){
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
index 218d6f8b..c8be9d10 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
@@ -258,22 +258,22 @@
{{ 'PRODUCT_INVENTORY._pricing' | translate }}
- @if(selectedProduct?.productPrice != undefined){
+ @if(productOff?.productOfferingPrice != undefined){
@if(checkCustom){
-
- @for (price of selectedProduct?.productPrice; track price.id) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'custom') {
- {{price.name}}
+ {{price.name}}
}
}
- @if(selectedProduct?.productPrice?.length==0){
+ @if(productOff?.productOfferingPrice?.length==0){
-
+
{{ 'SHOPPING_CART._free' | translate }}
@@ -281,45 +281,46 @@
- @for (price of selectedProduct?.productPrice; track price) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'recurring') {
-
+
- {{price.name}}
+ {{price.name}}
+
+
+
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.recurringChargePeriodType}}
- {{price?.description}}
} @else if (price.priceType == 'usage') {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.unitOfMeasure}}
- {{price?.description}}
+
+
+
} @else {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- {{price?.description}}
+
+
+
}
}
- @if(selectedProduct?.productPrice?.length==0){
-
+ @if(productOff?.productOfferingPrice?.length==0){
+
{{ 'SHOPPING_CART._free' | translate }}
{{ 'SHOPPING_CART._free_desc' | translate }}
-
+
}
}
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
index 5331ebcd..bbe5f6a8 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
@@ -52,6 +52,7 @@ export class InventoryProductsComponent implements OnInit {
selectedInv:any;
selectedResources:any[]=[];
selectedServices:any[]=[];
+ productOff:any;
errorMessage:any='';
showError:boolean=false;
@@ -231,37 +232,63 @@ export class InventoryProductsComponent implements OnInit {
console.log(id)
}
- selectProduct(prod:any){
+ async selectProduct(prod:any){
this.selectedProduct=prod;
console.log('selecting prod')
console.log(this.selectedProduct)
this.selectedResources=[];
this.selectedServices=[];
- for(let i=0; i {
- if(spec.serviceSpecification != undefined){
- for(let j=0; j < spec.serviceSpecification.length; j++){
- this.api.getServiceSpec(spec.serviceSpecification[j].id).then(serv => {
- this.selectedServices.push(serv);
- console.log(serv)
- })
- }
+ let spec = await this.api.getProductSpecification(this.selectedProduct.product.productSpecification.id)
+ if(spec.serviceSpecification != undefined){
+ for(let j=0; j < spec.serviceSpecification.length; j++){
+ let serv = await this.api.getServiceSpec(spec.serviceSpecification[j].id);
+ this.selectedServices.push(serv);
}
- if(spec.resourceSpecification != undefined){
- for(let j=0; j < spec.resourceSpecification.length; j++){
- this.api.getResourceSpec(spec.resourceSpecification[j].id).then(res => {
- this.selectedResources.push(res);
- console.log(res)
- })
+ }
+ if(spec.resourceSpecification != undefined){
+ for(let j=0; j < spec.resourceSpecification.length; j++){
+ let res = await this.api.getResourceSpec(spec.resourceSpecification[j].id);
+ this.selectedResources.push(res);
+ }
+ }
+ console.log('--- spec')
+ console.log(spec)
+
+ let prodOff = await this.api.getProductById(this.selectedProduct.productOffering.id);
+ let prodPrices: any[] | undefined= prodOff.productOfferingPrice;
+ let prices: any[]=[];
+ if(prodPrices!== undefined){
+ for(let j=0; j < prodPrices.length; j++){
+ let price = await this.api.getProductPrice(prodPrices[j].id);
+ prices.push(price);
+ console.log(price)
+ if(price.priceType == 'custom'){
+ this.checkCustom = true;
}
}
- })
+ }
+
+ this.productOff={
+ id: prodOff.id,
+ name: prodOff.name,
+ category: prodOff.category,
+ description: prodOff.description,
+ lastUpdate: prodOff.lastUpdate,
+ attachment: spec.attachment,
+ productOfferingPrice: prices,
+ productSpecification: prodOff.productSpecification,
+ productOfferingTerm: prodOff.productOfferingTerm,
+ serviceLevelAgreement: prodOff.serviceLevelAgreement,
+ version: prodOff.version
+ }
this.showDetails=true;
console.log(this.selectedProduct)
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
{{att.name}}
+{{att.name}}
- {{rel.name}}
+ {{rel.name}}
{{rel.relationshipType}}
@if(rel.relationshipType == 'dependency'){
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
index 218d6f8b..c8be9d10 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html
@@ -258,22 +258,22 @@
{{ 'PRODUCT_INVENTORY._pricing' | translate }}
- @if(selectedProduct?.productPrice != undefined){
+ @if(productOff?.productOfferingPrice != undefined){
@if(checkCustom){
-
- @for (price of selectedProduct?.productPrice; track price.id) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'custom') {
- {{price.name}}
+ {{price.name}}
}
}
- @if(selectedProduct?.productPrice?.length==0){
+ @if(productOff?.productOfferingPrice?.length==0){
-
+
{{ 'SHOPPING_CART._free' | translate }}
@@ -281,45 +281,46 @@
- @for (price of selectedProduct?.productPrice; track price) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'recurring') {
-
+
- {{price.name}}
+ {{price.name}}
+
+
+
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.recurringChargePeriodType}}
- {{price?.description}}
} @else if (price.priceType == 'usage') {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.unitOfMeasure}}
- {{price?.description}}
+
+
+
} @else {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- {{price?.description}}
+
+
+
}
}
- @if(selectedProduct?.productPrice?.length==0){
-
+ @if(productOff?.productOfferingPrice?.length==0){
+
{{ 'SHOPPING_CART._free' | translate }}
{{ 'SHOPPING_CART._free_desc' | translate }}
-
+
}
}
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
index 5331ebcd..bbe5f6a8 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
@@ -52,6 +52,7 @@ export class InventoryProductsComponent implements OnInit {
selectedInv:any;
selectedResources:any[]=[];
selectedServices:any[]=[];
+ productOff:any;
errorMessage:any='';
showError:boolean=false;
@@ -231,37 +232,63 @@ export class InventoryProductsComponent implements OnInit {
console.log(id)
}
- selectProduct(prod:any){
+ async selectProduct(prod:any){
this.selectedProduct=prod;
console.log('selecting prod')
console.log(this.selectedProduct)
this.selectedResources=[];
this.selectedServices=[];
- for(let i=0; i {
- if(spec.serviceSpecification != undefined){
- for(let j=0; j < spec.serviceSpecification.length; j++){
- this.api.getServiceSpec(spec.serviceSpecification[j].id).then(serv => {
- this.selectedServices.push(serv);
- console.log(serv)
- })
- }
+ let spec = await this.api.getProductSpecification(this.selectedProduct.product.productSpecification.id)
+ if(spec.serviceSpecification != undefined){
+ for(let j=0; j < spec.serviceSpecification.length; j++){
+ let serv = await this.api.getServiceSpec(spec.serviceSpecification[j].id);
+ this.selectedServices.push(serv);
}
- if(spec.resourceSpecification != undefined){
- for(let j=0; j < spec.resourceSpecification.length; j++){
- this.api.getResourceSpec(spec.resourceSpecification[j].id).then(res => {
- this.selectedResources.push(res);
- console.log(res)
- })
+ }
+ if(spec.resourceSpecification != undefined){
+ for(let j=0; j < spec.resourceSpecification.length; j++){
+ let res = await this.api.getResourceSpec(spec.resourceSpecification[j].id);
+ this.selectedResources.push(res);
+ }
+ }
+ console.log('--- spec')
+ console.log(spec)
+
+ let prodOff = await this.api.getProductById(this.selectedProduct.productOffering.id);
+ let prodPrices: any[] | undefined= prodOff.productOfferingPrice;
+ let prices: any[]=[];
+ if(prodPrices!== undefined){
+ for(let j=0; j < prodPrices.length; j++){
+ let price = await this.api.getProductPrice(prodPrices[j].id);
+ prices.push(price);
+ console.log(price)
+ if(price.priceType == 'custom'){
+ this.checkCustom = true;
}
}
- })
+ }
+
+ this.productOff={
+ id: prodOff.id,
+ name: prodOff.name,
+ category: prodOff.category,
+ description: prodOff.description,
+ lastUpdate: prodOff.lastUpdate,
+ attachment: spec.attachment,
+ productOfferingPrice: prices,
+ productSpecification: prodOff.productSpecification,
+ productOfferingTerm: prodOff.productOfferingTerm,
+ serviceLevelAgreement: prodOff.serviceLevelAgreement,
+ version: prodOff.version
+ }
this.showDetails=true;
console.log(this.selectedProduct)
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
{{rel.name}}
+{{rel.name}}
{{rel.relationshipType}}
@if(rel.relationshipType == 'dependency'){ diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html index 218d6f8b..c8be9d10 100644 --- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html +++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html @@ -258,22 +258,22 @@
{{ 'PRODUCT_INVENTORY._pricing' | translate }}
- @if(selectedProduct?.productPrice != undefined){
+ @if(productOff?.productOfferingPrice != undefined){
@if(checkCustom){
-
- @for (price of selectedProduct?.productPrice; track price.id) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'custom') {
- {{price.name}}
+ {{price.name}}
}
}
- @if(selectedProduct?.productPrice?.length==0){
+ @if(productOff?.productOfferingPrice?.length==0){
-
+
{{ 'SHOPPING_CART._free' | translate }}
@@ -281,45 +281,46 @@
- @for (price of selectedProduct?.productPrice; track price) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'recurring') {
-
+
- {{price.name}}
+ {{price.name}}
+
+
+
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.recurringChargePeriodType}}
- {{price?.description}}
} @else if (price.priceType == 'usage') {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.unitOfMeasure}}
- {{price?.description}}
+
+
+
} @else {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- {{price?.description}}
+
+
+
}
}
- @if(selectedProduct?.productPrice?.length==0){
-
+ @if(productOff?.productOfferingPrice?.length==0){
+
{{ 'SHOPPING_CART._free' | translate }}
{{ 'SHOPPING_CART._free_desc' | translate }}
-
+
}
}
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
index 5331ebcd..bbe5f6a8 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
@@ -52,6 +52,7 @@ export class InventoryProductsComponent implements OnInit {
selectedInv:any;
selectedResources:any[]=[];
selectedServices:any[]=[];
+ productOff:any;
errorMessage:any='';
showError:boolean=false;
@@ -231,37 +232,63 @@ export class InventoryProductsComponent implements OnInit {
console.log(id)
}
- selectProduct(prod:any){
+ async selectProduct(prod:any){
this.selectedProduct=prod;
console.log('selecting prod')
console.log(this.selectedProduct)
this.selectedResources=[];
this.selectedServices=[];
- for(let i=0; i {
- if(spec.serviceSpecification != undefined){
- for(let j=0; j < spec.serviceSpecification.length; j++){
- this.api.getServiceSpec(spec.serviceSpecification[j].id).then(serv => {
- this.selectedServices.push(serv);
- console.log(serv)
- })
- }
+ let spec = await this.api.getProductSpecification(this.selectedProduct.product.productSpecification.id)
+ if(spec.serviceSpecification != undefined){
+ for(let j=0; j < spec.serviceSpecification.length; j++){
+ let serv = await this.api.getServiceSpec(spec.serviceSpecification[j].id);
+ this.selectedServices.push(serv);
}
- if(spec.resourceSpecification != undefined){
- for(let j=0; j < spec.resourceSpecification.length; j++){
- this.api.getResourceSpec(spec.resourceSpecification[j].id).then(res => {
- this.selectedResources.push(res);
- console.log(res)
- })
+ }
+ if(spec.resourceSpecification != undefined){
+ for(let j=0; j < spec.resourceSpecification.length; j++){
+ let res = await this.api.getResourceSpec(spec.resourceSpecification[j].id);
+ this.selectedResources.push(res);
+ }
+ }
+ console.log('--- spec')
+ console.log(spec)
+
+ let prodOff = await this.api.getProductById(this.selectedProduct.productOffering.id);
+ let prodPrices: any[] | undefined= prodOff.productOfferingPrice;
+ let prices: any[]=[];
+ if(prodPrices!== undefined){
+ for(let j=0; j < prodPrices.length; j++){
+ let price = await this.api.getProductPrice(prodPrices[j].id);
+ prices.push(price);
+ console.log(price)
+ if(price.priceType == 'custom'){
+ this.checkCustom = true;
}
}
- })
+ }
+
+ this.productOff={
+ id: prodOff.id,
+ name: prodOff.name,
+ category: prodOff.category,
+ description: prodOff.description,
+ lastUpdate: prodOff.lastUpdate,
+ attachment: spec.attachment,
+ productOfferingPrice: prices,
+ productSpecification: prodOff.productSpecification,
+ productOfferingTerm: prodOff.productOfferingTerm,
+ serviceLevelAgreement: prodOff.serviceLevelAgreement,
+ version: prodOff.version
+ }
this.showDetails=true;
console.log(this.selectedProduct)
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
{{price.name}}
+{{price.name}}
{{ 'SHOPPING_CART._free' | translate }}
- @for (price of selectedProduct?.productPrice; track price) {
+
+ @for (price of productOff?.productOfferingPrice; track price.id) {
@if (price.priceType == 'recurring') {
-
+
- {{price.name}}
+ {{price.name}}
+
+
+
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.recurringChargePeriodType}}
- {{price?.description}}
} @else if (price.priceType == 'usage') {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- /{{price.unitOfMeasure}}
- {{price?.description}}
+
+
+
} @else {
-
+
{{price.name}}
- {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
- {{price?.description}}
+
+
+
}
}
- @if(selectedProduct?.productPrice?.length==0){
-
+ @if(productOff?.productOfferingPrice?.length==0){
+
{{ 'SHOPPING_CART._free' | translate }}
{{ 'SHOPPING_CART._free_desc' | translate }}
-
+
}
}
diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
index 5331ebcd..bbe5f6a8 100644
--- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
+++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts
@@ -52,6 +52,7 @@ export class InventoryProductsComponent implements OnInit {
selectedInv:any;
selectedResources:any[]=[];
selectedServices:any[]=[];
+ productOff:any;
errorMessage:any='';
showError:boolean=false;
@@ -231,37 +232,63 @@ export class InventoryProductsComponent implements OnInit {
console.log(id)
}
- selectProduct(prod:any){
+ async selectProduct(prod:any){
this.selectedProduct=prod;
console.log('selecting prod')
console.log(this.selectedProduct)
this.selectedResources=[];
this.selectedServices=[];
- for(let i=0; i {
- if(spec.serviceSpecification != undefined){
- for(let j=0; j < spec.serviceSpecification.length; j++){
- this.api.getServiceSpec(spec.serviceSpecification[j].id).then(serv => {
- this.selectedServices.push(serv);
- console.log(serv)
- })
- }
+ let spec = await this.api.getProductSpecification(this.selectedProduct.product.productSpecification.id)
+ if(spec.serviceSpecification != undefined){
+ for(let j=0; j < spec.serviceSpecification.length; j++){
+ let serv = await this.api.getServiceSpec(spec.serviceSpecification[j].id);
+ this.selectedServices.push(serv);
}
- if(spec.resourceSpecification != undefined){
- for(let j=0; j < spec.resourceSpecification.length; j++){
- this.api.getResourceSpec(spec.resourceSpecification[j].id).then(res => {
- this.selectedResources.push(res);
- console.log(res)
- })
+ }
+ if(spec.resourceSpecification != undefined){
+ for(let j=0; j < spec.resourceSpecification.length; j++){
+ let res = await this.api.getResourceSpec(spec.resourceSpecification[j].id);
+ this.selectedResources.push(res);
+ }
+ }
+ console.log('--- spec')
+ console.log(spec)
+
+ let prodOff = await this.api.getProductById(this.selectedProduct.productOffering.id);
+ let prodPrices: any[] | undefined= prodOff.productOfferingPrice;
+ let prices: any[]=[];
+ if(prodPrices!== undefined){
+ for(let j=0; j < prodPrices.length; j++){
+ let price = await this.api.getProductPrice(prodPrices[j].id);
+ prices.push(price);
+ console.log(price)
+ if(price.priceType == 'custom'){
+ this.checkCustom = true;
}
}
- })
+ }
+
+ this.productOff={
+ id: prodOff.id,
+ name: prodOff.name,
+ category: prodOff.category,
+ description: prodOff.description,
+ lastUpdate: prodOff.lastUpdate,
+ attachment: spec.attachment,
+ productOfferingPrice: prices,
+ productSpecification: prodOff.productSpecification,
+ productOfferingTerm: prodOff.productOfferingTerm,
+ serviceLevelAgreement: prodOff.serviceLevelAgreement,
+ version: prodOff.version
+ }
this.showDetails=true;
console.log(this.selectedProduct)
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index acf6e7ff..9d6b1434 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -309,7 +309,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_save": "Save",
"_success": "Updated successfully",
@@ -395,7 +395,7 @@
"_delete": "Yes, delete",
"_confirm_delete": "Are you sure about deleting the following billing address?",
"_cancel": "No, cancel",
- "_invalid_phone": "Phonenumber is invalid!",
+ "_invalid_phone": "Phone number is invalid!",
"_invalid_email": "Email is invalid!",
"_no_billing": "There's no billing information.",
"_close_modal": "Close modal",
{{price.name}}
+{{price.name}}
+{{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
-/{{price.recurringChargePeriodType}}
-{{price?.description}}
{{price.name}}
{{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
-/{{price.unitOfMeasure}}
-{{price?.description}}
+{{price.name}}
{{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
-{{price?.description}}
+{{ 'SHOPPING_CART._free' | translate }}
{{ 'SHOPPING_CART._free_desc' | translate }}
-