diff --git a/src/li/li0100.cpp b/src/li/li0100.cpp index 788afb9f9..90c7321a1 100644 --- a/src/li/li0100.cpp +++ b/src/li/li0100.cpp @@ -142,13 +142,24 @@ void TVisLI_mask::load_sheet() } // Campi solo filtrabili con SELECT ************************** // TIPODOC+STATO - if(get(F_TIPODOC).full()) - query << "SELECT TIPODOC==#TIPODOC"; - if(get(F_STATO).full()) - query << "SELECT STATO==#STATO"; + TString querySel; + bool tipo = get(F_TIPODOC).full(); + bool stato = get(F_STATO).full(); + querySel << ((tipo || stato) ? "\nSELECT " : "") << (tipo ? "TIPODOC==#TIPODOC&&" : "") << (stato ? "STR(STATO==#STATO)" : ""); + /* + if(tipo || stato) + querySel = "\nSELECT "; + if(tipo) + querySel << "TIPODOC==#TIPODOC&&"; + if(stato) + querySel << "STATO==#STATO"; + else + */ + if(tipo && !stato) + querySel.cut(querySel.len()-2); // Unisco query - query << "FROM " << queryFrom << "\nTO " << queryTo << "\n"; + query << querySel << "\nFROM " << queryFrom << "\nTO " << queryTo << "\n"; // Creo recordset TISAM_recordset rec(query); @@ -231,6 +242,8 @@ void TVisLI_mask::addRow(TSheet_field& sheet, TISAM_recordset& rec) row.add(rec.get("CODNUM").as_string(), sheet.cid2index(A_CODNUM)); // Tipo documento row.add(rec.get("TIPODOC").as_string(), sheet.cid2index(A_TIPODOC)); + // Stato documento + row.add(rec.get("STATO").as_string(), sheet.cid2index(A_STATODOC)); // Tipo cliente row.add("C", sheet.cid2index(A_TIPOCF)); // Codice cliente diff --git a/src/li/li0100a.h b/src/li/li0100a.h index b69b0371c..c25ef1d6e 100644 --- a/src/li/li0100a.h +++ b/src/li/li0100a.h @@ -28,32 +28,33 @@ #define A_NUMDOC 103 #define A_CODNUM 104 #define A_TIPODOC 105 -#define A_TIPOCF 106 -#define A_CODCF 107 -#define A_RAGSOC 108 -#define A_TOTDOC 109 +#define A_STATODOC 106 +#define A_TIPOCF 107 +#define A_CODCF 108 +#define A_RAGSOC 109 +#define A_TOTDOC 110 // Campi lettere intento -#define START_PLA 110 +#define START_PLA 111 -#define PLA1_NUMPROT 110 -#define PLA1_QTA 111 -#define PLA2_NUMPROT 112 -#define PLA2_QTA 113 -#define PLA3_NUMPROT 114 -#define PLA3_QTA 115 -#define PLA4_NUMPROT 116 -#define PLA4_QTA 117 -#define PLA5_NUMPROT 118 -#define PLA5_QTA 119 -#define PLA6_NUMPROT 120 -#define PLA6_QTA 121 -#define PLA7_NUMPROT 122 -#define PLA7_QTA 123 -#define PLA8_NUMPROT 124 -#define PLA8_QTA 125 -#define PLA9_NUMPROT 126 -#define PLA9_QTA 127 -#define PLA10_NUMPROT 128 -#define PLA10_QTA 129 +#define PLA1_NUMPROT 111 +#define PLA1_QTA 112 +#define PLA2_NUMPROT 113 +#define PLA2_QTA 114 +#define PLA3_NUMPROT 115 +#define PLA3_QTA 116 +#define PLA4_NUMPROT 117 +#define PLA4_QTA 118 +#define PLA5_NUMPROT 119 +#define PLA5_QTA 120 +#define PLA6_NUMPROT 121 +#define PLA6_QTA 122 +#define PLA7_NUMPROT 123 +#define PLA7_QTA 124 +#define PLA8_NUMPROT 125 +#define PLA8_QTA 126 +#define PLA9_NUMPROT 127 +#define PLA9_QTA 128 +#define PLA10_NUMPROT 129 +#define PLA10_QTA 130 -#define END_SHEET 109 \ No newline at end of file +#define END_SHEET 130 \ No newline at end of file diff --git a/src/li/li0100a.msk b/src/li/li0100a.msk index 25843c449..6f1fccf7d 100644 --- a/src/li/li0100a.msk +++ b/src/li/li0100a.msk @@ -231,6 +231,7 @@ BEGIN ITEM "Numero\nDocum.@5F" ITEM "Cod.\nNum.@8F" ITEM "Tipo\nDoc.@4F" + ITEM "Stato\nDoc.@5F" ITEM "C/F@2" ITEM "Codice@6" ITEM "Ragione Sociale@35" @@ -293,6 +294,12 @@ BEGIN FLAGS "D" END +STRING A_STATODOC 1 +BEGIN + PROMPT 1 0 "Stato documento" + FLAGS "D" +END + STRING A_TIPOCF 1 BEGIN PROMPT 1 1 "Tipo C/F "