Purchase Changes in AI : ps
This commit is contained in:
parent
eec3532307
commit
675538fa3e
@ -0,0 +1,85 @@
|
||||
<form [formGroup]="purchaseItemForm" novalidate>
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
{{pageTitle}}
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="closeDialogue()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
</h2>
|
||||
<mat-dialog-content>
|
||||
<mat-card>
|
||||
<mat-card-content formArrayName="purchase_product">
|
||||
<mat-card *ngFor="let purchase of purchaseItemForm.controls.purchase_product['controls']; let s = index;" [formGroupName]="s">
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 87%">
|
||||
<mat-select placeholder="Raw Material/Trading Item" formControlName="purchase_item" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prod of productListData" [value]="prod">{{ prod }}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 35%" *ngIf="purchase.get('purchase_item').value == 'Others'">
|
||||
<input type="text" matInput placeholder="Other Raw Material/Trading Item" formControlName="other_purchase_item">
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeProducts(s)" *ngIf="purchaseItemForm.value.purchase_product.length>1"
|
||||
matTooltip="Remove" matTooltipPosition="above">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
<!-- switch case date/frequency information section -->
|
||||
<div [ngSwitch]="purchase.value.purchase_type">
|
||||
<!-- date info -->
|
||||
<div formArrayName="child">
|
||||
<div class="item-margin" fxLayout="row wrap" *ngFor="let childItem of purchase.get('child').controls; let c = index" [formGroupName]="c">
|
||||
<div fxFlex="100" *ngIf="childItem.value.isactive===true">
|
||||
<mat-form-field style="width: 33%;">
|
||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="purchase_date" (dateChange)="purchaseCalculation(s,purchase.value)" placeholder="Purchase Date" required>
|
||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 44%">
|
||||
<input OnlyNumber type="text" matInput placeholder="Bill Value" (keyup)="purchaseCalculation(s,purchase.value)" formControlName="purchase_value" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="childItem.value.purchase_value != ''">{{"₹"}} {{childItem.value.purchase_value | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeDailyItems(s,c,childItem.value)" *ngIf="purchase.value.child.length>1"
|
||||
matTooltip="Remove" matTooltipPosition="above">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div align="center" style="margin-top: 3%;">
|
||||
<button type="button" mat-flat-button (click)="addMoreDailyPurchase(s,purchase.value)"
|
||||
matTooltip="Add More" matTooltipPosition="above" color="primary">
|
||||
<strong>Add More Daily Purchase</strong>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<mat-form-field style="width: 92%">
|
||||
<textarea matInput type="text" placeholder="Remarks" formControlName="comments" [required]="purchase.value.purchase_type=='2' ? true : false"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="center" *ngIf="data.manage_status==1">
|
||||
<button type="button" mat-flat-button (click)="addMore(purchaseItemForm.controls.purchase_product.value.length)"
|
||||
matTooltip="Add More" matTooltipPosition="above" color="primary">
|
||||
<strong>Add More Purchase Product</strong>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<notifier-container></notifier-container>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="submitDetails(purchaseItemForm.value)"><mat-icon>save</mat-icon></button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
mat-form-field {
|
||||
margin: 0 2%;
|
||||
}
|
||||
.example-section {
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.example-margin {
|
||||
margin: 0 10px;
|
||||
}
|
||||
::ng-deep .cdk-global-overlay-wrapper{
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.item-margin {
|
||||
margin-left:4%;
|
||||
margin-top:2%;
|
||||
}
|
||||
.item-product-margin{
|
||||
margin-top:2%;
|
||||
}
|
||||
.example-radio-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.example-radio-button {
|
||||
margin: 0 2%;
|
||||
color: #000 !important
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ManageDailyPurchaseComponent } from './manage-daily-purchase.component';
|
||||
|
||||
describe('ManageDailyPurchaseComponent', () => {
|
||||
let component: ManageDailyPurchaseComponent;
|
||||
let fixture: ComponentFixture<ManageDailyPurchaseComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ManageDailyPurchaseComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ManageDailyPurchaseComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,261 @@
|
||||
import { Component, OnInit, Input, Output, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
|
||||
import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { DeleteRecordsCountPipe } from './../../../../../../../pd-pipes/delete-records-count.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-manage-daily-purchase',
|
||||
templateUrl: './manage-daily-purchase.component.html',
|
||||
styleUrls: ['./manage-daily-purchase.component.scss']
|
||||
})
|
||||
export class ManageDailyPurchaseComponent implements OnInit {
|
||||
Value: any []=[];
|
||||
pipe = new DatePipe('en-US');
|
||||
pageTitle:string;
|
||||
purchaseItemForm:FormGroup;
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
marginAmtInwords: any[]=[];
|
||||
productListData : any[]=[];
|
||||
private notifier: NotifierService;
|
||||
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailyPurchaseComponent>) {
|
||||
this.pageTitle = this.data.manage_status==1 ? 'Add Daily Purchase Item' : 'Update Daily Purchase Item';
|
||||
this.notifier = notifier;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Business Product list for dropdown.
|
||||
this._pd.getProductsFromBusinessAndSupplier(this.data.masterData.pdid, this.data.masterData.company_id).subscribe(data => {
|
||||
if (data.dataStatus){
|
||||
let datas = data.record;
|
||||
|
||||
let type2 = datas.from_business.filter(data => data.type_of_activity_id == 2);
|
||||
if(type2[0].hasOwnProperty("products")){
|
||||
// this.productListData.push(type2[0].products);
|
||||
}
|
||||
let type3 = datas.from_business.filter(data => data.type_of_activity_id == 3);
|
||||
if(type3[0].hasOwnProperty("products")){
|
||||
this.productListData.push(type3[0].products);
|
||||
}
|
||||
let type4 = datas.from_business.filter(data => data.type_of_activity_id == 4);
|
||||
if(type4[0].hasOwnProperty("products")){
|
||||
this.productListData.push(type4[0].products);
|
||||
}
|
||||
if(datas.from_supplier.hasOwnProperty("raw_material")){
|
||||
this.productListData.push(datas.from_supplier.raw_material);
|
||||
}
|
||||
this.productListData = [].concat.apply([], this.productListData);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
//manage_status '1' for Add , '2' for edit functionalities
|
||||
|
||||
if(this.data.manage_status==1){
|
||||
this.purchaseItemForm = this._fb.group({
|
||||
purchase_product: this._fb.array([this.createPurchaseItem()]),
|
||||
});
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
control = control.controls[0].get('child') as FormArray;
|
||||
control.push(this.createDailyPurchaseData(''))
|
||||
}
|
||||
else if(this.data.manage_status==2){
|
||||
this.purchaseItemForm = this._fb.group({
|
||||
purchase_product: this._fb.array([this.createPurchaseItemWithData(this.data.editData)]),
|
||||
});
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
let innercontrol: any = control.controls[0].get('child') as FormArray;
|
||||
this.data.editData.values.forEach((elementVal,inx) => {
|
||||
innercontrol.push(this.createDailyPurchaseWithData(elementVal,this.data.editData))
|
||||
});
|
||||
|
||||
|
||||
control.controls[control.value.length-1].controls['comments'].setValidators([Validators.required]);
|
||||
control.controls[control.value.length-1].controls['comments'].updateValueAndValidity();
|
||||
}
|
||||
else{
|
||||
this.purchaseItemForm = this._fb.group({
|
||||
purchase_product: this._fb.array([]),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//create purchase product
|
||||
createPurchaseItem():FormGroup {
|
||||
return this._fb.group({
|
||||
fk_pd_id: [this.data.masterData.pdid],
|
||||
company_id:[this.data.masterData.company_id],
|
||||
pbw_id: [''],
|
||||
purchase_item: ['', Validators.compose([Validators.required])],
|
||||
other_purchase_item:[''],
|
||||
annual_purchase_value: [''],
|
||||
child: this._fb.array([]),
|
||||
comments: [''],
|
||||
isactive:[true],
|
||||
});
|
||||
}
|
||||
|
||||
// create daily list empty
|
||||
createDailyPurchaseData(pbw_id: string) {
|
||||
return this._fb.group({
|
||||
pbwc_id: [''],
|
||||
fk_pbw_id: [pbw_id],
|
||||
purchase_date: [''],
|
||||
purchase_value: ['', Validators.compose([Validators.required])],
|
||||
isactive:[true],
|
||||
})
|
||||
}
|
||||
|
||||
// create purchase product with Data
|
||||
createPurchaseItemWithData(values: any) {
|
||||
return this._fb.group({
|
||||
fk_pd_id: [this.data.masterData.pdid],
|
||||
company_id:[this.data.masterData.company_id],
|
||||
pbw_id: [values.pbw_id],
|
||||
purchase_item: [values.purchaseItem, Validators.compose([Validators.required])],
|
||||
other_purchase_item:[values.otherPurchaseItem === null ? '' : values.otherPurchaseItem ],
|
||||
annual_purchase_value: [values.annualPurchaseValue],
|
||||
child: this._fb.array([]),
|
||||
comments: [values.comments],
|
||||
isactive:[true],
|
||||
});
|
||||
}
|
||||
|
||||
// create daily purchase product with Data
|
||||
createDailyPurchaseWithData(values: any, parent: any) {
|
||||
return this._fb.group({
|
||||
pbwc_id: [values.pbwc_id],
|
||||
fk_pbw_id: [parent.pbw_id],
|
||||
purchase_date: [parent.purchase_type=='2' ? '' :new Date(this.pipe.transform(values.purchase_date, 'yyyy-MM-dd')), Validators.compose([Validators.required])],
|
||||
purchase_value: [values.purchase_value, Validators.compose([Validators.required])],
|
||||
isactive:[true]
|
||||
})
|
||||
}
|
||||
|
||||
// add more purchase products
|
||||
addMore(parentIndex: number): void{
|
||||
let control = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
control.push(this.createPurchaseItem());
|
||||
control = control.controls[parentIndex].get('child') as FormArray;
|
||||
control.push(this.createDailyPurchaseData(''))
|
||||
}
|
||||
|
||||
// add more purchase daily products
|
||||
addMoreDailyPurchase(parentIndex: number,values: any): void{
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
control=control.controls[parentIndex].get('child') as FormArray;
|
||||
control.push(this.createDailyPurchaseData(values.pbw_id));
|
||||
}
|
||||
|
||||
// remove dailywise Purchase Products items
|
||||
removeDailyItems(parentIndex: number,childIndex:number, childValue:any): void {
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
control=control.controls[parentIndex].get('child') as FormArray;
|
||||
if(childValue.pbwc_id=='' || childValue.pbwc_id==null){
|
||||
control.removeAt(childIndex);
|
||||
let calculatControlValues: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
calculatControlValues = calculatControlValues.controls[parentIndex];
|
||||
this.purchaseCalculation(parentIndex,calculatControlValues.value);
|
||||
}
|
||||
else {
|
||||
control.controls[childIndex].controls.isactive.setValue(false);
|
||||
let calculatControlValues: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
calculatControlValues = calculatControlValues.controls[parentIndex];
|
||||
this.purchaseCalculation(parentIndex,calculatControlValues.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//To remove the Products
|
||||
removeProducts(parentIndex:number){
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
control.removeAt(parentIndex);
|
||||
}
|
||||
|
||||
// close dialogue manually
|
||||
closeDialogue(){
|
||||
this.dialogRef.close({update_status:false});
|
||||
}
|
||||
|
||||
// this caculation for running total
|
||||
purchaseCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||
|
||||
if(values.child.length>0){
|
||||
let transformData = values.child.filter(val=>val.purchase_date!='' && val.purchase_date!=null && val.purchase_date!=undefined && val.purchase_value!='' && val.isactive===true).map(mval=>{
|
||||
mval.custum_date = this.pipe.transform(mval.purchase_date, 'yyyy-MM');
|
||||
return mval;
|
||||
});
|
||||
|
||||
if(transformData.length>0) {
|
||||
// let getUniqueMonthCounts = transformData.map(val=>val.custum_date)
|
||||
// .filter((fVal,fIndex,fArray)=>{
|
||||
// return fIndex === fArray.indexOf(fVal);
|
||||
// });
|
||||
|
||||
let TotalAnnualValue = transformData.map(val=>val.purchase_value)
|
||||
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(TotalAnnualValue);
|
||||
}
|
||||
else{
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue("");
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
|
||||
innercontrol.controls[innercontrol.value.length-1].controls['purchase_value'].setValue("");
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue("");
|
||||
}
|
||||
}
|
||||
|
||||
// save purchase details
|
||||
submitDetails(records) {
|
||||
|
||||
if (this.purchaseItemForm.invalid) {
|
||||
this.validateAllFormFields(this.purchaseItemForm);
|
||||
this.notifier.notify('warning',"Please Check All Manatory Fields..");
|
||||
return;
|
||||
}
|
||||
// this is for remove custom date key from my array values
|
||||
records.purchase_product.forEach(parVal => {
|
||||
parVal.child.forEach(childVal => {
|
||||
if(childVal['custum_date']){
|
||||
delete childVal['custum_date'];
|
||||
}
|
||||
if(childVal['purchase_date'])
|
||||
childVal['purchase_date']=this.pipe.transform(childVal['purchase_date'], 'yyyy-MM-dd');
|
||||
});
|
||||
});
|
||||
|
||||
this._pd.saveAssessedDetails('saveAssessedIncomePurchaseBillwise',records.purchase_product).subscribe(data => {
|
||||
this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.');
|
||||
setTimeout(() =>{
|
||||
this.dialogRef.close({update_status:true});
|
||||
},3000);
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
|
||||
// validate all form group and form array fields
|
||||
validateAllFormFields(formGroup: any) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
if (control instanceof FormControl) {
|
||||
control.markAsTouched({ onlySelf: true });
|
||||
} else if (control instanceof FormGroup) {
|
||||
this.validateAllFormFields(control);
|
||||
} else if (control instanceof FormArray) {
|
||||
this.validateAllFormFields(control);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -13,19 +13,32 @@
|
||||
<mat-card-content formArrayName="purchase">
|
||||
<div fxLayout="row wrap" *ngFor="let item of purchaseItemForm.controls.purchase['controls']; let s = index;" [formGroupName]="s" style="margin-top: 4%;">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 87%">
|
||||
<input type="text" matInput placeholder="Raw Material/Trading Item" formControlName="purchase_item" required>
|
||||
<mat-form-field style="width: 87%">
|
||||
<!-- <input type="text" matInput placeholder="Raw Material/Trading Item" formControlName="purchase_item" required> -->
|
||||
<mat-select placeholder="Raw Material/Trading Item" formControlName="purchase_item" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prod of productListData" [value]="prod">{{ prod }}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 35%" *ngIf="item.get('purchase_item').value == 'Others'">
|
||||
<input type="text" matInput placeholder="Other Raw Material/Trading Item" formControlName="other_purchase_item">
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeItem(s)" *ngIf="purchaseItemForm.value.purchase.length>1"
|
||||
matTooltip="Remove Purchase Item" matTooltipPosition="above">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
<div fxFlex="100">
|
||||
<mat-radio-group formControlName="purchase_type" class="example-radio-group" (change)="changeOptions(s,$event)">
|
||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<div class="item-margin" fxFlex="100">
|
||||
<mat-form-field style="width: 25%">
|
||||
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
||||
<input OnlyNumber type="text" matInput placeholder="Purchase Quantity" (keyup)="purchaseCalculation(s,item.value)" formControlName="purchase_qty" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
||||
<mat-select placeholder="UOM" formControlName="fk_uom_id" (selectionChange)="generateOtherUOM(s,item.value)" required>
|
||||
<mat-option *ngFor="let uom of UOMData" [value]="uom.uom_id">{{uom.name}}</mat-option>
|
||||
</mat-select>
|
||||
@ -36,7 +49,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item-margin" fxFlex="100">
|
||||
<div class="item-margin" fxFlex="100" *ngIf="item.value.purchase_type=='1'">
|
||||
<mat-form-field style="width: 25%">
|
||||
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Purchase" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
||||
@ -53,6 +66,22 @@
|
||||
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="item-margin" fxFlex="100" *ngIf="item.value.purchase_type=='2'">
|
||||
<mat-form-field style="width: 25%">
|
||||
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
||||
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<input OnlyNumber type="text" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 27%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"₹"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="item-product-margin" fxFlex="100">
|
||||
<mat-form-field style="width: 92%">
|
||||
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
|
||||
|
||||
@ -23,4 +23,14 @@
|
||||
|
||||
.item-product-margin{
|
||||
margin-top:2%;
|
||||
}
|
||||
|
||||
.example-radio-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.example-radio-button {
|
||||
margin: 0 2%;
|
||||
color: #000 !important
|
||||
}
|
||||
@ -15,6 +15,9 @@ export class ManagePurchaseComponent implements OnInit {
|
||||
purchaseItemForm:FormGroup;
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
productListData: any[]=[];
|
||||
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
|
||||
|
||||
private notifier: NotifierService;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManagePurchaseComponent>) {
|
||||
this.UOMData=this.data.masterData.UOMList;
|
||||
@ -24,6 +27,30 @@ export class ManagePurchaseComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._pd.getProductsFromBusinessAndSupplier(this.data.masterData.pdid, this.data.masterData.company_id).subscribe(data => {
|
||||
if (data.dataStatus){
|
||||
let datas = data.record;
|
||||
|
||||
let type2 = datas.from_business.filter(data => data.type_of_activity_id == 2);
|
||||
if(type2[0].hasOwnProperty("products")){
|
||||
// this.productListData.push(type2[0].products);
|
||||
}
|
||||
let type3 = datas.from_business.filter(data => data.type_of_activity_id == 3);
|
||||
if(type3[0].hasOwnProperty("products")){
|
||||
this.productListData.push(type3[0].products);
|
||||
}
|
||||
let type4 = datas.from_business.filter(data => data.type_of_activity_id == 4);
|
||||
if(type4[0].hasOwnProperty("products")){
|
||||
this.productListData.push(type4[0].products);
|
||||
}
|
||||
if(datas.from_supplier.hasOwnProperty("raw_material")){
|
||||
this.productListData.push(datas.from_supplier.raw_material);
|
||||
}
|
||||
this.productListData = [].concat.apply([], this.productListData);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
if(this.data.manage_status==2){
|
||||
this.purchaseItemForm = this._fb.group({
|
||||
purchase: this._fb.array([this.createPurchaseItemWithData(this.data.editData)]),
|
||||
@ -47,6 +74,8 @@ export class ManagePurchaseComponent implements OnInit {
|
||||
fk_pd_id:[this.data.masterData.pdid],
|
||||
company_id:[this.data.masterData.company_id],
|
||||
purchase_item:['',Validators.compose([Validators.required])],
|
||||
other_purchase_item:[''],
|
||||
purchase_type:['1'],
|
||||
purchase_qty:['',Validators.compose([Validators.required])],
|
||||
fk_uom_id:['',Validators.compose([Validators.required])],
|
||||
rate_per_unit:['',Validators.compose([Validators.required])],
|
||||
@ -64,6 +93,8 @@ createPurchaseItemWithData(values: any) {
|
||||
fk_pd_id:[this.data.masterData.pdid],
|
||||
company_id:[this.data.masterData.company_id],
|
||||
purchase_item:[values.purchase_item,Validators.compose([Validators.required])],
|
||||
other_purchase_item:[values.other_purchase_item],
|
||||
purchase_type:[values.purchase_type],
|
||||
purchase_qty:[values.purchase_qty,Validators.compose([Validators.required])],
|
||||
fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])],
|
||||
rate_per_unit:[values.rate_per_unit,Validators.compose([Validators.required])],
|
||||
@ -87,10 +118,15 @@ closeDialogue(){
|
||||
|
||||
purchaseCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||
if(values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||
|
||||
if(values.purchase_type=="1" &&values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||
|
||||
}
|
||||
else if(values.purchase_type=="2" && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||
|
||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||
}
|
||||
else {
|
||||
control.controls[indexVal].controls['annual_purchase_value'].setValue('');
|
||||
@ -108,6 +144,29 @@ generateOtherUOM(index: number, values: any): void {
|
||||
values.fk_uom_id=="1" ? control.controls[index].addControl('uom_other', new FormControl('', Validators.required)) : control.controls[index].removeControl('uom_other');
|
||||
}
|
||||
|
||||
changeOptions(indexVal: any,event: any): void{
|
||||
|
||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||
if(event.value=="1"){
|
||||
control.controls[indexVal].controls['purchase_qty'].setValidators([Validators.required]);
|
||||
control.controls[indexVal].controls['purchase_qty'].updateValueAndValidity();
|
||||
|
||||
control.controls[indexVal].controls['fk_uom_id'].setValidators([Validators.required]);
|
||||
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
|
||||
this.purchaseCalculation(indexVal,control.controls[indexVal].value);
|
||||
}
|
||||
else if(event.value=="2"){
|
||||
control.controls[indexVal].controls['purchase_qty'].setValue("");
|
||||
control.controls[indexVal].controls['purchase_qty'].clearValidators();
|
||||
control.controls[indexVal].controls['purchase_qty'].updateValueAndValidity();
|
||||
|
||||
control.controls[indexVal].controls['fk_uom_id'].setValue("");
|
||||
control.controls[indexVal].controls['fk_uom_id'].clearValidators();
|
||||
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
|
||||
this.purchaseCalculation(indexVal,control.controls[indexVal].value);
|
||||
}
|
||||
}
|
||||
|
||||
// save purchase details
|
||||
submitDetails(records) {
|
||||
if (this.purchaseItemForm.invalid) {
|
||||
|
||||
@ -74,28 +74,36 @@
|
||||
</mat-tab>
|
||||
<mat-tab label="Sales">
|
||||
<ng-template matTabContent>
|
||||
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()"></app-gross-profit-calculation>
|
||||
<app-sales-calculation [masterData]="getCustomValues" [parentData]="salesDeclaredCustomer" (loadAssessedForms)="loadAIDetails()"></app-sales-calculation>
|
||||
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()" TabLabel="Sales"></app-gross-profit-calculation>
|
||||
<app-sales-calculation [masterData]="getCustomValues" [parentData]="salesDeclaredCustomer" (loadAssessedForms)="loadAIDetails()"></app-sales-calculation>
|
||||
<app-sales-details [masterData]="getCustomValues" [parentData]="salesCaluatedItem" (loadAssessedForms)="loadAIDetails()"></app-sales-details>
|
||||
<app-daily-sales-details [masterData]="getCustomValues" [parentData]="salesMonthWiseExpandedItems" (loadAssessedForms)="loadAIDetails()"></app-daily-sales-details>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab label="Purchase">
|
||||
<ng-template matTabContent>
|
||||
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()"></app-gross-profit-calculation>
|
||||
<app-purchase-details [masterData]="getCustomValues" [parentData]="purchaseDetails" (loadAssessedForms)="loadAIDetails()"></app-purchase-details>
|
||||
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()" TabLabel="Purchase"></app-gross-profit-calculation>
|
||||
<div *ngIf="PurchaseComponent">
|
||||
<app-purchase-details [masterData]="getCustomValues" [parentData]="purchaseDetails" (loadAssessedForms)="loadAIDetails()"></app-purchase-details>
|
||||
</div>
|
||||
<div *ngIf="DailyPurchaseComponent">
|
||||
<app-daily-purchase-details [masterData]="getCustomValues" [parentData]="purchaseBillWiseDetails" (loadAssessedForms)="loadAIDetails()"></app-daily-purchase-details>
|
||||
</div>
|
||||
<div *ngIf="!PurchaseComponent && !DailyPurchaseComponent">
|
||||
<p><strong>Purchase Item is Not Available.. </strong></p>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab label="Business Expense">
|
||||
<ng-template matTabContent>
|
||||
<app-business-expense-details [masterData]="getCustomValues" [parentData]="businessExpenses" (loadAssessedForms)="loadAIDetails()"></app-business-expense-details>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab label="House Hold">
|
||||
</mat-tab>
|
||||
<mat-tab label="House Hold">
|
||||
<ng-template matTabContent>
|
||||
<app-house-hold-details [masterData]="getCustomValues" [parentData]="houseHoldExpenses" (loadAssessedForms)="loadAIDetails()"></app-house-hold-details>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
</mat-tab>
|
||||
<!--<mat-tab label="Other Business Income">
|
||||
<ng-template matTabContent>
|
||||
<app-other-business-income-details [masterData]="getCustomValues" [parentData]="otherBusinessIncome" (loadAssessedForms)="loadAIDetails()"></app-other-business-income-details>
|
||||
|
||||
@ -33,6 +33,7 @@ export class AssessedIncomeComponent implements OnInit {
|
||||
public salesCaluatedItem:any= [];
|
||||
public salesItemMonthWise:any= [];
|
||||
public purchaseDetails:any= [];
|
||||
public purchaseBillWise:any= [];
|
||||
public businessExpenses:any= [];
|
||||
public houseHoldExpenses:any= [];
|
||||
public otherBusinessIncome: any=[];
|
||||
@ -43,6 +44,8 @@ salesItemMonthWiseBody: any[];
|
||||
salesItemMonthWiseFooter: any[];
|
||||
salesMonthWiseExpandedItems: any=[]
|
||||
|
||||
purchaseBillWiseDetails: any=[];
|
||||
|
||||
public UOMList: any=[];
|
||||
public frequencyList: any=[];
|
||||
public businessExpenseList: any=[];
|
||||
@ -50,6 +53,8 @@ public businessIncomeList: any=[];
|
||||
public grossProfitTypeList: any=[];
|
||||
public salesDeclaredCustomer: any=[];
|
||||
public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequencyList,businessExpenseList: this.businessExpenseList,businessIncomeList:this.businessIncomeList,pdid:'',company_id:'',grossProfitTypeList:this.grossProfitTypeList,salesDeclaredCustomer:this.salesDeclaredCustomer};
|
||||
DailyPurchaseComponent:boolean;
|
||||
PurchaseComponent:boolean;
|
||||
//public finalData: any;
|
||||
constructor(notifier: NotifierService, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
@ -65,7 +70,8 @@ public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequen
|
||||
this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
|
||||
this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
|
||||
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
|
||||
|
||||
this.DailyPurchaseComponent = false;
|
||||
this.PurchaseComponent = false;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
@ -96,13 +102,13 @@ public viewerOptions: any = {
|
||||
// load ai details
|
||||
loadAIDetails(): void{
|
||||
this.salesMonthWiseExpandedItems=[]
|
||||
this.purchaseBillWiseDetails=[];
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
this._pd.getAssessedIncomeFormDetails(params).subscribe(value => {
|
||||
if (value.status == 200) {
|
||||
console.log('value.records',value.records);
|
||||
if(value.records.gross_profit_calculation_type){
|
||||
this.grossProfitTypeList = value.records.gross_profit_calculation_type;
|
||||
this.getCustomValues.grossProfitTypeList=this.grossProfitTypeList;
|
||||
@ -141,9 +147,43 @@ public viewerOptions: any = {
|
||||
this.salesMonthWiseExpandedItems.push({sim_id:itemElement.sim_id,salesItem:itemElement.sales_item,otherSalesItem:itemElement.other_sales_item,sales_type:itemElement.sales_type,comments:itemElement.comments,margin_per:itemElement.margin_per,margin_value:itemElement.margin_value, expandElements:expandBodyContent, footerMessage: footerMessage});
|
||||
});
|
||||
}
|
||||
this.PurchaseComponent = value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].mode==1 && value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].purchase_type==1 ? true : false;
|
||||
|
||||
if(value.records.purchase_details){
|
||||
this.purchaseDetails = value.records.purchase_details;
|
||||
}
|
||||
this.DailyPurchaseComponent = value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].mode==1 && value.records.gross_profit_calculation_type[value.records.gross_profit_calculation_type.length-1].purchase_type==2 ? true : false;
|
||||
|
||||
if(value.records.purchase_billwise){
|
||||
this.purchaseBillWise = value.records.purchase_billwise;
|
||||
|
||||
this.purchaseBillWise.forEach((billElement, itemIndex) => {
|
||||
|
||||
let result = Object.assign({}, ...billElement.items);
|
||||
let expandBodyContent= Object.keys(result).map(key => ({ header:key, value: result[key] }));
|
||||
|
||||
let listItems: any=[];
|
||||
|
||||
expandBodyContent.forEach((expnadElement, expnadIndex) => {
|
||||
let calculateItems = expnadElement.value.reduce((acc, calculate) => acc + Number(calculate.purchase_value), 0);
|
||||
listItems.push({items:expnadElement, itemsTotal:calculateItems})
|
||||
})
|
||||
|
||||
let calculateAllItemsTotal:number=listItems.reduce((racc, rcalculate) => racc + Number(rcalculate.itemsTotal), 0);
|
||||
|
||||
let convertYear : number = 12 / listItems.length;
|
||||
let footerMessage: any=[];
|
||||
footerMessage.push({
|
||||
month_message: listItems.length + ' Monthly Purchase : '+ calculateAllItemsTotal,
|
||||
month_value:calculateAllItemsTotal,
|
||||
year_message: ' Yearly Purchase : '+ calculateAllItemsTotal * convertYear,
|
||||
year_value: calculateAllItemsTotal * convertYear,
|
||||
})
|
||||
|
||||
this.purchaseBillWiseDetails.push({pbw_id:billElement.pbw_id,purchaseItem:billElement.purchase_item,otherPurchaseItem:billElement.other_purchase_item,comments:billElement.comments,annual_purchase_value:billElement.annual_purchase_value, expandElements:expandBodyContent, footerMessage: footerMessage});
|
||||
});
|
||||
}
|
||||
|
||||
if(value.records.business_expenses){
|
||||
this.businessExpenses=value.records.business_expenses;
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<div fxLayout="row nowrap">
|
||||
<div fxFlex="60" align="left">
|
||||
<span>Purchase Calculate Daily Wise</span>
|
||||
</div>
|
||||
<div fxFlex="40" align="right">
|
||||
<button type="button" mat-flat-button (click)="addMoreItem()" matTooltip="Add More" matTooltipPosition="above"
|
||||
color="primary">
|
||||
<strong>Add More Item</strong>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<mat-card *ngFor="let expandDetails of purchaseBillWiseDetails">
|
||||
<div>
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<small class="expan_table_header">expandDetails.purchaseItem</small>
|
||||
</mat-card-title>
|
||||
<mat-card-subtitle *ngFor="let footer of expandDetails.footerMessage">
|
||||
<div fxFlex="100" class="subtitle_message">
|
||||
{{footer.month_message}} {{footer.year_message}}
|
||||
</div>
|
||||
</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
|
||||
<mat-divider></mat-divider>
|
||||
<mat-card-content style="display: flex;margin-top: -20px;">
|
||||
|
||||
<div fxFlex="50" *ngFor="let eachItem of expandDetails.expandElements" class="m-gap p-gap">
|
||||
|
||||
<h4 align="center" class="h4_font">{{eachItem.header}}</h4>
|
||||
<table mat-table [dataSource]="eachItem.value" class="mat-elevation-z8">
|
||||
<ng-container matColumnDef="Date">
|
||||
<th mat-header-cell *matHeaderCellDef>Date</th>
|
||||
<td mat-cell *matCellDef="let itemValue">{{itemValue.purchase_date | date:'dd-MM-yyyy'}} </td>
|
||||
<td mat-footer-cell *matFooterCellDef> Total </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Amount">
|
||||
<th mat-header-cell *matHeaderCellDef>Amount</th>
|
||||
<td mat-cell *matCellDef="let itemValue">{{itemValue.purchase_value}}</td>
|
||||
<td mat-footer-cell *matFooterCellDef> {{getTotalCost(eachItem.value)}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="purchaseBillWiseItemColumns; sticky: true"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: purchaseBillWiseItemColumns;"></tr>
|
||||
<tr mat-footer-row *matFooterRowDef="purchaseBillWiseItemColumns; sticky: true"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
</div>
|
||||
<mat-card-actions>
|
||||
<div fxFlex="75" align="left">
|
||||
{{expandDetails.comments}}
|
||||
</div>
|
||||
<div fxFlex="25" align="right">
|
||||
<button class="mr-1 mb-1" mat-mini-fab matTooltip="Edit" matTooltipPosition="above" (click)="editPurchaseBillWise(expandDetails)"
|
||||
color="primary" type="button">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button class="mr-1 mb-1" mat-mini-fab matTooltip="Remove" matTooltipPosition="above" (click)="removePurchaseBillWise(expandDetails)"
|
||||
color="primary" type="button">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-actions>
|
||||
|
||||
</mat-card>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<notifier-container></notifier-container>
|
||||
@ -0,0 +1,37 @@
|
||||
.example-container {
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr.mat-footer-row {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.mat-table-sticky {
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
.expan_footer{
|
||||
font-size: 18px;
|
||||
direction: rtl;
|
||||
}
|
||||
.expan_table_header {
|
||||
font-size: 18px;
|
||||
//text-align: center;
|
||||
}
|
||||
.h4_font {
|
||||
font-size: 18px;
|
||||
}
|
||||
.subtitle_message {
|
||||
color:#e00201 !important;
|
||||
}
|
||||
.delete-margin {
|
||||
margin-left: 3%;
|
||||
}
|
||||
.mat-footer-cell {
|
||||
font-weight: bold;
|
||||
font-size: 1.2rem !important;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DailyPurchaseDetailsComponent } from './daily-purchase-details.component';
|
||||
|
||||
describe('DailyPurchaseDetailsComponent', () => {
|
||||
let component: DailyPurchaseDetailsComponent;
|
||||
let fixture: ComponentFixture<DailyPurchaseDetailsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DailyPurchaseDetailsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DailyPurchaseDetailsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,107 @@
|
||||
import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter, DoCheck } from '@angular/core';
|
||||
import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
|
||||
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
|
||||
import { ManageDailyPurchaseComponent } from './../AI-diologue/manage-daily-purchase/manage-daily-purchase.component';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
@Component({
|
||||
selector: 'app-daily-purchase-details',
|
||||
templateUrl: './daily-purchase-details.component.html',
|
||||
styleUrls: ['./daily-purchase-details.component.scss']
|
||||
})
|
||||
|
||||
export class DailyPurchaseDetailsComponent implements OnInit , DoCheck {
|
||||
|
||||
public purchaseBillWiseItemColumns = ['Date','Amount'];
|
||||
public purchaseBillWiseDetails: any[]=[];
|
||||
@Input() parentData: any;
|
||||
@Input() masterData: { UOMList: any; frequencyList: any; pdid:number,company_id:number, grossProfitTypeList:any,purchaseDeclaredCustomer: any};
|
||||
@Output() loadAssessedForms = new EventEmitter<string>();
|
||||
|
||||
private notifier:NotifierService;
|
||||
|
||||
constructor(notifier:NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
getTotalCost(getItems:any) {
|
||||
return getItems.map(t => t.purchase_value).reduce((acc, value) => acc + Number(value), 0);
|
||||
}
|
||||
|
||||
// add more item details
|
||||
addMoreItem():void {
|
||||
let passValues: any = {
|
||||
manage_status:1,
|
||||
masterData: this.masterData,
|
||||
}
|
||||
const dialogRef = this.dialog.open(ManageDailyPurchaseComponent, {
|
||||
data: passValues,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.update_status==true){
|
||||
this.loadAssessedForms.next('1');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
editPurchaseBillWise(value:any) {
|
||||
let transformData: any = value.expandElements.map(val=>val.value);
|
||||
transformData = [].concat.apply([], transformData);
|
||||
let editValue: any = {
|
||||
"fk_pd_id":this.masterData.pdid,
|
||||
"pbw_id":value.pbw_id,
|
||||
"purchaseItem":value.purchaseItem,
|
||||
"otherPurchaseItem":value.otherPurchaseItem,
|
||||
"comments":value.comments,
|
||||
"annual_purchase_value":value.annual_purchase_value,
|
||||
"values":transformData,
|
||||
}
|
||||
let passValues: any = {
|
||||
manage_status:2,
|
||||
masterData: this.masterData,
|
||||
editData:editValue,
|
||||
}
|
||||
const dialogRef = this.dialog.open(ManageDailyPurchaseComponent, {
|
||||
data: passValues,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.update_status==true){
|
||||
this.loadAssessedForms.next('1');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// remove purchase item
|
||||
removePurchaseBillWise(value: any) : void{
|
||||
let deleteRecords: any =[{
|
||||
"fk_pd_id":this.masterData.pdid,
|
||||
"pbw_id":value.pbw_id,
|
||||
"company_id":this.masterData.company_id,
|
||||
"isactive":false,
|
||||
"child":[]
|
||||
}];
|
||||
this._pd.saveAssessedDetails('saveAssessedIncomePurchaseBillwise',deleteRecords).subscribe(data => {
|
||||
this.notifier.notify('success','Removed Successfully');
|
||||
this.loadAssessedForms.next('1');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
|
||||
// do check component bases
|
||||
ngDoCheck() {
|
||||
this.purchaseBillWiseDetails = this.parentData;
|
||||
}
|
||||
|
||||
}
|
||||
@ -113,7 +113,6 @@ ngDoCheck() {
|
||||
if(this.masterData.grossProfitTypeList.length>0){
|
||||
this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false;
|
||||
this.enableDailySalesSection = this.masterData.salesDeclaredCustomer.length>0 ? true : false;
|
||||
|
||||
}}
|
||||
|
||||
// detect chnges from parent
|
||||
|
||||
@ -15,6 +15,18 @@
|
||||
<mat-option *ngFor="let getSale of check_sales_type" [value]="getSale.id">{{getSale.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field> -->
|
||||
<div style="width: 35%" fxFlex="35" *ngIf="grossProfitForm.controls['mode'].value == 1 && TabLabel == 'Purchase'">
|
||||
|
||||
<!-- <mat-radio-group formControlName="margin" class="example-radio-group">
|
||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of purchase_sub_type; let t = index">{{types.name}}</mat-radio-button>
|
||||
</mat-radio-group> -->
|
||||
<!-- <label id="example-radio-group-label">Pick Up purchase sub type</label> -->
|
||||
<mat-radio-group formControlName="purchase_type" class="example-radio-group">
|
||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of purchase_sub_type; let t = index">{{types.name}}</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Save" matTooltipPosition="above" (click)="submitDetails(grossProfitForm.value)"><mat-icon>save</mat-icon>
|
||||
</button>
|
||||
|
||||
|
||||
@ -1,3 +1,17 @@
|
||||
mat-form-field {
|
||||
margin: 0 2%;
|
||||
}
|
||||
}
|
||||
|
||||
.mat-radio-button ~ .mat-radio-button {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.example-radio-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
// .example-radio-button {
|
||||
// margin: 5px;
|
||||
// }
|
||||
@ -11,29 +11,49 @@ import { NotifierService } from 'angular-notifier';
|
||||
export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
||||
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number, company_id:number};
|
||||
@Input() parentData: any;
|
||||
@Input() TabLabel: any;
|
||||
@Output() loadAssessedForms = new EventEmitter<string>();
|
||||
public grossProfitForm: FormGroup;
|
||||
check__purchse_type:any=[{'id':'1','name':'Yes'},{'id':'2','name':'No'}]
|
||||
check_sales_type:any=[{'id':'1','name':'Gross Margin'},{'id':'2','name':'Net Margin'}]
|
||||
purchase_sub_type:any=[{'id':'1','name':'Purchase Item Wise'},{'id':'2','name':'Purchase Bill Wise'}]
|
||||
private notifier: NotifierService;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log('TabLabel',this.TabLabel);
|
||||
}
|
||||
changeOptions(values: any){
|
||||
// console.log('values',values);
|
||||
this.grossProfitForm.controls['margin'].setValue('');
|
||||
|
||||
if(this.TabLabel == 'Sales' && values.mode == 1){
|
||||
this.grossProfitForm.controls['margin'].setValue('');
|
||||
this.grossProfitForm.controls['purchase_type'].setValue('');
|
||||
}
|
||||
else if(this.TabLabel == 'Purchase' && values.mode == 1){
|
||||
this.grossProfitForm.controls['margin'].setValue('');
|
||||
}
|
||||
/** if Mode Value is 'No' -> margin value is setted as netmargin and its id - 2
|
||||
* Refer => check_sales_type **/
|
||||
if(values.mode == 2){
|
||||
// console.log('2');
|
||||
this.grossProfitForm.controls['margin'].setValue('2');
|
||||
}
|
||||
this.grossProfitForm.controls['purchase_type'].setValue('');
|
||||
}
|
||||
|
||||
// console.log('values',values);
|
||||
}
|
||||
|
||||
|
||||
// if(values.mode == 2 && this.TabLabel == 'Purchase'){
|
||||
// this.grossProfitForm.controls['margin'].setValue('2');
|
||||
// this.grossProfitForm.controls['purchase_type'].setValue(null);
|
||||
// }
|
||||
|
||||
|
||||
submitDetails(records: any){
|
||||
console.log(records);
|
||||
// return;
|
||||
if (this.grossProfitForm.invalid) {
|
||||
this.validateAllFormFields(this.grossProfitForm);
|
||||
this.notifier.notify('warning',"Please Check All Manatory Fields..");
|
||||
@ -58,6 +78,7 @@ ngOnChanges(changes: SimpleChanges) {
|
||||
company_id:[this.masterData.company_id],
|
||||
mode:[changes.parentData.currentValue[0].mode,Validators.compose([Validators.required])],
|
||||
margin:[changes.parentData.currentValue[0].margin],
|
||||
purchase_type:[changes.parentData.currentValue[0].purchase_type],
|
||||
})
|
||||
}
|
||||
else {
|
||||
@ -68,6 +89,7 @@ ngOnChanges(changes: SimpleChanges) {
|
||||
company_id:[this.masterData.company_id],
|
||||
mode:['',Validators.compose([Validators.required])],
|
||||
margin:[''],
|
||||
purchase_type:[''],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ getTotalCost(getItems:any) {
|
||||
// do check component bases
|
||||
ngDoCheck() {
|
||||
if(this.masterData.grossProfitTypeList.length>0){
|
||||
this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==1 ? true : false;
|
||||
this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==1 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].purchase_type==1 ? true : false;
|
||||
}
|
||||
this.purchaseItemSource.data = this.parentData;
|
||||
}
|
||||
|
||||
@ -40,12 +40,12 @@
|
||||
<mat-form-field>
|
||||
<input matInput OnlyNumber type="number" autocomplete="off" placeholder="Year"
|
||||
formControlName="how_long_year" required min='0'>
|
||||
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higer then business vintage</mat-error>
|
||||
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higer than business vintage</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput OnlyNumber type="number" autocomplete="off" placeholder="Month"
|
||||
formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
||||
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higer then business vintage</mat-error>
|
||||
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higer than business vintage</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 30%">
|
||||
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience"
|
||||
|
||||
@ -491,6 +491,7 @@ addMoreUnitDetails(){
|
||||
}
|
||||
ValidatedRentAmount(value:any,index:number,type: number){
|
||||
let control: any = <FormArray>this._rentalForm.controls['property_unit_details'];
|
||||
console.log('value',value);
|
||||
if(type==1){
|
||||
if(value && value.payment_mode.id==3){
|
||||
let ChildCtrl : any = control.controls[index];
|
||||
@ -521,8 +522,8 @@ addMoreUnitDetails(){
|
||||
}
|
||||
}
|
||||
}
|
||||
if(type==2){
|
||||
|
||||
if(type==2 && value.payment_mode_per_met != ''){
|
||||
console.log('type,value.payment_mode_per_met',type,value.payment_mode_per_met);
|
||||
if(value && value.payment_mode.id==3){
|
||||
let ChildCtrl : any = control.controls[index];
|
||||
ChildCtrl.controls['amount_received_bank_per_met'].clearValidators();
|
||||
@ -992,10 +993,11 @@ saveRental(formData: any) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
/** html: 'Rent as Per Tenant = '+TenantRentAmt+ '<br>'+'Rent as Per Applicant =' + ApplicantRentAmt , */
|
||||
Swal({
|
||||
title: 'Confirm The Rent Amount',
|
||||
type: 'info',
|
||||
html: 'Rent as Per Tenant = '+TenantRentAmt+ '<br>'+'Rent as Per Applicant =' + ApplicantRentAmt ,
|
||||
html: 'Monthly Rent as Per Loan Applicant = '+ApplicantRentAmt+'<br>'+'Monthly Rent amount as Per Lease or Tenant met =' + TenantRentAmt ,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
|
||||
@ -93,7 +93,7 @@ export class StockComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._pd.stockFormAccess(this.pdid, this.company_id).subscribe(data => {
|
||||
this._pd.getProductsFromBusinessAndSupplier(this.pdid, this.company_id).subscribe(data => {
|
||||
|
||||
if (data.dataStatus == true) {
|
||||
this.initstockForms(data.record);
|
||||
|
||||
@ -115,6 +115,8 @@ import { ViewLocationComponent } from './../pd-directive/view-location/view-loca
|
||||
import { GetAnswerableFormsPipe } from './../pd-pipes/get-answerable-forms.pipe';
|
||||
import { ConfirmAiDetailsComponent } from './list-pd/start-pd/forms/assessed-income/confirm-ai-details/confirm-ai-details.component';
|
||||
import { RentalVerificationComponent } from './list-pd/start-pd/forms/rental-verification/rental-verification.component';
|
||||
import { ManageDailyPurchaseComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-purchase/manage-daily-purchase.component';
|
||||
import { DailyPurchaseDetailsComponent } from './list-pd/start-pd/forms/assessed-income/daily-purchase-details/daily-purchase-details.component';
|
||||
|
||||
/**
|
||||
* Custom angular notifier options
|
||||
@ -161,7 +163,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, 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],
|
||||
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, ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ManagePdRoutingModule,
|
||||
@ -194,13 +196,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
AgmCoreModule.forRoot({apiKey: 'AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'}),OwlDateTimeModule,
|
||||
OwlNativeDateTimeModule,
|
||||
],
|
||||
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent,DailyPurchaseDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent,ManageDailyPurchaseComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
|
||||
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective],
|
||||
|
||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
|
||||
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent, ManageDailyPurchaseComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent],
|
||||
|
||||
})
|
||||
export class ManagePdModule {
|
||||
|
||||
@ -353,6 +353,11 @@ export class PdTrigerService {
|
||||
)
|
||||
}
|
||||
|
||||
/* To get TypeofActivity's Product And Service From About Business,
|
||||
* Used In 1) SupplierForm
|
||||
* 2) ClientForm
|
||||
* 3) AI - Sales Tab - Sales DailyWise & Sales ItemWise
|
||||
*/
|
||||
getTypeofActivityForSuppliedInfoForm(pd_id: any,company_id:any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id,"company_id":company_id } })
|
||||
.pipe(
|
||||
@ -486,10 +491,13 @@ export class PdTrigerService {
|
||||
)
|
||||
}
|
||||
|
||||
/** For Stock Details
|
||||
* To Get The Products With TypeofActivity From Business
|
||||
**/
|
||||
stockFormAccess(pdid: any,companyid: any): Observable<any> {
|
||||
|
||||
/* To get TypeofActivity's Product From About Business,
|
||||
* To get RawMaterial's From Supplier Form,
|
||||
* Used In 1) StockForm
|
||||
* 2) AI - Purchase Tab
|
||||
*/
|
||||
getProductsFromBusinessAndSupplier(pdid: any,companyid: any): Observable<any> {
|
||||
// { "pd_id":"104","company_id":"1"}
|
||||
return this._http.post<any>(this.apiUrl + "getProductsFromBusiness", { "pd_id" : pdid , "company_id":companyid })
|
||||
.pipe(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user