-
+
+
+
+
@@ -388,7 +243,7 @@
-->
+
-
-
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
index 294dc4fa9..71e617ab3 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss
@@ -3,35 +3,11 @@
overflow: auto;
}
-table {
- width: 100%;
-}
-
-tr.mat-footer-row {
- font-weight: bold;
-}
-
-.mat-table-sticky {
- border-top: 1px solid #e0e0e0;
-}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
- .mat-form-field {
- width: 100%;
- }
- .expan_footer{
- font-size: 18px;
- direction: rtl;
- }
- .expan_table_header {
- font-size: 18px;
- text-align: center;
- }
- .h4_font {
- font-size: 18px;
- }
+
.subtitle_message {
color:#e00201 !important;
}
@@ -144,4 +120,21 @@ tr.mat-footer-row {
border:1px solid rgba(0, 0, 0, 0.12);
}
+ mat-list-item:nth-child(3) {
+ background-color: #f5f5f5;
+ }
+ mat-list-item:nth-child(6) {
+ background-color: #f5f5f5;
+ }
+ mat-list-item:nth-child(8) {
+ background-color: #f5f5f5;
+ }
+ .mat_list_right_div {
+ text-align: left;
+ }
+ .mat_list_center_div {
+ text-align: center;
+ }
+
+
\ No newline at end of file
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 f8a6e5b87..bdb939669 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
@@ -1,5 +1,4 @@
import {Component,OnInit,Inject,Input, ViewChild } from '@angular/core';
-import {FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
@@ -16,42 +15,65 @@ import { ActivatedRoute, Router } from "@angular/router";
styleUrls: ['./assessed-income.component.scss']
})
export class AssessedIncomeComponent implements OnInit {
- public _assessedIncomeFormFrom: FormGroup;
private notifier: NotifierService;
pageTitle: string ="Assessed Income Details";
// @Input() pdid: number;
// @Input() form_id: number;
pdid: number;
form_id: number;
- salesCaluatedItemColumns: string[] = ['Item', 'Qty/UOM','Rate/Unit','Frequency','Annual Sale Value'];
+ displayedColumns = ['sno','list','amount'];
+ sales_value: number;
+ purchase_value: number;
+ gross_profit_value: number;
+ other_income_value: number;
+ other_expense_value: number;
+ net_profit_value: number;
+ house_hold_value: number;
+ net_disable_income_value: number;
public salesCaluatedItem:any= [];
- salesItemMonthWiseColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value'];
public salesItemMonthWise:any= [];
- purchaseDetailsColumns: string[] = ['Item', 'Qty/UOM','Rate/Unit','Frequency','Annual Purchase Value'];
public purchaseDetails:any= [];
- businessExpensesColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value'];
public businessExpenses:any= [];
- houseHoldExpensesColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value'];
public houseHoldExpenses:any= [];
-
- public salesMonthItemColumns = ['Date','Amount'];
+ public otherBusinessIncome: any=[];
// Sales Item MonthWise declare table header,body andd footer elements
salesMonthWiseTable:any=[];
salesItemMonthWiseBody: any[];
salesItemMonthWiseFooter: any[];
-
salesMonthWiseExpandedItems: any=[]
-
- constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
+public UOMList: any=[];
+public frequencyList: any=[];
+public businessExpenseList: any=[];
+public businessIncomeList: any=[];
+public grossProfitTypeList: any=[];
+public salesDeclaredCustomer: any=[];
+public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequencyList,businessExpenseList: this.businessExpenseList,businessIncomeList:this.businessIncomeList,pdid:'',grossProfitTypeList:this.grossProfitTypeList};
+//public finalData: any;
+ constructor(notifier: NotifierService, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.notifier = notifier;
this.form_id = 16;
+ this.loadAIDetails();
+ this.getAIMaster('UOM',1);
+ this.getAIMaster('FREQUENCY',2);
+ this.getAIMaster('BUSINESSEXPENSES',3);
+ this.getAIMaster('BUSINESSINCOME',4);
+ this.getCustomValues.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.sales_value=0;
+ this.purchase_value=0;
+ this.gross_profit_value=0;
+ this.other_income_value=0;
+ this.other_expense_value=0;
+ this.net_profit_value=0;
+ this.house_hold_value=0;
+ this.net_disable_income_value=0;
+
}
public viewerOptions: any = {
navbar: false,
@@ -73,19 +95,22 @@ public viewerOptions: any = {
}
};
ngOnInit() {
-
- this.initAssessedIncomeForm();
+
+ }
+ // load ai details
+ loadAIDetails(): void{
+ this.salesMonthWiseExpandedItems=[]
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
this._pd.getAssessedIncomeFormDetails(params).subscribe(value => {
if (value.status == 200) {
- if(value.records.sales_declared_by_customer){
- this._assessedIncomeFormFrom.controls['sales_declared_by_customer'].setValue(value.records.sales_declared_by_customer[0].sales_declared_by_customer);
+ if(value.records.gross_profit_calculation_type){
+ this.grossProfitTypeList = value.records.gross_profit_calculation_type;
+ this.getCustomValues.grossProfitTypeList=this.grossProfitTypeList;
}
- else{
- this._assessedIncomeFormFrom.controls['sales_declared_by_customer'].setValue('');
-
+ if(value.records.sales_declared_by_customer){
+ this.salesDeclaredCustomer = value.records.sales_declared_by_customer;
}
if(value.records.sales_calculated_by_itemwise){
this.salesCaluatedItem = value.records.sales_calculated_by_itemwise;
@@ -142,10 +167,8 @@ public viewerOptions: any = {
// message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived',
// value: calculateAllItemsTotal * convertYear,
// })
- this.salesMonthWiseExpandedItems.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage});
+ this.salesMonthWiseExpandedItems.push({sim_id:itemElement.sim_id,salesItem:itemElement.sales_item,margin_per:itemElement.margin_per,margin_value:itemElement.margin_value, expandElements:expandBodyContent, footerMessage: footerMessage});
});
-
-
}
if(value.records.purchase_details){
this.purchaseDetails = value.records.purchase_details;
@@ -156,6 +179,22 @@ public viewerOptions: any = {
if(value.records.house_hold_expenses){
this.houseHoldExpenses = value.records.house_hold_expenses;
}
+ if(value.records.othre_business_income){
+ this.otherBusinessIncome = value.records.othre_business_income;
+ }
+
+ if(value.records.final_data.length >0){
+ // this.finalData = value.records.final_data[0];
+
+ this.sales_value = value.records.final_data[0].income.sales_revenue !='' && value.records.final_data[0].income.sales_revenue !=null ? value.records.final_data[0].income.sales_revenue : 0;
+ this.purchase_value = value.records.final_data[0].expense.purchase !='' && value.records.final_data[0].expense.purchase !=null ? value.records.final_data[0].expense.purchase : 0;
+ this.gross_profit_value = value.records.final_data[0].gross_profit !='' && value.records.final_data[0].gross_profit !=null ? value.records.final_data[0].gross_profit : 0;
+ this.other_income_value = value.records.final_data[0].income.other_business_income !='' && value.records.final_data[0].income.other_business_income !=null ? value.records.final_data[0].income.other_business_income : 0;
+ this.other_expense_value = value.records.final_data[0].expense.business_expense !='' && value.records.final_data[0].expense.business_expense !=null ? value.records.final_data[0].expense.business_expense : 0;
+ this.net_profit_value = value.records.final_data[0].expense.net_profit !='' && value.records.final_data[0].expense.net_profit !=null ? value.records.final_data[0].expense.net_profit : 0;
+ this.house_hold_value = 0;
+ this.net_disable_income_value = this.net_profit_value-this.house_hold_value;
+ }
}
})
@@ -166,14 +205,29 @@ public viewerOptions: any = {
return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0);
}
+ // get common drop down list
+ getAIMaster(table:string, type:Number):void {
+ this._pd.getAllMasterDatas(table).subscribe(
+ data => {
+ if (data.dataStatus == true) {
+ if(type==1){
+ this.UOMList = data.records.filter(uom=>uom.isactive==1);
+ this.getCustomValues.UOMList= this.UOMList;
+ }
+ if(type==2){
+ this.frequencyList = data.records.filter(frq=>frq.isactive==1);
+ this.getCustomValues.frequencyList= this.frequencyList;
+ }
+ if(type==3) {
+ this.businessExpenseList = data.records.filter(val=>val.isactive==1);
+ this.getCustomValues.businessExpenseList= this.businessExpenseList;
+ }
+ if(type==4){
+ this.businessIncomeList=data.records.filter(val=>val.isactive==1);
+ this.getCustomValues.businessIncomeList= this.businessIncomeList;
- // Dynamic Form field creation
-
- public initAssessedIncomeForm(): void {
- this._assessedIncomeFormFrom = this.fb.group({
- sales_declared_by_customer: ['', Validators.compose([Validators.required])],
- // lender_representative_details: this.fb.array([]),
+ }
+ }
});
-}
-
+ }
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html
new file mode 100644
index 000000000..4aa869563
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html
@@ -0,0 +1,56 @@
+
+
+
+
+ Business Expense Items
+
+
+
+
+
+
+
+
+
+ | Buiness Expense |
+ {{element.expense_item}} |
+
+
+
+ Amount (Rs) |
+ {{element.expense_value}} |
+
+
+ Frequency |
+ {{element.frequency_name}}
+ |
+
+
+ Annual Expenses |
+ {{element.annual_expenses_value}}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss
new file mode 100644
index 000000000..a464130a1
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss
@@ -0,0 +1,30 @@
+.example-container {
+ max-height: 280px;
+ width: 100%;
+ overflow: auto;
+ margin-top: 2%;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ td{
+ padding-right: 2%;
+ padding-left: 2%;
+ white-space: nowrap;
+ }
+
+ th {
+ padding-left: 2%;
+ padding-right: 2%;
+ white-space: nowrap;
+ }
+
+ .mat-table-sticky:first-child {
+ border-right: 1px solid #e0e0e0;
+ }
+
+ .mat-table-sticky:last-child {
+ border-left: 1px solid #e0e0e0;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts
new file mode 100644
index 000000000..3687bddfc
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { BusinessExpenseDetailsComponent } from './business-expense-details.component';
+
+describe('BusinessExpenseDetailsComponent', () => {
+ let component: BusinessExpenseDetailsComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ BusinessExpenseDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(BusinessExpenseDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts
new file mode 100644
index 000000000..6b54e794f
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts
@@ -0,0 +1,88 @@
+import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManageBusinesExpenseComponent } from './../AI-diologue/manage-busines-expense/manage-busines-expense.component';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-business-expense-details',
+ templateUrl: './business-expense-details.component.html',
+ styleUrls: ['./business-expense-details.component.scss']
+})
+export class BusinessExpenseDetailsComponent implements OnInit {
+
+ displayedColumns = ['buiness_expense','expense_value','frequency','annual_expenses','action'];
+ public businessItemSource= new MatTableDataSource();
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number};
+ @Output() loadAssessedForms = new EventEmitter();
+ private notifier: NotifierService;
+ constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.notifier= notifier;
+ }
+
+ ngOnInit() {
+ }
+
+ // add more item details
+ addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData
+ }
+ const dialogRef = this.dialog.open(ManageBusinesExpenseComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editExpenseItem(value:any) {
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:value
+ }
+ const dialogRef = this.dialog.open(ManageBusinesExpenseComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+
+// remove expense item
+removeExpenseItem(value: any) : void{
+
+ let deleteRecords: any =[{
+ "fk_pd_id":this.masterData.pdid,
+ "pd_expense_id":value.pd_expense_id,
+ "isactive":false,
+ }];
+ this._pd.saveAssessedDetails('saveAssessedIncomeBusinessExpenses',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+// detect chnges from parent
+ngOnChanges(changes: SimpleChanges) {
+ this.businessItemSource.data = changes.parentData.currentValue;
+}
+
+}
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.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html
new file mode 100644
index 000000000..f0951717b
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Sales Calculate Daily Wise
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{footer.month_message}} {{footer.year_message}}
+
+
+
+
+
+
+
+
+
+
{{eachItem.header}}
+
+
+ | Date |
+ {{itemValue.sales_date | date: 'dd-MM-yyyy'}} |
+ Total |
+
+
+ Amount |
+ {{itemValue.sales_value}} |
+ {{getTotalCost(eachItem.value)}} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss
new file mode 100644
index 000000000..588f58a6b
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss
@@ -0,0 +1,33 @@
+.example-container {
+ max-height: 500px;
+ overflow: auto;
+}
+
+table {
+ width: 100%;
+}
+
+tr.mat-footer-row {
+ font-weight: bold;
+}
+
+.mat-table-sticky {
+ border-top: 1px solid #e0e0e0;
+}
+ .expan_footer{
+ font-size: 18px;
+ direction: rtl;
+}
+.expan_table_header {
+ font-size: 18px;
+ //text-align: center;
+}
+.h4_font {
+ font-size: 18px;
+}
+.subtitle_message {
+ color:#e00201 !important;
+}
+.delete-margin {
+ margin-left: 3%;
+ }
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.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts
new file mode 100644
index 000000000..b8081b9f6
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DailySalesDetailsComponent } from './daily-sales-details.component';
+
+describe('DailySalesDetailsComponent', () => {
+ let component: DailySalesDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DailySalesDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DailySalesDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
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
new file mode 100644
index 000000000..a3aa5c5ba
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts
@@ -0,0 +1,121 @@
+import { Component, OnInit, Input, Output, Inject, DoCheck, EventEmitter } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManageDailySalesComponent } from './../AI-diologue/manage-daily-sales/manage-daily-sales.component';
+import { NotifierService } from 'angular-notifier';
+import { AnyAaaaRecord } from 'dns';
+
+@Component({
+ selector: 'app-daily-sales-details',
+ templateUrl: './daily-sales-details.component.html',
+ styleUrls: ['./daily-sales-details.component.scss']
+})
+export class DailySalesDetailsComponent implements OnInit, DoCheck {
+ public salesMonthItemColumns = ['Date','Amount'];
+ public salesMonthWiseExpandedItems: any[]=[];
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any; pdid:number, grossProfitTypeList:any};
+ @Output() loadAssessedForms = new EventEmitter();
+ activateMariginCalculation: boolean;
+ private notifier:NotifierService;
+ constructor(notifier:NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.activateMariginCalculation=false;
+ this.notifier = notifier;
+ }
+
+ ngOnInit() {
+ }
+
+ // get total cost
+ getTotalCost(getItems:any) {
+ return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0);
+ }
+
+// add more item details
+addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData,
+ margin_calculation_status:this.activateMariginCalculation,
+ }
+ const dialogRef = this.dialog.open(ManageDailySalesComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editSalesItem(value:any) {
+ let transformData: any = value.expandElements.map(val=>val.value);
+ transformData = [].concat.apply([], transformData);
+ let editValue: any = {
+ "fk_pd_id":this.masterData.pdid,
+ "sim_id":value.sim_id,
+ "salesItem":value.salesItem,
+ "margin_value":value.margin_value,
+ "margin_per":value.margin_per,
+ "values":transformData
+ }
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:editValue,
+ margin_calculation_status:this.activateMariginCalculation,
+ }
+ const dialogRef = this.dialog.open(ManageDailySalesComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+
+// remove sales item
+removeSalesItem(value: any) : void{
+ // let transformData: any = value.expandElements.map(val=>val.value);
+ // transformData = [].concat.apply([], transformData);
+ let deleteRecords: any =[{
+ "sim_id":value.sim_id,
+ "isactive":false,
+ "child":[]
+ }];
+ this._pd.saveAssessedDetails('saveAssessedIncomeMonthwiseItems',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+// do check component bases
+ngDoCheck() {
+ this.salesMonthWiseExpandedItems = this.parentData;
+
+ if(this.masterData.grossProfitTypeList.length>0){
+ this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false;
+ }}
+
+ // detect chnges from parent
+// ngOnChanges(changes: SimpleChanges) {
+// this.salesMonthWiseExpandedItems = changes.parentData.currentValue;
+// if(changes.masterData){
+// if(changes.masterData.currentValue.grossProfitTypeList.length>0){
+// this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].margin==2 && changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==2 ? true : false;
+// }
+// }
+// }
+
+}
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
new file mode 100644
index 000000000..42dd4466c
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html
@@ -0,0 +1,26 @@
+
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.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss
new file mode 100644
index 000000000..b559b3c47
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss
@@ -0,0 +1,3 @@
+mat-form-field {
+ margin: 0 2%;
+ }
\ No newline at end of file
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.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts
new file mode 100644
index 000000000..d9b770dc8
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { GrossProfitCalculationComponent } from './gross-profit-calculation.component';
+
+describe('GrossProfitCalculationComponent', () => {
+ let component: GrossProfitCalculationComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ GrossProfitCalculationComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(GrossProfitCalculationComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
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.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts
new file mode 100644
index 000000000..b9f81139f
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts
@@ -0,0 +1,79 @@
+import { Component, OnInit, Input, Output, Inject,EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
+import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-gross-profit-calculation',
+ templateUrl: './gross-profit-calculation.component.html',
+ styleUrls: ['./gross-profit-calculation.component.scss']
+})
+export class GrossProfitCalculationComponent implements OnInit, OnChanges {
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number};
+ @Input() parentData: any;
+ @Output() loadAssessedForms = new EventEmitter();
+ public grossProfitForm: FormGroup;
+ check__purchse_type:any=[{'id':'1','name':'Yes'},{'id':'2','name':'No'}]
+ check_sales_type:any=[{'id':'1','name':'Gross Margin'},{'id':'2','name':'Net Margin'}]
+ private notifier: NotifierService;
+ constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) {
+ this.notifier = notifier;
+ }
+
+ ngOnInit() {
+
+ }
+ changeOptions(values: any){
+ this.grossProfitForm.controls['margin'].setValue('');
+ }
+ submitDetails(records: any){
+ if (this.grossProfitForm.invalid) {
+ this.validateAllFormFields(this.grossProfitForm);
+ this.notifier.notify('warning',"Please Check All Manatory Fields..");
+ return;
+ }
+ this._pd.saveAssessedDetails('saveAssessedIncomeCalculateMode',records).subscribe(data => {
+ this.notifier.notify('success','Saved Successfully.');
+ this.loadAssessedForms.next('1');
+ }, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ this.loadAssessedForms.next('1');
+ });
+ }
+
+ // detect chnges from parent
+ngOnChanges(changes: SimpleChanges) {
+ if(changes.parentData.currentValue.length>0){
+ this.grossProfitForm = this._fb.group(
+ {
+ calc_type_id:[changes.parentData.currentValue[0].calc_type_id],
+ fk_pd_id:[this.masterData.pdid],
+ mode:[changes.parentData.currentValue[0].mode,Validators.compose([Validators.required])],
+ margin:[changes.parentData.currentValue[0].margin],
+ })
+ }
+ else {
+ this.grossProfitForm = this._fb.group(
+ {
+ calc_type_id:[''],
+ fk_pd_id:[this.masterData.pdid],
+ mode:['',Validators.compose([Validators.required])],
+ margin:[''],
+ })
+ }
+}
+
+// validate all form group and form array fields
+validateAllFormFields(formGroup: any) {
+ Object.keys(formGroup.controls).forEach(field => {
+ const control = formGroup.get(field);
+ if (control instanceof FormControl) {
+ control.markAsTouched({ onlySelf: true });
+ } else if (control instanceof FormGroup) {
+ this.validateAllFormFields(control);
+ } else if (control instanceof FormArray) {
+ this.validateAllFormFields(control);
+ }
+ });
+}
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html
new file mode 100644
index 000000000..031f03552
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html
@@ -0,0 +1,57 @@
+
+
+
+
+ House Hold Items
+
+
+
+
+
+
+
+
+
+ | Expense Particulars |
+ {{element.expense_item}} |
+
+
+
+ Amount (Rs) |
+ {{element.expense_value}} |
+
+
+ Frequency |
+ {{element.frequency_name}}
+ |
+
+
+ Annual Expenses |
+ {{element.annual_expense_value}}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss
new file mode 100644
index 000000000..a464130a1
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss
@@ -0,0 +1,30 @@
+.example-container {
+ max-height: 280px;
+ width: 100%;
+ overflow: auto;
+ margin-top: 2%;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ td{
+ padding-right: 2%;
+ padding-left: 2%;
+ white-space: nowrap;
+ }
+
+ th {
+ padding-left: 2%;
+ padding-right: 2%;
+ white-space: nowrap;
+ }
+
+ .mat-table-sticky:first-child {
+ border-right: 1px solid #e0e0e0;
+ }
+
+ .mat-table-sticky:last-child {
+ border-left: 1px solid #e0e0e0;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts
new file mode 100644
index 000000000..a2d07f83b
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HouseHoldDetailsComponent } from './house-hold-details.component';
+
+describe('HouseHoldDetailsComponent', () => {
+ let component: HouseHoldDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ HouseHoldDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HouseHoldDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts
new file mode 100644
index 000000000..1a168c080
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts
@@ -0,0 +1,90 @@
+import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManageHouseHoldComponent } from './../AI-diologue/manage-house-hold/manage-house-hold.component';
+import { NotifierService } from 'angular-notifier';
+
+
+@Component({
+ selector: 'app-house-hold-details',
+ templateUrl: './house-hold-details.component.html',
+ styleUrls: ['./house-hold-details.component.scss']
+})
+export class HouseHoldDetailsComponent implements OnInit {
+
+ displayedColumns = ['buiness_particulars','expense_value','frequency','annual_expenses','action'];
+ public houseItemSource= new MatTableDataSource();
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number};
+ @Output() loadAssessedForms = new EventEmitter();
+ private notifier: NotifierService;
+ constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.notifier= notifier;
+ }
+
+ ngOnInit() {
+ }
+
+ // add more item details
+ addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData
+ }
+ const dialogRef = this.dialog.open(ManageHouseHoldComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editHouseItem(value:any) {
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:value
+ }
+ const dialogRef = this.dialog.open(ManageHouseHoldComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+
+// remove house item
+removeHouseItem(value: any) : void{
+
+ let deleteRecords: any =[{
+ "fk_pd_id":this.masterData.pdid,
+ "household_expense_id":value.household_expense_id,
+ "isactive":false,
+ }];
+ this._pd.saveAssessedDetails('saveAssessedIncomeHouseholdExpenses',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+
+// detect chnges from parent
+ngOnChanges(changes: SimpleChanges) {
+ this.houseItemSource.data = changes.parentData.currentValue;
+}
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html
new file mode 100644
index 000000000..49e26601d
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html
@@ -0,0 +1,55 @@
+
+
+
+
+ Other Business Income Items
+
+
+
+
+
+
+
+
+
+ | Buiness Income |
+ {{element.business_income_item}} |
+
+
+
+ Amount (Rs) |
+ {{element.income_value}} |
+
+
+ Frequency |
+ {{element.frequency_name}}
+ |
+
+
+ Annual Income |
+ {{element.annual_income_value}}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss
new file mode 100644
index 000000000..a464130a1
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss
@@ -0,0 +1,30 @@
+.example-container {
+ max-height: 280px;
+ width: 100%;
+ overflow: auto;
+ margin-top: 2%;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ td{
+ padding-right: 2%;
+ padding-left: 2%;
+ white-space: nowrap;
+ }
+
+ th {
+ padding-left: 2%;
+ padding-right: 2%;
+ white-space: nowrap;
+ }
+
+ .mat-table-sticky:first-child {
+ border-right: 1px solid #e0e0e0;
+ }
+
+ .mat-table-sticky:last-child {
+ border-left: 1px solid #e0e0e0;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts
new file mode 100644
index 000000000..dc12132a1
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { OtherBusinessIncomeDetailsComponent } from './other-business-income-details.component';
+
+describe('OtherBusinessIncomeDetailsComponent', () => {
+ let component: OtherBusinessIncomeDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OtherBusinessIncomeDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OtherBusinessIncomeDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts
new file mode 100644
index 000000000..f7dd09c2a
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts
@@ -0,0 +1,87 @@
+import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManageOtherBusinessIncomeComponent } from './../AI-diologue/manage-other-business-income/manage-other-business-income.component';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-other-business-income-details',
+ templateUrl: './other-business-income-details.component.html',
+ styleUrls: ['./other-business-income-details.component.scss']
+})
+export class OtherBusinessIncomeDetailsComponent implements OnInit {
+
+ displayedColumns = ['buiness_income','income_value','frequency','annual_income','action'];
+ public businessIncomeItemSource= new MatTableDataSource();
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number};
+ @Output() loadAssessedForms = new EventEmitter();
+ private notifier: NotifierService;
+ constructor(notifier: NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.notifier=notifier;
+ }
+
+ ngOnInit() {
+ }
+
+ // add more item details
+ addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData
+ }
+ const dialogRef = this.dialog.open(ManageOtherBusinessIncomeComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editIncomeItem(value:any) {
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:value
+ }
+ const dialogRef = this.dialog.open(ManageOtherBusinessIncomeComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+// remove income item
+removeIncomeItem(value: any) : void{
+
+ let deleteRecords: any =[{
+ "fk_pd_id":this.masterData.pdid,
+ "pd_business_income_id":value.pd_business_income_id,
+ "isactive":false,
+ }];
+ this._pd.saveAssessedDetails('saveOtherBusinessIncome',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+// detect chnges from parent
+ngOnChanges(changes: SimpleChanges) {
+ this.businessIncomeItemSource.data = changes.parentData.currentValue;
+}
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html
new file mode 100644
index 000000000..766e42c2d
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html
@@ -0,0 +1,68 @@
+
+
+
+
+ Purchase Item
+
+
+
+
+
+
+
+
+
+ | Raw Material/Trading Item |
+ {{element.purchase_item}} |
+
+
+
+ Purchase Quantity |
+ {{element.purchase_qty}} |
+
+
+
+ UOM |
+ {{element.uom_name}} |
+
+
+
+ Rate/Unit of Purchase |
+ {{element.rate_per_unit}} |
+
+
+
+ Frequency |
+ {{element.frequency_name}}
+ |
+
+
+ Annual Purchase |
+ {{element.annual_purchase_value}}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+ Purchase Item is Not Available..
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss
new file mode 100644
index 000000000..a464130a1
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss
@@ -0,0 +1,30 @@
+.example-container {
+ max-height: 280px;
+ width: 100%;
+ overflow: auto;
+ margin-top: 2%;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ td{
+ padding-right: 2%;
+ padding-left: 2%;
+ white-space: nowrap;
+ }
+
+ th {
+ padding-left: 2%;
+ padding-right: 2%;
+ white-space: nowrap;
+ }
+
+ .mat-table-sticky:first-child {
+ border-right: 1px solid #e0e0e0;
+ }
+
+ .mat-table-sticky:last-child {
+ border-left: 1px solid #e0e0e0;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts
new file mode 100644
index 000000000..cf25e93a8
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PurchaseDetailsComponent } from './purchase-details.component';
+
+describe('PurchaseDetailsComponent', () => {
+ let component: PurchaseDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ PurchaseDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PurchaseDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts
new file mode 100644
index 000000000..bb5475978
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts
@@ -0,0 +1,100 @@
+import { Component, OnInit, Input, Output, Inject, DoCheck, EventEmitter } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManagePurchaseComponent } from './../AI-diologue/manage-purchase/manage-purchase.component';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-purchase-details',
+ templateUrl: './purchase-details.component.html',
+ styleUrls: ['./purchase-details.component.scss']
+})
+export class PurchaseDetailsComponent implements OnInit, DoCheck {
+ displayedColumns = ['raw_material','purchase_quantity','UOM','rate_per_unit_purchase','frequency','annual_purchase','action'];
+ public purchaseItemSource= new MatTableDataSource();
+ activateMariginCalculation:boolean;
+ private notifier: NotifierService;
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number, grossProfitTypeList:any};
+ @Output() loadAssessedForms = new EventEmitter();
+ constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.activateMariginCalculation=false;
+ this.notifier = notifier;
+ }
+
+ ngOnInit() {
+ }
+
+ // add more item details
+ addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData
+ }
+ const dialogRef = this.dialog.open(ManagePurchaseComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editPurchaseItem(value:any) {
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:value
+ }
+ const dialogRef = this.dialog.open(ManagePurchaseComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+// remove purchase item
+removePurchaseItem(value: any) : void{
+
+ let deleteRecords: any =[{
+ "fk_pd_id":this.masterData.pdid,
+ "purchase_id":value.purchase_id,
+ "isactive":false,
+ }];
+ this._pd.saveAssessedDetails('saveAssessedIncomePurchaseDetails',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+// do check component bases
+ngDoCheck() {
+ if(this.masterData.grossProfitTypeList.length>0){
+ this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==1 ? true : false;
+ }
+ this.purchaseItemSource.data = this.parentData;
+}
+
+// detect chnges from parent
+// ngOnChanges(changes: SimpleChanges) {
+// if(changes.masterData){
+// if(changes.masterData.currentValue.grossProfitTypeList.length>0){
+// this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==1 ? true : false;
+// }
+// }
+// this.purchaseItemSource.data = changes.parentData.currentValue;
+// }
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html
new file mode 100644
index 000000000..9d54b4f61
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss
new file mode 100644
index 000000000..b559b3c47
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss
@@ -0,0 +1,3 @@
+mat-form-field {
+ margin: 0 2%;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts
new file mode 100644
index 000000000..cdc8420d0
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SalesCalculationComponent } from './sales-calculation.component';
+
+describe('SalesCalculationComponent', () => {
+ let component: SalesCalculationComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SalesCalculationComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SalesCalculationComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts
new file mode 100644
index 000000000..05e271ac8
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts
@@ -0,0 +1,102 @@
+import { Component, OnInit, Input, Output, Inject, EventEmitter, DoCheck, OnChanges, SimpleChanges } from '@angular/core';
+import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-sales-calculation',
+ templateUrl: './sales-calculation.component.html',
+ styleUrls: ['./sales-calculation.component.scss']
+})
+export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck {
+ @Input() parentData: any;
+ @Input() masterData: { pdid:number,grossProfitTypeList:any};
+ @Output() loadAssessedForms = new EventEmitter();
+ salesCalculationForm:FormGroup;
+ activateMariginCalculation: boolean;
+ private notifier: NotifierService;
+ constructor(notifier:NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) {
+ this.activateMariginCalculation=false;
+ this.notifier = notifier;
+ }
+
+ ngOnInit() {
+ }
+ 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));
+ }
+ }
+ // save sales calculations details
+submitDetails(records) {
+ if (this.salesCalculationForm.invalid) {
+ this.validateAllFormFields(this.salesCalculationForm);
+ this.notifier.notify('warning',"Please Check All Manatory Fields..");
+ return;
+ }
+ this._pd.saveAssessedDetails('saveAssessedIncomeSalesDeclaredByCustomer',records).subscribe(data => {
+ this.notifier.notify('success', 'Saved Successfully.');
+ this.loadAssessedForms.next('1');
+ }, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+ this.loadAssessedForms.next('1');
+ });
+}
+
+// validate all form group and form array fields
+validateAllFormFields(formGroup: any) {
+ Object.keys(formGroup.controls).forEach(field => {
+ const control = formGroup.get(field);
+ if (control instanceof FormControl) {
+ control.markAsTouched({ onlySelf: true });
+ } else if (control instanceof FormGroup) {
+ this.validateAllFormFields(control);
+ } else if (control instanceof FormArray) {
+ this.validateAllFormFields(control);
+ }
+ });
+}
+
+// do check component bases
+ngDoCheck() {
+
+ if(this.masterData.grossProfitTypeList.length>0){
+ this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false;
+ }
+ this.activateMariginCalculation===true ? this.salesCalculationForm.controls['margin_per'].setValidators([Validators.required]) : this.salesCalculationForm.controls['margin_per'].clearValidators();
+ this.salesCalculationForm.controls['margin_per'].updateValueAndValidity();
+
+}
+
+ //detect chnges from parent
+ngOnChanges(changes: SimpleChanges) {
+ if(changes.masterData){
+ if(changes.masterData.currentValue.grossProfitTypeList.length>0){
+ this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].margin==2 && changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==2 ? true : false;
+ }
+ }
+ if(changes.parentData){
+ if(changes.parentData.currentValue.length>0){
+ this.salesCalculationForm = this._fb.group({
+ sdc_id:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sdc_id],
+ sales_declared_by_customer:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sales_declared_by_customer, Validators.compose([Validators.required])],
+ fk_pd_id:[this.masterData.pdid],
+ margin_per:[this.activateMariginCalculation===false ? '' : changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_per,this.activateMariginCalculation===true ? Validators.required: Validators.nullValidator],
+ margin_value:[this.activateMariginCalculation==false ? '' : changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_value],
+ });
+ }
+ else {
+ this.salesCalculationForm = this._fb.group({
+ sdc_id:[''],
+ sales_declared_by_customer:['', Validators.required],
+ fk_pd_id:[this.masterData.pdid],
+ margin_per:['',this.activateMariginCalculation===true ? Validators.required: Validators.nullValidator],
+ margin_value:[''],
+ });
+ }
+ }
+
+ }
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html
new file mode 100644
index 000000000..bc1f00af6
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html
@@ -0,0 +1,86 @@
+
+
+
+
+
+ Sales Calculate Item Wise
+
+
+
+
+
+
+
+
+
+ | Product/Services |
+ {{element.sales_item}} |
+
+
+
+ Sale Quantity |
+ {{element.sales_qty}} |
+
+
+
+ UOM |
+ {{element.uom_name}} |
+
+
+
+ Rate/Unit of Sale |
+ {{element.rate_per_unit}} |
+
+
+
+ Frequency |
+ {{element.frequency_name}}
+ |
+
+
+ Annual Sales |
+ {{element.annual_sale_value}}
+ |
+
+
+ Margin Percentage % |
+ {{element.margin_per}}
+ |
+
+
+ Margin Amount |
+ {{element.margin_per_uom}}
+ |
+
+
+ Final Value |
+ {{element.margin_final_value}}
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss
new file mode 100644
index 000000000..f78501e65
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss
@@ -0,0 +1,30 @@
+.example-container {
+ max-height: 300px;
+ width: 100%;
+ overflow: auto;
+ margin-top: 2%;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ td{
+ padding-right: 2%;
+ padding-left: 2%;
+ white-space: nowrap;
+ }
+
+ th {
+ padding-left: 2%;
+ padding-right: 2%;
+ white-space: nowrap;
+ }
+
+ .mat-table-sticky:first-child {
+ border-right: 1px solid #e0e0e0;
+ }
+
+ .mat-table-sticky:last-child {
+ border-left: 1px solid #e0e0e0;
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts
new file mode 100644
index 000000000..00a6abb8a
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SalesDetailsComponent } from './sales-details.component';
+
+describe('SalesDetailsComponent', () => {
+ let component: SalesDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SalesDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SalesDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts
new file mode 100644
index 000000000..79171bfa0
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts
@@ -0,0 +1,119 @@
+import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter, DoCheck } from '@angular/core';
+import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+import { ManageSalesComponent } from './../AI-diologue/manage-sales/manage-sales.component';
+import { NotifierService } from 'angular-notifier';
+
+@Component({
+ selector: 'app-sales-details',
+ templateUrl: './sales-details.component.html',
+ styleUrls: ['./sales-details.component.scss']
+})
+export class SalesDetailsComponent implements OnInit, DoCheck {
+ displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action'];
+ public salesItemSource= new MatTableDataSource();
+ @Input() parentData: any;
+ @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number, grossProfitTypeList:any};
+ @Output() loadAssessedForms = new EventEmitter();
+ activateMariginCalculation: boolean;
+ private notifier :NotifierService
+ constructor(notifier:NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) {
+ this.activateMariginCalculation=false;
+ this.notifier = notifier;
+ }
+
+ ngOnInit() {
+ }
+
+// add more item details
+addMoreItem():void {
+ let passValues: any = {
+ manage_status:1,
+ masterData: this.masterData,
+ margin_calculation_status:this.activateMariginCalculation,
+ }
+ const dialogRef = this.dialog.open(ManageSalesComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+
+}
+editSalesItem(value:any) {
+ let passValues: any = {
+ manage_status:2,
+ masterData: this.masterData,
+ editData:value,
+ margin_calculation_status:this.activateMariginCalculation,
+
+ }
+ const dialogRef = this.dialog.open(ManageSalesComponent, {
+ data: passValues,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ if(dataresult.update_status==true){
+ this.loadAssessedForms.next('1');
+ }
+ });
+}
+
+// remove sales item
+removeSalesItem(value: any) : void{
+
+ let deleteRecords: any =[{
+ "fk_pd_id":this.masterData.pdid,
+ "sci_id":value.sci_id,
+ "isactive":false,
+ }];
+ this._pd.saveAssessedDetails('saveAssessedIncomeSalesCalculatedByItemwise',deleteRecords).subscribe(data => {
+ this.notifier.notify('success','Removed Successfully');
+ this.loadAssessedForms.next('1');
+}, error => {
+ this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
+});
+}
+
+// do check component bases
+ngDoCheck() {
+ this.salesItemSource.data = this.parentData;
+
+ if(this.masterData.grossProfitTypeList.length>0){
+ this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false;
+ if(this.activateMariginCalculation===true){
+ this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','margin_percentage','margin_amount','final_value','action'];
+ }
+ else {
+ this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action'];
+
+ }
+ }}
+
+// detect chnges from parent
+// ngOnChanges(changes: SimpleChanges) {
+// this.salesItemSource.data = changes.parentData.currentValue;
+// if(changes.masterData){
+// if(changes.masterData.currentValue.grossProfitTypeList.length>0){
+// this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].margin==2 && changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==2 ? true : false;
+// if(this.activateMariginCalculation===true){
+// this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','margin_percentage','margin_amount','final_value','action'];
+// }
+// else {
+// this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action'];
+
+// }
+// }
+// }
+// }
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
index b84c413de..0d4c8b595 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
@@ -91,9 +91,23 @@ import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.compo
import { SharedModule } from "app/shared/shared.module";
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe';
+import { DeleteRecordsCountPipe } from './../pd-pipes/delete-records-count.pipe';
import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component';
import { BusinessBankingDetailsComponent } from './list-pd/start-pd/forms/business-banking-details/business-banking-details.component';
-
+import { SalesDetailsComponent } from './list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component';
+import { DailySalesDetailsComponent } from './list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component';
+import { SalesCalculationComponent } from './list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component';
+import { ManageSalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component';
+import { PurchaseDetailsComponent } from './list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component';
+import { BusinessExpenseDetailsComponent } from './list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component';
+import { HouseHoldDetailsComponent } from './list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component';
+import { OtherBusinessIncomeDetailsComponent } from './list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component';
+import { ManagePurchaseComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component';
+import { ManageBusinesExpenseComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component';
+import { ManageHouseHoldComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component';
+import { ManageOtherBusinessIncomeComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component';
+import { GrossProfitCalculationComponent } from './list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component';
+import { ManageDailySalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component';
/**
* Custom angular notifier options
*/
@@ -270,7 +284,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
- declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent],
+ declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@@ -308,13 +322,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
OwlNativeDateTimeModule,
],
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
- exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent],
+ exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
- ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent],
+ ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent],
})
export class ManagePdModule {
diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts
new file mode 100644
index 000000000..c729fa4fe
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts
@@ -0,0 +1,8 @@
+import { DeleteRecordsCountPipe } from './delete-records-count.pipe';
+
+describe('DeleteRecordsCountPipe', () => {
+ it('create an instance', () => {
+ const pipe = new DeleteRecordsCountPipe();
+ expect(pipe).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts
new file mode 100644
index 000000000..c41f3c7ee
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts
@@ -0,0 +1,18 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'deleteRecordsCount'
+})
+export class DeleteRecordsCountPipe implements PipeTransform {
+
+ transform(value: any): any {
+ if(value.length>0){
+ let filterData = value.filter(val=>val.isactive===true);
+ return filterData.length;
+ }
+ else {
+ return 0;
+ }
+ }
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
index 6ac7bb7ef..057387d01 100755
--- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
+++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
@@ -557,6 +557,15 @@ export class PdTrigerService {
catchError(this.handleError('role', []))
)
}
+
+ // save assessed sales item wise
+ saveAssessedDetails(methodURl: string,saveData:any){
+ //saveData.createdby = this._aws.getlocale();
+ return this._http.post(this.apiUrl + methodURl, { "records": saveData })
+ .pipe(
+ catchError(this.handleError('operation', []))
+ )
+ }
}
diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts
index 41ecee292..8149f4af5 100755
--- a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts
+++ b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts
@@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
-
import { CKEditorModule } from 'ng2-ckeditor';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import {
diff --git a/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts b/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts
new file mode 100644
index 000000000..cc1db71f5
--- /dev/null
+++ b/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts
@@ -0,0 +1,31 @@
+import { Directive, ElementRef, HostListener, Input } from '@angular/core';
+
+@Directive({
+ selector: '[OnlyNumber]'
+})
+export class NumbersOnlyDirective {
+
+ // Allow decimal numbers. The \. is only allowed once to occur
+ private regex: RegExp = new RegExp(/^[0-9]+(\.[0-9]*){0,1}$/g);
+
+ // Allow key codes for special events. Reflect :
+ // Backspace, tab, end, home
+ private specialKeys: Array = [ 'Backspace', 'Tab', 'End', 'Home' ];
+
+ constructor(private el: ElementRef) {
+ }
+
+ @HostListener('keydown', [ '$event' ])
+ onKeyDown(event: KeyboardEvent) {
+ // Allow Backspace, tab, end, and home keys
+ if (this.specialKeys.indexOf(event.key) !== -1) {
+ return;
+ }
+
+ let current: string = this.el.nativeElement.value;
+ let next: string = current.concat(event.key);
+ if (next && !String(next).match(this.regex)) {
+ event.preventDefault();
+ }
+ }
+}
\ No newline at end of file
diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts
index cc6a4cb68..7ec2767bd 100755
--- a/ng6-seed/src/app/shared/shared.module.ts
+++ b/ng6-seed/src/app/shared/shared.module.ts
@@ -5,6 +5,7 @@ import { HorizontalMenuItems } from './menu-items/horizontal-menu-items';
import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective } from './accordion';
import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive';
import { RatingComponent} from './rating/rating.component';
+import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive';
@NgModule({
declarations: [
@@ -12,14 +13,16 @@ import { RatingComponent} from './rating/rating.component';
AccordionLinkDirective,
AccordionDirective,
ToggleFullscreenDirective,
- RatingComponent
+ RatingComponent,
+ NumbersOnlyDirective
],
exports: [
AccordionAnchorDirective,
AccordionLinkDirective,
AccordionDirective,
ToggleFullscreenDirective,
- RatingComponent
+ RatingComponent,
+ NumbersOnlyDirective
],
providers: [ MenuItems, HorizontalMenuItems ]
})