Corretta gestione form per stamap ordini (mischiava Valore con Residuo)
git-svn-id: svn://10.65.10.50/branches/R_10_00@23007 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
30fb95bbaf
commit
b4795aed72
@ -309,6 +309,32 @@ void TStampa_ordini::add_tiporiga(TString& cond, const char tipo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void append_range_filter(TString& filter, int file, const char* field, long from, long to)
|
||||||
|
{
|
||||||
|
if (from > 0 || to > 0)
|
||||||
|
{
|
||||||
|
filter << "&&(BETWEEN(";
|
||||||
|
if (file > 0) filter << file << "->";
|
||||||
|
filter << field << ',' << from << ',' << to << "))";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void append_range_filter(TString& filter, int file, const char* field, const TDate& from, const TDate& to)
|
||||||
|
{
|
||||||
|
if (from.ok() || to.ok())
|
||||||
|
append_range_filter(filter, file, field, from.date2ansi(), to.date2ansi());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void append_range_filter(TString& filter, int file, const char* field, const TString& from, const TString& to)
|
||||||
|
{
|
||||||
|
if (from.full() || to.full())
|
||||||
|
{
|
||||||
|
filter << "&&(BETWEEN(";
|
||||||
|
if (file > 0) filter << file << "->";
|
||||||
|
filter << field << ",\"" << from << "\",\"" << to << "\"))";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TStampa_ordini::filter_for_number()
|
void TStampa_ordini::filter_for_number()
|
||||||
{
|
{
|
||||||
CHECK(_frm, "Form non valido");
|
CHECK(_frm, "Form non valido");
|
||||||
@ -383,6 +409,7 @@ void TStampa_ordini::filter_for_number()
|
|||||||
{
|
{
|
||||||
// In caso di dettaglio per righe non va settato il filtro per dataconsegnain quanto
|
// In caso di dettaglio per righe non va settato il filtro per dataconsegnain quanto
|
||||||
// già impostato sulla sottosezione (vedi sotto)
|
// già impostato sulla sottosezione (vedi sotto)
|
||||||
|
/*
|
||||||
if (_from_cons.ok())
|
if (_from_cons.ok())
|
||||||
{
|
{
|
||||||
filter_expr << "&&";
|
filter_expr << "&&";
|
||||||
@ -397,6 +424,8 @@ void TStampa_ordini::filter_for_number()
|
|||||||
(const char*)_to_cons.string(ANSI));
|
(const char*)_to_cons.string(ANSI));
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, 0, DOC_DATACONS, _from_cons, _to_cons);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter_expr.starts_with("&&"))
|
if (filter_expr.starts_with("&&"))
|
||||||
@ -459,6 +488,7 @@ void TStampa_ordini::filter_for_number()
|
|||||||
cond << s;
|
cond << s;
|
||||||
|
|
||||||
// Setta i range per la data di consegna
|
// Setta i range per la data di consegna
|
||||||
|
/*
|
||||||
if (_from_cons.ok())
|
if (_from_cons.ok())
|
||||||
{
|
{
|
||||||
if (cond.not_empty())
|
if (cond.not_empty())
|
||||||
@ -475,8 +505,11 @@ void TStampa_ordini::filter_for_number()
|
|||||||
LF_RIGHEDOC, (const char*)_to_cons.string(ANSI));
|
LF_RIGHEDOC, (const char*)_to_cons.string(ANSI));
|
||||||
cond << s;
|
cond << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(cond, LF_RIGHEDOC, RDOC_DATACONS, _from_cons, _to_cons);
|
||||||
|
|
||||||
// Setta i range per il codice magazzino
|
// Setta i range per il codice magazzino
|
||||||
|
/*
|
||||||
if (_from_mag.not_empty())
|
if (_from_mag.not_empty())
|
||||||
{
|
{
|
||||||
if (cond.not_empty())
|
if (cond.not_empty())
|
||||||
@ -493,8 +526,11 @@ void TStampa_ordini::filter_for_number()
|
|||||||
LF_RIGHEDOC, (const char*)_to_mag);
|
LF_RIGHEDOC, (const char*)_to_mag);
|
||||||
cond << s;
|
cond << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(cond, LF_RIGHEDOC, RDOC_CODMAG, _from_mag, _to_mag);
|
||||||
|
|
||||||
// Setta i range per il codice articolo
|
// Setta i range per il codice articolo
|
||||||
|
/*
|
||||||
if (_from_art.not_empty())
|
if (_from_art.not_empty())
|
||||||
{
|
{
|
||||||
if (cond.not_empty())
|
if (cond.not_empty())
|
||||||
@ -511,6 +547,8 @@ void TStampa_ordini::filter_for_number()
|
|||||||
LF_RIGHEDOC, (const char*)_to_art);
|
LF_RIGHEDOC, (const char*)_to_art);
|
||||||
cond << s;
|
cond << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(cond, LF_RIGHEDOC, RDOC_CODART, _from_art, _to_art);
|
||||||
|
|
||||||
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
||||||
cond << s;
|
cond << s;
|
||||||
@ -686,6 +724,7 @@ void TStampa_ordini::filter_for_clifo_agent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Filtro sulla data ordine...
|
// Filtro sulla data ordine...
|
||||||
|
/*
|
||||||
if (_from_date.ok())
|
if (_from_date.ok())
|
||||||
{
|
{
|
||||||
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
||||||
@ -698,8 +737,11 @@ void TStampa_ordini::filter_for_clifo_agent()
|
|||||||
(const char*)_to_date.string(ANSI));
|
(const char*)_to_date.string(ANSI));
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, LF_DOC, DOC_DATADOC, _from_date, _to_date);
|
||||||
|
|
||||||
// Filtro sulla data consegna...
|
// Filtro sulla data consegna...
|
||||||
|
/*
|
||||||
if (_from_cons.ok())
|
if (_from_cons.ok())
|
||||||
{
|
{
|
||||||
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
||||||
@ -712,10 +754,13 @@ void TStampa_ordini::filter_for_clifo_agent()
|
|||||||
(const char*)_to_cons.string(ANSI));
|
(const char*)_to_cons.string(ANSI));
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, 0, DOC_DATACONS, _from_cons, _to_cons);
|
||||||
|
|
||||||
if (_detail_rows)
|
if (_detail_rows)
|
||||||
{
|
{
|
||||||
// Setta i range per il codice articolo
|
// Setta i range per il codice articolo
|
||||||
|
/*
|
||||||
if (_from_art.full())
|
if (_from_art.full())
|
||||||
{
|
{
|
||||||
s.format("&&(%d->CODART>=\"%s\")",
|
s.format("&&(%d->CODART>=\"%s\")",
|
||||||
@ -729,6 +774,9 @@ void TStampa_ordini::filter_for_clifo_agent()
|
|||||||
LF_RIGHEDOC, (const char*)_to_art);
|
LF_RIGHEDOC, (const char*)_to_art);
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, LF_RIGHEDOC, RDOC_CODART, _from_art, _to_art);
|
||||||
|
|
||||||
// Setta i range per i livelli di giacenza (da 1 a 4)
|
// Setta i range per i livelli di giacenza (da 1 a 4)
|
||||||
if (_detail_level > 0)
|
if (_detail_level > 0)
|
||||||
for (int lev=1, index=0; lev <= _detail_level; lev++)
|
for (int lev=1, index=0; lev <= _detail_level; lev++)
|
||||||
@ -999,18 +1047,22 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
|
|
||||||
// Filtro su Cli/Fo
|
// Filtro su Cli/Fo
|
||||||
|
/*
|
||||||
if (_from_cf > 0L)
|
if (_from_cf > 0L)
|
||||||
{
|
{
|
||||||
s.format("&&(STR(NUM(%d->CODCF)>=%ld))", LF_DOC, _from_cf);
|
s.format("&&(STR(NUM(%d->CODCF)>=%ld))", LF_DOC, _from_cf);
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_to_cf > 0L)
|
if (_to_cf > 0L)
|
||||||
{
|
{
|
||||||
s.format("&&(STR(NUM(%d->CODCF)<=%ld))", LF_DOC, _to_cf);
|
s.format("&&(STR(NUM(%d->CODCF)<=%ld))", LF_DOC, _to_cf);
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, LF_DOC, DOC_CODCF, _from_cf, _to_cf);
|
||||||
|
|
||||||
// Filtro sulla data ordine...
|
// Filtro sulla data ordine...
|
||||||
|
/*
|
||||||
if (_from_date.ok())
|
if (_from_date.ok())
|
||||||
{
|
{
|
||||||
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
||||||
@ -1023,8 +1075,11 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
(const char*)_to_date.string(ANSI));
|
(const char*)_to_date.string(ANSI));
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, LF_DOC, DOC_DATADOC, _from_date, _to_date);
|
||||||
|
|
||||||
// Filtro sulla data consegna...
|
// Filtro sulla data consegna...
|
||||||
|
/*
|
||||||
if (_from_cons.ok())
|
if (_from_cons.ok())
|
||||||
{
|
{
|
||||||
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
||||||
@ -1037,6 +1092,8 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
(const char*)_to_cons.string(ANSI));
|
(const char*)_to_cons.string(ANSI));
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, 0, DOC_DATACONS, _from_cons, _to_cons);
|
||||||
|
|
||||||
// Setta i range per i livelli di giacenza (da 1 a 4)
|
// Setta i range per i livelli di giacenza (da 1 a 4)
|
||||||
if (_detail_level > 0)
|
if (_detail_level > 0)
|
||||||
@ -1062,6 +1119,7 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Setta i range per il codice magazzino (deposito incluso)
|
// Setta i range per il codice magazzino (deposito incluso)
|
||||||
|
/*
|
||||||
if (_from_mag.not_empty())
|
if (_from_mag.not_empty())
|
||||||
{
|
{
|
||||||
s.format("&&(%d->CODMAG>=\"%s\")",
|
s.format("&&(%d->CODMAG>=\"%s\")",
|
||||||
@ -1074,6 +1132,8 @@ void TStampa_ordini::filter_for_articolo()
|
|||||||
LF_RIGHEDOC, (const char*)_to_mag);
|
LF_RIGHEDOC, (const char*)_to_mag);
|
||||||
filter_expr << s;
|
filter_expr << s;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
append_range_filter(filter_expr, LF_RIGHEDOC, RDOC_CODMAG, _from_mag, _to_mag);
|
||||||
|
|
||||||
if (_TEA_rord > ' ')
|
if (_TEA_rord > ' ')
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,8 @@ BEGIN
|
|||||||
SPECIAL STRINGA FINCATURA "XX" "Fincatura sinistra e destra"
|
SPECIAL STRINGA FINCATURA "XX" "Fincatura sinistra e destra"
|
||||||
KEY "Codice Valuta"
|
KEY "Codice Valuta"
|
||||||
PROMPT 7 1 ""
|
PROMPT 7 1 ""
|
||||||
FIELD CODVAL
|
//FIELD CODVAL
|
||||||
|
MESSAGE _ORDINE,CODVAL
|
||||||
END
|
END
|
||||||
|
|
||||||
DATA BODY_COL_DATACONS 10
|
DATA BODY_COL_DATACONS 10
|
||||||
|
@ -338,7 +338,7 @@ void TStampa_dettaglio_articoli::main_loop()
|
|||||||
int or1200(int argc, char** argv)
|
int or1200(int argc, char** argv)
|
||||||
{
|
{
|
||||||
TStampa_dettaglio_articoli a;
|
TStampa_dettaglio_articoli a;
|
||||||
a.run(argc,argv,TR("Stampa disponibilita' articoli"));
|
a.run(argc,argv,TR("Stampa disponibilità articoli"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@ BEGIN
|
|||||||
MESSAGE _PAGENO
|
MESSAGE _PAGENO
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMERO 4 40
|
STRINGA 4 40
|
||||||
BEGIN
|
BEGIN
|
||||||
KEY "Intestazione stampa"
|
KEY "Intestazione stampa"
|
||||||
PROMPT 60 2 "Stampa dettaglio disponibilita' articoli"
|
PROMPT 60 2 "Stampa dettaglio disponibilità articoli"
|
||||||
END
|
END
|
||||||
|
|
||||||
END //HEADER
|
END //HEADER
|
||||||
|
@ -4,7 +4,7 @@ TOOLBAR "topbar" 0 0 0 2
|
|||||||
#include <printbar.h>
|
#include <printbar.h>
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Disponibilita' articoli" 0 0 0 0
|
PAGE "Disponibilità articoli" 0 0 0 0
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 41 7
|
GROUPBOX DLG_NULL 41 7
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -173,8 +173,15 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
|
|
||||||
cf.set(qt.string());
|
cf.set(qt.string());
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
if (action == "CODVAL") // Comandi per stampa riepilogo per valuta
|
||||||
|
{
|
||||||
|
const TString& codval = doc.get(DOC_CODVAL);
|
||||||
|
if (is_firm_value(codval))
|
||||||
|
cf.set("");
|
||||||
else
|
else
|
||||||
|
cf.set(codval);
|
||||||
|
} else
|
||||||
if (action == "VALTABLE") // Comandi per stampa riepilogo per valuta
|
if (action == "VALTABLE") // Comandi per stampa riepilogo per valuta
|
||||||
{
|
{
|
||||||
TString subcommand(s.get(2));
|
TString subcommand(s.get(2));
|
||||||
@ -189,7 +196,9 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int valute = _totvaluta.items();
|
const int valute = _totvaluta.items();
|
||||||
TString codval(doc.get(DOC_CODVAL));
|
TString4 codval = doc.get(DOC_CODVAL);
|
||||||
|
if (is_firm_value(codval)) codval.cut(0);
|
||||||
|
|
||||||
const bool is_key = _totvaluta.is_key(codval);
|
const bool is_key = _totvaluta.is_key(codval);
|
||||||
const bool is_new = !is_key && valute < 4;
|
const bool is_new = !is_key && valute < 4;
|
||||||
|
|
||||||
@ -402,7 +411,7 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
} else
|
} else
|
||||||
if (action == "VALRES")
|
if (action == "VALRES")
|
||||||
{
|
{
|
||||||
cf.set(rdoc.valore(true, false, AUTO_DECIMALS).string());
|
cf.set(rdoc.valore(false, false, AUTO_DECIMALS).string()); // true -> false totale -> residuo 22-10-2014
|
||||||
} else
|
} else
|
||||||
if (action == "GIACENZA")
|
if (action == "GIACENZA")
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,6 @@ Picture = <or00>
|
|||||||
Module = 33
|
Module = 33
|
||||||
Flags = ""
|
Flags = ""
|
||||||
Item_01 = "Stampa ordini", "or1.exe -0","F"
|
Item_01 = "Stampa ordini", "or1.exe -0","F"
|
||||||
Item_02 = "Stampa disponibilita' articoli", "or1.exe -1","F"
|
Item_02 = "Stampa disponibilitŕ articoli", "or1.exe -1","F"
|
||||||
Item_03 = "Generazione ordini a fornitore", "or1.exe -3","F"
|
Item_03 = "Generazione ordini a fornitore", "or1.exe -3","F"
|
||||||
Item_04 = "Scarico e ripristino documenti", "ve5.exe -0","F"
|
Item_04 = "Scarico e ripristino documenti", "ve5.exe -0","F"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user