Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
02c01fe3b5
@ -53,16 +53,12 @@ export class DashboardService {
|
||||
|
||||
getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr): Observable<any> {
|
||||
|
||||
console.log('From',fromdate);
|
||||
console.log('To',todate);
|
||||
console.log('Lender Arr',lenderarr);
|
||||
console.log('City Arr',cityarr);
|
||||
|
||||
console.log(' From : ' + fromdate + ' To : ' + todate + ' Lender Array : ' + lenderarr + ' City Array : ' + cityarr);
|
||||
|
||||
return this._http.post(this.apiUrl+'getDashBoardMaster', {
|
||||
"fromdate":fromdate != '' && fromdate != null && fromdate != undefined ? fromdate : '',
|
||||
"todate": todate != '' && todate != null && todate != undefined ? todate : '',
|
||||
"lenderarr": lenderarr,"cityarr":cityarr})
|
||||
"cityarr":cityarr,"lenderarr": lenderarr})
|
||||
.pipe(catchError(this.handleError('role', []))
|
||||
)
|
||||
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
<div *ngIf="pdOfficerList.length > 0" >
|
||||
<div fxLayout="row wrap" fxFlex="100%">
|
||||
<div fxLayout="row wrap" fxFlex="33.33%" *ngFor="let officer of pdOfficerList; ">
|
||||
<div fxLayout="row wrap" fxFlex="22%" *ngFor="let officer of pdOfficerList; ">
|
||||
<mat-card fxFlex="100%">
|
||||
<mat-card-content style="text-align:center">
|
||||
<mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:50%"><br>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:100px;height:100px;"><br>
|
||||
<span>{{officer.first_name}}</span>
|
||||
<br>
|
||||
<span>{{officer.mobile_no}}</span><br>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<!-- <form [formGroup]="_pdAllocationForm" (submit)="onSubmit()"> -->
|
||||
<div *ngIf="pdCentralOfficerList.length > 0" >
|
||||
<div fxLayout="row wrap" fxFlex="100%">
|
||||
<div fxLayout="row wrap" fxFlex="33.33%" *ngFor="let officer of pdCentralOfficerList; ">
|
||||
<div fxLayout="row wrap" fxFlex="22%" *ngFor="let officer of pdCentralOfficerList; ">
|
||||
<!-- <p><mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
|
||||
{{officer.first_name}}
|
||||
</p>
|
||||
@ -31,10 +31,10 @@
|
||||
<mat-card fxFlex="100%">
|
||||
<mat-card-content style="text-align:center">
|
||||
<mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:50%"><br>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:100px;height:100px;"><br>
|
||||
<span>{{officer.first_name}}</span>
|
||||
<br>
|
||||
<span>{{officer.mobile_no}}</span>
|
||||
<span>{{officer.mobile_no}}</span> <br>
|
||||
<span>PD in hand - {{officer.count}}</span>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
@ -64,11 +64,11 @@
|
||||
|
||||
<div *ngIf="pdExcutiveList.length > 0" >
|
||||
<div fxLayout="row wrap" fxFlex="100%">
|
||||
<div fxLayout="row wrap" fxFlex="33.33%" *ngFor="let excutive of pdExcutiveList">
|
||||
<div fxLayout="row wrap" fxFlex="22%" *ngFor="let excutive of pdExcutiveList">
|
||||
<mat-card fxFlex="100%">
|
||||
<mat-card-content style="text-align:center">
|
||||
<mat-radio-button [value]="excutive" (change)="selectExcutiveOfficer(excutive)"></mat-radio-button>
|
||||
<img [src]="excutive.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:50%"><br>
|
||||
<img [src]="excutive.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:100px;height:100px;"><br>
|
||||
<span>{{excutive.first_name}}</span>
|
||||
<br>
|
||||
<span>{{excutive.mobile_no}}</span> <br>
|
||||
|
||||
@ -0,0 +1,281 @@
|
||||
<form [formGroup]="_assessedIncomeFormFrom">
|
||||
<!-- house hold expenses start-->
|
||||
<!-- hide table based start -->
|
||||
<!-- <mat-card>
|
||||
<mat-card-content *ngFor="let tbl of salesMonthWiseTable; let tableIndex=index">
|
||||
<table>
|
||||
<caption>{{tbl.salesItem}}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th *ngFor="let tblHeader of tbl.headerElement; let tableHeaderIndex=index">
|
||||
{{tblHeader.header}}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td *ngFor="let tblBody of tbl.bodyElements;">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr *ngFor="let tblBodyTr of tblBody.bodyElement;">
|
||||
<td>{{tblBodyTr.sales_date | date: 'dd-MM-yyyy'}}</td>
|
||||
<td>{{tblBodyTr.sales_value}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">{{tblBody.bodyElementTotal}}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tfoot>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr *ngFor="let parentTabFooter of tbl.parentTableFooter">
|
||||
<td colspan="parentTabFooter.cols_span_length">{{parentTabFooter.message}}</td>
|
||||
<td>{{parentTabFooter.value}}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
</mat-card-content>
|
||||
</mat-card> -->
|
||||
<!-- hide table based end -->
|
||||
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Sales Declared By Customer" formControlName="sales_declared_by_customer">
|
||||
</mat-form-field>
|
||||
<mat-accordion multi="false">
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">Sales Calculate Items Wise</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<table mat-table [dataSource]="salesCaluatedItem">
|
||||
<!-- Item Column -->
|
||||
<ng-container matColumnDef="Item">
|
||||
<th mat-header-cell *matHeaderCellDef>Item</th>
|
||||
<td mat-cell *matCellDef="let salesItem">{{salesItem.sales_item}} </td>
|
||||
</ng-container>
|
||||
<!-- Qty/Uom Column-->
|
||||
<ng-container matColumnDef="Qty/UOM">
|
||||
<th mat-header-cell *matHeaderCellDef>Qty/UOM</th>
|
||||
<td mat-cell *matCellDef="let salesItem">{{salesItem.sales_qty }}/{{salesItem.uom_name }} </td>
|
||||
</ng-container>
|
||||
<!-- Rate/Unit Column-->
|
||||
<ng-container matColumnDef="Rate/Unit">
|
||||
<th mat-header-cell *matHeaderCellDef>Rate/Unit</th>
|
||||
<td mat-cell *matCellDef="let salesItem"> {{salesItem.rate_per_unit }} </td>
|
||||
</ng-container>
|
||||
<!-- Frequency Name Column -->
|
||||
|
||||
<ng-container matColumnDef="Frequency">
|
||||
<th mat-header-cell *matHeaderCellDef>Frequency</th>
|
||||
<td mat-cell *matCellDef="let salesItem"> {{salesItem.frequency_name}} </td>
|
||||
</ng-container>
|
||||
<!-- Annual Sale Value Column-->
|
||||
<ng-container matColumnDef="Annual Sale Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Annual Sale Value</th>
|
||||
<td mat-cell *matCellDef="let salesItem"> {{salesItem.annual_sale_value}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="salesCaluatedItemColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: salesCaluatedItemColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">Sales Calculate Items Month Wise</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<mat-accordion multi="true">
|
||||
<mat-expansion-panel *ngFor="let expandDetails of salesMonthWiseExpandedItems">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">{{expandDetails.salesItem}}</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<div fxLayout="row wrap" style="display: flex">
|
||||
<div fxFlex="50" *ngFor="let eachItem of expandDetails.expandElements" class="m-gap p-gap">
|
||||
|
||||
<h4 align="center" class="h4_font">{{eachItem.header}}</h4>
|
||||
<table mat-table [dataSource]="eachItem.value" class="mat-elevation-z8">
|
||||
<ng-container matColumnDef="Date">
|
||||
<th mat-header-cell *matHeaderCellDef>Date</th>
|
||||
<td mat-cell *matCellDef="let itemValue">{{itemValue.sales_date | date: 'dd-MM-yyyy'}} </td>
|
||||
<td mat-footer-cell *matFooterCellDef> Total </td>
|
||||
</ng-container>
|
||||
<!-- Value Column-->
|
||||
<ng-container matColumnDef="Amount">
|
||||
<th mat-header-cell *matHeaderCellDef>Amount</th>
|
||||
<td mat-cell *matCellDef="let itemValue">{{itemValue.sales_value}}</td>
|
||||
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(eachItem.value)}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="salesMonthItemColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: salesMonthItemColumns;"></tr>
|
||||
<tr mat-footer-row *matFooterRowDef="salesMonthItemColumns; sticky: true"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</ng-template>
|
||||
|
||||
<mat-action-row *ngFor="let footer of expandDetails.footerMessage">
|
||||
<div fxFlex="50" >
|
||||
<small class="expan_footer">{{footer.month_message}}</small>
|
||||
</div>
|
||||
<div fxFlex="50" >
|
||||
<small class="expan_footer">{{footer.year_message}}</small>
|
||||
</div>
|
||||
</mat-action-row>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">Purchase Details</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<table mat-table [dataSource]="purchaseDetails">
|
||||
<!-- Item Column -->
|
||||
<ng-container matColumnDef="Item">
|
||||
<th mat-header-cell *matHeaderCellDef>Item</th>
|
||||
<td mat-cell *matCellDef="let purchaseItem">{{purchaseItem.purchase_item}} </td>
|
||||
</ng-container>
|
||||
<!-- Qty/Uom Column-->
|
||||
<ng-container matColumnDef="Qty/UOM">
|
||||
<th mat-header-cell *matHeaderCellDef>Qty/UOM</th>
|
||||
<td mat-cell *matCellDef="let purchaseItem">{{purchaseItem.purchase_qty }}/{{purchaseItem.uom_name }} </td>
|
||||
</ng-container>
|
||||
<!-- Rate/Unit Column-->
|
||||
<ng-container matColumnDef="Rate/Unit">
|
||||
<th mat-header-cell *matHeaderCellDef>Rate/Unit</th>
|
||||
<td mat-cell *matCellDef="let purchaseItem"> {{purchaseItem.rate_per_unit }} </td>
|
||||
</ng-container>
|
||||
<!-- Frequency Name Column -->
|
||||
|
||||
<ng-container matColumnDef="Frequency">
|
||||
<th mat-header-cell *matHeaderCellDef>Frequency</th>
|
||||
<td mat-cell *matCellDef="let purchaseItem"> {{purchaseItem.frequency_name}} </td>
|
||||
</ng-container>
|
||||
<!-- Annual Sale Value Column-->
|
||||
<ng-container matColumnDef="Annual Purchase Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Annual Purchase Value</th>
|
||||
<td mat-cell *matCellDef="let purchaseItem"> {{purchaseItem.annual_purchase_value}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="purchaseDetailsColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: purchaseDetailsColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">Business Expenses</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<table mat-table [dataSource]="businessExpenses">
|
||||
<!-- Expense Item Column -->
|
||||
<ng-container matColumnDef="Item">
|
||||
<th mat-header-cell *matHeaderCellDef>Item</th>
|
||||
<td mat-cell *matCellDef="let businessEx"> {{businessEx.expense_item}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Expense Value Column-->
|
||||
<ng-container matColumnDef="Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Value</th>
|
||||
<td mat-cell *matCellDef="let businessEx"> {{businessEx.expense_value }} </td>
|
||||
</ng-container>
|
||||
<!-- Frequency Name Column -->
|
||||
<ng-container matColumnDef="Frequency">
|
||||
<th mat-header-cell *matHeaderCellDef>Frequency</th>
|
||||
<td mat-cell *matCellDef="let businessEx"> {{businessEx.frequency_name}} </td>
|
||||
</ng-container>
|
||||
<!-- Annual Expenses Value Column-->
|
||||
<ng-container matColumnDef="Annual Expenses Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Annual Expenses Value</th>
|
||||
<td mat-cell *matCellDef="let businessEx"> {{businessEx.annual_expenses_value}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="businessExpensesColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: businessExpensesColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<small class="expan_table_header">House Hold Expenses</small>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-template matExpansionPanelContent>
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<table mat-table [dataSource]="houseHoldExpenses">
|
||||
<!-- Item Column -->
|
||||
<ng-container matColumnDef="Item">
|
||||
<th mat-header-cell *matHeaderCellDef>Item</th>
|
||||
<td mat-cell *matCellDef="let householdItem">{{householdItem.expense_item}} </td>
|
||||
</ng-container>
|
||||
<!-- Value Column-->
|
||||
<ng-container matColumnDef="Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Value</th>
|
||||
<td mat-cell *matCellDef="let householdItem">{{householdItem.expense_value }}</td>
|
||||
</ng-container>
|
||||
<!-- Frequency Name Column -->
|
||||
<ng-container matColumnDef="Frequency">
|
||||
<th mat-header-cell *matHeaderCellDef>Frequency</th>
|
||||
<td mat-cell *matCellDef="let householdItem"> {{householdItem.frequency_name}} </td>
|
||||
</ng-container>
|
||||
<!-- Annual Expense Value Column-->
|
||||
<ng-container matColumnDef="Annual Expenses Value">
|
||||
<th mat-header-cell *matHeaderCellDef>Annual Expenses Value</th>
|
||||
<td mat-cell *matCellDef="let householdItem"> {{householdItem.annual_expense_value}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="houseHoldExpensesColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: houseHoldExpensesColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,46 @@
|
||||
.example-container {
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr.mat-footer-row {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.mat-table-sticky {
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
// table, th, td {
|
||||
// border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
// border-collapse: collapse;
|
||||
// }
|
||||
// td {
|
||||
// padding: 5px;
|
||||
// text-align: left;
|
||||
// }
|
||||
// th {
|
||||
// padding: 5px;
|
||||
// text-align: center;
|
||||
// }
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AssessedIncomeComponent } from './assessed-income.component';
|
||||
|
||||
describe('AssessedIncomeComponent', () => {
|
||||
let component: AssessedIncomeComponent;
|
||||
let fixture: ComponentFixture<AssessedIncomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AssessedIncomeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AssessedIncomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,150 @@
|
||||
import {Component,OnInit,Inject,Input, ViewChild } from '@angular/core';
|
||||
import {FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
/** Service */
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-assessed-income',
|
||||
templateUrl: './assessed-income.component.html',
|
||||
styleUrls: ['./assessed-income.component.scss']
|
||||
})
|
||||
export class AssessedIncomeComponent implements OnInit {
|
||||
public _assessedIncomeFormFrom: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
@Input() pdid: number;
|
||||
@Input() form_id: number;
|
||||
salesCaluatedItemColumns: string[] = ['Item', 'Qty/UOM','Rate/Unit','Frequency','Annual Sale Value'];
|
||||
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'];
|
||||
|
||||
|
||||
// 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,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.initAssessedIncomeForm();
|
||||
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);
|
||||
}
|
||||
else{
|
||||
this._assessedIncomeFormFrom.controls['sales_declared_by_customer'].setValue('');
|
||||
|
||||
}
|
||||
if(value.records.sales_calculated_by_itemwise){
|
||||
this.salesCaluatedItem = value.records.sales_calculated_by_itemwise;
|
||||
}
|
||||
if(value.records.sales_items_by_monthwise){
|
||||
this.salesItemMonthWise = value.records.sales_items_by_monthwise;
|
||||
// hide table format start
|
||||
|
||||
// this.salesItemMonthWise.forEach((itemElement, itemIndex) => {
|
||||
// this.salesItemMonthWiseBody= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] }));
|
||||
// let combineTableColumn = Object.keys(itemElement.items).map(key => (itemElement.items[key]));
|
||||
// let sumItems: any=[];
|
||||
// combineTableColumn.forEach((sumValue, sumIndex) => {
|
||||
// let calculateItems = sumValue.reduce((acc, calculate) => acc + Number(calculate.sales_value), 0);
|
||||
// sumItems.push({bodyElement:sumValue, bodyElementTotal:calculateItems});
|
||||
// })
|
||||
// let calculateAllItemsTotal:number=sumItems.reduce((racc, rcalculate) => racc + Number(rcalculate.bodyElementTotal), 0);
|
||||
// let convertYear : number = 12 / sumItems.length;
|
||||
// let tableFooterMessage: any=[];
|
||||
// tableFooterMessage.push({
|
||||
// message: sumItems.length + ' Months ' + itemElement.sales_item + ' Sales ',
|
||||
// value:calculateAllItemsTotal,
|
||||
// cols_span_length:sumItems.length * 2 -1,
|
||||
// })
|
||||
// tableFooterMessage.push({
|
||||
// message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived',
|
||||
// value: calculateAllItemsTotal * convertYear,
|
||||
// cols_span_length:sumItems.length * 2 -1 ,
|
||||
// })
|
||||
// this.salesMonthWiseTable.push({salesItem:itemElement.sales_item,headerElement:this.salesItemMonthWiseBody, bodyElements:sumItems, parentTableFooter:tableFooterMessage});
|
||||
// //console.log(this.salesMonthWiseTable)
|
||||
// });
|
||||
// hide table format end
|
||||
|
||||
|
||||
this.salesItemMonthWise.forEach((itemElement, itemIndex) => {
|
||||
let expandBodyContent= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] }));
|
||||
let listItems: any=[];
|
||||
expandBodyContent.forEach((expnadElement, expnadIndex) => {
|
||||
let calculateItems = expnadElement.value.reduce((acc, calculate) => acc + Number(calculate.sales_value), 0);
|
||||
listItems.push({items:expnadElement, itemsTotal:calculateItems})
|
||||
})
|
||||
let calculateAllItemsTotal:number=listItems.reduce((racc, rcalculate) => racc + Number(rcalculate.itemsTotal), 0);
|
||||
|
||||
let convertYear : number = 12 / listItems.length;
|
||||
let footerMessage: any=[];
|
||||
footerMessage.push({
|
||||
month_message: listItems.length + ' Months ' + itemElement.sales_item + ' Sales : '+ calculateAllItemsTotal,
|
||||
month_value:calculateAllItemsTotal,
|
||||
year_message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived : '+ calculateAllItemsTotal * convertYear,
|
||||
year_value: calculateAllItemsTotal * convertYear,
|
||||
})
|
||||
// footerMessage.push({
|
||||
// message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived',
|
||||
// value: calculateAllItemsTotal * convertYear,
|
||||
// })
|
||||
this.salesMonthWiseExpandedItems.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
if(value.records.purchase_details){
|
||||
this.purchaseDetails = value.records.purchase_details;
|
||||
}
|
||||
if(value.records.business_expenses){
|
||||
this.businessExpenses=value.records.business_expenses;
|
||||
}
|
||||
if(value.records.house_hold_expenses){
|
||||
this.houseHoldExpenses = value.records.house_hold_expenses;
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// get total cost
|
||||
getTotalCost(getItems:any) {
|
||||
return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0);
|
||||
}
|
||||
|
||||
|
||||
// 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([]),
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -436,6 +436,9 @@
|
||||
<ng-container *ngSwitchCase="15">
|
||||
<app-lender-representative [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-lender-representative>
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="16">
|
||||
<app-assessed-income [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-assessed-income>
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="17">
|
||||
<app-rental-info [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-rental-info>
|
||||
</ng-container>
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
<div *ngIf="pdCentralOfficerList.length > 0" >
|
||||
<div fxLayout="row wrap" fxFlex="100%">
|
||||
<div fxLayout="row wrap" fxFlex="33.33%" *ngFor="let officer of pdCentralOfficerList; ">
|
||||
<div fxLayout="row wrap" fxFlex="22%" *ngFor="let officer of pdCentralOfficerList; ">
|
||||
<mat-card fxFlex="100%">
|
||||
<mat-card-content style="text-align:center">
|
||||
<mat-radio-button [value]="officer" (change)="selectPdOfficer(officer)"></mat-radio-button>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:50%"><br>
|
||||
<img [src]="officer.profile_url ||'https://image.ibb.co/mGjZB9/usernew.png'" alt="No Image" style="border-radius:50%;width:100px;height:100px;"><br>
|
||||
<span>{{officer.first_name}}</span>
|
||||
<br>
|
||||
<span>{{officer.mobile_no}}</span><br>
|
||||
|
||||
@ -60,7 +60,7 @@ import {EmploymentInfoComponent} from "./list-pd/start-pd/forms/employment-info/
|
||||
import {BusinessInfoComponent} from "./list-pd/start-pd/forms/business-info/business-info.component";
|
||||
import {FinancialInfoComponent} from "./list-pd/start-pd/forms/financial-info/financial-info.component";
|
||||
import { LenderRepresentativeComponent } from './list-pd/start-pd/forms/lender-representative/lender-representative.component';
|
||||
|
||||
import { AssessedIncomeComponent } from './list-pd/start-pd/forms/assessed-income/assessed-income.component';
|
||||
import { TelePdAllocationComponent } from './list-pd/tele-pd-allocation/tele-pd-allocation.component';
|
||||
|
||||
import { PdReportComponent } from './list-pd/pd-report/pd-report.component';
|
||||
@ -140,7 +140,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],
|
||||
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],
|
||||
|
||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||
@ -172,7 +172,7 @@ 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],
|
||||
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, AssessedIncomeComponent],
|
||||
providers: [PdTrigerService, GetGeometricLocationService],
|
||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent]
|
||||
})
|
||||
|
||||
@ -233,6 +233,13 @@ export class PdTrigerService {
|
||||
// catchError(this.handleError('operation', []))
|
||||
// )
|
||||
// }
|
||||
// get assessed income form details
|
||||
getAssessedIncomeFormDetails(formDetails):Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl+"getAssessedIncome",formDetails)
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
private handleError<T>(operation = 'operation', result?: T) {
|
||||
return (error: any): Observable<T> => {
|
||||
|
||||
@ -429,6 +429,9 @@
|
||||
<ng-container *ngSwitchCase="15">
|
||||
<app-lender-representative [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-lender-representative>
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="16">
|
||||
<app-assessed-income [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-assessed-income>
|
||||
</ng-container>
|
||||
|
||||
<!-- end personal type questions
|
||||
-->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user