-
{{single_ques.get('question').value}}
+
{{single_ques.get('question').value}}
{{val.answer}}
diff --git a/src/app/pages/ques-template/ques-template.component.ts b/src/app/pages/ques-template/ques-template.component.ts
index a144c1e..ac139b9 100644
--- a/src/app/pages/ques-template/ques-template.component.ts
+++ b/src/app/pages/ques-template/ques-template.component.ts
@@ -48,6 +48,7 @@ export class QuesTemplateComponent implements OnInit {
console.log('Hello QuesTemplateComponent Component');
this.text = 'Hello World';
this.cameraProvider.checkAndRequestGPSPermission();
+ this.cameraProvider.checkAndRequestCameraPermission();
}
ngOnInit() {}
@@ -350,7 +351,9 @@ export class QuesTemplateComponent implements OnInit {
data = data.filter((group_indi:any) => !group_indi.hasOwnProperty('additional_field') && group_indi.additional_field != 1);
if (options == 'camera') {
+ console.log('camera')
this.cameraProvider.getpicture().then((res:any) => {
+ console.log('camera',res)
if (res != 'error') {
this.geoCoordinates = localStorage.getItem('current_coordinates');
this.cameraProvider.addWatermarks(res).then((watermarkedImage:any) => {
@@ -439,10 +442,13 @@ export class QuesTemplateComponent implements OnInit {
captureImg(parent_index:any,parent_control:any){
// parent_control.controls.is_image_status.setValue('l')
+ console.log('camera')
this.cameraProvider.getpicture().then((res:any) => {
+ console.log('Camera',res)
if (res != 'error') {
this.geoCoordinates=localStorage.getItem('current_coordinates')
this.cameraProvider.addWatermarks(res).then((watermarkedImage:any)=>{
+ console.log(watermarkedImage)
parent_control.controls.answer_value.setValue(watermarkedImage)
@@ -923,32 +929,41 @@ export class QuesTemplateComponent implements OnInit {
console.log(this.fileredSearchValue)
}
- public findInvalidControls() {
- const questionsControl = this.quesAnsForm.get('questions');
- if (questionsControl instanceof FormArray && questionsControl.controls) {
- const controls = questionsControl.controls;
- console.log(controls);
- for (const name in controls) {
- if (controls[name].invalid) {
+ // public findInvalidControls() {
+ // const questionsArray = this.quesAnsForm.get('questions') as FormArray;
+
+ // for (let i = 0; i < questionsArray.length; i++) {
+ // const parent_ques = questionsArray.at(i) as FormGroup;
+
+ // // Iterate through all controls in the FormGroup
+ // Object.keys(parent_ques.controls).forEach(controlName => {
+ // const formControl = parent_ques.get(controlName);
+
+ // if (formControl && formControl.invalid) {
+ // formControl.markAsTouched(); // Trigger Angular validation and error messages
+ // const invalidControlElement = document.getElementById(controlName + '_' + i);
+
+ // if (invalidControlElement) {
+ // invalidControlElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ // // Scroll to the first invalid control and break the loop
+ // return;
+ // }
+ // }
+ // });
+ // }
+ // }
- let invalidFields = [].slice.call(document.getElementsByClassName('ng-invalid')) as HTMLElement[];
- let firstInvalidField:any;
- for(let val in invalidFields){
- if(invalidFields[val].nodeName == 'MAT-FORM-FIELD'){ //INPUT FOR INPUT FIELD
- firstInvalidField=invalidFields[val]
- break;
- }
- }
- if(firstInvalidField != undefined){
- firstInvalidField.scrollIntoView(true)
- }
- break;
- }
+ private findInvalidControls(formGroup: FormGroup | FormArray) {
+ Object.values(formGroup.controls).forEach(control => {
+ if (control instanceof FormControl) {
+ control.markAsTouched();
+ } else if (control instanceof FormGroup || control instanceof FormArray) {
+ this.findInvalidControls(control);
}
- }
- // return invalid;
+ });
}
+
onSubmit(flag:any){ //1-Submit 0-Draft
if(flag != 0){
@@ -961,7 +976,7 @@ export class QuesTemplateComponent implements OnInit {
if(this.matExpansionPanel!= undefined){
this.matExpansionPanel.open()
}
- this.findInvalidControls()
+ this.findInvalidControls(this.quesAnsForm)
return
}
// CHECKING THE SAVE IMAGE REQUEST IS STILL PENDING
@@ -1123,7 +1138,7 @@ export class QuesTemplateComponent implements OnInit {
section_dis_names.push(res.sectin_name)
})
}
- const alert = this.toastProvider.setAlertWithOkButton("
Sales PD is incomplete", "The Following sections are not Saved " + section_dis_names + '');
+ const alert = this.toastProvider.setAlertWithOkButton("Sales PD is incomplete", "The Following sections are not Saved " + section_dis_names);
alert.then(async (resolvedAlert) => {
await resolvedAlert.present();
diff --git a/src/app/pages/section-list/section-list.component.scss b/src/app/pages/section-list/section-list.component.scss
index 36b4a29..49fff99 100644
--- a/src/app/pages/section-list/section-list.component.scss
+++ b/src/app/pages/section-list/section-list.component.scss
@@ -112,4 +112,7 @@
--padding-end: 16px; // Adjust as needed
--padding-top: 16px; // Adjust as needed
--padding-bottom: 16px; // Adjust as needed
+ }
+ h6{
+ font-size: 14px;
}
\ No newline at end of file
diff --git a/src/global.scss b/src/global.scss
index 5a5bec6..aa236ae 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -19,6 +19,7 @@
@import "@ionic/angular/css/typography.css";
@import "@ionic/angular/css/display.css";
+
/* Optional CSS utils that can be commented out */
@import "@ionic/angular/css/padding.css";
@import "@ionic/angular/css/float-elements.css";
@@ -41,6 +42,10 @@
// --padding-bottom: 16px; // Adjust as needed
// }
+.alert-title.sc-ion-alert-md{
+ color: black !important;
+}
+
diff --git a/src/pipes/num-to-words.pipe.spec.ts b/src/pipes/num-to-words.pipe.spec.ts
new file mode 100644
index 0000000..7327310
--- /dev/null
+++ b/src/pipes/num-to-words.pipe.spec.ts
@@ -0,0 +1,8 @@
+import { NumToWordsPipe } from './num-to-words.pipe';
+
+describe('NumToWordsPipe', () => {
+ it('create an instance', () => {
+ const pipe = new NumToWordsPipe();
+ expect(pipe).toBeTruthy();
+ });
+});
diff --git a/src/pipes/num-to-words.pipe.ts b/src/pipes/num-to-words.pipe.ts
new file mode 100644
index 0000000..cd3eeec
--- /dev/null
+++ b/src/pipes/num-to-words.pipe.ts
@@ -0,0 +1,74 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'numToWords'
+})
+export class NumToWordsPipe implements PipeTransform {
+ /**
+ * Takes a value and makes it lowercase.
+ */
+ a:any = [
+ '',
+ 'one ',
+ 'two ',
+ 'three ',
+ 'four ',
+ 'five ',
+ 'six ',
+ 'seven ',
+ 'eight ',
+ 'nine ',
+ 'ten ',
+ 'eleven ',
+ 'twelve ',
+ 'thirteen ',
+ 'fourteen ',
+ 'fifteen ',
+ 'sixteen ',
+ 'seventeen ',
+ 'eighteen ',
+ 'nineteen '];
+
+b:any = [
+ '',
+ '',
+ 'twenty',
+ 'thirty',
+ 'forty',
+ 'fifty',
+ 'sixty',
+ 'seventy',
+ 'eighty',
+ 'ninety'];
+
+ transform(value: any, ...args:any) {
+ if (value) {
+ let num: any = Number(value);
+ if (num) {
+ if ((num = num.toString()).length > 9) {
+ // return 'We are not the Iron Bank, you can lower down the stakes :)';
+ return ''
+ }
+ const n = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/);
+ if (!n) {return ''; }
+ let str = '';
+ str += (Number(n[1]) !== 0) ? (this.a[Number(n[1])] || this.b[n[1][0]] + ' ' + this.a[n[1][1]]) + 'crore ' : '';
+ str += (Number(n[2]) !== 0) ? (this.a[Number(n[2])] || this.b[n[2][0]] + ' ' + this.a[n[2][1]]) + 'lakh ' : '';
+ str += (Number(n[3]) !== 0) ? (this.a[Number(n[3])] || this.b[n[3][0]] + ' ' + this.a[n[3][1]]) + 'thousand ' : '';
+ str += (Number(n[4]) !== 0) ? (this.a[Number(n[4])] || this.b[n[4][0]] + ' ' + this.a[n[4][1]]) + 'hundred ' : '';
+ str += (Number(n[5]) !== 0) ? ((str !== '') ? 'and ' : '') +
+ (this.a[Number(n[5])] || this.b[n[5][0]] + ' ' +
+ this.a[n[5][1]]) + 'rupee' : '';
+ // return str;
+ return str.charAt(0).toUpperCase() +
+ str.slice(1);
+ } else {
+ return '';
+ }
+ } else {
+ return '';
+ }
+
+ }
+
+}
diff --git a/src/providers/pdtrigger/pdtrigger.service.ts b/src/providers/pdtrigger/pdtrigger.service.ts
index 9260482..1370a7e 100644
--- a/src/providers/pdtrigger/pdtrigger.service.ts
+++ b/src/providers/pdtrigger/pdtrigger.service.ts
@@ -98,9 +98,9 @@ export class PdtriggerService {
// catchError(this.handleError('role', []))
)
}
+
advancedFilter(params:any): Observable{
- return this.http.post(this.apiUrl+'filterPDList',{"records":params})
+ return this.http.post(this.apiUrl+'filterSalesPDList',{"records":params})
}
-
}
diff --git a/src/shared/shared.module.ts b/src/shared/shared.module.ts
index 0a03872..2cc3184 100644
--- a/src/shared/shared.module.ts
+++ b/src/shared/shared.module.ts
@@ -16,12 +16,13 @@ import { MatDatepickerModule } from '@angular/material/datepicker'
import { MatSelectModule } from '@angular/material/select'
import { MatRadioModule } from '@angular/material/radio'
import { MatExpansionModule } from '@angular/material/expansion'
+import { NumToWordsPipe } from 'src/pipes/num-to-words.pipe';
@NgModule({
- declarations: [],
+ declarations: [NumToWordsPipe],
imports: [
CommonModule,
MatButtonModule,
@@ -68,6 +69,7 @@ import { MatExpansionModule } from '@angular/material/expansion'
// FlexModule,
],
exports: [
+ NumToWordsPipe,
MatButtonModule,
MatCardModule,
MatInputModule,