@fluxhub/fluxhub-lib 18.0.46 → 18.0.48

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.
@@ -788,36 +788,42 @@ class UtilityService {
788
788
  return false;
789
789
  }
790
790
  sql_date(dt) {
791
- if (dt == null)
792
- return 'dbnull';
793
- if (typeof dt == 'undefined')
794
- return 'dbnull';
795
- if (typeof dt == 'string') {
796
- let apdt = this.string2date(dt, 2);
797
- if (apdt)
798
- dt = new Date(apdt);
791
+ try {
792
+ if (dt == null)
793
+ return 'dbnull';
794
+ if (typeof dt == 'undefined')
795
+ return 'dbnull';
796
+ if (typeof dt == 'string') {
797
+ let apdt = this.string2date(dt, 2);
798
+ if (apdt)
799
+ dt = new Date(apdt);
800
+ }
801
+ if (dt.getFullYear() == 1970)
802
+ return 'dbnull';
803
+ var mm = dt.getMonth() + 1; // getMonth() is zero-based
804
+ var dd = dt.getDate();
805
+ if (this.app_s.SQL_SERVER_LANG == 'it')
806
+ return [
807
+ (dd > 9 ? '' : '0') + dd,
808
+ '-',
809
+ (mm > 9 ? '' : '0') + mm,
810
+ '-',
811
+ dt.getFullYear(),
812
+ ].join('');
813
+ if (this.app_s.SQL_SERVER_LANG == 'uk')
814
+ return [
815
+ dt.getFullYear(),
816
+ '-',
817
+ (mm > 9 ? '' : '0') + mm,
818
+ '-',
819
+ (dd > 9 ? '' : '0') + dd,
820
+ ].join('');
821
+ return 'Parametro SQL_SERVER_LANG non corretto';
799
822
  }
800
- if (dt.getFullYear() == 1970)
823
+ catch (e) {
824
+ console.log('ERRORE CONV DATE', dt, typeof dt);
801
825
  return 'dbnull';
802
- var mm = dt.getMonth() + 1; // getMonth() is zero-based
803
- var dd = dt.getDate();
804
- if (this.app_s.SQL_SERVER_LANG == 'it')
805
- return [
806
- (dd > 9 ? '' : '0') + dd,
807
- '-',
808
- (mm > 9 ? '' : '0') + mm,
809
- '-',
810
- dt.getFullYear(),
811
- ].join('');
812
- if (this.app_s.SQL_SERVER_LANG == 'uk')
813
- return [
814
- dt.getFullYear(),
815
- '-',
816
- (mm > 9 ? '' : '0') + mm,
817
- '-',
818
- (dd > 9 ? '' : '0') + dd,
819
- ].join('');
820
- return 'Parametro SQL_SERVER_LANG non corretto';
826
+ }
821
827
  }
822
828
  sql_date_grid(dt, adds = '') {
823
829
  if (dt == null)
@@ -17143,6 +17149,10 @@ class WkfService {
17143
17149
  Authorization: "Bearer " + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
17144
17150
  });
17145
17151
  this.url = this.app_s.API_ENDPOINT + this.app_s.WKF_ENDPOINT;
17152
+ // il backend Node valida values come array di stringhe: un null (nota o cc non
17153
+ // valorizzati) fa rispondere 500 a dowkf e la mail non parte
17154
+ if ((queryp.sql == "send_wkf_mail" || queryp.sql == "send_mail") && queryp.values)
17155
+ queryp.values = queryp.values.map((v) => (v == null ? "" : "" + v));
17146
17156
  let post_v = JSON.stringify(queryp);
17147
17157
  return this.http.post(this.url, post_v, { headers: this.headers }).pipe(map((res) => {
17148
17158
  // Handle errors, display if enabled
@@ -45113,7 +45123,7 @@ class dati_aggiuntivi_v2 {
45113
45123
  ' ' +
45114
45124
  this.m_obj.codice +
45115
45125
  ' - ' +
45116
- this.tsr.instant(this.m_obj.stat_stato));
45126
+ (this.m_obj.stat_stato ? this.tsr.instant(this.m_obj.stat_stato) : ''));
45117
45127
  else
45118
45128
  this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve) +
45119
45129
  ' ' +
@@ -45121,12 +45131,12 @@ class dati_aggiuntivi_v2 {
45121
45131
  '/' +
45122
45132
  this.m_obj.v +
45123
45133
  ' - ' +
45124
- this.tsr.instant(this.m_obj.stat_stato));
45134
+ (this.m_obj.stat_stato ? this.tsr.instant(this.m_obj.stat_stato) : ''));
45125
45135
  this.reset_form_v(this.tsr.instant(this.app_info.descrizione_breve) +
45126
45136
  ' ' +
45127
45137
  this.m_obj.codice +
45128
45138
  ' - ' +
45129
- this.tsr.instant(this.m_obj.stat_stato));
45139
+ (this.m_obj.stat_stato ? this.tsr.instant(this.m_obj.stat_stato) : ''));
45130
45140
  this.old_doc = JSON.parse(JSON.stringify(this.getfieldvalues()));
45131
45141
  });
45132
45142
  // console.log("🚀 ~ file: wkfdatiaggiuntivi.ts ~ line 2301 ~ dati_aggiuntivi_v2 ~ return_edit 222 ~ b_respingi_button", this.b_respingi_button)