+
Purchase Item is Not Available..
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
index 392ce148a..ed06fb05b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts
@@ -55,6 +55,7 @@ public businessExpenseList: any=[];
public businessIncomeList: any=[];
public grossProfitTypeList: any=[];
public salesDeclaredCustomer: any=[];
+public purchaseDeclaredCustomer:any=[];
public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequencyList,businessExpenseList: this.businessExpenseList,businessIncomeList:this.businessIncomeList,pdid:'',company_id:'',grossProfitTypeList:this.grossProfitTypeList,salesDeclaredCustomer:this.salesDeclaredCustomer};
DailyPurchaseComponent:boolean;
PurchaseComponent:boolean;
@@ -125,12 +126,15 @@ public viewerOptions: any = {
this.getCustomValues.salesDeclaredCustomer=this.salesDeclaredCustomer;
}
+ if(value.records.purchase_declared_by_customer){
+ this.purchaseDeclaredCustomer=value.records.purchase_declared_by_customer
+ this.getCustomValues.purchaseDeclaredCustomer=this.purchaseDeclaredCustomer
+ }
if(value.records.sales_calculated_by_itemwise){
this.salesCaluatedItem = value.records.sales_calculated_by_itemwise;
- }
- if(value.records.sales_items_by_monthwise){
- this.salesItemMonthWise = value.records.sales_items_by_monthwise;
- this.salesItemMonthWise.forEach((itemElement, itemIndex) => {
+ // this.salesItemMonthWise = value.records.sales_items_by_monthwise;
+ this.salesCaluatedItem.forEach((itemElement, itemIndex) => {
+ if(itemElement.sales_type == "3"){
let expandBodyContent= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] }));
let listItems: any=[];
expandBodyContent.forEach((expnadElement, expnadIndex) => {
@@ -151,20 +155,49 @@ public viewerOptions: any = {
// message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived',
// value: calculateAllItemsTotal * convertYear,
// })
- this.salesMonthWiseExpandedItems.push({sim_id:itemElement.sim_id,salesItem:itemElement.sales_item,otherSalesItem:itemElement.other_sales_item,sales_type:itemElement.sales_type,comments:itemElement.comments,margin_per:itemElement.margin_per,margin_value:itemElement.margin_value, expandElements:expandBodyContent, footerMessage: footerMessage});
+ this.salesMonthWiseExpandedItems.push({sci_id:itemElement.sci_id,sales_item:itemElement.sales_item,other_sales_item:itemElement.other_sales_item,sales_type:itemElement.sales_type,comments:itemElement.comments,margin_per:itemElement.margin_per,margin_per_uom:itemElement.margin_per_uom,rate_per_unit:itemElement.rate_per_unit,sales_qty:itemElement.sales_qty,uom_name:itemElement.uom_name,uom_other:itemElement.uom_other,margin_final_value:itemElement.margin_final_value,annual_sale_value:itemElement.annual_sale_value,fk_frequency_id:itemElement.fk_frequency_id,fk_uom_id:itemElement.fk_uom_id,frequency_name:itemElement.frequency_name, expandElements:expandBodyContent, footerMessage: footerMessage});
+ }
+ else{
+ this.salesMonthWiseExpandedItems.push(itemElement)
+ }
+ // console.log("salesmonthwiseExpanded",this.salesMonthWiseExpandedItems);
});
+
}
+ // if(value.records.sales_items_by_monthwise){
+ // this.salesItemMonthWise = value.records.sales_items_by_monthwise;
+ // this.salesItemMonthWise.forEach((itemElement, itemIndex) => {
+ // let expandBodyContent= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] }));
+ // let listItems: any=[];
+ // expandBodyContent.forEach((expnadElement, expnadIndex) => {
+ // let calculateItems = expnadElement.value.reduce((acc, calculate) => acc + Number(calculate.sales_value), 0);
+ // listItems.push({items:expnadElement, itemsTotal:calculateItems})
+ // })
+ // let calculateAllItemsTotal:number=listItems.reduce((racc, rcalculate) => racc + Number(rcalculate.itemsTotal), 0);
+
+ // let convertYear : number = 12 / listItems.length;
+ // let footerMessage: any=[];
+ // footerMessage.push({
+ // month_message: listItems.length + ' Month Sales : '+ calculateAllItemsTotal,
+ // month_value:calculateAllItemsTotal,
+ // year_message: ' Yearly Sales Arrived : '+ calculateAllItemsTotal * convertYear,
+ // year_value: calculateAllItemsTotal * convertYear,
+ // })
+ // // footerMessage.push({
+ // // message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived',
+ // // value: calculateAllItemsTotal * convertYear,
+ // // })
+ // this.salesMonthWiseExpandedItems.push({sim_id:itemElement.sim_id,salesItem:itemElement.sales_item,otherSalesItem:itemElement.other_sales_item,sales_type:itemElement.sales_type,comments:itemElement.comments,margin_per:itemElement.margin_per,margin_value:itemElement.margin_value, expandElements:expandBodyContent, footerMessage: footerMessage});
+ // });
+ // }
this.PurchaseComponent = value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].mode==1 && value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].purchase_type==1 ? true : false;
if(value.records.purchase_details){
this.purchaseDetails = value.records.purchase_details;
- }
- this.DailyPurchaseComponent = value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].mode==1 && value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].purchase_type==2 ? true : false;
-
- if(value.records.purchase_billwise){
- this.purchaseBillWise = value.records.purchase_billwise;
+ // this.purchaseBillWise = value.records.purchase_billwise;
- this.purchaseBillWise.forEach((billElement, itemIndex) => {
+ this.purchaseDetails.forEach((billElement, itemIndex) => {
+ if(billElement.purchase_type == "3"){
let result = Object.assign({}, ...billElement.items);
let expandBodyContent= Object.keys(result).map(key => ({ header:key, value: result[key] }));
@@ -187,9 +220,58 @@ public viewerOptions: any = {
year_value: calculateAllItemsTotal * convertYear,
})
- this.purchaseBillWiseDetails.push({pbw_id:billElement.pbw_id,purchaseItem:billElement.purchase_item,otherPurchaseItem:billElement.other_purchase_item,comments:billElement.comments,annual_purchase_value:billElement.annual_purchase_value, expandElements:expandBodyContent, footerMessage: footerMessage});
+ // this.purchaseBillWiseDetails.push({purchase_id:billElement.purchase_id,purchaseItem:billElement.purchase_item,otherPurchaseItem:billElement.other_purchase_item,comments:billElement.comments,annual_purchase_value:billElement.annual_purchase_value, expandElements:expandBodyContent, footerMessage: footerMessage});
+ this.purchaseBillWiseDetails.push({
+ "purchase_id":billElement.purchase_id,
+ "purchase_item":billElement.purchase_item,
+ "other_purchase_item":billElement.other_purchase_item,
+ "comments":billElement.comments,
+ "annual_purchase_value":billElement.annual_purchase_value,
+ "fk_frequency_id":billElement.fk_frequency_id,
+ "fk_uom_id":billElement.fk_uom_id,
+ "purchase_qty":billElement.purchase_qty,
+ "purchase_type":billElement.purchase_type,
+ "rate_per_unit":billElement.rate_per_unit,
+ "expandElements":expandBodyContent,
+ "footerMessage": footerMessage
+ })
+ }
+ else{
+ this.purchaseBillWiseDetails.push(billElement)
+ }
});
}
+ this.DailyPurchaseComponent = value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].mode==1 && value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].purchase_type==2 ? true : false;
+
+ // if(value.records.purchase_billwise){
+ // this.purchaseBillWise = value.records.purchase_billwise;
+
+ // this.purchaseBillWise.forEach((billElement, itemIndex) => {
+
+ // let result = Object.assign({}, ...billElement.items);
+ // let expandBodyContent= Object.keys(result).map(key => ({ header:key, value: result[key] }));
+
+ // let listItems: any=[];
+
+ // expandBodyContent.forEach((expnadElement, expnadIndex) => {
+ // let calculateItems = expnadElement.value.reduce((acc, calculate) => acc + Number(calculate.purchase_value), 0);
+ // listItems.push({items:expnadElement, itemsTotal:calculateItems})
+ // })
+
+ // let calculateAllItemsTotal:number=listItems.reduce((racc, rcalculate) => racc + Number(rcalculate.itemsTotal), 0);
+
+ // let convertYear : number = 12 / listItems.length;
+ // let footerMessage: any=[];
+ // footerMessage.push({
+ // month_message: listItems.length + ' Monthly Purchase : '+ calculateAllItemsTotal,
+ // month_value:calculateAllItemsTotal,
+ // year_message: ' Yearly Purchase : '+ calculateAllItemsTotal * convertYear,
+ // year_value: calculateAllItemsTotal * convertYear,
+ // })
+
+ // this.purchaseBillWiseDetails.push({pbw_id:billElement.pbw_id,purchaseItem:billElement.purchase_item,otherPurchaseItem:billElement.other_purchase_item,comments:billElement.comments,annual_purchase_value:billElement.annual_purchase_value, expandElements:expandBodyContent, footerMessage: footerMessage});
+ // });
+ // }
if(value.records.business_expenses){
this.businessExpenses=value.records.business_expenses;
@@ -335,6 +417,8 @@ public viewerOptions: any = {
this.summaryItemSource=get_sumary;
}
+ // console.log("salesItemMonthWise",this.salesItemMonthWise);
+ // console.log("salesCaluatedItem",this.salesCaluatedItem);
}
})
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts
index d653cfc30..cba934c68 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts
@@ -25,7 +25,9 @@ export class DailySalesDetailsComponent implements OnInit, DoCheck {
this.enableDailySalesSection = false;
}
- ngOnInit() {}
+ ngOnInit() {
+ console.log("master data",this.masterData);
+ }
// get total cost
getTotalCost(getItems:any) {
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html
index c2efa2f4d..8014b4716 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html
@@ -15,16 +15,16 @@
{{getSale.name}}
-->
-
+
-
+