diff --git a/mg/mg4200.cpp b/mg/mg4200.cpp index ffb5687c4..82fbef693 100755 --- a/mg/mg4200.cpp +++ b/mg/mg4200.cpp @@ -22,7 +22,7 @@ static const char* or_connect(TString & expr) TCursor* TForm_inventario::cursor() const { if (_use_alternate_cursor) // Se e' settata la stampa per ragg. fisc ritorna il cursore appropriato - return (TCursor*)_sortcur; + return _sortcur; return TForm_stampemg::cursor(); } @@ -33,7 +33,7 @@ bool TForm_inventario::validate(TForm_item &cf, TToken_string &s) if (code=="_USER") { const TRectype& magrec=relation()->curr(LF_MAG); - const TString subcode=s.get(); + const TFixed_string subcode=s.get(); if (subcode=="GIAC") { real v=curr_art().giacenza_corretta(magrec, false,_valcomp); @@ -110,9 +110,7 @@ void TForm_inventario::add_colval(int tipo) _valorizz_scelte[_colonne++] = t; - TString col; - - col << _colonne; + TString8 col; col << _colonne; find_field('B',odd_page,FF_ENABLECOLS).set(col); // Accende le colonne per l'intestazione @@ -299,7 +297,8 @@ TStampainv_mask::TStampainv_mask() field(F_CATVENLISTINO).enable(prassid.get_bool("GESLISCV")); else { - field(F_CATVENLISTINO).disable(); field(F_CODLISTINO).disable(); + field(F_CATVENLISTINO).disable(); + field(F_CODLISTINO).disable(); } if (prassid.get_bool("CHK_USER", "ve", 1)) @@ -309,6 +308,13 @@ TStampainv_mask::TStampainv_mask() show(F_DAUSR); show(F_AUSR); } + if (!IsPeppeOk()) // Rimuovere quand'e' ora, non prima + { + hide(F_FORNITORE); + hide(F_DASTAGIONE); + hide(F_ASTAGIONE); + } + set_handler(F_TOLIVELLOART, handle_liv); set_handler(F_TOLIVELLOGIAC, handle_liv); set_handler(F_ORDINE, handle_ragg); @@ -502,7 +508,6 @@ TIsamtempfile * TStampa_inventario::crea_tempmag(const bool valcomp) delete temp_mag; return NULL; } - } TIsamtempfile* TStampa_inventario::calcola_giacenze(const bool giaceff, const bool valcomp, const TDate & al, const char subordine) @@ -605,17 +610,10 @@ void TStampa_inventario::setprint_permagazzini(const char subordine, const bool // setta il filtro sul cursore switch (filtro) { - case '0': - cfilter = "(STR(GIAC!=\"0\"))"; - break; - case 'N': // negativi - cfilter << "(STR(GIAC<\"0\"))"; - break; - case '+': - cfilter = "(STR(GIAC>\"0\"))"; - break; - default: - break; + case '0': cfilter = "(STR(GIAC!=\"0\"))"; break; + case 'N': cfilter = "(STR(GIAC<\"0\"))"; break; // negativi + case '+': cfilter = "(STR(GIAC>\"0\"))"; break; + default : break; } if (m.get(F_DAART).full()) @@ -627,6 +625,11 @@ void TStampa_inventario::setprint_permagazzini(const char subordine, const bool _form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,3]",_strexpr); else _form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,5]",_strexpr); + + if (!m.field(F_FORNITORE).empty()) + cfilter << and_connect(cfilter) << "(47->CODFORN==\"" << m.get(F_FORNITORE) << "\")" ; + if (!m.field(F_DASTAGIONE).empty() || !m.field(F_ASTAGIONE).empty()) + cfilter << and_connect(cfilter) << "(BETWEEN(47->STAGIONE,\"" << m.get(F_DASTAGIONE) << "\",\"" << m.get(F_ASTAGIONE) <<"\"))" ; switch (subordine) { @@ -778,19 +781,17 @@ void TStampa_inventario::setprint_perarticoli(const char subordine, const bool a // setta il filtro sul cursore switch (filtro) { - case '0': - cfilter = "(STR(GIAC!=\"0\"))"; - break; - case 'N': // negativi - cfilter << "(STR(GIAC<\"0\"))"; - break; - case '+': - cfilter = "(STR(GIAC>\"0\"))"; - break; - default: - break; + case '0': cfilter = "(STR(GIAC!=\"0\"))"; break; + case 'N': cfilter = "(STR(GIAC<\"0\"))"; break; // negativi + case '+': cfilter = "(STR(GIAC>\"0\"))"; break; + default : break; } + if (!m.field(F_FORNITORE).empty()) + cfilter << and_connect(cfilter) << "(47->CODFORN==\"" << m.get(F_FORNITORE) << "\")" ; + if (!m.field(F_DASTAGIONE).empty() || !m.field(F_ASTAGIONE).empty()) + cfilter << and_connect(cfilter) << "(BETWEEN(47->STAGIONE,\"" << m.get(F_DASTAGIONE) << "\",\"" << m.get(F_ASTAGIONE) <<"\"))" ; + switch (subordine) { case 'C': @@ -834,6 +835,11 @@ void TStampa_inventario::setprint_perarticoli(const char subordine, const bool a _form->set_ordering(mg_cat_merc); espr2.format("%d->GRMERC[1,3]", LF_ANAMAG); _form->find_field('B',odd_page,"GRUPPI_CATMER").setcondition(espr2,_strexpr); + + if (m.get(F_DAART).full()) + cfilter << and_connect(cfilter) << "(CODART>=\"" << m.get(F_DAART) << "\")"; + if (m.get(F_AART).full()) + cfilter << and_connect(cfilter) << "(CODART<=\"" << m.get(F_AART) << "\")"; if (subordine == 'S') { @@ -947,6 +953,11 @@ void TStampa_inventario::setprint_perarticoli_all(const char subordine, bool all if (m.get(F_AMAG).full()) filter << and_connect(filter) << "(CODMAG[1,3]<=" <<'"' << m.get(F_AMAG)<< "\")" ; + if (!m.field(F_FORNITORE).empty()) + cfilter << and_connect(cfilter) << "(CODFORN==\"" << m.get(F_FORNITORE) << "\")" ; + if (!m.field(F_DASTAGIONE).empty() || !m.field(F_ASTAGIONE).empty()) + cfilter << and_connect(cfilter) << "(BETWEEN(STAGIONE,\"" << m.get(F_DASTAGIONE) << "\",\"" << m.get(F_ASTAGIONE) <<"\"))" ; + //m.set_livellicodice(); TString sortexp; diff --git a/mg/mg4200.h b/mg/mg4200.h index eee315ee7..c3ab6830a 100755 --- a/mg/mg4200.h +++ b/mg/mg4200.h @@ -19,6 +19,11 @@ #define F_ADES 112 #define F_VALMEDI 113 #define F_STAMPAGIAC 114 + +#define F_FORNITORE 115 +#define F_DASTAGIONE 116 +#define F_ASTAGIONE 117 + #define F_TOTALIMAGAZZINI 119 #define F_TOTALIDEPOSITI 120 diff --git a/mg/mg4200.uml b/mg/mg4200.uml index 875333eb2..ad00af6e1 100755 --- a/mg/mg4200.uml +++ b/mg/mg4200.uml @@ -1,6 +1,6 @@ #include "mg4200.h" -TOOLBAR "" 0 0 0 2 +TOOLBAR "Toolbar" 0 0 0 2 #include @@ -76,19 +76,9 @@ BEGIN ITEM "T|tutti gli articoli" END -TEXT DLG_NULL -BEGIN - PROMPT 16 4 "@bDall'articolo" -END - -TEXT DLG_NULL -BEGIN - PROMPT 50 4 "@bAll'articolo" -END - STRING F_DAART 20 BEGIN - PROMPT 2 5 "Codice " + PROMPT 2 4 "@bDall'articolo " FLAGS "U" USE LF_ANAMAG INPUT CODART F_DAART @@ -101,9 +91,9 @@ BEGIN ADD RUN ve2 -3 END -STRING F_DADES 50 28 +STRING F_DADES 50 34 BEGIN - PROMPT 2 6 "Descrizione " + PROMPT 44 4 "" FLAGS "U" USE LF_ANAMAG KEY 2 INPUT DESCR F_DADES @@ -114,16 +104,9 @@ BEGIN CHECKTYPE NORMAL END -STRING F_DAUSR 40 30 -BEGIN - PROMPT 2 7 "Personalizz. " - FLAGS "UH" - GROUP G_USER -END - STRING F_AART 20 BEGIN - PROMPT 50 5 "" + PROMPT 2 5 "@bAll'articolo " FLAGS "U" COPY USE F_DAART INPUT CODART F_AART @@ -135,9 +118,9 @@ BEGIN ADD RUN ve2 -3 END -STRING F_ADES 50 28 +STRING F_ADES 50 34 BEGIN - PROMPT 50 6 "" + PROMPT 44 5 "" FLAGS "U" COPY USE F_DADES INPUT DESCR F_ADES @@ -147,13 +130,59 @@ BEGIN CHECKTYPE NORMAL END -STRING F_AUSR 40 30 +STRING F_DAUSR 50 30 BEGIN - PROMPT 50 7 "" + PROMPT 2 6 "Da pers. " FLAGS "UH" GROUP G_USER END + +STRING F_AUSR 50 30 +BEGIN + PROMPT 48 6 "a pers. " + FLAGS "UH" + GROUP G_USER +END + +NUMBER F_FORNITORE 6 +BEGIN + PROMPT 2 7 "Fornitore " + USE LF_CLIFO + INPUT TIPOCF "F" + INPUT CODCF F_FORNITORE + DISPLAY "Codice" CODCF + DISPLAY "Ragione Sociale@50" RAGSOC + OUTPUT F_FORNITORE CODCF + CHECKTYPE NORMAL + ADD RUN,cg0 -1 F + FLAGS "U" +END + +STRING F_DASTAGIONE 4 +BEGIN + PROMPT 38 7 "Da stagione " + FLAGS "UZ" + USE %STG + INPUT CODTAB F_DASTAGIONE + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_DASTAGIONE CODTAB + CHECKTYPE NORMAL +END + +STRING F_ASTAGIONE 4 +BEGIN + PROMPT 63 7 "A stagione " + FLAGS "UZ" + USE %STG + INPUT CODTAB F_ASTAGIONE + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_ASTAGIONE CODTAB + CHECKTYPE NORMAL +END + STRING F_DAMAG 3 BEGIN PROMPT 2 8 "Dal magazzino " diff --git a/mg/mg4200a.frm b/mg/mg4200a.frm index 4661b6fda..e5cd81cd0 100755 --- a/mg/mg4200a.frm +++ b/mg/mg4200a.frm @@ -1,4 +1,5 @@ #include "mg4frm.h" + USE LF_MAG KEY 2 BY ANNOES CODART LIVELLO CODMAG JOIN LF_ANAMAG TO LF_MAG INTO CODART==CODART JOIN MAG TO LF_MAG ALIAS 500 INTO CODTAB==CODMAG[1,3] diff --git a/mg/mglib.h b/mg/mglib.h index 8e22c4f7e..b1e864b03 100755 --- a/mg/mglib.h +++ b/mg/mglib.h @@ -388,7 +388,7 @@ public: // costruisce il codice compatto e viceversa void pack_maskgrpcodes(TString & pc, const TMask & m, int field, int level) const; void pack_grpcode(TString & pc, const TString &codlev, const int levnum) const; // Inserisce il codice del gruppo del livello levnum in pc - TString unpack_grpcode(const TString & pc, const int levnum) const ; // Estrae il codice del gruppo del livello levnum da pc + const TString& unpack_grpcode(const TString & pc, const int levnum) const; // Estrae il codice del gruppo del livello levnum da pc // costruisce il codice della tabella di decodifica dei livelli TString build_tabcode(const TString & code, const int levnum) const ; TString build_tabcode_packed(const TString & pcode, const int levnum) const ; diff --git a/mg/mglib01.cpp b/mg/mglib01.cpp index bf004f332..f73ea841b 100755 --- a/mg/mglib01.cpp +++ b/mg/mglib01.cpp @@ -796,7 +796,7 @@ void TCodice_livelli::pack_grpcode(TString & pc, const TString &codlev, const in } -TString TCodice_livelli::unpack_grpcode(const TString& pc, const int levnum) const +const TString& TCodice_livelli::unpack_grpcode(const TString& pc, const int levnum) const { CHECK(levnum<=max_levels() && levnum>0,"I codici livello partono da 1") ; int start=0;