iptdevs-design-system 3.1.276 → 3.1.280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2747,6 +2747,11 @@ class CommercialService extends IPTGeneralService {
2747
2747
  let serviceUrl = this.SERVICE_URL + 'get/latest/cod/by/student/code/' + codeStudent;
2748
2748
  return this.http.get(serviceUrl, this.httpOptions);
2749
2749
  }
2750
+ updateCOD(request) {
2751
+ let serviceUrl = this.SERVICE_URL + 'post/update/cod';
2752
+ this.generateRequestParams(request);
2753
+ return this.http.post(serviceUrl, this.httpOptions);
2754
+ }
2750
2755
  }
2751
2756
  CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2752
2757
  CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
@@ -4791,6 +4796,52 @@ class CodFormComponent {
4791
4796
  this.loaderMessage = 'Editando COD, espere un momento';
4792
4797
  let request = this.getUpdateCOD(totalData);
4793
4798
  console.log(request);
4799
+ this.commercialService.updateCOD(request).subscribe({
4800
+ next: (response) => {
4801
+ if (response.message.code === 1) {
4802
+ this.isLoading = false;
4803
+ this.loaderMessage = '';
4804
+ Swal.fire({
4805
+ title: 'Perfecto!',
4806
+ text: 'El COD ha sido Editado exitosamente.',
4807
+ icon: 'success'
4808
+ });
4809
+ this.localStorageCOD.clearData();
4810
+ this.okCreatedCOD.emit(true);
4811
+ }
4812
+ else if (response.message.code === 4) {
4813
+ this.isLoading = false;
4814
+ this.loaderMessage = '';
4815
+ const errorMessages = response.data.errors.map(error => `- ${error.message}`).join('<br>');
4816
+ Swal.fire({
4817
+ title: 'Revisar lo seleccionado en los campos',
4818
+ html: `${errorMessages}`,
4819
+ icon: 'warning'
4820
+ });
4821
+ }
4822
+ else {
4823
+ this.isLoading = false;
4824
+ this.loaderMessage = '';
4825
+ Swal.fire({
4826
+ title: 'Warning!',
4827
+ text: response.message.message,
4828
+ icon: 'error'
4829
+ });
4830
+ }
4831
+ },
4832
+ error: (err) => {
4833
+ this.isLoading = false;
4834
+ this.loaderMessage = '';
4835
+ Swal.fire({
4836
+ title: 'Error in cod creation',
4837
+ text: err.message,
4838
+ icon: 'error'
4839
+ });
4840
+ },
4841
+ complete: () => {
4842
+ this.codCreationSubscription = null;
4843
+ }
4844
+ });
4794
4845
  // this.commercialService.EditCod(request).subscribe({
4795
4846
  // next: (response: any) => {
4796
4847
  // this.isLoading = false;
@@ -5462,6 +5513,11 @@ class BudgetService extends IPTGeneralService {
5462
5513
  this.generateRequestParams(params);
5463
5514
  return this.http.post(serviceUrl, this.httpOptions);
5464
5515
  }
5516
+ getTotalCashReceiptsByDateAndUser(params) {
5517
+ let serviceUrl = this.SERVICE_URL + 'post/total/cash/receipts/by/date/and/user';
5518
+ this.generateRequestParams(params);
5519
+ return this.http.post(serviceUrl, this.httpOptions);
5520
+ }
5465
5521
  }
5466
5522
  BudgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: BudgetService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5467
5523
  BudgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: BudgetService, providedIn: 'root' });