common alert : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-17 20:36:31 +05:30
parent 70e605627e
commit e6531fe154
9 changed files with 448 additions and 229 deletions

View File

@ -40,7 +40,7 @@
</mat-form-field>
</div>
<div *ngIf="addressForm.controls['address_type'].value == 12" fxFlex="33">
<div *ngIf="addressForm.controls['address_type'].value == 1" fxFlex="33">
<mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off" (change)="selectedAddressType($event.target.value)">
</mat-form-field>
@ -56,7 +56,7 @@
</mat-form-field>
</div>
<div *ngIf="addressForm.controls.locality.value == 7" fxFlex="33">
<div *ngIf="addressForm.controls.locality.value == 1" fxFlex="33">
<mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Locality"
formControlName="locality_others" autocomplete="off">
@ -83,7 +83,7 @@
</mat-form-field>
</div>
<div *ngIf="addressForm.controls['comment_locality'].value == 10 " fxFlex="33">
<div *ngIf="addressForm.controls['comment_locality'].value == 1 " fxFlex="33">
<mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Comment on Locality" formControlName="other_comment_locality" autocomplete="off">
</mat-form-field>
@ -173,23 +173,23 @@
<mat-card *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
<div formArrayName="additional_address_units">
<div *ngFor="let item of addressForm.controls.additional_address_units['controls']; let i=index" >
<div *ngFor="let item of addressForm.controls.additional_address_units['controls']; let i=index let last=last" >
<mat-card-header><p>Additional Unit #{{i+1}}</p></mat-card-header>
<mat-card-content class="matcard" [formGroup]="item">
<mat-form-field style="width: 40%">
<mat-form-field style="width: 42%">
<mat-select placeholder="Type of Premises" formControlName="premises_type">
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('premises_type').value == 12" style="width: 40%">
<mat-form-field *ngIf="item.get('premises_type').value == 1" style="width: 42%">
<input matInput placeholder="Specify Premises Type" formControlName="premises_type_others" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 40%;">
<mat-form-field style="width: 42%;">
<input matInput placeholder="Number Of Additional Units"
formControlName="no_of_additional_units" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 40%;">
<mat-form-field style="width: 42%;">
<input matInput placeholder="Location/City"
formControlName="premises_city" autocomplete="off">
@ -212,24 +212,22 @@
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('premises_rent_amt').value != ''">{{"&#8377;"}} {{premisesRentAmtInwords[i]}} Only</mat-hint>
</mat-form-field> -->
<mat-form-field style="width: 40%">
<mat-form-field style="width: 88%">
<input matInput placeholder="Remarks"
formControlName="premises_remarks" style="width: 65%;" autocomplete="off">
formControlName="premises_remarks" autocomplete="off">
</mat-form-field>
<button type="button" matTooltip="Add More Neighbour Details" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i==0"
(click)="addUnits($event)"
color="primary" style="float: right;">
<mat-icon>add</mat-icon>
</button>
<button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i>0"
(click)="removeUnits(i)"
style="float: right;">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addUnits($event)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Additional Unit </strong>
</button>
<button type="button" mat-flat-button (click)="removeUnits(i)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Additional Unit </strong>
</button>
</mat-card-actions>
</div>
</div>

View File

@ -134,19 +134,19 @@ export class AddressComponent implements OnInit {
let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type);
this.selectedAddressType(selectedAddressType);
if(data.records.address_type == 12) {
if(data.records.address_type == 1) {
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
this.selectedAddressType(data.records.address_type_others);
}
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
if(data.records.comment_locality == 10){
if(data.records.comment_locality == 1){
this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality);
}
// this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
this.addressForm.controls.locality.setValue(data.records.locality);
if(data.records.locality == 7 ){
if(data.records.locality == 1 ){
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
}
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
@ -349,20 +349,21 @@ export class AddressComponent implements OnInit {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
if(this.address.value.other_premises_bussiness_activity != ''){
if(this.address.value.bussiness_activity_remark != ''){
// console.log(this.addressForm.controls.bussiness_activity_remark.value);
// console.log(this.address.value.bussiness_activity_remark);
if(this.address.value.bussiness_activity_remark == ''){
this.notifier.notify('warning', 'Fill Remark!');
return;
}}
}
let records: any = {};
records.address = this.address.value;
records.address_type = this.addressType.value;
if (this.addressType.value == 12) {
if (this.addressType.value == 1) {
records.address_type_others = this.addressForm.controls.address_type_others.value;
}
records.locality = this.locality.value;
if (this.locality.value == 7) {
if (this.locality.value == 1) {
records.locality_others = this.addressForm.controls.locality_others.value;
}
records.pd_location = this.pdLocation.value;
@ -394,7 +395,9 @@ export class AddressComponent implements OnInit {
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');

View File

@ -536,6 +536,7 @@ export class GeneralInfoComponent implements OnInit {
if (this._generalForm.invalid) {
// console.log('if',this._generalForm.value);
this.validateAllFormFields(this._generalForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
// else if(formData.applicant_relation.length==0){
@ -556,7 +557,7 @@ export class GeneralInfoComponent implements OnInit {
this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
dataresult => {
if (dataresult.status == 200) {
this.notifier.notify('success', 'General Information Updated.!');
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
},3000);

View File

@ -165,3 +165,4 @@
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -27,6 +27,7 @@ export class LenderRepresentativeComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<LenderRepresentativeComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 15;
@ -107,6 +108,7 @@ export class LenderRepresentativeComponent implements OnInit {
submitLRForm() {
if (!this.representativeForm.valid) {
this.validateAllFormFields(this.representativeForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
let records: any = {};
@ -119,7 +121,15 @@ export class LenderRepresentativeComponent implements OnInit {
records.lender_representative_details = this.representativeForm.controls['lender_representative_details'].value;
}
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
})

View File

@ -19,7 +19,7 @@
<mat-card>
<mat-card>
<mat-card-content class="matcard">
<div fxLayout="row wrap">
<!-- <div fxLayout="row wrap"> -->
<mat-form-field style="width: 64%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
@ -28,87 +28,69 @@
<mat-select multiple (selectionChange)="endUserChange($event.value)" placeholder="What is the end use" formControlName="end_use" >
<mat-option *ngFor="let enduse of m_endUseForLoan" [value]="enduse.enduse_of_loan_id">{{ enduse.enduse_of_loan}}</mat-option>
</mat-select>
<!--<mat-select multiple placeholder="What is the end use"
formControlName="end_use" (selectionChange)="endUserChange($event)">
<mat-option value="purchase_of_property"> Puchase of property</mat-option>
<mat-option value="construction">Construction</mat-option>
<mat-option value="extention">Extention</mat-option>
<mat-option value="improvement">Improvement</mat-option>
<mat-option value="working_capital">Working capital</mat-option>
<mat-option value="purchase_of_business_asset">Purchase of business asset</mat-option>
<mat-option value="to_close_an_existing_debt">to close an existing debt</mat-option>
<mat-option value="other">Other purpose</mat-option>
</mat-select>-->
</mat-form-field>
<mat-form-field *ngIf="isOtherPurpose" style="width: 28%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 64%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
formControlName="is_transfer" >
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<mat-form-field *ngIf="isOtherPurpose" style="width: 28%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 60%">
<span *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 64%">
<input matInput placeholder="What is the amount for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-form-field style="width:28%">
<mat-select placeholder="Is there a Top Up"
formControlName="is_topup" >
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 60%">
<mat-form-field style="width: 64%">
<mat-select placeholder="Lender from where balance transfer done"
formControlName="lender">
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 30%">
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 28%">
<input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%">
<mat-form-field style="width: 64%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%">
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 28%">
<input matInput placeholder="End Use of Top Up" formControlName="end_use_topup" autocomplete="off">
</mat-form-field>
</div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
</span>
<span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
<mat-form-field style="width: 30%">
<mat-form-field style="width: 64%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 28%">
<mat-select (selectionChange)="sourceChange($event.value)" placeholder="Source of Own Contribution" formControlName="source" multiple>
<mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="isPLSource" style="width: 30%">
<mat-form-field *ngIf="isPLSource" style="width: 28%">
<input matInput placeholder="Specify Personal Loan" formControlName="personal_loan_source" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="isOtherSource" style="width: 30%">
<mat-form-field *ngIf="isOtherSource" style="width: 28%">
<input matInput placeholder="Specify Other Sources" formControlName="other_source" autocomplete="off">
</mat-form-field>
@ -126,10 +108,10 @@
<input matInput placeholder="Specify Lender Name and Type" formControlName="lender_name_type" autocomplete="off">
</mat-form-field>-->
</div>
</span>
<mat-form-field style="width: 60%">
<mat-form-field style="width: 64%">
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
</mat-form-field>
@ -161,21 +143,29 @@
<mat-option value="vacant_land">Vacant Land</mat-option>
<mat-option value="others">Others</mat-option>
</mat-select>-->
{{CompanyApplicantGroupList | json}}
<mat-form-field *ngIf="mortageAccess">
<input matInput placeholder="Specify Type of Property" formControlName="property_type_others" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select multiple placeholder="Name of Owner"
formControlName="owner_name" (selectionChange)="ownerNameChange($event)" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<mat-option value="Others">Others (Please Specify)</mat-option>
formControlName="owner_name">
<mat-optgroup *ngFor="let GROUP of CompanyApplicantGroupList" [label]="GROUP.groupName">
<mat-option value="owner" *ngFor="let owner of GROUP.groupValues">{{owner.name}}</mat-option>
</mat-optgroup>
</mat-select>
<!-- <mat-select placeholder="Name of Owner" formControlName="owner_name">
<mat-optgroup *ngFor="let group of CompanyApplicantGroupList" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select> -->
</mat-form-field>
<mat-form-field *ngIf="OtherOwnerFlag">
<!-- <mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true">
<input matInput placeholder="Specify Other Owner Name" formControlName="other_owners_name" autocomplete="off">
</mat-form-field>
</mat-form-field> -->
<mat-form-field>
<mat-select placeholder="Status of Construction" formControlName="construction_status" >
@ -195,7 +185,7 @@
<mat-option value="other_purpose">Vacant Land</mat-option>
</mat-select>-->
<mat-form-field>
<mat-form-field style="width:50%">
<input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>

View File

@ -56,6 +56,9 @@ export class LoanDetailsComponent implements OnInit {
m_mortageTypeProperty = [];
m_statusofCunstruction = [];
m_btLenderList = [];
// existCompanyList: any =[];
CompanyApplicantGroupList: any=[];
CompanyApplicantGroupList2: any=[];
loanAmtInWords : any;
balTxrfAmtInWords : any;
@ -70,14 +73,35 @@ export class LoanDetailsComponent implements OnInit {
mortageAccess: boolean = false;
propertyType : any;
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<LoanDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.applicants = this.pd_all_details.pdapplicants_detials;
console.log(this.applicants);
let CompanyList : any=[];
let ApplicantList : any=[];
this.applicants.forEach(val => {
if(val.applicant_type == 0){
this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
}
if(val.applicant_type == 1){
this.CompanyApplicantGroupList.push({groupName:'APPLICANTS',groupValues:{id:val.pd_co_applicant_id,name:val.applicant_name,group_id:2}})
}
if(val.applicant_type == 2){
this.CompanyApplicantGroupList.push({groupName:'COMPANIES',groupValues:{id:val.pd_co_applicant_id.toString(),name:val.applicant_name,group_id:1}})
}
});
console.log(this.CompanyApplicantGroupList);
this.productAbbr = this.pd_all_details.pdmaster_details.product_abbr;
this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
@ -107,7 +131,7 @@ export class LoanDetailsComponent implements OnInit {
}
};
ngOnInit() {
console.clear();
// console.clear();
this.initloanDetailsForm();
this.getM_EndUseofLoad();
this.getM_EndUseForLoan(this.pdid);
@ -115,6 +139,32 @@ export class LoanDetailsComponent implements OnInit {
this.getM_MortageTypeProperty();
this.getM_StatusofCunstruction();
this.getM_BTLenderList();
// this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
// if(data.dataStatus){
// this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
// }
// let modifyCompanyList : any=[];
// if(this.existCompanyList.length>0){
// modifyCompanyList = this.existCompanyList.map(element => {
// return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
// });
// this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
// }
// let modifyApplicantList: any=[];
// if(this.applicants.length > 0){
// modifyApplicantList = this.applicants.map(element => {
// return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
// });
// this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
// this.mergeCompanyApplicant.splice(this.mergeCompanyApplicant.indexOf(languague), 1);
// // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1);
// }
// })
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
@ -227,7 +277,7 @@ export class LoanDetailsComponent implements OnInit {
if(this.mortageCardAccess == true){
this.loanDetailsForm.controls['property_type_others'].setValue(value.records.property_type_others);
this.loanDetailsForm.controls['owner_name'].setValue(ownername);
this.loanDetailsForm.controls['other_owners_name'].setValue(value.records.other_owners_name);
// this.loanDetailsForm.controls['other_owners_name'].setValue(value.records.other_owners_name);
this.loanDetailsForm.controls['construction_status'].setValue(value.records.construction_status);
// if(value.records.construction_status == 4 ){
@ -358,9 +408,37 @@ getM_sourceofamount() {
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1);
// this.m_btLenderList = this.m_btLenderList.sort((a, b) => {
// if (a.lender_name > b.lender_name) {
// return 1;
// }
// if (a.lender_name < b.lender_name) {
// return -1;
// }
// return 0;
// });
})
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
}
}
// ==================
public initloanDetailsForm(): void {
@ -386,7 +464,7 @@ getM_sourceofamount() {
property_type: [''],
property_type_others:[''],
owner_name: [''],
other_owners_name :[''],
// other_owners_name :[''],
construction_status: [''],
//percentage_of_construction : [''],
emv_per_customer: [''],
@ -462,7 +540,7 @@ getM_sourceofamount() {
}
submitLoanDetails() {
// if (!this.loanDetailsForm.valid) {
// //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!');
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
// return;
// }
let records: any = {};
@ -506,9 +584,9 @@ getM_sourceofamount() {
}
if (this.loanDetailsForm.controls['is_topup'].value == 'yes') {
// if (this.loanDetailsForm.controls['is_topup'].value == 'yes') {
records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value;
}
// }
records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
if (this.loanDetailsForm.controls['is_topup'].value == 'yes' || this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
@ -529,27 +607,19 @@ getM_sourceofamount() {
dataOwner_name.push({owner_name: element})
});
records.owner_name_group = dataOwner_name;
if(this.OtherOwnerFlag){
records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
}else{ records.other_owners_name = ''; }
// if(this.OtherOwnerFlag){
// records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
// }else{ records.other_owners_name = ''; }
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
}else{
records.property_type = null;
records.property_type_others = null;
records.owner_name_group = null;
records.other_owners_name = null;
// records.other_owners_name = null;
records.construction_status = null;
records.emv_per_customer = null;
}
if(this.isOtherSource){
records.other_source = this.loanDetailsForm.controls['other_source'].value;
}else{ records.other_source = ''; }
@ -564,11 +634,21 @@ getM_sourceofamount() {
//records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value;
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
})
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
@ -667,16 +747,24 @@ getM_sourceofamount() {
*/
loanCalc()
{
let BtAmount = this.loanDetailsForm.value.balance_transfer_amount;
let loanAmount = this.loanDetailsForm.value.loan_amount;
let BtAmount : number = +this.loanDetailsForm.value.balance_transfer_amount;
let loanAmount : number = +this.loanDetailsForm.value.loan_amount;
let topupAmt ;
if(BtAmount !=null && BtAmount !='' && loanAmount !=null && loanAmount!='')
if(BtAmount !=null && loanAmount !=null)
{
if(loanAmount >= BtAmount){
topupAmt = loanAmount - BtAmount;
//topUpAmtInWords
}
this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt);
this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
}
else{
this.notifier.notify('warning', 'Balances Transfer Amount is greater than Loan Amount Please check.!');
this.loanDetailsForm.controls['balance_transfer_amount'].setValue('');
this.balTxrfAmtInWords = '';
this.loanDetailsForm.controls['topup_amount'].setValue('');
this.topUpAmtInWords = '';
}
}
}
}

View File

@ -24,7 +24,7 @@
<div formArrayName="manufacturing_details">
<div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<div formArrayName="manufacturing_raw_materials">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index" [formGroupName]="a">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index; let last=last" [formGroupName]="a">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Raw Material #{{a+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -48,17 +48,17 @@
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mrm.get('raw_uom').value == 61" style="width:30%">
<input matInput autocomplete="off" placeholder="Specify Other UOM" formControlName="other_uom" >
<mat-form-field *ngIf="mrm.get('raw_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="other_uom" >
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1,a)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords[a]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" (keyup)="inWords($event,8,a)">
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('rawmaterial_value').value != ''">{{"&#8377;"}} {{M_financialRawValueInWords[a]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" >
<mat-option value="yes" >Yes</mat-option>
@ -70,21 +70,23 @@
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials(1)"
matTooltip="Add More Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="a==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(a,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="a>0">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addRawMaterials(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Raw Materials </strong>
</button>
<button type="button" mat-flat-button (click)="deleteRawMaterials(a,1)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Raw Materials </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="manufacturing_finished_goods">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index" [formGroupName]="b">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index;let last=last" [formGroupName]="b">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{b+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -102,14 +104,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mfg.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,2,b)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords[b]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,9,b)">
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{M_financialGoodsValueInWords[b]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option>
@ -122,22 +133,32 @@
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addGoods(1)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods(1)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="b==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(b,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="b>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
<button type="button" mat-flat-button (click)="deleteGoods(b,1)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Finished Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="manufacturing_traded_goods">
<div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index" [formGroupName]="c">
<div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index;let last = last" [formGroupName]="c">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{c+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -154,14 +175,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)" >
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="traded_goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mtg.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3,c)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,10,c)">
<mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{M_financialTradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
@ -175,16 +205,26 @@
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(1)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(1)"
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="c==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(c,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="c>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
<button type="button" mat-flat-button (click)="deleteTradedGoods(c,1)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Traded Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
@ -202,7 +242,7 @@
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j">
<div formArrayName="retail_finished_goods">
<div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index" [formGroupName]="d">
<div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index;let last =last" [formGroupName]="d">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{d+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -219,14 +259,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="retailfg.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,4,d)" >
<mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords[d]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,11,d)">
<mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{R_financialGoodsValueInWords[d]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" >
@ -240,7 +289,7 @@
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addGoods(2)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods(2)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="d==0">
<mat-icon>add</mat-icon>
</button>
@ -248,14 +297,24 @@
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="d>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods</strong>
</button>
<button type="button" mat-flat-button (click)="deleteGoods(d,2)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Finished Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index" [formGroupName]="e">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index;let last =last" [formGroupName]="e">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{e+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -272,14 +331,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="traded_goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,5,e)" >
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,12,e)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('traded_goods_value').value != ''">{{"&#8377;"}} {{R_financialTradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
@ -293,16 +361,26 @@
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(2)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(2)"
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="e==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,2)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
<button type="button" mat-flat-button (click)="deleteTradedGoods(e,2)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Traded Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
@ -321,7 +399,7 @@
<div formArrayName="trade_details">
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k">
<div formArrayName="trading_finished_goods">
<div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index" [formGroupName]="f">
<div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index;let last =last" [formGroupName]="f">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{f+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -338,14 +416,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,6,f)" >
<mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords[f]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,13,f)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('finished_goods_value').value != ''">{{"&#8377;"}} {{T_financialGoodsValueInWords[f]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" >
@ -360,23 +447,33 @@
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addGoods(3)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods(3)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="f==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(f,3)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="f>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addGoods(3)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
<button type="button" mat-flat-button (click)="deleteGoods(f,3)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Finished Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index" [formGroupName]="g">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index;let last = last" [formGroupName]="g">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{g+1}} </i> </mat-label>
<mat-card-content class="matcard">
@ -393,14 +490,23 @@
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:76%">
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="traded_goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,7,g)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:76%">
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,14,g)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{T_financialTradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
@ -414,16 +520,26 @@
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(3)"
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(3)"
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="g==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="g>0">
<mat-icon>delete</mat-icon>
</button>
</button> -->
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(3)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
<button type="button" mat-flat-button (click)="deleteTradedGoods(g,3)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Traded Goods </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>

View File

@ -30,23 +30,23 @@ export class StockComponent implements OnInit {
rawmaterial : any;
M_rawValueInWords : any = [];
M_financialRawValueInWords : any = [];
// M_financialRawValueInWords : any = [];
M_goodsValueInWords : any = [];
R_goodsValueInWords : any = [];
T_goodsValueInWords : any = [];
M_financialGoodsValueInWords : any = [];
R_financialGoodsValueInWords : any = [];
T_financialGoodsValueInWords : any = [];
// M_financialGoodsValueInWords : any = [];
// R_financialGoodsValueInWords : any = [];
// T_financialGoodsValueInWords : any = [];
M_tradedGoodsValueInWords : any = [];
R_tradedGoodsValueInWords : any = [];
T_tradedGoodsValueInWords : any = [];
M_financialTradedGoodsValueInWords : any = [];
R_financialTradedGoodsValueInWords : any = [];
T_financialTradedGoodsValueInWords : any = [];
// M_financialTradedGoodsValueInWords : any = [];
// R_financialTradedGoodsValueInWords : any = [];
// T_financialTradedGoodsValueInWords : any = [];
rawMaterialAccess: boolean;
finishedGoodsAccess: boolean;
@ -58,6 +58,7 @@ export class StockComponent implements OnInit {
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private dialogRef: MatDialogRef<StockComponent>,
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 11;
@ -423,7 +424,6 @@ tradingFormCreation(val) {
'raw_uom': '',
'other_uom': '',
'raw_value': '',
'rawmaterial_value': '',
'is_sufficiant_raw': '',
'rawmaterial_remarks':''};
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
@ -443,7 +443,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.raw_value){
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
// this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
}
rawMaterial.push(this.createRawmaterial(val));
}
@ -456,7 +456,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.goods_value){
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
// this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -470,7 +470,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value);
// this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
@ -494,7 +494,7 @@ tradingFormCreation(val) {
raw_uom: [''],
other_uom : [''],
raw_value: [''],
rawmaterial_value: [''],
// rawmaterial_value: [''],
is_sufficiant_raw: [''],
rawmaterial_remarks:['']
})
@ -508,7 +508,7 @@ tradingFormCreation(val) {
raw_uom: [records.raw_uom],
other_uom : [records.other_uom],
raw_value: [records.raw_value],
rawmaterial_value: [records.rawmaterial_value],
// rawmaterial_value: [records.rawmaterial_value],
is_sufficiant_raw: [records.is_sufficiant_raw],
rawmaterial_remarks:[records.rawmaterial_remarks]
})
@ -533,7 +533,7 @@ tradingFormCreation(val) {
if(val.goods_value){
this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value);
// this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -549,7 +549,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
// this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
@ -579,8 +579,10 @@ tradingFormCreation(val) {
goods_name: [''],
goods_observed: [''],
goods_quantity: [''],
goods_uom: [''],
goods_other_uom: [''],
goods_value: [''],
finished_goods_value: [''],
// finished_goods_value: [''],
is_sufficiant_goods: [''],
finishedgoods_remarks:['']
});
@ -590,8 +592,10 @@ tradingFormCreation(val) {
goods_name: [records.goods_name],
goods_observed: [records.goods_observed],
goods_quantity: [records.goods_quantity],
goods_uom: [records.goods_uom],
goods_other_uom: [records.goods_other_uom],
goods_value: [records.goods_value],
finished_goods_value: [records.finished_goods_value],
// finished_goods_value: [records.finished_goods_value],
is_sufficiant_goods: [records.is_sufficiant_goods],
finishedgoods_remarks:[records.finishedgoods_remarks]
})
@ -604,8 +608,10 @@ tradingFormCreation(val) {
traded_goods_name: [''],
traded_goods_observed: [''],
traded_goods_quantity: [''],
traded_goods_uom: [''],
traded_goods_other_uom: [''],
estimated_traded_goods_value: [''],
traded_goods_value: [''],
// traded_goods_value: [''],
is_sufficiant_traded_goods: [''],
traded_goods_remarks:['']
});
@ -634,7 +640,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.goods_value){
this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
// this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -649,7 +655,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
// this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
}
@ -668,8 +674,10 @@ tradingFormCreation(val) {
traded_goods_name: [''],
traded_goods_observed: [''],
traded_goods_quantity: [''],
traded_goods_uom: [''],
traded_goods_other_uom: [''],
estimated_traded_goods_value: [''],
traded_goods_value: [''],
// traded_goods_value: [''],
is_sufficiant_traded_goods: [''],
traded_goods_remarks:['']
});
@ -679,8 +687,10 @@ tradingFormCreation(val) {
traded_goods_name: [records.traded_goods_name],
traded_goods_observed: [records.traded_goods_observed],
traded_goods_quantity: [records.traded_goods_quantity],
traded_goods_uom: [records.traded_goods_uom],
traded_goods_other_uom: [records.traded_goods_other_uom],
estimated_traded_goods_value: [records.estimated_traded_goods_value],
traded_goods_value: [records.traded_goods_value],
// traded_goods_value: [records.traded_goods_value],
is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods],
traded_goods_remarks:[records.traded_goods_remarks]
})
@ -814,6 +824,7 @@ tradingFormCreation(val) {
this.submitted = true;
// stop here if form is invalid
// if (this.stockForms.invalid) {
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
// return;
// } else {
var answerFormValues = this.stockForms.value;
@ -824,13 +835,14 @@ tradingFormCreation(val) {
this._pd.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
if(dataresult.status == 200) {
this.notifier.notify('success', 'Record Saved Successfully.!');
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -897,27 +909,27 @@ tradingFormCreation(val) {
case 7 :
this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 8 :
this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 9 :
this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 10 :
this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 11 :
this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 12 :
this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 13 :
this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 14 :
this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
// case 8 :
// this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 9 :
// this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 10 :
// this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 11 :
// this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 12 :
// this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 13 :
// this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
// case 14 :
// this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
// break;
default:
break;
}