This commit is contained in:
venbatechnologies@gmail.com 2019-02-12 14:07:55 +05:30
commit f26093d912
49 changed files with 402 additions and 82 deletions

View File

@ -14,7 +14,7 @@
<div fxLayout="row wrap" *ngFor="let item of businessItemForm.controls.busExpense['controls']; let s = index;" [formGroupName]="s">
<div fxFlex="100">
<mat-form-field style="width: 87%">
<mat-select placeholder="Buiness Expense" formControlName="expense_item_id" required>
<mat-select placeholder="Business Expense" formControlName="expense_item_id" required>
<mat-option *ngFor="let expense of businessExpenseData" [value]="expense.expense_item_id">{{expense.expense_item}}</mat-option>
</mat-select>
</mat-form-field>
@ -25,7 +25,8 @@
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="businessCalculation(s,item.value)" formControlName="expense_value" required>
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="businessCalculation(s,item.value);inWords($event.target.value,s,1)" formControlName="expense_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('expense_value').value != ''">{{"&#8377;"}} {{Amount[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="businessCalculation(s,item.value)" required>

View File

@ -10,7 +10,8 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./manage-busines-expense.component.scss']
})
export class ManageBusinesExpenseComponent implements OnInit {
Amount: any = [];
pageTitle:string;
businessItemForm:FormGroup;
frequencyData: any[]=[];
@ -43,6 +44,7 @@ export class ManageBusinesExpenseComponent implements OnInit {
return this._fb.group({
pd_expense_id:[''],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
expense_item_id:['',Validators.compose([Validators.required])],
expense_value:['',Validators.compose([Validators.required])],
fk_frequency_id:['',Validators.compose([Validators.required])],
@ -55,6 +57,7 @@ createBusinessItemWithData(values: any) {
return this._fb.group({
pd_expense_id:[values.pd_expense_id],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
expense_item_id:[values.expense_item_id,Validators.compose([Validators.required])],
expense_value:[values.expense_value,Validators.compose([Validators.required])],
fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])],
@ -122,4 +125,15 @@ submitDetails(records) {
});
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.Amount[i] = this._pd.convertNumberToWords(e);
break;
default:
break;
}
}
}

View File

@ -35,8 +35,9 @@
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Value" (keyup)="salesCalculation(s,sales.value,sales.value.child)" formControlName="sales_value" required>
</mat-form-field>
<input OnlyNumber type="text" matInput placeholder="Value" (keyup)="salesCalculation(s,sales.value,sales.value.child);inWords($event.target.value,c,1)" formControlName="sales_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="childItem.get('sales_value').value != ''">{{"&#8377;"}} {{Value[c]}} Only</mat-hint>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeDailyItems(s,c,childItem.value)" *ngIf="(sales.value.child | deleteRecordsCount)>1"
matTooltip="Remove" matTooltipPosition="above">
<mat-icon>delete</mat-icon>

View File

@ -13,6 +13,7 @@ import { DeleteRecordsCountPipe } from './../../../../../../../pd-pipes/delete-r
providers: [DeleteRecordsCountPipe],
})
export class ManageDailySalesComponent implements OnInit {
Value: any []=[];
pipe = new DatePipe('en-US');
pageTitle:string;
salesItemForm:FormGroup;
@ -56,6 +57,7 @@ export class ManageDailySalesComponent implements OnInit {
createSalesItem():FormGroup {
return this._fb.group({
fk_pd_id: [this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
sim_id: [''],
sales_item: ['', Validators.compose([Validators.required])],
child: this._fb.array([]),
@ -79,6 +81,7 @@ createDailySalesData(sim_id: string) {
createSalesItemWithData(values: any) {
return this._fb.group({
fk_pd_id: [this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
sim_id: [values.sim_id],
sales_item: [values.salesItem, Validators.compose([Validators.required])],
child: this._fb.array([]),
@ -211,5 +214,12 @@ submitDetails(records) {
}
});
}
inWords(e,c,flag){
switch(flag){
case 1 :
this.Value[c] = this._pd.convertNumberToWords(e);
break;
}
}
}

View File

@ -23,7 +23,8 @@
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="houseCalculation(s,item.value)" formControlName="expense_value" required>
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="houseCalculation(s,item.value);inWords($event.target.value,s,1)" formControlName="expense_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('expense_value').value != ''">{{"&#8377;"}} {{Amount[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="houseCalculation(s,item.value)" required>

View File

@ -10,7 +10,8 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./manage-house-hold.component.scss']
})
export class ManageHouseHoldComponent implements OnInit {
pageTitle:string;
Amount: any[]=[];
pageTitle: string;
houseItemForm:FormGroup;
frequencyData: any[]=[];
private notifier: NotifierService;
@ -39,7 +40,8 @@ export class ManageHouseHoldComponent implements OnInit {
createHouseholdItem():FormGroup {
return this._fb.group({
household_expense_id:[''],
fk_pd_id:[this.data.masterData.pdid] ,
fk_pd_id:[this.data.masterData.pdid] ,
company_id:[this.data.masterData.company_id],
expense_item: ['',Validators.compose([Validators.required])],
expense_value: ['',Validators.compose([Validators.required])],
fk_frequency_id: ['',Validators.compose([Validators.required])],
@ -51,7 +53,8 @@ export class ManageHouseHoldComponent implements OnInit {
createHouseholdItemWithData(values: any) {
return this._fb.group({
household_expense_id:[values.household_expense_id],
fk_pd_id:[this.data.masterData.pdid] ,
fk_pd_id:[this.data.masterData.pdid] ,
company_id:[this.data.masterData.company_id],
expense_item: [values.expense_item,Validators.compose([Validators.required])],
expense_value: [values.expense_value,Validators.compose([Validators.required])],
fk_frequency_id: [values.fk_frequency_id,Validators.compose([Validators.required])],
@ -118,5 +121,12 @@ submitDetails(records) {
}
});
}
inWords(e,s,flag){
switch(flag){
case 1 :
this.Amount[s] = this._pd.convertNumberToWords(e);
break;
}
}
}

View File

@ -14,7 +14,7 @@
<div fxLayout="row wrap" *ngFor="let item of businessIncomeItemForm.controls.busIncome['controls']; let s = index;" [formGroupName]="s">
<div fxFlex="100">
<mat-form-field style="width: 87%">
<mat-select placeholder="Buiness Income" formControlName="business_income_id" required>
<mat-select placeholder="business Income" formControlName="business_income_id" required>
<mat-option *ngFor="let income of businessIncomeData" [value]="income.business_income_id">{{income.business_income_item}}</mat-option>
</mat-select>
</mat-form-field>
@ -25,7 +25,8 @@
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="businessCalculation(s,item.value)" formControlName="income_value" required>
<input OnlyNumber type="text" matInput placeholder="Amount (Rs)" (keyup)="businessCalculation(s,item.value);inWords($event.target.value,s,1)" formControlName="income_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('income_value').value != ''">{{"&#8377;"}} {{Amount[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="businessCalculation(s,item.value)" required>

View File

@ -10,6 +10,7 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./manage-other-business-income.component.scss']
})
export class ManageOtherBusinessIncomeComponent implements OnInit {
Amount: any[]=[];
pageTitle:string;
businessIncomeItemForm:FormGroup;
@ -43,6 +44,7 @@ export class ManageOtherBusinessIncomeComponent implements OnInit {
return this._fb.group({
pd_business_income_id:[''],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
business_income_id:['',Validators.compose([Validators.required])],
income_value:['',Validators.compose([Validators.required])],
fk_frequency_id:['',Validators.compose([Validators.required])],
@ -55,6 +57,7 @@ createBusinessIncomeItemWithData(values: any) {
return this._fb.group({
pd_business_income_id:[values.pd_business_income_id],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
business_income_id:[values.business_income_id,Validators.compose([Validators.required])],
income_value:[values.income_value,Validators.compose([Validators.required])],
fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])],
@ -122,4 +125,13 @@ submitDetails(records) {
});
}
inWords(e,s,flag){
switch(flag){
case 1 :
this.Amount[s] = this._pd.convertNumberToWords(e);
break;
}
}
}

View File

@ -31,7 +31,8 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Purchase" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Purchase" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value);inWords($event.target.value,s,1)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('rate_per_unit').value != ''">{{"&#8377;"}} {{RateUnitofPurchase[s]}} Only</mat-hint>
</mat-form-field>
</div>

View File

@ -10,8 +10,8 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./manage-purchase.component.scss']
})
export class ManagePurchaseComponent implements OnInit {
pageTitle:string;
RateUnitofPurchase: any[]=[];
pageTitle: string;
purchaseItemForm:FormGroup;
UOMData: any[]=[];
frequencyData: any[]=[];
@ -43,6 +43,7 @@ export class ManagePurchaseComponent implements OnInit {
return this._fb.group({
purchase_id:[''],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
purchase_item:['',Validators.compose([Validators.required])],
purchase_qty:['',Validators.compose([Validators.required])],
fk_uom_id:['',Validators.compose([Validators.required])],
@ -57,6 +58,7 @@ createPurchaseItemWithData(values: any) {
return this._fb.group({
purchase_id:[values.purchase_id],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
purchase_item:[values.purchase_item,Validators.compose([Validators.required])],
purchase_qty:[values.purchase_qty,Validators.compose([Validators.required])],
fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])],
@ -126,4 +128,13 @@ submitDetails(records) {
});
}
inWords(e,s,flag){
switch(flag){
case 1 :
this.RateUnitofPurchase[s] = this._pd.convertNumberToWords(e);
break;
}
}
}

View File

@ -23,7 +23,8 @@
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(s,sales.value)" formControlName="sales_qty" required>
<input OnlyNumber type="text" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(s,sales.value);inWords($event.target.value,s,1)" formControlName="sales_qty" required>
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('sales_qty').value != ''">{{"&#8377;"}} {{Sale_Quantity[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-select placeholder="UOM" formControlName="fk_uom_id" required>

View File

@ -10,7 +10,8 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./manage-sales.component.scss']
})
export class ManageSalesComponent implements OnInit {
pageTitle:string;
Sale_Quantity: any[]=[];
pageTitle: string;
salesItemForm:FormGroup;
UOMData: any[]=[];
frequencyData: any[]=[];
@ -41,6 +42,7 @@ export class ManageSalesComponent implements OnInit {
createSalesItem():FormGroup {
return this._fb.group({
sci_id:[],
company_id:[this.data.masterData.company_id],
fk_pd_id:[this.data.masterData.pdid],
sales_item:['',Validators.compose([Validators.required])],
sales_qty:['',Validators.compose([Validators.required])],
@ -59,6 +61,7 @@ createSalesItemWithData(values: any) {
return this._fb.group({
sci_id:[values.sci_id],
fk_pd_id:[this.data.masterData.pdid],
company_id:[this.data.masterData.company_id],
sales_item:[values.sales_item,Validators.compose([Validators.required])],
sales_qty:[values.sales_qty,Validators.compose([Validators.required])],
fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])],
@ -154,4 +157,12 @@ submitDetails(records) {
});
}
inWords(e,s,flag){
switch(flag){
case 1 :
this.Sale_Quantity[s] = this._pd.convertNumberToWords(e);
break;
}
}
}

View File

@ -302,17 +302,11 @@
<!-- end assessed income tabs control -->
</mat-dialog-content>
<mat-dialog-actions>
<!-- <div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="personal_info_form_remark" required></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above"><mat-icon>save</mat-icon></button>
</div> -->
<mat-dialog-actions align="end">
<button type="button" mat-flat-button (click)="completeAI()"
matTooltip="Complete Assessed Income" matTooltipPosition="above" color="primary">
<strong>Complete</strong>
</button>
</mat-dialog-actions>
<notifier-container></notifier-container>

View File

@ -8,7 +8,7 @@ import {
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router";
import { ConfirmAiDetailsComponent } from "./confirm-ai-details/confirm-ai-details.component";
@Component({
selector: 'app-assessed-income',
templateUrl: './assessed-income.component.html',
@ -25,6 +25,7 @@ export class AssessedIncomeComponent implements OnInit {
// @Input() form_id: number;
pdid: number;
form_id: number;
company_id: number;
emptyArray: any=[];
sumary_details: {[k: string]: any} = {};
// sumary_details:any={"sales_revenue":0,"sales_revenue_details":[],"purchase":0,"purchase_details":[],"gross_profit":0,"other_business_income":0,"other_business_income_details":[]
@ -47,13 +48,14 @@ 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 getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequencyList,businessExpenseList: this.businessExpenseList,businessIncomeList:this.businessIncomeList,pdid:'',company_id:'',grossProfitTypeList:this.grossProfitTypeList};
//public finalData: any;
constructor(notifier: NotifierService, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private _pd: PdTrigerService, private dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.company_id = this.pd_all_details.company_id;
this.notifier = notifier;
this.form_id = 16;
this.loadAIDetails();
@ -62,6 +64,7 @@ public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequen
this.getAIMaster('BUSINESSEXPENSES',3);
this.getAIMaster('BUSINESSINCOME',4);
this.getCustomValues.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.getCustomValues.company_id = this.pd_all_details.company_id;
this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
@ -96,6 +99,7 @@ public viewerOptions: any = {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
params.company_id = this.company_id;
this._pd.getAssessedIncomeFormDetails(params).subscribe(value => {
if (value.status == 200) {
if(value.records.gross_profit_calculation_type){
@ -192,4 +196,21 @@ public viewerOptions: any = {
}
});
}
// complete AI detailscomplete AI details
completeAI(): void{
const dialogRef = this.dialog.open(ConfirmAiDetailsComponent, {
data: { pdid: this.pdid, company_id: this.company_id ,calc_type_id:this.grossProfitTypeList.length > 0 ? this.grossProfitTypeList[0].calc_type_id : ''},
disableClose: true,
minWidth:'30%',
maxWidth:'40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
this.loadAIDetails();
}
});
}
}

View File

@ -11,27 +11,35 @@
</button>
</div>
</div>
<div class="example-container mat-elevation-z8">
<div class="example-container mat-elevation-z8" *ngIf="businessItemSource.data.length>0">
<table mat-table [dataSource]="businessItemSource">
<ng-container matColumnDef="buiness_expense" sticky>
<th mat-header-cell *matHeaderCellDef> Buiness Expense </th>
<th mat-header-cell *matHeaderCellDef> Business Expense </th>
<td mat-cell *matCellDef="let element"> {{element.expense_item}} </td>
<td mat-footer-cell *matFooterCellDef> Total of Expense</td>
</ng-container>
<ng-container matColumnDef="expense_value">
<th mat-header-cell *matHeaderCellDef> Amount (Rs) </th>
<td mat-cell *matCellDef="let element"> {{element.expense_value}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="frequency">
<th mat-header-cell *matHeaderCellDef> Frequency </th>
<td mat-cell *matCellDef="let element">{{element.frequency_name}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="annual_expenses">
<th mat-header-cell *matHeaderCellDef> Annual Expenses </th>
<td mat-cell *matCellDef="let element">{{element.annual_expenses_value}}
</td>
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(businessItemSource.data)}} </td>
</ng-container>
<ng-container matColumnDef="action" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
@ -43,10 +51,13 @@
<mat-icon>delete</mat-icon>
</button>
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns; sticky:true"></tr>
</table>
</div>
</mat-card-content>

View File

@ -27,4 +27,8 @@
.mat-table-sticky:last-child {
border-left: 1px solid #e0e0e0;
}
.mat-footer-cell {
font-weight: bold;
font-size: 1.2rem !important;
}

View File

@ -14,7 +14,7 @@ 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};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number,company_id:number};
@Output() loadAssessedForms = new EventEmitter<string>();
private notifier: NotifierService;
constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
@ -69,6 +69,7 @@ removeExpenseItem(value: any) : void{
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"company_id":this.masterData.company_id,
"pd_expense_id":value.pd_expense_id,
"isactive":false,
}];
@ -78,7 +79,13 @@ removeExpenseItem(value: any) : void{
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// sum all annual expense values
getTotalCost(getItems:any) {
return getItems.map(t => t.annual_expenses_value).reduce((acc, value) => acc + Number(value), 0);
}
// detect chnges from parent
ngOnChanges(changes: SimpleChanges) {

View File

@ -0,0 +1,12 @@
<h2 mat-dialog-title>{{dialoge_title_content}}</h2>
<mat-dialog-content>
<div fxFlex="100" align="center">
<p>
{{dialoge_content}}
</p>
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-raised-button color="primary" (click)="completeAI()" *ngIf="data.calc_type_id"><strong>Yes</strong></button>
<button mat-raised-button mat-dialog-close><strong>{{data.calc_type_id ? 'No' :'Ok'}}</strong></button>
</mat-dialog-actions>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ConfirmAiDetailsComponent } from './confirm-ai-details.component';
describe('ConfirmAiDetailsComponent', () => {
let component: ConfirmAiDetailsComponent;
let fixture: ComponentFixture<ConfirmAiDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ConfirmAiDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ConfirmAiDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,45 @@
import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
import { NotifierService } from "angular-notifier";
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from '../../../../../../pd-service/pd-triger.service';
@Component({
selector: 'app-confirm-ai-details',
templateUrl: './confirm-ai-details.component.html',
styleUrls: ['./confirm-ai-details.component.scss']
})
export class ConfirmAiDetailsComponent implements OnInit {
conformation: Boolean = false;
private notifier: NotifierService;
dialoge_title_content: string;
dialoge_content: string;
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<ConfirmAiDetailsComponent>,@Inject(MAT_DIALOG_DATA) public data: any) {
this.notifier = notifier;
this.dialoge_title_content = 'Complete Assessed Income ';
this.dialoge_content =this.data.calc_type_id ? 'Please confirm you are completing the Assessed Income details?' : 'Please confirm Purchase Detail Available In Sales tab ';
}
ngOnInit() {
}
completeAI(): void {
let update_status = {
"fk_pd_id":this.data.pdid,
"company_id":this.data.company_id,
"calc_type_id":this.data.calc_type_id,
"is_completed":1
};
this.pd.saveAssessedDetails('saveAssessedIncomeCalculateMode',update_status).subscribe(result => {
if (result.status == 200) {
this.dialogRef.close({update_status:true});
this.notifier.notify('success', 'Assessed Income Completed Successfully');
}
else {
this.dialogRef.close({update_status:false});
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.dialogRef.close({update_status:false});
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}

View File

@ -14,7 +14,7 @@ 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};
@Input() masterData: { UOMList: any; frequencyList: any; pdid:number,company_id:number, grossProfitTypeList:any};
@Output() loadAssessedForms = new EventEmitter<string>();
activateMariginCalculation: boolean;
private notifier:NotifierService;
@ -88,7 +88,9 @@ removeSalesItem(value: any) : void{
// let transformData: any = value.expandElements.map(val=>val.value);
// transformData = [].concat.apply([], transformData);
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"sim_id":value.sim_id,
"company_id":this.masterData.company_id,
"isactive":false,
"child":[]
}];

View File

@ -9,7 +9,7 @@ import { NotifierService } from 'angular-notifier';
styleUrls: ['./gross-profit-calculation.component.scss']
})
export class GrossProfitCalculationComponent implements OnInit, OnChanges {
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number, company_id:number};
@Input() parentData: any;
@Output() loadAssessedForms = new EventEmitter<string>();
public grossProfitForm: FormGroup;
@ -48,6 +48,7 @@ ngOnChanges(changes: SimpleChanges) {
{
calc_type_id:[changes.parentData.currentValue[0].calc_type_id],
fk_pd_id:[this.masterData.pdid],
company_id:[this.masterData.company_id],
mode:[changes.parentData.currentValue[0].mode,Validators.compose([Validators.required])],
margin:[changes.parentData.currentValue[0].margin],
})
@ -57,6 +58,7 @@ ngOnChanges(changes: SimpleChanges) {
{
calc_type_id:[''],
fk_pd_id:[this.masterData.pdid],
company_id:[this.masterData.company_id],
mode:['',Validators.compose([Validators.required])],
margin:[''],
})

View File

@ -11,27 +11,35 @@
</button>
</div>
</div>
<div class="example-container mat-elevation-z8">
<div class="example-container mat-elevation-z8" *ngIf="houseItemSource.data.length>0">
<table mat-table [dataSource]="houseItemSource">
<ng-container matColumnDef="buiness_particulars" sticky>
<th mat-header-cell *matHeaderCellDef> Expense Particulars </th>
<td mat-cell *matCellDef="let element"> {{element.expense_item}} </td>
<td mat-footer-cell *matFooterCellDef> Total of Expenses</td>
</ng-container>
<ng-container matColumnDef="expense_value">
<th mat-header-cell *matHeaderCellDef> Amount (Rs) </th>
<td mat-cell *matCellDef="let element"> {{element.expense_value}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="frequency">
<th mat-header-cell *matHeaderCellDef> Frequency </th>
<td mat-cell *matCellDef="let element">{{element.frequency_name}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="annual_expenses">
<th mat-header-cell *matHeaderCellDef> Annual Expenses </th>
<td mat-cell *matCellDef="let element">{{element.annual_expense_value}}
</td>
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(houseItemSource.data)}} </td>
</ng-container>
<ng-container matColumnDef="action" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
@ -43,10 +51,14 @@
<mat-icon>delete</mat-icon>
</button>
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns; sticky:true"></tr>
</table>
</div>
</mat-card-content>

View File

@ -27,4 +27,8 @@
.mat-table-sticky:last-child {
border-left: 1px solid #e0e0e0;
}
.mat-footer-cell {
font-weight: bold;
font-size: 1.2rem !important;
}

View File

@ -15,7 +15,7 @@ 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};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number,company_id:number};
@Output() loadAssessedForms = new EventEmitter<string>();
private notifier: NotifierService;
constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
@ -70,6 +70,7 @@ removeHouseItem(value: any) : void{
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"company_id":this.masterData.company_id,
"household_expense_id":value.household_expense_id,
"isactive":false,
}];
@ -81,6 +82,11 @@ removeHouseItem(value: any) : void{
});
}
// sum all house hold values
getTotalCost(getItems:any) {
return getItems.map(t => t.annual_expense_value).reduce((acc, value) => acc + Number(value), 0);
}
// detect chnges from parent
ngOnChanges(changes: SimpleChanges) {

View File

@ -11,27 +11,35 @@
</button>
</div>
</div>
<div class="example-container mat-elevation-z8">
<div class="example-container mat-elevation-z8" *ngIf="businessIncomeItemSource.data.length>0">
<table mat-table [dataSource]="businessIncomeItemSource">
<ng-container matColumnDef="buiness_income" sticky>
<th mat-header-cell *matHeaderCellDef> Buiness Income </th>
<th mat-header-cell *matHeaderCellDef> business Income </th>
<td mat-cell *matCellDef="let element"> {{element.business_income_item}} </td>
<td mat-footer-cell *matFooterCellDef> Total of Income</td>
</ng-container>
<ng-container matColumnDef="income_value">
<th mat-header-cell *matHeaderCellDef> Amount (Rs) </th>
<td mat-cell *matCellDef="let element"> {{element.income_value}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="frequency">
<th mat-header-cell *matHeaderCellDef> Frequency </th>
<td mat-cell *matCellDef="let element">{{element.frequency_name}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="annual_income">
<th mat-header-cell *matHeaderCellDef> Annual Income </th>
<td mat-cell *matCellDef="let element">{{element.annual_income_value}}
</td>
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(businessIncomeItemSource.data)}} </td>
</ng-container>
<ng-container matColumnDef="action" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
@ -43,10 +51,14 @@
<mat-icon>delete</mat-icon>
</button>
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns; sticky:true"></tr>
</table>
</div>
</mat-card-content>

View File

@ -27,4 +27,8 @@
.mat-table-sticky:last-child {
border-left: 1px solid #e0e0e0;
}
.mat-footer-cell {
font-weight: bold;
font-size: 1.2rem !important;
}

View File

@ -14,7 +14,7 @@ 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};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number,company_id:number};
@Output() loadAssessedForms = new EventEmitter<string>();
private notifier: NotifierService;
constructor(notifier: NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) {
@ -68,6 +68,7 @@ removeIncomeItem(value: any) : void{
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"company_id":this.masterData.company_id,
"pd_business_income_id":value.pd_business_income_id,
"isactive":false,
}];
@ -79,6 +80,11 @@ removeIncomeItem(value: any) : void{
});
}
// sum all annual income values
getTotalCost(getItems:any) {
return getItems.map(t => t.annual_income_value).reduce((acc, value) => acc + Number(value), 0);
}
// detect chnges from parent
ngOnChanges(changes: SimpleChanges) {
this.businessIncomeItemSource.data = changes.parentData.currentValue;

View File

@ -11,38 +11,50 @@
</button>
</div>
</div>
<div class="example-container mat-elevation-z8">
<div class="example-container mat-elevation-z8" *ngIf="purchaseItemSource.data.length>0;">
<table mat-table [dataSource]="purchaseItemSource">
<ng-container matColumnDef="raw_material" sticky>
<th mat-header-cell *matHeaderCellDef> Raw Material/Trading Item </th>
<td mat-cell *matCellDef="let element"> {{element.purchase_item}} </td>
<td mat-footer-cell *matFooterCellDef> Total of Purchase</td>
</ng-container>
<ng-container matColumnDef="purchase_quantity">
<th mat-header-cell *matHeaderCellDef> Purchase Quantity </th>
<td mat-cell *matCellDef="let element"> {{element.purchase_qty}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="UOM">
<th mat-header-cell *matHeaderCellDef> UOM </th>
<td mat-cell *matCellDef="let element"> {{element.uom_name}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="rate_per_unit_purchase">
<th mat-header-cell *matHeaderCellDef> Rate/Unit of Purchase </th>
<td mat-cell *matCellDef="let element"> {{element.rate_per_unit}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="frequency">
<th mat-header-cell *matHeaderCellDef> Frequency </th>
<td mat-cell *matCellDef="let element">{{element.frequency_name}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="annual_purchase">
<th mat-header-cell *matHeaderCellDef> Annual Purchase </th>
<td mat-cell *matCellDef="let element">{{element.annual_purchase_value}}
</td>
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(purchaseItemSource.data)}} </td>
</ng-container>
<ng-container matColumnDef="action" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
@ -54,10 +66,14 @@
<mat-icon>delete</mat-icon>
</button>
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns; sticky:true"></tr>
</table>
</div>
</mat-card-content>

View File

@ -27,4 +27,8 @@
.mat-table-sticky:last-child {
border-left: 1px solid #e0e0e0;
}
.mat-footer-cell {
font-weight: bold;
font-size: 1.2rem !important;
}

View File

@ -15,7 +15,7 @@ export class PurchaseDetailsComponent implements OnInit, DoCheck {
activateMariginCalculation:boolean;
private notifier: NotifierService;
@Input() parentData: any;
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number, grossProfitTypeList:any};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number,company_id:number, grossProfitTypeList:any};
@Output() loadAssessedForms = new EventEmitter<string>();
constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) {
this.activateMariginCalculation=false;
@ -69,6 +69,7 @@ removePurchaseItem(value: any) : void{
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"company_id":this.masterData.company_id,
"purchase_id":value.purchase_id,
"isactive":false,
}];
@ -79,6 +80,10 @@ removePurchaseItem(value: any) : void{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// sum all annual Purchase values
getTotalCost(getItems:any) {
return getItems.map(t => t.annual_purchase_value).reduce((acc, value) => acc + Number(value), 0);
}
// do check component bases
ngDoCheck() {

View File

@ -10,7 +10,7 @@ import { NotifierService } from 'angular-notifier';
})
export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck {
@Input() parentData: any;
@Input() masterData: { pdid:number,grossProfitTypeList:any};
@Input() masterData: { pdid:number,company_id:number,grossProfitTypeList:any};
@Output() loadAssessedForms = new EventEmitter<string>();
salesCalculationForm:FormGroup;
activateMariginCalculation: boolean;
@ -82,6 +82,7 @@ ngOnChanges(changes: SimpleChanges) {
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],
company_id:[this.masterData.company_id],
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],
});
@ -91,6 +92,7 @@ ngOnChanges(changes: SimpleChanges) {
sdc_id:[''],
sales_declared_by_customer:['', Validators.required],
fk_pd_id:[this.masterData.pdid],
company_id:[this.masterData.company_id],
margin_per:['',this.activateMariginCalculation===true ? Validators.required: Validators.nullValidator],
margin_value:[''],
});

View File

@ -14,53 +14,70 @@
</button>
</div>
</div>
<div class="example-container mat-elevation-z8">
<div class="example-container mat-elevation-z8" *ngIf="salesItemSource.data.length>0;">
<table mat-table [dataSource]="salesItemSource">
<ng-container matColumnDef="product_services" sticky>
<th mat-header-cell *matHeaderCellDef> Product/Services </th>
<td mat-cell *matCellDef="let element"> {{element.sales_item}} </td>
<td mat-footer-cell *matFooterCellDef> Total of Sales </td>
</ng-container>
<ng-container matColumnDef="sale_quantity">
<th mat-header-cell *matHeaderCellDef> Sale Quantity </th>
<td mat-cell *matCellDef="let element"> {{element.sales_qty}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="UOM">
<th mat-header-cell *matHeaderCellDef> UOM </th>
<td mat-cell *matCellDef="let element"> {{element.uom_name}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="rate_per_unit_sale">
<th mat-header-cell *matHeaderCellDef> Rate/Unit of Sale </th>
<td mat-cell *matCellDef="let element"> {{element.rate_per_unit}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="frequency">
<th mat-header-cell *matHeaderCellDef> Frequency </th>
<td mat-cell *matCellDef="let element">{{element.frequency_name}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="annual_sales">
<th mat-header-cell *matHeaderCellDef> Annual Sales </th>
<td mat-cell *matCellDef="let element">{{element.annual_sale_value}}
</td>
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(salesItemSource.data)}} </td>
</ng-container>
<ng-container matColumnDef="margin_percentage" *ngIf="activateMariginCalculation===true">
<th mat-header-cell *matHeaderCellDef> Margin Percentage % </th>
<td mat-cell *matCellDef="let element">{{element.margin_per}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="margin_amount" *ngIf="activateMariginCalculation===true">
<th mat-header-cell *matHeaderCellDef> Margin Amount </th>
<td mat-cell *matCellDef="let element">{{element.margin_per_uom}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<ng-container matColumnDef="final_value" *ngIf="activateMariginCalculation===true">
<th mat-header-cell *matHeaderCellDef> Final Value </th>
<td mat-cell *matCellDef="let element">{{element.margin_final_value}}
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
@ -74,12 +91,17 @@
<mat-icon>delete</mat-icon>
</button>
</td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns; sticky:true"></tr>
</table>
</div>
</div>
</mat-card-content>
</mat-card>

View File

@ -27,4 +27,9 @@
.mat-table-sticky:last-child {
border-left: 1px solid #e0e0e0;
}
}
.mat-footer-cell {
font-weight: bold;
font-size: 1.2rem !important;
}

View File

@ -13,7 +13,7 @@ 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};
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number,company_id:number, grossProfitTypeList:any};
@Output() loadAssessedForms = new EventEmitter<string>();
activateMariginCalculation: boolean;
private notifier :NotifierService
@ -73,6 +73,7 @@ removeSalesItem(value: any) : void{
let deleteRecords: any =[{
"fk_pd_id":this.masterData.pdid,
"company_id":this.masterData.company_id,
"sci_id":value.sci_id,
"isactive":false,
}];
@ -97,7 +98,14 @@ ngDoCheck() {
this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action'];
}
}}
}
}
// sum all annual sale values
getTotalCost(getItems:any) {
return getItems.map(t => t.annual_sale_value).reduce((acc, value) => acc + Number(value), 0);
}
// detect chnges from parent
// ngOnChanges(changes: SimpleChanges) {

View File

@ -12,6 +12,7 @@ import {BusinessInfoComponent} from './../../forms/business-info/business-info.c
import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/business-assets-info.component';
import { BusinessBankingDetailsComponent } from './../../forms/business-banking-details/business-banking-details.component';
import { GetAnswerableFormsPipe } from './../../../../../pd-pipes/get-answerable-forms.pipe';
import {AssessedIncomeComponent} from './../assessed-income/assessed-income.component';
@Component({
selector: 'app-business-info-group',
@ -174,6 +175,21 @@ export class BusinessInfoGroupComponent implements OnInit {
});
}
else if(details.form_id==16){
const dialogRef = this.dialog.open(AssessedIncomeComponent, {
data: this.pd_all_details,
// position: { right: '0'},
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getCompanyListForBusiness();
});
}
}

View File

@ -395,22 +395,6 @@ export class StartPdComponent implements OnInit, OnDestroy {
});
}
else
if(this.selectedFormsCategory.form_id==16){
const dialogRef = this.dialog.open(AssessedIncomeComponent, {
data: this.pdFullDetails,
// position: { right: '0'},
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2);
});
}else
if(this.selectedFormsCategory.form_id==17){
const dialogRef = this.dialog.open(RentalInfoComponent, {
data: this.pdFullDetails,

View File

@ -47,7 +47,7 @@
<span *ngFor="let master of pdMasterData">
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID,master.pd_status)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<!-- {{master | json}} -->

View File

@ -2,6 +2,7 @@ import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDes
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
import {DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
@ -12,8 +13,7 @@ import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.component';
import { PdRequirementComponent } from '../pd-requirement/pd-requirement.component';
import {DatePipe } from '@angular/common';
import { PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component';
/**sweet alert */
import Swal from 'sweetalert2';
@ -134,7 +134,6 @@ export class ViewPdComponent implements OnInit, OnDestroy {
if (data.status == 200) {
let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]);
console.log('this.pdMasterData',this.pdMasterData);
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData= data.records.applicants_details;
@ -354,9 +353,25 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// start pd
getPDStart(pdID:any){
getPDStart(pdID:any, status: string){
this.destroyType=3;
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
if(status==this.pdStatusCheck.SCHEDULED){
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.viewID, pd_status: this.pdStatusCheck.INPROGRESS },
disableClose: true,
minWidth:'30%',
maxWidth:'40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
}
});
}
else {
this.router.navigate([ '../../startpd',pdID], { relativeTo: this.route });
}
}
getPDIDReport(pdID:any) {
@ -429,6 +444,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// updateViewComponent(editBack:string) {
// if(editBack=='1'){

View File

@ -112,6 +112,7 @@ import { PdStatusChangeDialogueComponent } from './list-pd/pd-status-change-dial
import { PdLocatedMapViewDirective } from './../pd-directive/pd-located-map-view.directive';
import { ViewLocationComponent } from './../pd-directive/view-location/view-location.component';
import { GetAnswerableFormsPipe } from './../pd-pipes/get-answerable-forms.pipe';
import { ConfirmAiDetailsComponent } from './list-pd/start-pd/forms/assessed-income/confirm-ai-details/confirm-ai-details.component';
/**
* Custom angular notifier options
@ -158,7 +159,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
};
@NgModule({
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, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe],
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, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
@ -191,13 +192,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
OwlNativeDateTimeModule,
],
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, PdStatusChangeDialogueComponent, ViewLocationComponent],
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, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent],
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}, PdLocatedMapViewDirective],
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, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent],
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,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent],
})
export class ManagePdModule {

View File

@ -87,7 +87,7 @@
</div>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="button"(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</form>

View File

@ -48,7 +48,7 @@
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1" color="primary" matTooltip="Add More Region Information" matTooltipPosition="above" (click)="addRegionFormData(null, $event); false"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="reset();false"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" (click)="reset();false"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</form>

View File

@ -58,7 +58,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<button *ngIf="selection?.selected.length > 0" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset"
<button *ngIf="selection?.selected.length > 0" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes"
matTooltipPosition="above" type="button" (click)="onDelete()"><mat-icon>delete</mat-icon></button>
</mat-tab>
<mat-tab label="Add TAT">
@ -91,7 +91,7 @@
</div>
</div>
<div fxLayout="row" fxLayoutAlign="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</form>

View File

@ -12,6 +12,6 @@
</mat-chip-list>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="button" (click)="onSubmit()"><mat-icon>save</mat-icon></button>
</div>

View File

@ -86,7 +86,7 @@
</div>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_pdTeamForm.valid"><mat-icon>save</mat-icon></button>
</div>
</mat-card>

View File

@ -157,7 +157,7 @@
<hr>
<mat-card-actions style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Submit" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>

View File

@ -4,6 +4,6 @@
</mat-list-option>
</mat-selection-list>
<div align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="restore()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="button" (click)="restore()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" (click)="myClick()"><mat-icon>save</mat-icon></button>
</div>

View File

@ -16,7 +16,7 @@
<mat-error *ngIf="submitted && f.template_name.hasError('required')" class="mat-text-warn">You must Include Template Name.</mat-error>
</mat-form-field>
<div>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</div>