From 34146c7a7193efc230dcf25639ecc8df5fe618ab Mon Sep 17 00:00:00 2001 From: Surendiran Date: Wed, 31 May 2023 18:26:42 +0530 Subject: [PATCH] payment mode --- .../appoinments-list.component.html | 9 ++++++++ .../appoinments-list.component.ts | 2 +- .../dialog-box/dialog-box.component.html | 6 ++--- .../dialog-box/dialog-box.component.scss | 2 +- .../dialog-box/dialog-box.component.ts | 18 +++++++++------ .../app/dashboard/dashboard.component.html | 14 ++++++------ .../src/app/dashboard/dashboard.component.ts | 22 ++++++++++++++----- 7 files changed, 48 insertions(+), 25 deletions(-) diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html index 0f3dfeb..3ff7622 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html @@ -61,6 +61,15 @@ Client Address {{row.customer[0].address_1}} {{row.customer[0].city}} {{row.customer[0].state}} --> + + Payment Status + {{row.paymentStatus == 1 ? 'Paid' : 'Not Paid'}} + + + + Payment Mode + {{row.paymentMode == '' ? '-' : row.paymentMode}} + Status diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts index 32cb217..9d775c1 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts @@ -34,7 +34,7 @@ export interface UsersData { export class AppoinmentsListComponent implements OnInit { push: any; - displayedColumns: string[] = ['id','ClientName','datetime','phoneNo','email','status', 'action']; + displayedColumns: string[] = ['id','ClientName','datetime','phoneNo','email','paymentStatus','paymentMode','status', 'action']; public appointmentListLength: number; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html index 96bbdc5..6884074 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.html @@ -91,7 +91,7 @@ - + @@ -150,9 +150,9 @@ - + Payment Mode - + Cash UPI Card diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss index d10b836..e67e7af 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.scss @@ -166,7 +166,7 @@ $tem-color : #217e69; } .cardDesign{ border: 1px solid #e8edef; - width: 89%; + width: 85%; background-color: #227f6e21; box-shadow: 0 2px 0 #00000008 } diff --git a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts index a84414e..7287c5f 100644 --- a/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/dialog-box/dialog-box.component.ts @@ -111,7 +111,6 @@ export class DialogBoxComponent implements OnInit { practiId: any; isSubmitting: boolean = false; selectedRadioValue: any; - paymentMode: boolean = false; slotIndex_group:any=[]; slotslength:any=[]; constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public _cus:CustomersService, @@ -435,6 +434,11 @@ export class DialogBoxComponent implements OnInit { console.log(this.form.value,this.slotsResult,this.days[this.clicks]); // if(this.slotsResult == undefined){ // } + if(this.form.value.paymentStatus == 0){ + console.log('paymentmode') + this.form.controls['paymentMode'].clearValidators(); + this.form.controls['paymentMode'].updateValueAndValidity(); + } if(this.slotsResult.length == 0){ console.log(this.slotsResult.length == 0) this.notifierService.notify('warning', 'Please Select Slots'); @@ -464,7 +468,7 @@ export class DialogBoxComponent implements OnInit { "busId":localStorage.getItem('busId') } this.end_user.CreatecusServicesMapDetails(paramsmap).subscribe(res => { - if (res.status == 200) { + if (res.status == 200) { let serviceMap = res['data'][0].id let paramsData:any= { "busId": localStorage.getItem('busId'), @@ -472,8 +476,10 @@ export class DialogBoxComponent implements OnInit { "appoinmentDate": this.days[this.clicks], "appoinmentTime": this.form.value.appoinmentTime, "serviceMap":serviceMap, - "appoinmentSlots": JSON.stringify(this.slotsResult) + "appoinmentSlots": JSON.stringify(this.slotsResult), //"servicemap" :this.bookedAppointment_servicemap + "paymentStatus": this.form.value.paymentStatus, + "paymentMode": this.form.value.paymentMode } if(this.local_data.hasOwnProperty('id')){ paramsData.id =this.local_data.id @@ -603,13 +609,11 @@ console.log(params) console.log(res) let data = res['data']; this.slots = data - let len =[]; - this.slots.forEach(element => { - + let len =[]; + this.slots.forEach(element => { len.push( element.length) }) console.log(len) - this.slotslength = len.reduce((a, b) => a + b, 0) } }) diff --git a/ng-seed/src/app/dashboard/dashboard.component.html b/ng-seed/src/app/dashboard/dashboard.component.html index 3cfe349..e5b660b 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.html +++ b/ng-seed/src/app/dashboard/dashboard.component.html @@ -34,9 +34,9 @@
- +
-
Twitter
+
Earnings
@@ -44,13 +44,13 @@
-

76

-

Online

+

{{count.total_earning_count == null ? 0 : count.total_earning_count}}

+

Total


-

19

-

Comment

+

{{count.monthly_earning_count == null ? 0 : count.monthly_earning_count}}

+

Monthly

@@ -172,7 +172,7 @@
- Revenue   + Practitioner  
diff --git a/ng-seed/src/app/dashboard/dashboard.component.ts b/ng-seed/src/app/dashboard/dashboard.component.ts index a8d3d51..2f507e3 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.ts +++ b/ng-seed/src/app/dashboard/dashboard.component.ts @@ -34,18 +34,18 @@ export class DashboardComponent { } }; - pieChartData: number[] = [300, 500, 100]; + pieChartData: number[] = []; doughnutOptions: any = Object.assign({ elements: { arc: { - borderWidth: 5 + borderWidth: 3 } } }, this.globalChartOptions); doughnutChartColors: any[] = [{ - backgroundColor: ['#673ab7', '#f44336', '#009688 ', '#2196f3'] + backgroundColor: ['#f44336', '#009688 ', '#2196f3'] }]; - pieChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail Sales']; + pieChartLabels: string[] = ['Customer', 'Services', 'Practitioner']; pieChartType = 'pie'; // Bar @@ -215,15 +215,25 @@ messages: Object[] = [{ } ngOnInit() { - let buiId = {'busId':localStorage.getItem('busId')} - this.getCount(buiId) + let user_role = localStorage.getItem('user_role') + let param + if(user_role == 'PRACTITIONER'){ + param = {'user_id':localStorage.getItem('user_id'),'busId':localStorage.getItem('busId')} + }else{ + param = {'busId':localStorage.getItem('busId')} + } + + this.getCount(param) } getCount(param){ + + console.log(param) this._dash.getCountDetails(param).subscribe(res => { if (res.status == 200) { console.log(res) this.count = res['data'] + this.pieChartData.push(this.count.customer_count, this.count.practitioner_count, this.count.service_count) } }) }