AI Summary Rupee format changes
This commit is contained in:
parent
e0f9ee034c
commit
6955f0b907
@ -143,8 +143,9 @@ salesMarginAmtCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
|
||||
control.controls[indexVal].controls['margin_per'].setValue('');
|
||||
|
||||
if(values.sales_type=="1" && values.margin_per_uom!='' && values.sales_qty!='') {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.sales_qty) * parseInt(values.margin_per_uom));
|
||||
if(values.sales_type=="1" && values.margin_per_uom!='' && values.sales_qty!='' && values.fk_frequency_id!='') {
|
||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.sales_qty) * parseInt(values.margin_per_uom) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||
}
|
||||
else if(values.sales_type=="2" && values.margin_per_uom!='' && values.rate_per_unit!='') {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.rate_per_unit) * parseInt(values.margin_per_uom));
|
||||
|
||||
@ -38,19 +38,20 @@
|
||||
<!-- Position1 Column -->
|
||||
<ng-container matColumnDef="position_2">
|
||||
<th mat-header-cell *matHeaderCellDef> Declared_by_customer</th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.declared_by_customer}} </td>
|
||||
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.declared_by_customer : i==9 ? element.declared_by_customer : element.declared_by_customer | rupeeCurrencyFormat}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Position2 Column -->
|
||||
<ng-container matColumnDef="position_3">
|
||||
<th mat-header-cell *matHeaderCellDef> As Derived from Item Wise Sales </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.derived_item_wise}} </td>
|
||||
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.derived_item_wise : i==9 ? element.derived_item_wise : element.derived_item_wise | rupeeCurrencyFormat}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Position3 Column -->
|
||||
<ng-container matColumnDef="position_4">
|
||||
<th mat-header-cell *matHeaderCellDef> As Derived from Kuchha Sales Book/Bills </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.derived_sales_book}} </td>
|
||||
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.derived_sales_book : i==9 ? element.derived_sales_book : element.derived_sales_book | rupeeCurrencyFormat}} </td>
|
||||
<!-- | rupeeCurrencyFormat -->
|
||||
</ng-container>
|
||||
|
||||
<!-- action Column -->
|
||||
|
||||
@ -5,10 +5,13 @@ import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angul
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { ConfirmAiDetailsComponent } from "./confirm-ai-details/confirm-ai-details.component";
|
||||
import { RupeeCurrencyFormatPipe } from './../../../../../pd-pipes/rupee-currency-format.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-assessed-income',
|
||||
templateUrl: './assessed-income.component.html',
|
||||
styleUrls: ['./assessed-income.component.scss']
|
||||
styleUrls: ['./assessed-income.component.scss'],
|
||||
providers: [RupeeCurrencyFormatPipe]
|
||||
})
|
||||
export class AssessedIncomeComponent implements OnInit {
|
||||
displayedSummaryColumns: any =[];
|
||||
|
||||
@ -126,17 +126,17 @@
|
||||
</mat-form-field> -->
|
||||
<div style="width:100%">
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Original Tenture in Months" OnlyNumber type="text"
|
||||
<input matInput autocomplete="off" placeholder="Original Tenure in Months" OnlyNumber type="text"
|
||||
formControlName="original_tenure" (change)="checkTenure(details);calculateTenure(details)">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:35%">
|
||||
<input matInput autocomplete="off" placeholder="Current Balance Tenture in Months" OnlyNumber type="text"
|
||||
<input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" OnlyNumber type="text"
|
||||
formControlName="current_balance_tenure" (change)="calculateTenure(details)">
|
||||
<mat-error>Invalid Balance Tenture.</mat-error>
|
||||
<mat-error>Invalid Balance Tenure.</mat-error>
|
||||
<!-- //*ngIf="current_balance_tenure.hasError('min')" class="mat-text-warn" -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput placeholder="Elapsed Tenture in Months" readonly formControlName="elapsed_tenure">
|
||||
<input matInput placeholder="Elapsed Tenure in Months" readonly formControlName="elapsed_tenure">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
{{loanAmtInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-label>Loan Tenture applied for?</mat-label>
|
||||
<mat-label>Loan Tenure applied for?</mat-label>
|
||||
<input matInput placeholder="No of months" formControlName="loan_tenure"
|
||||
OnlyNumber type="text" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
@ -98,7 +98,8 @@
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
<mat-option value="not applicable">Not Applicable</mat-option>
|
||||
<!-- <mat-option value="not applicable">Not Applicable</mat-option> -->
|
||||
<mat-option value="not applicable">Stock not required to be maintained</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" style="width: 90%" *ngIf="md.get('is_sufficiant_raw').value == 'no'">
|
||||
|
||||
@ -91,6 +91,7 @@ import { SharedModule } from "app/shared/shared.module";
|
||||
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
|
||||
import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe';
|
||||
import { NumberToWordsPipe } from './../pd-pipes/number-to-words.pipe';
|
||||
import { RupeeCurrencyFormatPipe } from './../pd-pipes/rupee-currency-format.pipe';
|
||||
import { DeleteRecordsCountPipe } from './../pd-pipes/delete-records-count.pipe';
|
||||
import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component';
|
||||
import { BusinessBankingDetailsComponent } from './list-pd/start-pd/forms/business-banking-details/business-banking-details.component';
|
||||
@ -160,7 +161,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
declarations: [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, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
declarations: [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, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ManagePdRoutingModule,
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
import { RupeeCurrencyFormatPipe } from './rupee-currency-format.pipe';
|
||||
|
||||
describe('RupeeCurrencyFormatPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new RupeeCurrencyFormatPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,28 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'rupeeCurrencyFormat'
|
||||
})
|
||||
export class RupeeCurrencyFormatPipe implements PipeTransform {
|
||||
|
||||
transform(value: any): any {
|
||||
if (!isNaN(value) && value) {
|
||||
var currencySymbol = '₹';
|
||||
//var output = Number(input).toLocaleString('en-IN'); <-- This method is not working fine in all browsers!
|
||||
var result = value.toString().split('.');
|
||||
|
||||
var lastThree = result[0].substring(result[0].length - 3);
|
||||
var otherNumbers = result[0].substring(0, result[0].length - 3);
|
||||
if (otherNumbers != '')
|
||||
lastThree = ',' + lastThree;
|
||||
var output = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
|
||||
|
||||
if (result.length > 1) {
|
||||
output += "." + result[1];
|
||||
}
|
||||
|
||||
return currencySymbol + output;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user