Patch level : at
Files correlati : Ricompilazione Demo : [ ] Commento : correzione cap: possibilitá di farlo solo per le loc. postali e possibilitá di fare solo la stampa senza correzione su archivio git-svn-id: svn://10.65.10.50/trunk@9351 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
349d075753
commit
0d72e4263c
@ -19,6 +19,9 @@ class TAggiornaCAP : public TPrintapp
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
int _cur;
|
||||
bool _scrivi;
|
||||
|
||||
static bool filter_func_cap(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -33,52 +36,59 @@ public:
|
||||
|
||||
HIDDEN inline TAggiornaCAP& app() { return (TAggiornaCAP&) main_app(); }
|
||||
|
||||
bool TAggiornaCAP::filter_func_cap(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = FALSE;
|
||||
TString16 cap;
|
||||
TString16 loc;
|
||||
TString16 capcom;
|
||||
TRectype recsog = rel->lfile().curr();
|
||||
cap = recsog.get(SOG_DOM_CAP);
|
||||
loc = recsog.get(SOG_DOM_CODLOC);
|
||||
if (loc.empty())
|
||||
capcom = rel->lfile(-ALIAS_COMD).get("CAPCOM");
|
||||
else
|
||||
capcom = rel->lfile(-ALIAS_LCPD).get("S6");
|
||||
if (capcom.not_empty() && cap != capcom)
|
||||
filtrato = TRUE;
|
||||
|
||||
cap = recsog.get(SOG_RES_CAP);
|
||||
loc = recsog.get(SOG_RES_CODLOC);
|
||||
if (loc.empty())
|
||||
capcom = rel->lfile(-ALIAS_COMR).get("CAPCOM");
|
||||
else
|
||||
capcom = rel->lfile(-ALIAS_LCPR).get("S6");
|
||||
if (capcom.not_empty() && cap != capcom)
|
||||
filtrato = TRUE;
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TAggiornaCAP::preprocess_page(int file, int counter)
|
||||
{
|
||||
bool rew = FALSE;
|
||||
TString16 cap;
|
||||
TString16 loc;
|
||||
TString16 com;
|
||||
TString16 capcom;
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
cap = recsog.get(SOG_DOM_CAP);
|
||||
com = recsog.get(SOG_DOM_CODCOM);
|
||||
loc = recsog.get(SOG_DOM_CODLOC);
|
||||
if (loc.empty())
|
||||
capcom = current_cursor()->file(-ALIAS_COMD).get("CAPCOM");
|
||||
else
|
||||
capcom = current_cursor()->file(-ALIAS_LCPD).get("S6");
|
||||
if (cap.empty() && com.not_empty())
|
||||
{
|
||||
if (capcom.not_empty() && (cap != capcom))
|
||||
recsog.put(SOG_DOM_CAP, capcom);
|
||||
rew = TRUE;
|
||||
}
|
||||
if (cap.not_empty() && com.not_empty() && (cap != capcom))
|
||||
{
|
||||
recsog.put(SOG_DOM_CAP, capcom);
|
||||
rew = TRUE;
|
||||
}
|
||||
|
||||
cap = recsog.get(SOG_RES_CAP);
|
||||
com = recsog.get(SOG_RES_CODCOM);
|
||||
loc = recsog.get(SOG_RES_CODLOC);
|
||||
if (loc.empty())
|
||||
capcom = current_cursor()->file(-ALIAS_COMR).get("CAPCOM");
|
||||
else
|
||||
capcom = current_cursor()->file(-ALIAS_LCPR).get("S6");
|
||||
if (cap.empty() && com.not_empty())
|
||||
{
|
||||
if (capcom.not_empty() && (cap != capcom))
|
||||
recsog.put(SOG_RES_CAP, capcom);
|
||||
rew = TRUE;
|
||||
}
|
||||
if (cap.not_empty() && com.not_empty() && (cap != capcom))
|
||||
{
|
||||
recsog.put(SOG_RES_CAP, capcom);
|
||||
rew = TRUE;
|
||||
}
|
||||
if (rew)
|
||||
if (_scrivi)
|
||||
current_cursor()->file().rewrite();
|
||||
return rew;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TAggiornaCAP::set_page(int file, int cnt)
|
||||
@ -89,6 +99,8 @@ void TAggiornaCAP::set_page(int file, int cnt)
|
||||
set_row(1,"@62g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
|
||||
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_DOM_CAP));
|
||||
set_row(1,"@74g@S", FLD(LF_SOGGETTI,SOG_RES_CAP));
|
||||
set_row(1,"@81g@ld", FLD(LF_SOGGETTI,SOG_DATAULTAGG));
|
||||
set_row(1,"@92g@S", FLD(LF_SOGGETTI,SOG_UTENULTAGG));
|
||||
}
|
||||
|
||||
bool TAggiornaCAP::set_print(int)
|
||||
@ -96,9 +108,13 @@ bool TAggiornaCAP::set_print(int)
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
{
|
||||
_scrivi = !_msk->get_bool(102);
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
if (_msk->get_bool(101))
|
||||
current_cursor()->setfilter("(90->DOM_CODLOC != \"\")", TRUE);
|
||||
current_cursor()->set_filterfunction (filter_func_cap, FALSE);
|
||||
reset_print();
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,5 +1,15 @@
|
||||
PAGE "Aggiornamento CAP" -1 -1 78 20
|
||||
|
||||
BOOLEAN 101
|
||||
BEGIN
|
||||
PROMPT 2 2 "Solo localita' postali"
|
||||
END
|
||||
|
||||
BOOLEAN 102
|
||||
BEGIN
|
||||
PROMPT 2 4 "Solo stampa senza correzione su archivio"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user