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()
|
||||
{
|
||||
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
|
||||
// già impostato sulla sottosezione (vedi sotto)
|
||||
/*
|
||||
if (_from_cons.ok())
|
||||
{
|
||||
filter_expr << "&&";
|
||||
@ -397,6 +424,8 @@ void TStampa_ordini::filter_for_number()
|
||||
(const char*)_to_cons.string(ANSI));
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, 0, DOC_DATACONS, _from_cons, _to_cons);
|
||||
}
|
||||
|
||||
if (filter_expr.starts_with("&&"))
|
||||
@ -459,6 +488,7 @@ void TStampa_ordini::filter_for_number()
|
||||
cond << s;
|
||||
|
||||
// Setta i range per la data di consegna
|
||||
/*
|
||||
if (_from_cons.ok())
|
||||
{
|
||||
if (cond.not_empty())
|
||||
@ -475,8 +505,11 @@ void TStampa_ordini::filter_for_number()
|
||||
LF_RIGHEDOC, (const char*)_to_cons.string(ANSI));
|
||||
cond << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(cond, LF_RIGHEDOC, RDOC_DATACONS, _from_cons, _to_cons);
|
||||
|
||||
// Setta i range per il codice magazzino
|
||||
/*
|
||||
if (_from_mag.not_empty())
|
||||
{
|
||||
if (cond.not_empty())
|
||||
@ -493,8 +526,11 @@ void TStampa_ordini::filter_for_number()
|
||||
LF_RIGHEDOC, (const char*)_to_mag);
|
||||
cond << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(cond, LF_RIGHEDOC, RDOC_CODMAG, _from_mag, _to_mag);
|
||||
|
||||
// Setta i range per il codice articolo
|
||||
/*
|
||||
if (_from_art.not_empty())
|
||||
{
|
||||
if (cond.not_empty())
|
||||
@ -511,6 +547,8 @@ void TStampa_ordini::filter_for_number()
|
||||
LF_RIGHEDOC, (const char*)_to_art);
|
||||
cond << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(cond, LF_RIGHEDOC, RDOC_CODART, _from_art, _to_art);
|
||||
|
||||
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
||||
cond << s;
|
||||
@ -686,6 +724,7 @@ void TStampa_ordini::filter_for_clifo_agent()
|
||||
}
|
||||
|
||||
// Filtro sulla data ordine...
|
||||
/*
|
||||
if (_from_date.ok())
|
||||
{
|
||||
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));
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, LF_DOC, DOC_DATADOC, _from_date, _to_date);
|
||||
|
||||
// Filtro sulla data consegna...
|
||||
/*
|
||||
if (_from_cons.ok())
|
||||
{
|
||||
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
||||
@ -712,10 +754,13 @@ void TStampa_ordini::filter_for_clifo_agent()
|
||||
(const char*)_to_cons.string(ANSI));
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, 0, DOC_DATACONS, _from_cons, _to_cons);
|
||||
|
||||
if (_detail_rows)
|
||||
{
|
||||
// Setta i range per il codice articolo
|
||||
/*
|
||||
if (_from_art.full())
|
||||
{
|
||||
s.format("&&(%d->CODART>=\"%s\")",
|
||||
@ -729,6 +774,9 @@ void TStampa_ordini::filter_for_clifo_agent()
|
||||
LF_RIGHEDOC, (const char*)_to_art);
|
||||
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)
|
||||
if (_detail_level > 0)
|
||||
for (int lev=1, index=0; lev <= _detail_level; lev++)
|
||||
@ -999,18 +1047,22 @@ void TStampa_ordini::filter_for_articolo()
|
||||
filter_expr << s;
|
||||
|
||||
// Filtro su Cli/Fo
|
||||
/*
|
||||
if (_from_cf > 0L)
|
||||
{
|
||||
s.format("&&(STR(NUM(%d->CODCF)>=%ld))", LF_DOC, _from_cf);
|
||||
filter_expr << s;
|
||||
}
|
||||
|
||||
if (_to_cf > 0L)
|
||||
{
|
||||
s.format("&&(STR(NUM(%d->CODCF)<=%ld))", LF_DOC, _to_cf);
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, LF_DOC, DOC_CODCF, _from_cf, _to_cf);
|
||||
|
||||
// Filtro sulla data ordine...
|
||||
/*
|
||||
if (_from_date.ok())
|
||||
{
|
||||
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
||||
@ -1023,8 +1075,11 @@ void TStampa_ordini::filter_for_articolo()
|
||||
(const char*)_to_date.string(ANSI));
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, LF_DOC, DOC_DATADOC, _from_date, _to_date);
|
||||
|
||||
// Filtro sulla data consegna...
|
||||
/*
|
||||
if (_from_cons.ok())
|
||||
{
|
||||
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
||||
@ -1037,6 +1092,8 @@ void TStampa_ordini::filter_for_articolo()
|
||||
(const char*)_to_cons.string(ANSI));
|
||||
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)
|
||||
if (_detail_level > 0)
|
||||
@ -1062,6 +1119,7 @@ void TStampa_ordini::filter_for_articolo()
|
||||
}
|
||||
}
|
||||
// Setta i range per il codice magazzino (deposito incluso)
|
||||
/*
|
||||
if (_from_mag.not_empty())
|
||||
{
|
||||
s.format("&&(%d->CODMAG>=\"%s\")",
|
||||
@ -1074,6 +1132,8 @@ void TStampa_ordini::filter_for_articolo()
|
||||
LF_RIGHEDOC, (const char*)_to_mag);
|
||||
filter_expr << s;
|
||||
}
|
||||
*/
|
||||
append_range_filter(filter_expr, LF_RIGHEDOC, RDOC_CODMAG, _from_mag, _to_mag);
|
||||
|
||||
if (_TEA_rord > ' ')
|
||||
{
|
||||
|
@ -119,7 +119,8 @@ BEGIN
|
||||
SPECIAL STRINGA FINCATURA "XX" "Fincatura sinistra e destra"
|
||||
KEY "Codice Valuta"
|
||||
PROMPT 7 1 ""
|
||||
FIELD CODVAL
|
||||
//FIELD CODVAL
|
||||
MESSAGE _ORDINE,CODVAL
|
||||
END
|
||||
|
||||
DATA BODY_COL_DATACONS 10
|
||||
|
@ -338,7 +338,7 @@ void TStampa_dettaglio_articoli::main_loop()
|
||||
int or1200(int argc, char** argv)
|
||||
{
|
||||
TStampa_dettaglio_articoli a;
|
||||
a.run(argc,argv,TR("Stampa disponibilita' articoli"));
|
||||
a.run(argc,argv,TR("Stampa disponibilità articoli"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ BEGIN
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
NUMERO 4 40
|
||||
STRINGA 4 40
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 60 2 "Stampa dettaglio disponibilita' articoli"
|
||||
PROMPT 60 2 "Stampa dettaglio disponibilità articoli"
|
||||
END
|
||||
|
||||
END //HEADER
|
||||
|
@ -4,7 +4,7 @@ TOOLBAR "topbar" 0 0 0 2
|
||||
#include <printbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Disponibilita' articoli" 0 0 0 0
|
||||
PAGE "Disponibilità articoli" 0 0 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 41 7
|
||||
BEGIN
|
||||
|
@ -173,8 +173,15 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
||||
|
||||
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
|
||||
cf.set(codval);
|
||||
} else
|
||||
if (action == "VALTABLE") // Comandi per stampa riepilogo per valuta
|
||||
{
|
||||
TString subcommand(s.get(2));
|
||||
@ -189,7 +196,9 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
||||
else
|
||||
{
|
||||
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_new = !is_key && valute < 4;
|
||||
|
||||
@ -402,7 +411,7 @@ bool TOrdine_form::validate(TForm_item &cf, TToken_string &s)
|
||||
} else
|
||||
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
|
||||
if (action == "GIACENZA")
|
||||
{
|
||||
|
@ -4,6 +4,6 @@ Picture = <or00>
|
||||
Module = 33
|
||||
Flags = ""
|
||||
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_04 = "Scarico e ripristino documenti", "ve5.exe -0","F"
|
||||
|
Loading…
x
Reference in New Issue
Block a user