Issues Fixes : ps
This commit is contained in:
parent
26f8e55308
commit
c0394be0db
@ -14,8 +14,16 @@
|
||||
<mat-card *ngFor="let sales of salesItemForm.controls.sales_product['controls']; let s = index;" [formGroupName]="s">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 87%">
|
||||
<input type="text" matInput placeholder="Product/Services" formControlName="sales_item" required>
|
||||
<!-- <input type="text" matInput placeholder="Product/Services" formControlName="sales_item" required> -->
|
||||
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prod of productandservice" [value]="prod.name">{{ prod.name }}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 35%" *ngIf="sales.get('sales_item').value == 'Others'">
|
||||
<input type="text" matInput placeholder="Other Product/Services" formControlName="other_sales_item">
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeProducts(s)" *ngIf="salesItemForm.value.sales_product.length>1"
|
||||
matTooltip="Remove" matTooltipPosition="above">
|
||||
<mat-icon>delete</mat-icon>
|
||||
@ -32,7 +40,7 @@
|
||||
<mat-form-field style="width: 33%;">
|
||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="sales_date" (dateChange)="salesCalculation(s,sales.value)" placeholder="Sales Date" required>
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #picker></mat-datepicker>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 44%">
|
||||
<input OnlyNumber type="text" matInput placeholder="Bill Value" (keyup)="salesCalculation(s,sales.value)" formControlName="sales_value" required>
|
||||
@ -82,7 +90,7 @@
|
||||
</div>
|
||||
<div style="margin-top:3%;margin-bottom:2%; ">
|
||||
<mat-form-field style="width: 40%" *ngIf="data.margin_calculation_status===true">
|
||||
<input matInput OnlyNumber type="text" placeholder="Magin Percetage %" formControlName="margin_per" (keyup)="salesCalculation(s,sales.value)">
|
||||
<input matInput OnlyNumber type="text" placeholder="Gross Margin %" formControlName="margin_per" (keyup)="salesCalculation(s,sales.value)">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 47%" *ngIf="data.margin_calculation_status===true">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Value" formControlName="margin_value" readonly>
|
||||
|
||||
@ -19,6 +19,7 @@ export class ManageDailySalesComponent implements OnInit {
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
marginAmtInwords: any[]=[];
|
||||
productandservice : any[]=[];
|
||||
private notifier: NotifierService;
|
||||
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailySalesComponent>) {
|
||||
@ -28,6 +29,46 @@ export class ManageDailySalesComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._pd.getTypeofActivityForSuppliedInfoForm(this.data.masterData.pdid, this.data.masterData.company_id).subscribe(data => {
|
||||
|
||||
if (data.dataStatus) {
|
||||
|
||||
let datas = data.records;
|
||||
|
||||
let api = Object.keys(datas.type_of_activity).map(function (key) {
|
||||
return datas.type_of_activity[key];
|
||||
});
|
||||
|
||||
if (api.length > 0) {
|
||||
api.forEach(val => {
|
||||
if (val.type_of_activity_id == 2) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 3) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 4) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 5) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this.productandservice = [].concat.apply([], this.productandservice);
|
||||
}
|
||||
})
|
||||
if(this.data.manage_status==1){
|
||||
this.salesItemForm = this._fb.group({
|
||||
sales_product: this._fb.array([this.createSalesItem()]),
|
||||
@ -79,6 +120,7 @@ export class ManageDailySalesComponent implements OnInit {
|
||||
company_id:[this.data.masterData.company_id],
|
||||
sim_id: [''],
|
||||
sales_item: ['', Validators.compose([Validators.required])],
|
||||
other_sales_item:[''],
|
||||
child: this._fb.array([]),
|
||||
margin_per: [''],
|
||||
margin_value: [''],
|
||||
@ -107,6 +149,7 @@ createSalesItemWithData(values: any) {
|
||||
company_id:[this.data.masterData.company_id],
|
||||
sim_id: [values.sim_id],
|
||||
sales_item: [values.salesItem, Validators.compose([Validators.required])],
|
||||
other_sales_item:[values.otherSalesItem === null ? '' : values.otherSalesItem ],
|
||||
child: this._fb.array([]),
|
||||
margin_per: [this.data.margin_calculation_status===true ? values.margin_per: ''],
|
||||
margin_value: [this.data.margin_calculation_status===true ? values.margin_value: ''],
|
||||
@ -187,7 +230,8 @@ salesCalculation(indexVal: number,values: any): void {
|
||||
});
|
||||
let getTotalValueCounts = transformData.map(val=>val.sales_value)
|
||||
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
||||
control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)));
|
||||
let calculatedValue = parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length));
|
||||
control.controls[indexVal].controls['margin_value'].setValue(calculatedValue.toFixed(2));
|
||||
}
|
||||
else{
|
||||
control.controls[indexVal].controls['margin_value'].setValue("");
|
||||
@ -208,7 +252,8 @@ salesCalculation(indexVal: number,values: any): void {
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value));
|
||||
|
||||
let getTotalValueCounts =parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value)
|
||||
values.margin_per!='' ? control.controls[indexVal].controls['margin_value'].setValue( getTotalValueCounts * (parseInt(values.margin_per)/100)) : '';
|
||||
let CalculatedVal = getTotalValueCounts * (parseInt(values.margin_per)/100);
|
||||
values.margin_per!='' ? control.controls[indexVal].controls['margin_value'].setValue( CalculatedVal.toFixed(2)) : '';
|
||||
}
|
||||
else {
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
|
||||
@ -222,7 +267,8 @@ salesCalculation(indexVal: number,values: any): void {
|
||||
|
||||
if(values.child[values.child.length-1].fk_frequency_id!='' && values.child[values.child.length-1].frequency_value!=''){
|
||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.child[values.child.length-1].fk_frequency_id);
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value));
|
||||
let marginCalculatedValue = parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value);
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue(marginCalculatedValue.toFixed(2));
|
||||
}
|
||||
else {
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
|
||||
|
||||
@ -14,8 +14,16 @@
|
||||
<div fxLayout="row wrap" *ngFor="let sales of salesItemForm.controls.salesCalItemwise['controls']; let s = index;" [formGroupName]="s" style="margin-top: 4%;">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 87%">
|
||||
<input type="text" matInput placeholder="Product/Services" formControlName="sales_item" required>
|
||||
<!-- <input type="text" matInput placeholder="Product/Services" formControlName="sales_item" required> -->
|
||||
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prod of productandservice" [value]="prod.name">{{ prod.name }}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 35%" *ngIf="sales.get('sales_item').value == 'Others'">
|
||||
<input type="text" matInput placeholder="Other Product/Services" formControlName="other_sales_item">
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeItem(s)" *ngIf="salesItemForm.value.salesCalItemwise.length>1"
|
||||
matTooltip="Remove Sales Item" matTooltipPosition="above">
|
||||
<mat-icon>delete</mat-icon>
|
||||
@ -83,7 +91,7 @@
|
||||
|
||||
<div class="item-product-margin" fxFlex="100" *ngIf="data.margin_calculation_status===true">
|
||||
<mat-form-field style="width: 25%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Percentage %" formControlName="margin_per" (keyup)="salesMarginPerCalculation(s,sales.value)">
|
||||
<input matInput OnlyNumber type="text" placeholder="Gross Margin %" formControlName="margin_per" (keyup)="salesMarginPerCalculation(s,sales.value)">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%" *ngIf="sales.value.sales_type=='1'">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Per Unit" formControlName="margin_per_uom" (keyup)="salesMarginAmtCalculation(s,sales.value)">
|
||||
|
||||
@ -16,7 +16,7 @@ export class ManageSalesComponent implements OnInit {
|
||||
salesItemForm:FormGroup;
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
|
||||
productandservice: any[]=[];
|
||||
//Declaration for Amout INwords.
|
||||
annualSaleAmtInwords: any[]=[];
|
||||
marginAmtInwords: any[]=[];
|
||||
@ -33,6 +33,47 @@ export class ManageSalesComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._pd.getTypeofActivityForSuppliedInfoForm(this.data.masterData.pdid, this.data.masterData.company_id).subscribe(data => {
|
||||
|
||||
if (data.dataStatus) {
|
||||
|
||||
let datas = data.records;
|
||||
|
||||
let api = Object.keys(datas.type_of_activity).map(function (key) {
|
||||
return datas.type_of_activity[key];
|
||||
});
|
||||
|
||||
if (api.length > 0) {
|
||||
api.forEach(val => {
|
||||
if (val.type_of_activity_id == 2) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 3) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 4) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
|
||||
if (val.type_of_activity_id == 5) {
|
||||
if (val.prodcuts) {
|
||||
this.productandservice.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this.productandservice = [].concat.apply([], this.productandservice);
|
||||
}
|
||||
})
|
||||
|
||||
if(this.data.manage_status==2){
|
||||
this.salesItemForm = this._fb.group({
|
||||
salesCalItemwise: this._fb.array([this.createSalesItemWithData(this.data.editData)]),
|
||||
@ -67,6 +108,7 @@ export class ManageSalesComponent implements OnInit {
|
||||
company_id:[this.data.masterData.company_id],
|
||||
fk_pd_id:[this.data.masterData.pdid],
|
||||
sales_item:['',Validators.compose([Validators.required])],
|
||||
other_sales_item:[''],
|
||||
sales_qty:['',Validators.compose([Validators.required])],
|
||||
fk_uom_id:['',Validators.compose([Validators.required])],
|
||||
rate_per_unit:['',Validators.compose([Validators.required])],
|
||||
@ -87,6 +129,7 @@ createSalesItemWithData(values: any) {
|
||||
fk_pd_id:[this.data.masterData.pdid],
|
||||
company_id:[this.data.masterData.company_id],
|
||||
sales_item:[values.sales_item,Validators.compose([Validators.required])],
|
||||
other_sales_item:[values.other_sales_item],
|
||||
sales_qty:[values.sales_qty,Validators.compose([Validators.required])],
|
||||
fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])],
|
||||
rate_per_unit:[values.rate_per_unit,Validators.compose([Validators.required])],
|
||||
@ -133,7 +176,8 @@ salesMarginPerCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
|
||||
control.controls[indexVal].controls['margin_per_uom'].setValue('');
|
||||
if(values.margin_per!='' && values.annual_sale_value!='') {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.annual_sale_value) * (parseInt(values.margin_per)/100));
|
||||
let calculatedValue = parseInt(values.annual_sale_value) * (parseInt(values.margin_per)/100);
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(calculatedValue.toFixed(2));
|
||||
}
|
||||
else {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue('');
|
||||
@ -194,6 +238,7 @@ removeItem(indexVal: number) : void {
|
||||
|
||||
// save sales details
|
||||
submitDetails(records) {
|
||||
|
||||
if (this.salesItemForm.invalid) {
|
||||
this.validateAllFormFields(this.salesItemForm);
|
||||
this.notifier.notify('warning',"Please Check All Manatory Fields..");
|
||||
|
||||
@ -34,10 +34,10 @@
|
||||
<th mat-header-cell *matHeaderCellDef> Summary </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.sno}}{{element.label}} </td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<!-- Position1 Column -->
|
||||
<ng-container matColumnDef="position_2">
|
||||
<th mat-header-cell *matHeaderCellDef> Declared_by_customer</th>
|
||||
<th mat-header-cell *matHeaderCellDef> Declared by customer</th>
|
||||
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.declared_by_customer : i==9 ? element.declared_by_customer : element.declared_by_customer | rupeeCurrencyFormat}} </td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@ -102,6 +102,7 @@ public viewerOptions: any = {
|
||||
params.company_id = this.company_id;
|
||||
this._pd.getAssessedIncomeFormDetails(params).subscribe(value => {
|
||||
if (value.status == 200) {
|
||||
console.log('value.records',value.records);
|
||||
if(value.records.gross_profit_calculation_type){
|
||||
this.grossProfitTypeList = value.records.gross_profit_calculation_type;
|
||||
this.getCustomValues.grossProfitTypeList=this.grossProfitTypeList;
|
||||
@ -137,7 +138,7 @@ 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,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({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});
|
||||
});
|
||||
}
|
||||
if(value.records.purchase_details){
|
||||
@ -174,7 +175,7 @@ public viewerOptions: any = {
|
||||
if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.cost_of_goods_sold) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.cost_of_goods_sold)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.cost_of_goods_sold) ){
|
||||
let get_sumary: any=[];
|
||||
// set sales and revenue
|
||||
get_sumary.push({"sno":'a. ',"label":'Sales Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||
//set cost of goods sold
|
||||
get_sumary.push({"sno":'b. ',"label":'Cost of Goods Sold ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.cost_of_goods_sold) ? value.records.final_data[0].sales_declared_by_customer.cost_of_goods_sold:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.cost_of_goods_sold) ? value.records.final_data[0].sales_calculated_by_itemwise.cost_of_goods_sold:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.cost_of_goods_sold) ? value.records.final_data[0].sales_calculated_by_monthwise.cost_of_goods_sold:0 });
|
||||
//set gross profit
|
||||
@ -199,23 +200,25 @@ public viewerOptions: any = {
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Sales / Revenue ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_sales_revenue ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Sales / Revenue ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_sales_revenue })
|
||||
:'';
|
||||
// get conslidate net margin details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' })
|
||||
:'';
|
||||
// get conslidate net profit details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||
|
||||
// get conslidate net profit details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||
:'';
|
||||
|
||||
// get conslidate net margin details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales %',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' })
|
||||
:'';
|
||||
|
||||
this.summaryItemSource=get_sumary;
|
||||
@ -236,7 +239,7 @@ public viewerOptions: any = {
|
||||
else if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.purchases) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.purchases)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.purchases)){
|
||||
let get_sumary: any=[];
|
||||
// set sales and revenue
|
||||
get_sumary.push({"sno":'a. ',"label":'Sales Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||
//set purchase
|
||||
get_sumary.push({"sno":'b. ',"label":'Purchases ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.purchases) ? value.records.final_data[0].sales_declared_by_customer.purchases:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.purchases) ? value.records.final_data[0].sales_calculated_by_itemwise.purchases:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.purchases) ? value.records.final_data[0].sales_calculated_by_monthwise.purchases:0 });
|
||||
//set gross profit
|
||||
@ -260,6 +263,15 @@ public viewerOptions: any = {
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Sales / Revenue ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_sales_revenue, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Sales / Revenue ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_sales_revenue ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Sales / Revenue ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_sales_revenue })
|
||||
:'';
|
||||
// get conslidate net profit details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||
:'';
|
||||
// get conslidate net margin details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
@ -270,15 +282,7 @@ public viewerOptions: any = {
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%' })
|
||||
:'';
|
||||
// get conslidate net profit details
|
||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nerprofit, "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":value.records.final_data[0].consolidated_report.consolidated_nerprofit ,"derived_sales_book":'' })
|
||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||
:'';
|
||||
|
||||
this.summaryItemSource=get_sumary;
|
||||
|
||||
}
|
||||
|
||||
@ -25,8 +25,7 @@ export class DailySalesDetailsComponent implements OnInit, DoCheck {
|
||||
this.enableDailySalesSection = false;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
// get total cost
|
||||
getTotalCost(getItems:any) {
|
||||
@ -61,6 +60,7 @@ editSalesItem(value:any) {
|
||||
"fk_pd_id":this.masterData.pdid,
|
||||
"sim_id":value.sim_id,
|
||||
"salesItem":value.salesItem,
|
||||
"otherSalesItem":value.otherSalesItem,
|
||||
"sales_type":value.sales_type,
|
||||
"comments":value.comments,
|
||||
"margin_value":value.margin_value,
|
||||
|
||||
@ -10,11 +10,11 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="salesCalculationForm.value.sales_declared_by_customer != ''">{{"₹"}} {{salesCalculationForm.value.sales_declared_by_customer | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<!-- {{salesCalculationForm.value.sales_declared_by_customer}} -->
|
||||
<mat-form-field style="width: 40%" *ngIf="activateMariginCalculation">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Percentage %" formControlName="margin_per" (keyup)="salesCalculation(salesCalculationForm.value)" required>
|
||||
<mat-form-field style="width: 40%" *ngIf="activateMariginCalculation">
|
||||
<input matInput OnlyNumber type="text" placeholder="Net Margin %" formControlName="margin_per" (keyup)="salesCalculation(salesCalculationForm.value)" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 41%" *ngIf="activateMariginCalculation">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Value" formControlName="margin_value" readonly>
|
||||
<input matInput OnlyNumber type="text" placeholder="Net Profit Value" formControlName="margin_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="salesCalculationForm.value.margin_value != ''">{{"₹"}} {{salesCalculationForm.value.margin_value | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 85%">
|
||||
|
||||
@ -28,8 +28,8 @@ export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck {
|
||||
salesCalculation(values): void {
|
||||
if(values.margin_per !='' && values.sales_declared_by_customer !='')
|
||||
{
|
||||
|
||||
this.salesCalculationForm.controls['margin_value'].setValue(values.sales_declared_by_customer * (values.margin_per/100));
|
||||
let caculatedVal = values.sales_declared_by_customer * (values.margin_per/100)
|
||||
this.salesCalculationForm.controls['margin_value'].setValue(caculatedVal.toFixed(2));
|
||||
}
|
||||
}
|
||||
// save sales calculations details
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:45%">
|
||||
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
|
||||
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property" OnlyNumber type="text"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:45%">
|
||||
|
||||
@ -187,17 +187,17 @@
|
||||
<!-- <input matInput placeholder="Net Take Home"
|
||||
formControlName="net_take_home"> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Amount paid in Cash"
|
||||
formControlName="amount_paid_in_cash" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_in_cash'].value != ''">{{"₹"}} {{employmentForm.controls['amount_paid_in_cash'].value | numberToWords}} Only</mat-hint>
|
||||
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Amount paid through Bank"
|
||||
formControlName="amount_paid_through_bank" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_through_bank'].value != ''">{{"₹"}} {{employmentForm.controls['amount_paid_through_bank'].value | numberToWords}} Only</mat-hint>
|
||||
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
|
||||
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is More than Net Salary</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Amount paid in Cash"
|
||||
formControlName="amount_paid_in_cash" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_in_cash'].value != ''">{{"₹"}} {{employmentForm.controls['amount_paid_in_cash'].value | numberToWords}} Only</mat-hint>
|
||||
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is More than Net Salary</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%" *ngIf="employmentForm.controls['amount_paid_in_cash'].value != '' && employmentForm.controls['amount_paid_in_cash'].value != 0">
|
||||
<mat-select placeholder="Is the Amount is Validated or Not" formControlName="check_validated">
|
||||
@ -215,7 +215,7 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 33%">
|
||||
<mat-select placeholder="Any Delays" formControlName="any_delays">
|
||||
<mat-select placeholder="Is There Any Delay in Receiving the Salary" formControlName="any_delays">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
|
||||
@ -302,28 +302,31 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
console.log('this.employmentForm.controls[amount_paid_in_cash].value',this.employmentForm.controls['amount_paid_in_cash'].value);
|
||||
|
||||
if(salary != ''){
|
||||
let cash_amount = this.employmentForm.controls['amount_paid_in_cash'].value;
|
||||
// let Bank_amount = this.employmentForm.controls['amount_paid_through_bank'].value;
|
||||
// let cash_amount = this.employmentForm.controls['amount_paid_in_cash'].value;
|
||||
let bank_amount = this.employmentForm.controls['amount_paid_through_bank'].value;
|
||||
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValidators([Validators.max(salary)]);
|
||||
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
|
||||
let maxamt = salary-cash_amount
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(salary)]);
|
||||
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
|
||||
let maxamt = salary-bank_amount
|
||||
if(maxamt >= 0 ){
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(salary-cash_amount)]);
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValue(maxamt);
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValidators([Validators.max(salary-bank_amount)]);
|
||||
}
|
||||
else{
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValue('0');
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(0)]);
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValue('0');
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValidators([Validators.max(0)]);
|
||||
}
|
||||
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
|
||||
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
|
||||
|
||||
}
|
||||
else{
|
||||
// this.toast.pdTriggerappmessage('Net Monthly Salary Is Empty.!');
|
||||
this.notifier.notify('warning', 'Net Monthly Salary Is Empty.!');
|
||||
this.employmentForm.controls['amount_paid_in_cash'].setValue('');
|
||||
// this.employmentForm.controls['amount_paid_in_cash'].clearValidators();
|
||||
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValue('');
|
||||
this.employmentForm.controls['amount_paid_through_bank'].setValue('');
|
||||
// this.employmentForm.controls['amount_paid_through_bank'].clearValidators();
|
||||
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
|
||||
return;
|
||||
}
|
||||
@ -422,7 +425,7 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
|
||||
|
||||
if (!this.employmentForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
this.notifier.notify('warning', 'Please Fill/Correct All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -197,8 +197,8 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
return this._fb.group({
|
||||
reference_name: [elementValue.reference_name],
|
||||
mobile: [elementValue.mobile,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
|
||||
std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
std_code: [stdcode != null ? stdcode : '',Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
landline: [landline != null ? landline : '',Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
location:[elementValue.location],
|
||||
relationship_with:[elementValue.relationship_with],
|
||||
others: [elementValue.others],
|
||||
@ -263,55 +263,56 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
|
||||
// let resultMessage:string='';
|
||||
// const referencecheckControl = <FormGroup>this._neighbourhoodForm.controls['referencecheck_list'];
|
||||
const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl;
|
||||
// const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl;
|
||||
// let RefCtrlLength : any = referencecheckControl.controls.length;
|
||||
const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
|
||||
let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
|
||||
if (NbhdCtrlLength > 0) {
|
||||
let Ncnt = 0;
|
||||
while(Ncnt < NbhdCtrlLength){
|
||||
// const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
|
||||
// let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
|
||||
// if (NbhdCtrlLength > 0) {
|
||||
// let Ncnt = 0;
|
||||
// while(Ncnt < NbhdCtrlLength){
|
||||
|
||||
let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
|
||||
// let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
|
||||
|
||||
nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
|
||||
nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
|
||||
// nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
|
||||
// nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
|
||||
|
||||
nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
|
||||
nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
|
||||
// nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
|
||||
// nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
|
||||
|
||||
if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
|
||||
// if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
|
||||
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_month'].setValidators([Validators.required]);
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_year'].setValidators([Validators.required]);
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
|
||||
}
|
||||
else if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == true){
|
||||
// // nbhdChildCtrl.controls['how_long_do_know_in_month'].setValidators([Validators.required]);
|
||||
// // nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_year'].setValidators([Validators.required]);
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
|
||||
// }
|
||||
// else if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == true){
|
||||
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_month'].setValue('');
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_month'].clearValidators();
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_year'].setValue('');
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_year'].clearValidators();
|
||||
nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
|
||||
}
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_month'].setValue('');
|
||||
// // nbhdChildCtrl.controls['how_long_do_know_in_month'].clearValidators();
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_month'].updateValueAndValidity();
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_year'].setValue('');
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_year'].clearValidators();
|
||||
// nbhdChildCtrl.controls['how_long_do_know_in_year'].updateValueAndValidity();
|
||||
// }
|
||||
|
||||
if(nbhdChildCtrl.controls.did_not_know_the_owner.value == '' || nbhdChildCtrl.controls.did_not_know_the_owner.value == false){
|
||||
nbhdChildCtrl.controls['organisation_owner'].setValidators([Validators.required]);
|
||||
nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
|
||||
}
|
||||
else if(nbhdChildCtrl.controls.did_not_know_the_owner.value == true){
|
||||
nbhdChildCtrl.controls['organisation_owner'].setValue('');
|
||||
nbhdChildCtrl.controls['organisation_owner'].clearValidators();
|
||||
nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
|
||||
}
|
||||
Ncnt++;
|
||||
}
|
||||
}
|
||||
// if(nbhdChildCtrl.controls.did_not_know_the_owner.value == '' || nbhdChildCtrl.controls.did_not_know_the_owner.value == false){
|
||||
// nbhdChildCtrl.controls['organisation_owner'].setValidators([Validators.required]);
|
||||
// nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
|
||||
// }
|
||||
// else if(nbhdChildCtrl.controls.did_not_know_the_owner.value == true){
|
||||
// nbhdChildCtrl.controls['organisation_owner'].setValue('');
|
||||
// nbhdChildCtrl.controls['organisation_owner'].clearValidators();
|
||||
// nbhdChildCtrl.controls['organisation_owner'].updateValueAndValidity();
|
||||
// }
|
||||
// Ncnt++;
|
||||
// }
|
||||
// }
|
||||
|
||||
this._neighbourhoodForm.controls.neighbourhood_status.setValidators([Validators.required]);
|
||||
this._neighbourhoodForm.controls.neighbourhood_status.updateValueAndValidity();
|
||||
|
||||
this._neighbourhoodForm.controls.neighbour_reference_remark.setValidators([Validators.required]);
|
||||
this._neighbourhoodForm.controls.neighbour_reference_remark.updateValueAndValidity();
|
||||
// }
|
||||
|
||||
// if(formData.check_type==1){
|
||||
|
||||
@ -317,7 +317,7 @@
|
||||
<div fxLayout="row wrap">
|
||||
<!-- start tenant/lessees -->
|
||||
<mat-form-field style="width:46%" appearance="outline">
|
||||
<mat-label>Name of the Tenant(s)/Lessees(s) of the Let out Property</mat-label>
|
||||
<mat-label>Is Name of the Tenant(s)/Lessees(s) of the Let out Property Provided ?</mat-label>
|
||||
<mat-select placeholder="" formControlName="tenant_lessees_options" (selectionChange)="generateTenantOptions(units.value,u)" required>
|
||||
<mat-option value="1">Yes</mat-option>
|
||||
<mat-option value="0">Name(s) not provided</mat-option>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user