@fluxhub/fluxhub-lib 10.0.437 → 10.0.439

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.
@@ -441,6 +441,13 @@ class UtilityService {
441
441
  const m = dt.split("/").map((m) => parseInt(m));
442
442
  return new Date(m[2], m[1] - 1, m[0]);
443
443
  }
444
+ if (f == 5) {
445
+ // parse date in 20181017 (dd/MM/YYYY)
446
+ if (!dt || dt.length != 8) {
447
+ return null;
448
+ }
449
+ return new Date(parseInt(dt.substring(0, 4)), parseInt(dt.substring(4, 2)) - 1, parseInt(dt.substring(6, 2)));
450
+ }
444
451
  return null;
445
452
  }
446
453
  sql_number(a) {
@@ -7037,41 +7044,48 @@ class wkfapp {
7037
7044
  dialogRef.afterClosed().subscribe((result) => {
7038
7045
  if (result) {
7039
7046
  let p = new QParam();
7040
- p.sql = "SELECT_WKF_SELECT_USER_MIN";
7047
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
7041
7048
  p.types = ["string", "string"];
7042
7049
  p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
7043
7050
  this.m_dataService.doQuery(p).subscribe((data) => {
7044
- let b_found = false;
7045
- let livello = 0;
7046
- let descri_livello = '';
7047
- for (let i = 0; i < data.result_data.length; i++) {
7048
- if (data.result_data[i].idp == this.app_s.user) {
7049
- livello = data.result_data[i].livello;
7050
- descri_livello = data.result_data[i].descri_livello;
7051
- b_found = true;
7052
- break;
7051
+ let stato_doc = data.result_data[0].stato;
7052
+ p = new QParam();
7053
+ p.sql = "SELECT_WKF_SELECT_USER_MIN";
7054
+ p.types = ["string", "string"];
7055
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
7056
+ this.m_dataService.doQuery(p).subscribe((data) => {
7057
+ let b_found = false;
7058
+ let livello = 0;
7059
+ let descri_livello = '';
7060
+ for (let i = 0; i < data.result_data.length; i++) {
7061
+ if (data.result_data[i].idp == this.app_s.user) {
7062
+ livello = data.result_data[i].livello;
7063
+ descri_livello = data.result_data[i].descri_livello;
7064
+ b_found = true;
7065
+ break;
7066
+ }
7053
7067
  }
7054
- }
7055
- if (b_found) {
7056
- if (livello != this.get_grid().sRow.stato) {
7057
- this._toastr.error('Il documento non è in stato Bozza');
7058
- return;
7068
+ if (b_found) {
7069
+ if (livello != stato_doc) {
7070
+ this._toastr.error('Il documento non è in stato Bozza');
7071
+ return;
7072
+ }
7073
+ let p = new QParam();
7074
+ p.sql = "UPDATE_WKF_STATO_BOZZA";
7075
+ p.types = ["string", "string", "int", 'string'];
7076
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
7077
+ this.m_dataService.doQuery(p).subscribe((data) => {
7078
+ if (data != null)
7079
+ if (data.result_msg == "OK") {
7080
+ this._toastr.info('Documento aggiornato');
7081
+ this.get_grid().doFill("");
7082
+ }
7083
+ });
7059
7084
  }
7060
- let p = new QParam();
7061
- p.sql = "UPDATE_WKF_STATO_BOZZA";
7062
- p.types = ["string", "string", "int", 'string'];
7063
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
7064
- this.m_dataService.doQuery(p).subscribe((data) => {
7065
- if (data != null)
7066
- if (data.result_msg == "OK") {
7067
- this._toastr.info('Documento aggiornato');
7068
- this.get_grid().doFill("");
7069
- }
7070
- });
7071
- }
7072
- else {
7073
- this._toastr.error('L\'utente non è configurato per lo step BOZZA');
7074
- }
7085
+ else {
7086
+ this._toastr.error('L\'utente non è configurato per lo step BOZZA');
7087
+ }
7088
+ });
7075
7089
  });
7076
7090
  }
7077
7091
  });
@@ -15761,7 +15775,7 @@ FHGridToolBarComponent.decorators = [
15761
15775
  { type: Component, args: [{
15762
15776
  selector: "FHGridToolBar",
15763
15777
  template: `
15764
- SROW: {{sRow | json}}
15778
+
15765
15779
  <div
15766
15780
  *ngIf="type == 'WKF_NO_EDIT'"
15767
15781
  fxLayoutGap="3px"
@@ -15821,7 +15835,7 @@ FHGridToolBarComponent.decorators = [
15821
15835
  {{ "SOSTITUISCI UTENTE" | translate }}
15822
15836
  </button>
15823
15837
  <button
15824
- mat-menu-item [hidden]="sRow==null || sRow?.stato<=10"
15838
+ mat-menu-item [hidden]="sRow==null"
15825
15839
  style="background-color: #F5F5F5"
15826
15840
  (click)="reclama_bozza()"
15827
15841
  *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"
@@ -15935,7 +15949,7 @@ FHGridToolBarComponent.decorators = [
15935
15949
  {{ "SOSTITUISCI UTENTE" | translate }}
15936
15950
  </button>
15937
15951
  <button
15938
- mat-menu-item [hidden]="sRow==null || sRow?.stato<=10"
15952
+ mat-menu-item [hidden]="sRow==null"
15939
15953
  style="background-color: #F5F5F5"
15940
15954
  (click)="reclama_bozza()"
15941
15955
  *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"
@@ -25608,41 +25622,49 @@ class wkfapp_v2 {
25608
25622
  dialogRef.afterClosed().subscribe((result) => {
25609
25623
  if (result) {
25610
25624
  let p = new QParam();
25611
- p.sql = "SELECT_WKF2_SELECT_USER_MIN";
25625
+ p.sql = "SELECT_DOCUMENTS_BY_UIID";
25612
25626
  p.types = ["string", "string"];
25613
25627
  p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
25614
25628
  this.m_dataService.doQuery(p).subscribe((data) => {
25615
- let b_found = false;
25616
- let livello = 0;
25617
- let descri_livello = '';
25618
- for (let i = 0; i < data.result_data.length; i++) {
25619
- if (data.result_data[i].username == this.app_s.user) {
25620
- livello = data.result_data[i].step;
25621
- descri_livello = data.result_data[i].des_step;
25622
- b_found = true;
25623
- break;
25629
+ let stato_doc = data.result_data[0].stato;
25630
+ p = new QParam();
25631
+ p.sql = "SELECT_WKF2_SELECT_USER_MIN";
25632
+ p.types = ["string", "string"];
25633
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid];
25634
+ this.m_dataService.doQuery(p).subscribe((data) => {
25635
+ let b_found = false;
25636
+ let livello = 0;
25637
+ let descri_livello = '';
25638
+ for (let i = 0; i < data.result_data.length; i++) {
25639
+ if (data.result_data[i].username == this.app_s.user) {
25640
+ livello = data.result_data[i].step;
25641
+ descri_livello = data.result_data[i].des_step;
25642
+ b_found = true;
25643
+ break;
25644
+ }
25624
25645
  }
25625
- }
25626
- if (b_found) {
25627
- if (livello != this.get_grid().sRow.stato) {
25628
- this._toastr.error('Il documento non è in stato Bozza');
25629
- return;
25646
+ if (b_found) {
25647
+ console.log(livello, stato_doc);
25648
+ if (livello != stato_doc) {
25649
+ this._toastr.error('Il documento non è in stato Bozza');
25650
+ return;
25651
+ }
25652
+ let p = new QParam();
25653
+ p.sql = "UPDATE_WKF_STATO_BOZZA";
25654
+ p.types = ["string", "string", "int", 'string'];
25655
+ p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
25656
+ this.m_dataService.doQuery(p).subscribe((data) => {
25657
+ if (data != null)
25658
+ if (data.result_msg == "OK") {
25659
+ this._toastr.info('Documento aggiornato');
25660
+ this.get_grid().doFill("");
25661
+ }
25662
+ });
25630
25663
  }
25631
- let p = new QParam();
25632
- p.sql = "UPDATE_WKF_STATO_BOZZA";
25633
- p.types = ["string", "string", "int", 'string'];
25634
- p.values = [this.id_applicativo, this.get_grid().sRow.uiid, livello, descri_livello];
25635
- this.m_dataService.doQuery(p).subscribe((data) => {
25636
- if (data != null)
25637
- if (data.result_msg == "OK") {
25638
- this._toastr.info('Documento aggiornato');
25639
- this.get_grid().doFill("");
25640
- }
25641
- });
25642
- }
25643
- else {
25644
- this._toastr.error('L\'utente non è configurato per lo step BOZZA');
25645
- }
25664
+ else {
25665
+ this._toastr.error('L\'utente non è configurato per lo step BOZZA');
25666
+ }
25667
+ });
25646
25668
  });
25647
25669
  }
25648
25670
  });