Fairoj AI Changes

This commit is contained in:
saravanakumarkandasami 2019-04-08 19:50:29 +05:30
parent b675b574d7
commit 2a0442ec84
18 changed files with 368 additions and 133 deletions

File diff suppressed because one or more lines are too long

View File

@ -120,6 +120,7 @@ import {PdQuestionAssessedSummaryPage} from '../pages/pd-question/pd-question-as
import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
import { ContentLoaderModule } from '@netbasal/content-loader';
import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-question-assessed-daily-purchase/pd-question-assessed-daily-purchase'
import {RupeeCurrencyFormatPipe} from '../pipes/rupee-currency-format/rupee-currency-format'
@NgModule({
declarations: [
@ -171,7 +172,8 @@ import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-quest
PdGeneralImagesPage,
PdQuestionSalaryInfoPage,
PdQuestionAssessedSummaryPage,
PdQuestionAssessedDailyPurchasePage
PdQuestionAssessedDailyPurchasePage,
RupeeCurrencyFormatPipe
],
imports: [
BrowserModule,ReactiveFormsModule,FormsModule,
@ -208,7 +210,8 @@ import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-quest
MatToolbarModule,
MatTooltipModule,
MatStepperModule,HttpClientModule,IonicImageViewerModule,NgxMatSelectSearchModule,
ContentLoaderModule
ContentLoaderModule,
],
bootstrap: [IonicApp],
entryComponents: [

View File

@ -31,14 +31,15 @@
<mat-option value="Others">Others</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field *ngIf="purchase.value.purchase_item == 'Others'">
<input type="text" matInput placeholder="Other Raw Material/Trading Item" formControlName="other_purchase_item">
</mat-form-field>
<div [ngSwitch]="purchase.value.purchase_type">
<div formArrayName="child">
<div *ngFor="let childItem of purchase.get('child').controls; let c=index;let last=last" [formGroupName]="c">
<div *ngIf="childItem.value.isactive == true">
<mat-form-field>
<input matInput type="date" max=maxDate formControlName="purchase_date" placeholder="Purchase Date" (dateChange)="purchaseCalculation(s,purchase.value)">
<input matInput type="date" [max]="maxDate" formControlName="purchase_date" placeholder="Purchase Date" (dateChange)="purchaseCalculation(s,purchase.value)">
</mat-form-field>
<mat-form-field>
<input matInput type="number" autocomplete="off" placeholder="Bill Value" formControlName="purchase_value" (keyup)="purchaseCalculation(s,purchase.value);inWords(childItem.value.purchase_value,c)">
@ -57,6 +58,7 @@
</ion-col>
</ion-buttons>
</div>
</div>
</div>
</div>
<mat-form-field>

View File

@ -6,6 +6,7 @@ import {QuestionCategoryProvider} from '../../../providers/question-category/que
import {ToastProvider} from '../../../providers/common-provider/toast'
import { DatePipe } from '@angular/common';
import {ConstantsProvider} from '../../../providers/constants/constants'
import { max } from 'rxjs/operators';
/**
* Generated class for the PdQuestionAssessedDailyPurchasePage page.
@ -30,9 +31,14 @@ export class PdQuestionAssessedDailyPurchasePage {
productListData: any=[];
purchaseData:any;
purchaseAmtInWords: any=[];
maxDate:any;
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,
private fb:FormBuilder,private quesCat:QuestionCategoryProvider,private toast:ToastProvider,private cons:ConstantsProvider) {
var today=new Date
console.log("today",today)
this.maxDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)) + '-' + ("0" + (today.getDate() ));
console.log("max",this.maxDate)
this.pdDetails=this.navParams.get('pdDetails')
console.log("pd",this.pdDetails)
this.formId=this.navParams.get('FormId')
@ -241,7 +247,12 @@ getDailyPurchase(records){
let saleDate = new Date(val.purchase_date);
console.log(saleDate.getDay())
console.log(saleDate.getDate());
val.purchase_date= saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() )).slice(-2);
// val.purchase_date= saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() )).slice(-2);
let date=saleDate.getDate()< 10 ? ("0"+(saleDate.getDate())) : saleDate.getDate()
let month=saleDate.getMonth() < 10 ? ("0"+(saleDate.getMonth()+1)) : (saleDate.getMonth()+1)
console.log("datamonth")
console.log(date,month)
val.purchase_date= saleDate.getFullYear() + '-' + month + '-' + date;
console.log( val.purchase_date)
}
if(val.purchase_value != ''){

View File

@ -20,6 +20,7 @@
<mat-card>
<mat-form-field style="width: 100%">
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let product of product_and_services" [value]="product.name">{{product.name | titlecase}}</mat-option>
<mat-option value="Others">Others</mat-option>
</mat-select>
@ -37,8 +38,9 @@
<mat-card-header><h2>{{item.get('sales_item').value | titlecase}}</h2></mat-card-header>
<div formArrayName="child">
<div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i">
<div *ngIf="tenants.value.isactive == true">
<mat-form-field style="width: 100%">
<input matInput type="date" max="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date">
<input matInput type="date" [max]="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date">
<mat-error align="end" style="font-size: 12px">Sales Date is Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
@ -48,7 +50,7 @@
<ion-buttons>
<ion-row>
<ion-col col-1>
<a (click)="deletedailyChildSaleProduct(sale_i,i)">
<a (click)="deletedailyChildSaleProduct(sale_i,i,tenants)">
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
@ -60,6 +62,7 @@
</ion-row>
</ion-buttons>
</div>
</div>
</div>
</div>
<!--Case 2-->

View File

@ -36,7 +36,13 @@ export class PdQuestionAssessedDailySalesPage {
freqAmtInwords: any=[];
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
product_and_services: any=[];
maxDate:any;
constructor(public navCtrl: NavController, public navParams: NavParams, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider, public fb: FormBuilder,public constant:ConstantsProvider) {
// this.maxDate=new Date()
var today=new Date
console.log("today",today)
this.maxDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)) + '-' + ("0" + (today.getDate() ));
console.log("max",this.maxDate)
this.pdDetails = this.navParams.get('pdDetails');
this.FormId = this.navParams.get('FormId');
this.salesDaily = this.navParams.get('salesDaily');
@ -170,7 +176,7 @@ changeOptions(indexVal: any,event: any): void{
margin_value: [null],
comments:[null],
fk_createdby: [this.users],
isactive: ['1'],
isactive: [true],
});
}
createdailyChildSaleProduct() {
@ -181,7 +187,7 @@ changeOptions(indexVal: any,event: any): void{
sales_value: [null],
fk_frequency_id:[null],
frequency_value:[null],
isactive: ['1'],
isactive: [true],
})
}
temparr = [];
@ -244,7 +250,7 @@ changeOptions(indexVal: any,event: any): void{
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
if(values.child.length>0 && values.margin_per!='' && values.margin_per!=null){
// let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{
let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive==1).map(mval=>{
let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive==true).map(mval=>{
mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM');
return mval;
});
@ -371,16 +377,26 @@ changeOptions(indexVal: any,event: any): void{
}
}
deletedailyChildSaleProduct(saleIndex, saleChildIndex) {
this.tempdate = [];
const control = (<FormArray>this.salesDailyForm.controls['sales_product']).at(saleIndex).get('child') as FormArray;
if(control.length==1)
{
control.removeAt(saleChildIndex);
this.adddailyChildSaleProduct(saleIndex);
}else{
control.removeAt(saleChildIndex);
deletedailyChildSaleProduct(saleIndex, saleChildIndex,childVal) {
let control = <FormArray> this.salesDailyForm.controls['sales_product'];
control=control.controls[saleIndex].get('child') as FormArray
if(childVal == '' || childVal == null){
control.removeAt(saleChildIndex)
}
else{
console.log("control",control.controls[saleChildIndex])
control.controls[saleChildIndex].get('isactive').setValue(false);
}
// this.tempdate = [];
// const control = (<FormArray>this.salesDailyForm.controls['sales_product']).at(saleIndex).get('child') as FormArray;
// if(control.length==1)
// {
// control.removeAt(saleChildIndex);
// this.adddailyChildSaleProduct(saleIndex);
// }else{
// control.removeAt(saleChildIndex);
// }
}
saveData(answerData) {
answerData.sales_product.forEach(parVal=>{
@ -414,6 +430,7 @@ changeOptions(indexVal: any,event: any): void{
}
getDailySalesData(dailySalesData) {
console.log("daily sale",dailySalesData);
const control = <FormArray>this.salesDailyForm.get('sales_product') as FormArray;
let control1: any = <FormArray>this.salesDailyForm.controls['sales_product'];
@ -435,7 +452,9 @@ changeOptions(indexVal: any,event: any): void{
if(val.sales_type != 2){
let saleDate = new Date(item.sales_date);
item.sales_date = saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() + 1)).slice(-2);
// item.sales_date = saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay()+1 )).slice(-2);
console.log("sale Day",saleDate.getDay())
item.sales_date = saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1))+ '-' + ("0" + (saleDate.getDate() ));
}
//console.log("sale data",new Date(this.pipe.transform(item.sales_date, 'dd-MM-yyyy')))
@ -476,14 +495,14 @@ changeOptions(indexVal: any,event: any): void{
return this.fb.group(
{
sim_id: [data.sim_id],
sales_item: [data.sales_item, Validators.compose([Validators.required])],
sales_item: [data.sales_item],
other_sales_item:[data.other_sales_item],
sales_type:[data.sales_type,Validators.compose([Validators.required])],
sales_type:[data.sales_type],
child: this.fb.array([]),
fk_pd_id: [this.pdDetails.pd_id],
company_id:[this.pdDetails.company_id],
fk_createdby: [this.users],
isactive: ['1'],
isactive: [true],
margin_per: [data.margin_per],
margin_value: [data.margin_value],
comments:[data.comments]
@ -499,10 +518,10 @@ console.log("Sales type",salesType)
// sales_date: [data.sales_date, Validators.compose([Validators.required])],
sales_date:[salesType==2 ? '' : data.sales_date],
// sales_date: [new Date(this.pipe.transform(data.sales_date, 'dd-MM-yyyy')), Validators.compose([Validators.required])],
sales_value: [data.sales_value, Validators.compose([Validators.required])],
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
frequency_value:[data.frequency_value,Validators.compose([Validators.required])],
isactive: ['1'],
sales_value: [data.sales_value],
fk_frequency_id:[data.fk_frequency_id],
frequency_value:[data.frequency_value],
isactive: [true],
})

View File

@ -112,7 +112,8 @@ else{
{
if(res['dataStatus']==true)
{
this.getassessedIncome();
this.toast.pdTriggerappmessage("Saved Successfully..!")
}else
{
@ -120,6 +121,9 @@ else{
})
}
setTimeout(()=>{
this.getassessedIncome();
})
}
getassessedIncome()
@ -166,7 +170,9 @@ else{
if(this.grossprofit.purchase_type == null ){
this.assessedForm.controls['purchase_type'].setValue(0);
}
// this.assessedForm.controls['purchase_type'].setValue(this.grossprofit.purchase_type);
else{
this.assessedForm.controls['purchase_type'].setValue(this.grossprofit.purchase_type);
}
this.assessedForm.controls['margin'].setValue(this.grossprofit.margin);
this.assessedForm.controls['calc_type_id'].setValue(this.grossprofit.calc_type_id);
this.assessedForm.controls['fk_createdby'].setValue(this.grossprofit.fk_createdby);

View File

@ -53,11 +53,11 @@
</mat-form-field>
<div *ngIf="activateMarginCalculation">
<mat-form-field style="width: 100%">
<input matInput type="number" placeholder="Margin percentage %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(assessedForm.value)">
<input matInput type="number" placeholder="Net Margin %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(assessedForm.value)">
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput type="number" placeholder="Margin Value" formControlName="margin_value" name="margin_value" readonly>
<input matInput type="number" placeholder="Net Profit Value" formControlName="margin_value" name="margin_value" readonly>
<mat-hint align="end" style="font-size: 12px" *ngIf="assessedForm.get('sales_declared_by_customer').value != ''">{{"&#8377;"}} {{marginAmtInwords}} Only</mat-hint>
</mat-form-field>
</div>
@ -87,7 +87,7 @@
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Sales Calculate Item Wise
Item-Wise Sales Calculation
</mat-panel-title>
</mat-expansion-panel-header>
@ -122,8 +122,15 @@
</ion-row>
<hr/>
</ion-item>
</ion-list>
<ion-row *ngIf="totalAnnualSale_Item_wise != ''">
<ion-col col-6>
<h4>Total of Sales</h4>
</ion-col>
<ion-col col-6 text-right>
<h5>{{totalAnnualSale_Item_wise}}</h5>
</ion-col>
</ion-row>
</mat-expansion-panel>
@ -132,12 +139,18 @@
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Sales Calculate Daily Wise
Sales Calculation as per Kutcha Records / Bills
</mat-panel-title>
</mat-expansion-panel-header>
<mat-card-header><h4>Daily Sales Details</h4></mat-card-header>
<ion-row>
<ion-col offset-11 col-1 text-right>
<ion-col col-3 *ngIf="sales_item_month_value">
<a (click)="allEditSalesDailyWise(sales_item_month_value)">
<h2>{{"&#9998;"}}</h2>
</a>
</ion-col>
<ion-col offset-6 col-3 text-right>
<a (click)="AddAssessedDailyForm()">
<ion-icon color="optblue" name="add-circle" style="font-size: 24px;"></ion-icon>
</a>
@ -177,6 +190,9 @@
<mat-card-title>Oct</mat-card-title>
<mat-card-subtitle text-right>06-05-2018 $5000</mat-card-subtitle>
</ion-col> -->
<!-- <ion-row >
Annual Sale : {{monthwise.footerMessage[0].month_value}}
</ion-row> -->
<ion-row>
{{monthwise.footerMessage[0].month_message}}<br/>
{{monthwise.footerMessage[0].year_message}}
@ -261,13 +277,75 @@
</ion-row>
<hr/>
</ion-item>
</ion-list>
<ion-row *ngIf="totalAnnualpurchase_Item_wise != ''">
<ion-col col-6>
<h4>Total of purchase</h4>
</ion-col>
<ion-col col-6 text-right>
<h5>{{totalAnnualpurchase_Item_wise}}</h5>
</ion-col>
</ion-row>
</mat-card>
<mat-card *ngIf="purchase_type == '2'">
<mat-card-header><h4>Purchase Calculate Daily Wise</h4></mat-card-header>
<ion-row>
<ion-row>
<ion-col col-3 *ngIf="purchase_bill_wise !=''">
<a (click)="alleditPurchaseBillWise(purchase_bill_wise)">
<h2>{{"&#9998;"}}</h2>
</a>
</ion-col>
<ion-col offset-6 col-3 text-right>
<a (click)="AddPurchaseBillWiseForm()">
<ion-icon color="optblue" name="add-circle" style="font-size: 24px;"></ion-icon>
</a>
</ion-col>
</ion-row>
<div *ngFor="let purchase of purchase_bill_wise_data">
<div (click)="editPurchaseBillWise(purchase.pbw_id)">
<h3 text-center>{{purchase.purchaseItem | titlecase}}<span *ngIf="purchase.purchaseItem == 'Others'">({{purchase.otherPurchaseItem | titlecase}})</span></h3>
<ion-row>
<ion-col col-12 *ngFor="let eachItem of purchase.expandElements">
<mat-card-title>
<span *ngIf="eachItem.header != 'Jan-1970';else freqtitle;">{{eachItem.header | titlecase}}</span>
<!-- <ng-template #freqtitle>YearWise Purchase</ng-template> -->
</mat-card-title>
<div *ngFor="let eachmonthItem of eachItem.value">
<mat-card-subtitle >
<ion-row>
<ion-col col-6>
<span *ngIf="eachmonthItem.purchase_date !== '0000-00-00 00:00:00';else freqname;">
{{eachmonthItem.purchase_date | date:'dd-MM-yyyy'}}
</span>
<!-- <ng-template #freqname>{{eachmonthItem.frequency_name}}</ng-template> -->
</ion-col>
<ion-col col-6 text-right>
<span *ngIf="eachmonthItem.purchase_date !== '0000-00-00 00:00:00';else freqvalue;">
{{"&#8377;"}} {{eachmonthItem.purchase_value}}
</span>
<!-- <ng-template #freqvalue>{{"&#8377;"}} {{eachmonthItem.frequency_value}}</ng-template> -->
</ion-col>
</ion-row>
</mat-card-subtitle>
</div>
</ion-col>
<ion-row>
{{purchase.footerMessage[0].month_message}}<br/>
{{purchase.footerMessage[0].year_message}}
</ion-row>
</ion-row>
</div>
<hr>
</div>
</mat-card>
</div>
<!-- <ion-row>
<ion-col col-3 *ngIf="purchase_bill_wise !=''"><a (click)="alleditPurchaseBillWise(purchase_bill_wise)"><h2>{{"&#9998;"}}</h2></a></ion-col>
<ion-col offset-9 col-3 text-right>
<a (click)="AddPurchaseBillWiseForm()">
@ -288,9 +366,8 @@
<hr/>
</ion-item>
</ion-list>
</mat-card>
</div>
</ion-list> -->
<div *ngIf="pageId==3">
<mat-card>
<mat-card-header><h4>Business Expense Items</h4></mat-card-header>
@ -317,6 +394,15 @@
</div>
</div>
<ion-row *ngIf="totalAnnualBusiness_details != ''">
<ion-col col-6>
<h4>Total of Expense</h4>
</ion-col>
<ion-col col-6 text-right>
<h5>{{totalAnnualBusiness_details}}</h5>
</ion-col>
</ion-row>
</mat-card>
</div>
<div *ngIf="pageId==4">
@ -345,6 +431,14 @@
</div>
</div>
<ion-row *ngIf="totalAnnual_House_hold_details != ''">
<ion-col col-6>
<h4>Total of Expense</h4>
</ion-col>
<ion-col col-6 text-right>
<h5>{{totalAnnual_House_hold_details}}</h5>
</ion-col>
</ion-row>
</mat-card>
</div>
<div *ngIf="pageId==5">

View File

@ -62,8 +62,13 @@ export class PdQuestionAssessedInfoPage {
activateMarginCalculation:boolean=false
SaleAmtInwords: any=[];
marginAmtInwords: any=[];
purchase_bill_wise: any;
purchase_bill_wise: any=[];
purchase_bill_wise_data:any=[]
purchase_type:any;
totalAnnualSale_Item_wise;
totalAnnualpurchase_Item_wise: any;
totalAnnualBusiness_details: any;
totalAnnual_House_hold_details: any;
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public cons:ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails');
this.pageId = this.navParams.get('pageId');
@ -191,9 +196,12 @@ export class PdQuestionAssessedInfoPage {
if(res['dataStatus']==true)
{
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
this.getAssessedDetails();
}
})
setTimeout(()=>{
this.getAssessedDetails();
},1500)
}
salesCalculation(values): void {
if(values.sales_declared_by_customer !=''){this.SaleAmtInwords = this.cons.convertNumberToWords(values.sales_declared_by_customer);}
@ -210,6 +218,7 @@ export class PdQuestionAssessedInfoPage {
this.sales_item_month_value = [];
this.sales_month_wise_data = [];
this.sales_item_value= [];
this.purchase_bill_wise_data=[];
let records = {'pd_id':this.pdDetails.pd_id,'company_id':this.pdDetails.company_id};
console.log("company",this.pdDetails.company_id)
console.log("getAssesed",records)
@ -219,8 +228,13 @@ export class PdQuestionAssessedInfoPage {
{
let sales_value = res['records'].sales_declared_by_customer[0];
this.sales_item_value = res['records'].sales_calculated_by_itemwise;
//SALE ANNUAL TOTAL
this.totalAnnualSale_Item_wise=this.sales_item_value.map(val=>val.annual_sale_value).reduce((original,value)=>original + Number(value),0)
console.log("this.sales_item",this.totalAnnualSale_Item_wise);
this.sales_item_month_value = res['records'].sales_items_by_monthwise;
this.purchse_details = res['records'].purchase_details;
//PURCHASE ANNUAL TOTAL
this.totalAnnualpurchase_Item_wise=this.purchse_details.map(val=>val.annual_purchase_value).reduce((original,value)=>original+Number(value),0)
this.purchase_bill_wise=res['records'].purchase_billwise
this.grossprofitCalc = res['records'].gross_profit_calculation_type[0]
this.purchase_type=this.grossprofitCalc.purchase_type;
@ -239,7 +253,11 @@ export class PdQuestionAssessedInfoPage {
this.businessExpenses_details = res['records'].business_expenses;
//BUSINESS ANNUAL TOTAL
this.totalAnnualBusiness_details=this.businessExpenses_details.map(val=>val.annual_expenses_value).reduce((original,value)=>original + Number(value),0);
this.houseHold_details = res['records'].house_hold_expenses;
//HOUSEHOLD ANNUAL TOTAL
this.totalAnnual_House_hold_details=this.houseHold_details.map(val=>val.annual_expense_value).reduce((original,value)=>original+Number(value),0)
this.busissnessIncome = res['records'].othre_business_income;
// console.log(this.sales_item_month_value);
// this.getpurchaseDetails(this.purchse_details);
@ -274,9 +292,32 @@ export class PdQuestionAssessedInfoPage {
})
this.sales_month_wise_data.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage,simId:itemElement.sim_id,otherSaleItem:itemElement.other_sales_item});
});
this.purchase_bill_wise.forEach((itemElement,itemIndex)=>{
console.log("0index",itemElement.items[0]);
let result=Object.assign({},...itemElement.items);
console.log("result",result)
let expandBodyContent=Object.keys(result).map(key=>({header:key,value:result[key]}));
console.log("expanBody",expandBodyContent);
let listItems:any=[];
expandBodyContent.forEach((expandElement,expandIndex)=>{
let calculateItems=expandElement.value.reduce((acc,calculate)=>acc + Number(calculate.purchase_value),0)
listItems.push({items:expandElement,itemsTotal:calculateItems})
})
let calculateAllItemsTotal:number=listItems.reduce((va,rcalc)=>va+Number(rcalc.itemsTotal),0);
let convertYear : number = 12 / listItems.length;
let footerMessage: any=[];
footerMessage.push({
month_message: listItems.length + ' Month Sales : '+ calculateAllItemsTotal,
month_value:calculateAllItemsTotal,
year_message: ' Yearly Sales Arrived : '+ calculateAllItemsTotal * convertYear,
year_value: calculateAllItemsTotal * convertYear,
})
this.purchase_bill_wise_data.push({purchaseItem:itemElement.purchase_item,expandElements:expandBodyContent,footerMessage:footerMessage,pbw_id:itemElement.pbw_id,otherPurchaseItem:itemElement.other_purchase_item});
})
console.log("val purchase0",this.purchase_bill_wise_data)
console.log(this.sales_month_wise_data);
console.log("value",this.sales_month_wise_data);
if(sales_value!==undefined){
this.assessedForm.controls['sdc_id'].setValue(sales_value.sdc_id);
this.assessedForm.controls['sales_declared_by_customer'].setValue(sales_value.sales_declared_by_customer);
@ -341,6 +382,9 @@ export class PdQuestionAssessedInfoPage {
this.navCtrl.push(PdQuestionAssessedDailySalesPage,{'pdDetails':this.pdDetails,'salesDaily':dailySaleDetails,'margin_calculation_status':this.activateMarginCalculation})
}
allEditSalesDailyWise(values){
this.navCtrl.push(PdQuestionAssessedDailySalesPage,{'pdDetails':this.pdDetails,'salesDaily':values,'margin_calculation_status':this.activateMarginCalculation})
}
/**purchase Details Forms */
AddPurchaseForm()

View File

@ -28,7 +28,7 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%">
<mat-form-field style="width:100%" *ngIf="item.value.purchase_item == 'Others'">
<input matInput autocomplete="off" formControlName="other_purchase_item" placeholder="Other Raw Material/Trading Item">
</mat-form-field>
</div>

View File

@ -21,6 +21,7 @@
<mat-form-field style="width: 100%">
<!-- <input type="text" matInput placeholder="Product/Services" formControlName="sales_item" (keyup)="salesCalculation(i,item.value)" name="sales_item"> -->
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
<mat-option>Select</mat-option>
<mat-option *ngFor="let product of product_and_services" [value]="product.name">{{product.name | titlecase}}</mat-option>
<mat-option value="Others">Others</mat-option>
</mat-select>
@ -50,9 +51,9 @@
<!--Case 1-->
<div *ngSwitchCase="1">
<mat-form-field style="width: 100%">
<input type="number" matInput placeholder="Rate/unit of sale" formControlName="rate_per_unit" name="rate_per_unit" (keyup)="inWords($event.target.value,i,4)">
<input type="number" matInput placeholder="Rate/unit of sale" formControlName="rate_per_unit" name="rate_per_unit" (keyup)="inWords($event.target.value,i,4);salesCalculation(i,item.value)">
</mat-form-field>
<mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
<mat-label float-right style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
<mat-form-field style="width: 100%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="salesCalculation(i,item.value)">

View File

@ -22,64 +22,64 @@
<mat-panel-title><h6> Declared By Customer </h6></mat-panel-title>
</mat-expansion-panel-header>
<ion-row>
<ion-col>
Sales Revenue
<ion-col class="label">
a. Sales/Revenue
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.sales_revenue}}
{{salesCustomer.sales_revenue | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Purchases
<ion-col class="label">
b. Purchases
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.purchases}}
{{salesCustomer.purchases | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Gross Profit / Loss(a-b)
<ion-col class="label">
c. Gross Profit / Loss(a-b)
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.grossprofit}}
{{salesCustomer.grossprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Business Expenses
<ion-col class="label">
d. Business Expenses
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.business_expenses}}
{{salesCustomer.business_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Profit / Loss(c-d)
<ion-col class="label">
e. Net Profit / Loss(c-d)
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.netprofit}}
{{salesCustomer.netprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Household Expenses
<ion-col class="label">
f. Household Expenses
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.house_hold_expenses}}
{{salesCustomer.house_hold_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Disposable Income
<ion-col class="label">
g. Disposable Income
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.disposable_income}}
{{salesCustomer.disposable_income | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Margin %
<ion-col class="label">
h. Net Margin %
</ion-col>
<ion-col text-right class="val">
{{salesCustomer.netmargin}} %
@ -96,64 +96,64 @@
<mat-panel-title><h6> As Derived from Item Wise Sales </h6></mat-panel-title>
</mat-expansion-panel-header>
<ion-row>
<ion-col>
Sales Revenue
<ion-col class="label">
a. Sales Revenue
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.sales_revenue}}
{{salesItemWise.sales_revenue | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Purchases
<ion-col class="label">
b. Purchases
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.purchases}}
{{salesItemWise.purchases | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Gross Profit / Loss(a-b)
<ion-col class="label">
c. Gross Profit / Loss(a-b)
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.grossprofit}}
{{salesItemWise.grossprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Business Expenses
<ion-col class="label">
d. Business Expenses
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.business_expenses}}
{{salesItemWise.business_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Profit / Loss(c-d)
<ion-col class="label">
e. Net Profit / Loss(c-d)
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.netprofit}}
{{salesItemWise.netprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Household Expenses
<ion-col class="label">
f. Household Expenses
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.house_hold_expenses}}
{{salesItemWise.house_hold_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Disposable Income
<ion-col class="label">
g. Disposable Income
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.disposable_income}}
{{salesItemWise.disposable_income | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Margin %
<ion-col class="label">
h. Net Margin %
</ion-col>
<ion-col text-right class="val">
{{salesItemWise.netmargin}} %
@ -172,64 +172,64 @@
<mat-panel-title><h6> As Derived from Kuchha Sales Book/Bills </h6></mat-panel-title>
</mat-expansion-panel-header>
<ion-row>
<ion-col>
Sales Revenue
<ion-col class="label">
a. Sales Revenue
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.sales_revenue}}
{{salesMonthWise.sales_revenue | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Purchases
<ion-col class="label">
b. Purchases
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.purchases}}
{{salesMonthWise.purchases | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Gross Profit / Loss(a-b)
<ion-col class="label">
c. Gross Profit / Loss(a-b)
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.grossprofit}}
{{salesMonthWise.grossprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Business Expenses
<ion-col class="label">
d. Business Expenses
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.business_expenses}}
{{salesMonthWise.business_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Profit / Loss(c-d)
<ion-col class="label">
e. Net Profit / Loss(c-d)
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.netprofit}}
{{salesMonthWise.netprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Household Expenses
<ion-col class="label">
f. Household Expenses
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.house_hold_expenses}}
{{salesMonthWise.house_hold_expenses | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Disposable Income
<ion-col class="label">
g. Disposable Income
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.disposable_income}}
{{salesMonthWise.disposable_income | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
Net Margin %
<ion-col class="label">
h. Net Margin %
</ion-col>
<ion-col text-right class="val">
{{salesMonthWise.netmargin}} %
@ -246,9 +246,17 @@
Considered Sales / Revenue
</ion-col>
<ion-col text-right class="val">
{{consolidatedReport.consolidated_sales_revenue}}
{{consolidatedReport.consolidated_sales_revenue | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col class="l_cons">
Considered Net Profit
</ion-col>
<ion-col text-right class="val">
{{consolidatedReport.consolidated_nerprofit | rupeeCurrencyFormat}}
</ion-col>
</ion-row>
<ion-row>
<ion-col class="l_cons">
Considered Net Margin %
@ -257,14 +265,7 @@
{{consolidatedReport.consolidated_nermagin}} %
</ion-col>
</ion-row>
<ion-row>
<ion-col class="l_cons">
Considered Net Profit
</ion-col>
<ion-col text-right class="val">
{{consolidatedReport.consolidated_nerprofit}}
</ion-col>
</ion-row>
</mat-card>
</div>

View File

@ -1,6 +1,8 @@
page-pd-question-assessed-summary {
.val{
font-weight: bold
// font-weight: bold
font-size:14.5px;
font-weight: bold
}
.l_cons{
color:seagreen;
@ -17,5 +19,8 @@ page-pd-question-assessed-summary {
.mat-expansion-panel-header{
padding: 30px;
}
.label{
font-weight: bold;
}
}

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {QuestionCategoryProvider} from '../../../providers/question-category/question-category'
import {RupeeCurrencyFormatPipe} from '../../../pipes/rupee-currency-format/rupee-currency-format'
/**
* Generated class for the PdQuestionAssessedSummaryPage page.
@ -13,6 +14,7 @@ import {QuestionCategoryProvider} from '../../../providers/question-category/que
@Component({
selector: 'page-pd-question-assessed-summary',
templateUrl: 'pd-question-assessed-summary.html',
providers:[RupeeCurrencyFormatPipe]
})
export class PdQuestionAssessedSummaryPage {
pdDetails:any;

View File

@ -9,6 +9,7 @@ import { DatePipe} from '@angular/common';
import {PdPipe} from './../../../pipes/pd/pd';
import { removeSummaryDuplicates } from '@angular/compiler';
import { DataSource } from '@angular/cdk/table';
import { MatSelect } from '@angular/material';
//import {} from 'moment'
/**
@ -70,7 +71,7 @@ export class PdQuestionGeneralInfoPage {
public addIndi:boolean
updateIndex_comp: any;
@ViewChild('remark') nameField: ElementRef;
@ViewChild('focusBusiness') focus_business_entity : ElementRef
@ViewChild('focusBusiness') focus_business_entity : MatSelect
customer_segment_abbr: any;
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public modal:ModalController) {
@ -941,11 +942,11 @@ console.log('1)',this.temp);
})
existData.forEach((element,index)=>{
console.log("company value",element)
if(element.business_entity_type==''){
this.toast.pdTriggerappmessage("Please choose business entity type for the company");
if(element.business_entity_type=='' || element.business_entity_type == null){
this.toast.pdTriggerappmessage("Please choose business entity type for each companies");
this.editCompanies(index);
this.focus_business_entity.nativeElement.focus();
return
// this.focus_business_entity.focused=true;
return;
}
valuesData.push(element)
})

View File

@ -1,8 +1,11 @@
import { NgModule } from '@angular/core';
import { PdPipe } from './pd/pd';
import { RupeeCurrencyFormatPipe } from './rupee-currency-format/rupee-currency-format';
@NgModule({
declarations: [PdPipe],
declarations: [PdPipe,
RupeeCurrencyFormatPipe],
imports: [],
exports: [PdPipe]
exports: [PdPipe,
RupeeCurrencyFormatPipe]
})
export class PipesModule {}

View File

@ -0,0 +1,35 @@
import { Pipe, PipeTransform } from '@angular/core';
/**
* Generated class for the RupeeCurrencyFormatPipe pipe.
*
* See https://angular.io/api/core/Pipe for more info on Angular Pipes.
*/
@Pipe({
name: 'rupeeCurrencyFormat',
})
export class RupeeCurrencyFormatPipe implements PipeTransform {
/**
* Takes a value and makes it lowercase.
*/
transform(value: any):any {
if (!isNaN(value) && value) {
var currencySymbol = '₹';
//var output = Number(input).toLocaleString('en-IN'); <-- This method is not working fine in all browsers!
var result = value.toString().split('.');
var lastThree = result[0].substring(result[0].length - 3);
var otherNumbers = result[0].substring(0, result[0].length - 3);
if (otherNumbers != '')
lastThree = ',' + lastThree;
var output = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
if (result.length > 1) {
output += "." + result[1];
}
return currencySymbol + output;
}
// return value.toLowerCase();
}
}

View File

@ -29320,6 +29320,7 @@ page-pd-question-assessed-sales .scroll-content {
}
page-pd-question-assessed-summary .val {
font-size: 14.5px;
font-weight: bold;
}
@ -29341,6 +29342,10 @@ page-pd-question-assessed-summary .mat-expansion-panel-header {
padding: 30px;
}
page-pd-question-assessed-summary .label {
font-weight: bold;
}
page-pd-question-assests .scroll-content {
padding: 16px;
}