Patch level : 12.0 472

Files correlati     : mr0
Commento            : 
- Aggiornata maschera e programma Consultivazione, aggiunti filtri per togliere parte dei risultati ottenuti che servono solo a scopi di controllo
- Sistemato errore loop infinito durante la ricerda di ordini clienti già chiusi

git-svn-id: svn://10.65.10.50/branches/R_10_00@24146 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-10-20 13:28:19 +00:00
parent feecc64d95
commit 635a076f2b
3 changed files with 67 additions and 16 deletions

View File

@ -13,17 +13,35 @@
class TConsuntivazione_mask : public TAutomask class TConsuntivazione_mask : public TAutomask
{ {
protected: protected:
void reload_sheet();
void load_sheet(); void load_sheet();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public: public:
TConsuntivazione_mask() : TAutomask("velib04e") { } TConsuntivazione_mask() : TAutomask("velib04e") {}
virtual ~TConsuntivazione_mask() { } virtual ~TConsuntivazione_mask() { }
}; };
TConsuntivazione_mask& msk()
{
static TConsuntivazione_mask* msk = NULL;
if (msk == NULL)
msk = new TConsuntivazione_mask();
return *msk;
}
static bool scan_rilprod(const TRelation& rel, void* pJolly) static bool scan_rilprod(const TRelation& rel, void* pJolly)
{ {
const TRectype& rec = rel.curr(); const TRectype& rec = rel.curr();
// Prima di fare qualsiasi cosa controllo che la riga vada messa
// Abilito le righe aperte
if(!msk().get_bool(B_RIGHE_APERTE) && !rec.get_bool("CHIUSO"))
return true;
// Abilito le righe chiuse con QTA <= 0
if(!msk().get_bool(B_RIGHE_CHIU_QTA) && rec.get_bool("CHIUSO") && rec.get_real(RDOC_QTA) <= ZERO)
return true;
TSheet_field& sheet = *(TSheet_field*)pJolly; TSheet_field& sheet = *(TSheet_field*)pJolly;
TToken_string& row = sheet.row(-1); TToken_string& row = sheet.row(-1);
TLocalisamfile righe(LF_RRILPROD); TLocalisamfile righe(LF_RRILPROD);
@ -57,6 +75,20 @@ static bool scan_rilprod(const TRelation& rel, void* pJolly)
return true; return true;
} }
void TConsuntivazione_mask::reload_sheet()
{
load_sheet();
TSheet_field& s = sfield(F_SHEET);
FOR_EACH_SHEET_ROW(s, n, row)
{
const real r(row->get(s.cid2index(S_QTA)));
if (r <= ZERO)
s.disable_row(n);
}
s.force_update();
}
void TConsuntivazione_mask::load_sheet() void TConsuntivazione_mask::load_sheet()
{ {
TRelation rel(LF_RILPROD); TRelation rel(LF_RILPROD);
@ -73,19 +105,13 @@ bool TConsuntivazione_mask::on_field_event(TOperable_field& o, TField_event e, l
{ {
switch (o.dlg()) switch (o.dlg())
{ {
case DLG_RECALC:
if(e == fe_button)
reload_sheet();
case F_SHEET: case F_SHEET:
if (e == fe_init) if (e == fe_init)
{ {
load_sheet(); reload_sheet();
TSheet_field& s = sfield(F_SHEET);
FOR_EACH_SHEET_ROW(s, n, row)
{
const real r(row->get(s.cid2index(S_QTA)));
if (r <= ZERO)
s.disable_row(n);
}
s.force_update();
} }
break; break;
case DLG_TUTTE: case DLG_TUTTE:
@ -140,7 +166,7 @@ bool TConsuntivazione_produzione::ref2doc(char & provv, int & anno, TString8 & c
f.setkey(4); f.setkey(4);
ok = false; ok = false;
for (int err = f.read(_isequal); !ok && rec == cmp && err == NOERR; f.next()) for (int err = f.read(_isequal); !ok && rec == cmp && err == NOERR; err = f.next())
{ {
if (rec.get(RDOC_CODNUM) == ordprod) if (rec.get(RDOC_CODNUM) == ordprod)
if(rec.get(RDOC_CODARTMAG) == codart) if(rec.get(RDOC_CODARTMAG) == codart)
@ -160,12 +186,12 @@ bool TConsuntivazione_produzione::ref2doc(char & provv, int & anno, TString8 & c
bool TConsuntivazione_produzione::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out, bool TConsuntivazione_produzione::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
const TDate& data_elab, bool interattivo) const TDate& data_elab, bool interattivo)
{ {
TConsuntivazione_mask msk; //TConsuntivazione_mask msk;
TLog_report log("Consuntivazione produzione"); TLog_report log("Consuntivazione produzione");
bool done = false; bool done = false;
if (msk.run() == K_ENTER) if (msk().run() == K_ENTER)
{ {
TSheet_field& sheet = msk.sfield(F_SHEET); TSheet_field& sheet = msk().sfield(F_SHEET);
TLocalisamfile rilevazioni(LF_RILPROD); TLocalisamfile rilevazioni(LF_RILPROD);
TRectype& ril = rilevazioni.curr(); TRectype& ril = rilevazioni.curr();
const TString8 codnum = codice_numerazione_finale(); const TString8 codnum = codice_numerazione_finale();

View File

@ -19,4 +19,6 @@
#define S_NDOC 113 #define S_NDOC 113
#define S_NRIGA 114 #define S_NRIGA 114
#define DLG_TUTTE 201 #define DLG_TUTTE 201
#define B_RIGHE_APERTE 202
#define B_RIGHE_CHIU_QTA 203

View File

@ -8,9 +8,16 @@ BEGIN
PICTURE BMP_ELABORA PICTURE BMP_ELABORA
END END
BUTTON DLG_RECALC 10 2
BEGIN
PROMPT -13 -11 "Ricarica"
PICTURE BMP_RECALC
END
BUTTON DLG_TUTTE 10 2 BUTTON DLG_TUTTE 10 2
BEGIN BEGIN
PROMPT -23 -11 "~Tutte" PROMPT -23 -11 "~Tutte"
PICTURE BMP_SELECT
END END
#include <helpbar.h> #include <helpbar.h>
@ -19,6 +26,22 @@ ENDPAGE
PAGE "Consuntivazione produzione" 0 0 0 0 PAGE "Consuntivazione produzione" 0 0 0 0
BOOLEAN B_RIGHE_APERTE
BEGIN
PROMPT 0 0 "Visualizza righe Aperte"
END
BOOLEAN B_RIGHE_CHIU_QTA
BEGIN
PROMPT 27 0 "Visualizza righe chiuse con Quantità > 0"
END
STRING DLG_PROFILE 50
BEGIN
PROMPT -1 -1 "Profilo "
PSELECT
END
SPREADSHEET F_SHEET SPREADSHEET F_SHEET
BEGIN BEGIN
PROMPT 0 1 "" PROMPT 0 1 ""