fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-30 19:27:11 +05:30
parent 460ae97a86
commit a418fb42c0
15 changed files with 1807 additions and 1711 deletions

File diff suppressed because one or more lines are too long

2042
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,6 @@
<mat-select placeholder="Financial Statements Available ?" formControlName="is_financial_statements" (selectionChange)="selectedStatement($event.value)">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="isDisplay">
@ -51,7 +50,8 @@
<div *ngIf="i>0">
<!-- <mat-label>Sale Variation from Previous Year in %</mat-label>&nbsp;&nbsp;- -->
<mat-form-field>
<input matInput placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)" readonly>
<input matInput placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" [ngClass]="details.get('financial_annualsales_variation').value > 0 ? 'greenhighlight' : 'highlight'"
(keypress)="keyPress($event)" readonly>
</mat-form-field>
<p class="info" *ngIf="details.get('financial_annualsales_variation').value != '' " >
<span *ngIf="details.get('financial_annualsales_variation').value == 0">

View File

@ -389,7 +389,8 @@ submitDetails(){
annual_sale = val.financial_annual_sale;
/** Calculating Sale Variation Based on Prev.Year ( Datas returns in percentage )
* Label name = " Sale Variation from Previous Year in % "
* Explaination : Comparing Curr.Year annual sales and Prev.year annual sales
* Label name : " Sale Variation from Previous Year in % "
*/
if (index != 0) {
@ -412,7 +413,8 @@ submitDetails(){
loss_amt = val.financial_net_loss;
/** Calculating Profit's Variation - STARTS HERE
* Label name = "Profit Variation from Previous Year in %"
* Explaination : Comparing Curr.Year Net Profit (or) Loss Amount With Prev.year Net Profit (or) Loss Amount
* Label name : "Profit Variation from Previous Year in %"
*/
if((profit_amt != '' || loss_amt != '') && index != 0) {
if(+profit_amt > +annual_sale){
@ -433,7 +435,8 @@ submitDetails(){
/********************************* Calculating Profit's Variation - ENDS HERE **************************************************************/
/** Calculating Net Profit (or) Net Loss (and) Sales's Profit Variation
* Label name = "Net Profit to Sales in % (or) Net Loss to Sales in %
* Explaination : Comparing Curr.Year Net Profit Amount With Curr.year Annual Sales Amount ( like wise loss )
* Label name : "Net Profit to Sales in % (or) Net Loss to Sales in %
**/
let SelectedlossOrProfit = val.finanical_profit_or_loss;
@ -444,8 +447,7 @@ submitDetails(){
if (annual_sale != '' && val.financial_net_profit != '') {
if(+profit_amt>+annual_sale){
// alert("profit is greater than Annual Sale ");
this.toast.pdTriggerappmessage("profit is greater than Annual Sale ")
alert("profit is greater than Annual Sale ");
childArray.controls.financial_net_profit.setValue(0);
childArray.controls.financial_margin_of_profit.setValue('');
childArray.controls.financial_profit_to_sale_variation.setValue('');
@ -464,8 +466,7 @@ submitDetails(){
if (annual_sale != '' && val.financial_net_loss != '') {
if(+val.financial_net_loss>+annual_sale){
// alert("Loss is greater than Annual Sale ");
this.toast.pdTriggerappmessage("Loss is greater than Annual Sale ")
alert("Loss is greater than Annual Sale ");
childArray.controls.financial_net_loss.setValue(0);
childArray.controls.financial_margin_of_loss.setValue('');
childArray.controls.financial_profit_to_sale_variation.setValue('');
@ -488,9 +489,14 @@ submitDetails(){
}
}
}
// console.log('val.financial_margin_of_profit',val.financial_margin_of_profit);
// console.log('profit_margin',profit_margin);
// console.log('childArray.controls.financial_margin_of_loss',childArray.controls.financial_margin_of_loss.value);
// prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0;
// prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ;
prev_profit_margin[index] = profit_margin != '' ? profit_margin : 0;
prev_loss_margin[index] = loss_margin !='' ? loss_margin : 0 ;
prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0;
prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ;
// if(index != 0 ){
@ -511,11 +517,21 @@ submitDetails(){
if ((profit_margin != '' || loss_margin != '') && index != 0) {
// console.log('temp_prev_losses',prev_loss_margin);
// console.log('temp_prev_profits',prev_profit_margin);
// console.log('curr index',index);
loss_margin = loss_margin !== undefined ? loss_margin : 0;
profit_margin = profit_margin !== undefined ? profit_margin:0;
let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ;
let temp_prev_profit_margin = prev_profit_margin[index-1] !== undefined ? prev_profit_margin[index-1] : 0 ;
// console.log('profit_margin',profit_margin);
// console.log('pre year loss_margin',temp_prev_loss_margin);
// console.log('loss_margin',loss_margin);
// console.log('pre year profit_margin',temp_prev_profit_margin);
if(annual_sale != ''){
@ -535,6 +551,7 @@ submitDetails(){
});
}
confirmAlert(i, details){
let estimate_sales_from = +details.value.estimate_sales_from;

View File

@ -28,7 +28,7 @@
<mat-select placeholder="Stock" formControlName="stock_observed" (selectionChange)="checkComments($event.value,1,a)">
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
<mat-option value="stock not required to be maintained">Stock not required to be maintained</mat-option>
<!-- <mat-option value="stock not required to be maintained">Stock not required to be maintained</mat-option> -->
</mat-select>
</mat-form-field>
<span *ngIf="mrm.get('stock_observed').value == 'yes'">
@ -77,8 +77,12 @@
<mat-placeholder>Is the stock of Raw Materials observed, sufficient considering the size of operations</mat-placeholder><br/>
<mat-select
formControlName="is_sufficiant_raw"><!-- (selectionChange)="checkComments($event.value,1,a)" -->
<mat-option value="yes">Yes</mat-option>
<mat-option *ngFor="let val of RMsufficientList" [value]="val.value" [disabled]="val.disabled">
{{val.isdisplayvalue}}
</mat-option>
<!-- <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Stock not required to be maintained</mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="md.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 100%">
@ -101,7 +105,6 @@
<mat-select placeholder="Stock" formControlName="goods_observed" (selectionChange)="checkComments($event.value,2,b)">
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
<mat-option value="stock not required to be maintained">Stock not required to be maintained</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="mfg.get('goods_observed').value == 'yes'">
@ -175,7 +178,6 @@
<mat-select placeholder="Stock" formControlName="traded_goods_observed" (selectionChange)="checkComments($event.value,3,e)">
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
<mat-option value="stock not required to be maintained">Stock not required to be maintained</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="item.get('traded_goods_observed').value == 'yes'">
@ -315,8 +317,12 @@
<mat-placeholder>Is the stock of finished / traded goods observed, sufficient considering the size of operations</mat-placeholder><br/>
<mat-select formControlName="is_sufficiant_finished_and_traded_goods">
<mat-option>Select</mat-option>
<mat-option value="yes" >Yes</mat-option>
<mat-option *ngFor="let val of TGsufficientList" [value]="val.value" [disabled]="val.isdisabled">
{{val.isdisplayvalue}}
</mat-option>
<!-- <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</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: 100%" *ngIf="this.stockForm.controls.is_sufficiant_finished_and_traded_goods.value == 'no'">

View File

@ -46,6 +46,8 @@ export class PdQuestionStockInfoPage {
RMCommentCard: boolean = false;
TGCommentCard: boolean = false
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
public TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
constructor(public navCtrl: NavController, public navParams: NavParams, public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider, public toast: ToastProvider, public fb: FormBuilder, public constant: ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails');
@ -57,8 +59,7 @@ export class PdQuestionStockInfoPage {
if (data.dataStatus == true) {
this.initstockForm(data.record);
}
else if(data.dataStatus == false)
{
else if (data.dataStatus == false) {
this.toast.pdTriggerappmessage('Fill Business Form First! / No Company Found at this ID ' + this.company_id);
this.noRecordsFound = false;
this.errorMessage = 'Fill Business Form First! / No Company Found at this ID' + this.company_id + '! ....';
@ -83,6 +84,8 @@ export class PdQuestionStockInfoPage {
return record.from_business[key];
});
if (record.from_business.length > 0) {
let type2 = record.from_business.filter(data => data.type_of_activity_id == 2);
let type2length = type2[0].hasOwnProperty("products") ? type2[0].products.length : 0;
let type3 = record.from_business.filter(data => data.type_of_activity_id == 3);
let type3length = type3[0].hasOwnProperty("products") ? type3[0].products.length : 0;
let type4 = record.from_business.filter(data => data.type_of_activity_id == 4);
@ -111,7 +114,7 @@ if(record.from_business.length>0){
is_sufficiant_finished_and_traded_goods: [dataForm.is_sufficiant_finished_and_traded_goods],
finished_and_traded_goods_remarks: [dataForm.finished_and_traded_goods_remarks],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
});
@ -166,7 +169,7 @@ if(record.from_business.length>0){
// rawmaterial_remarks:[''],
is_sufficiant_finished_and_traded_goods: [''],
finished_and_traded_goods_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
});
@ -220,7 +223,7 @@ if(record.from_business.length>0){
is_sufficiant_finished_and_traded_goods: [''],
finished_and_traded_goods_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
@ -276,8 +279,7 @@ if(record.from_business.length>0){
}
getdropdown()
{
getdropdown() {
this.qustCat.getcommondrop('UOM').subscribe(data => {
if (data['dataStatus'] == true) {
this.uomData = data['records'].filter(uom => uom.isactive == 1 && uom.is_land_uom == 0 || uom.is_land_uom == 2);
@ -286,11 +288,12 @@ if(record.from_business.length>0){
}
manufacturingForm: Boolean = false;
manufacturingFormCreation(record) {
manufacturingFormCreation(record,length) {
let arr = record.from_business.filter(data => data.type_of_activity_id == 2);
let rm_arr = record.from_supplier.hasOwnProperty("raw_material") ? record.from_supplier.raw_material : [];
//console.log("Manufacturing ",arr);
if (arr.length > 0) {
//console.log("rm_arr",rm_arr);
if (length > 0) {
this.manufacturingForm = true;
return this.fb.group({
is_sufficiant_raw: [],
@ -299,7 +302,13 @@ if(record.from_business.length>0){
manufacturing_finished_goods: this.fb.array([]),
})
} else {
return;
return this.fb.group({
is_sufficiant_raw: [],
rawmaterial_remarks: [],
manufacturing_raw_materials: this.fb.array([]),
manufacturing_finished_goods: this.fb.array([]),
})
// return;
}
}
@ -307,7 +316,7 @@ if(record.from_business.length>0){
retailFormCreation(val) {
//let arr = val.filter(data => data.type_of_activity_id == 3);
let arr = val
console.log("retail Form ",arr);
// console.log("retail Form ", arr);
if (arr > 0) {
// if(arr.products != undefined){
this.retailForm = true;
@ -357,14 +366,16 @@ if(record.from_business.length>0){
if (datas === null) {
if (this.suppliers_raw_materials.length > 0) {
this.suppliers_raw_materials.forEach(val => {
let Ref_RawMaterials : any = {'raw_name': val,
let Ref_RawMaterials: any = {
'raw_name': val,
'stock_observed': '',
'raw_quantity': '',
'raw_uom': '',
'other_uom': '',
'raw_value': '',
'is_sufficiant_raw': '',
'rawmaterial_remarks':''};
'rawmaterial_remarks': ''
};
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
});
}
@ -373,14 +384,16 @@ if(record.from_business.length>0){
}
if (this.suppliers_finished_goods.length > 0) {
this.suppliers_finished_goods.forEach(val => {
let Ref_Finished_Goods : any = {'goods_name': val,
let Ref_Finished_Goods: any = {
'goods_name': val,
'goods_observed': '',
'goods_quantity': '',
'goods_uom': '',
'goods_other_uom': '',
'goods_value': '',
'is_sufficiant_goods': '',
'finishedgoods_remarks':''};
'finishedgoods_remarks': ''
};
finishedGoods.push(this.createGoods(Ref_Finished_Goods));
});
}
@ -458,7 +471,8 @@ if(record.from_business.length>0){
'traded_goods_other_uom': '',
'estimated_traded_goods_value': '',
'is_sufficiant_traded_goods': '',
'traded_goods_remarks':''};
'traded_goods_remarks': ''
};
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
});
}
@ -523,7 +537,8 @@ if(record.from_business.length>0){
'traded_goods_other_uom': '',
'estimated_traded_goods_value': '',
'is_sufficiant_traded_goods': '',
'traded_goods_remarks':''};
'traded_goods_remarks': ''
};
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
});
}
@ -532,8 +547,7 @@ if(record.from_business.length>0){
}
} else {
if(datas.trading_traded_goods !==undefined)
{
if (datas.trading_traded_goods !== undefined) {
datas.trading_traded_goods.forEach((val, index) => {
if (val.estimated_traded_goods_value) {
this.inWords(val.estimated_traded_goods_value, 4, index);
@ -660,30 +674,81 @@ if(record.from_business.length>0){
RetailCounterArray: any = [];
WholeSaleCounterArray: any = [];
not_stock_of_rm: any = [];
not_stock_of_fg: any = [];
not_stock_of_tg: any = [];
not_stock_of_ws: any = [];
checkComments(value, flag, index) {
let count:number
console.log(this.stockForm);
console.log(value, flag, index);
if (flag == 1) {
this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0
this.ManufacturingCounterArray[index] = value != "" ? 1 : 0;
this.not_stock_of_rm[index] = value == "yes" ? 1 : 0;
let RMOverallCount = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0);
this.RMCommentCard = RMOverallCount > 0 ? true : false;
let not_stock1 = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
console.log('value',value);
console.log('not_stock1',not_stock1);
if(not_stock1 > 0){
console.log('not_stock1',not_stock1);
this.RMsufficientList[0].disabled = false;
this.RMsufficientList[2].disabled = true;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
}
if (flag == 2) {
this.FinishedCounterArray[index] = value == "yes" ? 1 : 0
else if(not_stock1 == 0){
console.log('0',not_stock1);
this.RMsufficientList[0].disabled = true;
this.RMsufficientList[2].disabled = false;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('not applicable');
}
if (flag == 3) {
this.RetailCounterArray[index] = value == "yes" ? 1 : 0
}
if (flag == 4) {
this.WholeSaleCounterArray[index] = value == "yes" ? 1 : 0
console.log('this.RMsufficientList',this.RMsufficientList);
}
if(flag == 2) {
this.FinishedCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_fg[index] = value == "yes" ? 1 : 0;
}
if (flag == 3) {
this.RetailCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_tg[index] = value == "yes" ? 1 : 0;
}
if (flag == 4) {
this.WholeSaleCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_ws[index] = value == "yes" ? 1 : 0;
}
let FGOverallCount = this.FinishedCounterArray.reduce((sum, val) => sum + +val, 0);
let RTGOverallCount = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
let WTGOverallCount = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0);
let TGOverallCount = FGOverallCount + RTGOverallCount + WTGOverallCount;
this.TGCommentCard = TGOverallCount > 0 ? true : false;
let not_stock_fg = this.not_stock_of_fg.reduce((sum, val) => sum + +val, 0);
let not_stock_ws = this.not_stock_of_ws.reduce((sum, val) => sum + +val, 0);
let not_stock_tg = this.not_stock_of_tg.reduce((sum, val) => sum + +val, 0);
let not_stock2 = not_stock_fg + not_stock_ws + not_stock_tg;
console.log('not_stock2',not_stock2);
if(not_stock2 > 0){
console.log('not_stock2',not_stock2);
this.TGsufficientList[0].isdisabled = false;
this.TGsufficientList[2].isdisabled = true;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
}
else if(not_stock2 == 0){
console.log('0',not_stock2);
this.TGsufficientList[0].isdisabled = true;
this.TGsufficientList[2].isdisabled = false;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('not applicable');
}
console.log('Data',this.TGsufficientList);
// else if(not_stock == 0){
// this.stockForms.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
// }
}
/** To Save/Edited Popup Data */
saveStockInfo(answerFormValues) {

View File

@ -149,6 +149,10 @@ export class PdQuestionSupplierInfoPage {
this.supplierInfoForm.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
}
}
let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) {
this.serviceProviderForm = true;
}
this.noRecordsFound = true;
} else {
this.supplierInfoForm = this.fb.group({

View File

@ -262,13 +262,13 @@
<div fxLayout="row wrap" class="align-margin" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
<mat-form-field style="width:100%;">
<mat-label>Rent per Unit</mat-label>
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f)" required (keyup)="inWords($event.target.value,fu,1)">
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);" required>
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"&#8377;"}} {{rent_per_unit_Inwords[f]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;">
<mat-label>Amount</mat-label>
<input type="number" matInput autocomplete="off" placeholder="" formControlName="amount" readonly (keyup)="inWords($event.target.value,fu,2)">
<input type="number" matInput autocomplete="off" placeholder="" formControlName="amount" readonly>
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.amount != ''">{{"&#8377;"}} {{amount_Inwords[f] }} Only</mat-hint>
</mat-form-field>
@ -281,7 +281,7 @@
<div class="rent-unit" fxFlex.xs="100" fxFlex.sm="45" fxFlex.md="45" fxFlex.lg="45" fxFlex.xl="45" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
<mat-form-field style="width:100%" appearance="outline">
<mat-label>Rent Unit {{fu+1}} </mat-label>
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f)" required (keyup)="inWords($event.target.value,fu,3)">
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);" required>
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"&#8377;"}} {{rent_per_unit_2_Inwords[f]}} Only</mat-hint>
</mat-form-field>
</div>
@ -295,7 +295,7 @@
<mat-form-field style="width:100%">
<mat-label>Total Rent Amount</mat-label>
<input type="number" matInput autocomplete="off" placeholder="" formControlName="floor_rent_amount" readonly>
<!-- <mat-hint align="end" style="font-size:12px" *ngIf="floor.value.floor_rent_amount != ''">{{"&#8377;"}} {{floor_rent_amount_Inwords[f]}} Only</mat-hint> -->
<mat-hint align="end" style="font-size:12px" *ngIf="floor.value.floor_rent_amount != ''">{{"&#8377;"}} {{floor_rent_amount_Inwords[f]}} Only</mat-hint>
</mat-form-field>
</div>
</mat-card-actions>
@ -339,7 +339,7 @@
<input matInput autocomplete="off" placeholder="" formControlName="monthly_rent_amount"
required (keyup)="inWords($event.target.value,u,5)" type="number">
<!-- (keyup)="inWords($event,1)" -->
<!-- <mat-hint align="end" style="font-size:12px" *ngIf="units.value.monthly_rent_amount != ''">{{"&#8377;"}} {{monthly_rent_amount_Inwords[u]}} Only</mat-hint> -->
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.monthly_rent_amount != ''">{{"&#8377;"}} {{monthly_rent_amount_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%">
<mat-label>Mode of Payment of Rent as per Loan Applicant</mat-label>

View File

@ -779,13 +779,16 @@ createFloorUnitDetails(type:number){
}
// calculate floor rent amount
calculateFloorRentAmt(values: any, index: number){
// this.inWords(values,index,1);
if(values.unit_rent_difference_options=="1"){
let control: any = <FormArray>this.rentalForms.controls['multistoried_building_details'];
let unitcontrol = control.controls[index];
unitcontrol= <FormArray> unitcontrol.controls['floor_unit_details'];
if(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
// this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,2);
control.controls[index].controls['floor_rent_amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
// this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,3);
}
else{
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue('');
@ -801,6 +804,7 @@ calculateFloorRentAmt(values: any, index: number){
let getunitValues = unitcontrol.value.filter(val=>val.rent_per_unit!='');
if(getunitValues.length>0){
control.controls[index].controls['floor_rent_amount'].setValue(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val), 0));
// this.inWords(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val)),index,3);
}
else{
control.controls[index].controls['floor_rent_amount'].setValue('');
@ -1010,12 +1014,12 @@ compareSingleObjects(o1: any, o2: any) {
element.amount_received_bank_per_met ? control.controls[index].addControl('amount_received_bank_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_bank_per_met');
element.payment_received_reason_per_met ? control.controls[index].addControl('payment_received_reason_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_received_reason_per_met');
element.payment_difference_per_met ? control.controls[index].addControl('payment_difference_per_met', new FormControl('')) : control.controls[index].removeControl('payment_difference_per_met');
this.inWords(element.monthly_rent_amount != '' ? +element.monthly_rent_amount : '',index,5);
this.inWords(element.amount_received_cash != '' ? +element.amount_received_cash : '',index,6);
this.inWords(element.amount_received_bank != '' ? +element.amount_received_bank : '',index,7);
this.inWords(element.securtity_deposit_amount != '' ? +element.securtity_deposit_amount : '',index,8);
this.inWords(element.agreement_monthly_rent_amount != '' ? +element.agreement_monthly_rent_amount : '',index,9);
this.inWords(element.agreement_security_deposit != '' ? +element.agreement_security_deposit :'',index,10);
this.inWords(element.agreement_security_deposit_amount != '' ? +element.agreement_security_deposit_amount :'',index,10);
this.inWords(element.paid_monthly_rent_per_met != '' ? +element.paid_monthly_rent_per_met : '',index,11);
this.inWords(element.amount_received_cash_per_met != '' ? +element.amount_received_cash_per_met : '',index,12);
this.inWords(element.amount_received_bank_per_met != '' ? +element.amount_received_bank_per_met : '',index,13);
@ -1107,7 +1111,7 @@ compareSingleObjects(o1: any, o2: any) {
// }
inWords(e,i,flag){
console.log(e,i,flag);
// console.log(e,i,flag);
switch(flag){
case 1 :
this.rent_per_unit_Inwords[i] = this.constprovider.convertNumberToWords(e);

View File

@ -19,7 +19,7 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/';
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
let localapiurl = 'http://192.168.0.9/sparqapi/api/';
return testapiurl;
return devapiurl;
}
getcurrentDate()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.