Patch level : 12.00 1366
Files correlati : sc2.exe sc2100a.msk sc2100b.msk sc2200a.msk sc2300a.msk sc2400a.msk sc2400b.msk sc2600a.msk Commento: Invio etratti conti e solleciti via mail
This commit is contained in:
parent
78d79f1d13
commit
df24f75940
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,5 @@
|
|||||||
#define F_TO_AGENT 123
|
#define F_TO_AGENT 123
|
||||||
#define F_TO_AGENT_D 124
|
#define F_TO_AGENT_D 124
|
||||||
|
|
||||||
// basename of profile
|
|
||||||
#define BASE_EC_PROFILE "PEC"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,14 +3,32 @@
|
|||||||
|
|
||||||
TOOLBAR "" 0 0 0 2
|
TOOLBAR "" 0 0 0 2
|
||||||
|
|
||||||
BUTTON DLG_EDIT 10 2
|
BUTTON DLG_PRINT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "~Esporta"
|
PROMPT 1 4 "~Stampa"
|
||||||
PICTURE TOOL_EXCEL
|
PICTURE TOOL_PRINT
|
||||||
MESSAGE EXIT,69
|
|
||||||
END
|
END
|
||||||
|
|
||||||
#include <printbar.h>
|
BUTTON DLG_SETPRINT 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "~Imposta"
|
||||||
|
PICTURE TOOL_SETPRINT
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_EMAIL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 4 "Mail"
|
||||||
|
PICTURE TOOL_EMAIL
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
BUTTON DLG_EDIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 4 "~Esporta"
|
||||||
|
PICTURE TOOL_EXCEL
|
||||||
|
END
|
||||||
|
|
||||||
|
#include <helpbar.h>
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
@ -76,7 +94,6 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
DATE F_DATALIMOP
|
DATE F_DATALIMOP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Data limite operazione "
|
PROMPT 2 4 "Data limite operazione "
|
||||||
@ -91,7 +108,6 @@ END
|
|||||||
DATE F_DATALIMSC
|
DATE F_DATALIMSC
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Data limite scaduto "
|
PROMPT 2 5 "Data limite scaduto "
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_GIORISCH 3
|
NUMBER F_GIORISCH 3
|
||||||
@ -160,7 +176,7 @@ BEGIN
|
|||||||
PROMPT 65 11 "A~zzera"
|
PROMPT 65 11 "A~zzera"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_NSEL 4
|
NUMBER SC_NSEL 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 52 12 "Selezionati "
|
PROMPT 52 12 "Selezionati "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
|
16
src/sc/sc2100b.h
Normal file
16
src/sc/sc2100b.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#define F_SHEET 201
|
||||||
|
#define F_FROMEMAIL 202
|
||||||
|
#define F_PASSWORD 203
|
||||||
|
#define F_CCEMAIL 204
|
||||||
|
#define F_CCNEMAIL 205
|
||||||
|
#define F_RECEIPT 206
|
||||||
|
#define F_MESSAGE 207
|
||||||
|
#define F_SUBJ 208
|
||||||
|
#define F_TESTEMAIL 209
|
||||||
|
#define F_SORT 210
|
||||||
|
|
||||||
|
#define S_SELECTED 101
|
||||||
|
#define S_EMAIL 102
|
||||||
|
#define S_CODCF 103
|
||||||
|
#define S_RAGSOC 104
|
||||||
|
|
135
src/sc/sc2100b.uml
Normal file
135
src/sc/sc2100b.uml
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
#include "sc2100b.h"
|
||||||
|
|
||||||
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_ALL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "~Tutti"
|
||||||
|
PICTURE TOOL_MULTISEL
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Invia"
|
||||||
|
PICTURE TOOL_EMAIL
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_PREVIEW 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 3 "~Anteprima"
|
||||||
|
PICTURE TOOL_PREVIEW
|
||||||
|
END
|
||||||
|
|
||||||
|
#include <helpbar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Invio Estratti conto" 0 2 0 0
|
||||||
|
|
||||||
|
LISTBOX F_SORT 1 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 0 "Ordinamento "
|
||||||
|
ITEM "1|Codice"
|
||||||
|
ITEM "2|Ragione sociale"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_FROMEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Email di invio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_PASSWORD 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Password "
|
||||||
|
FLAGS "*"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CCEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Conoscenza "
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_RECEIPT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 70 3 "Ricevuta"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CCNEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Conosc.nascosta "
|
||||||
|
END
|
||||||
|
|
||||||
|
ZOOM F_SUBJ 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Oggetto "
|
||||||
|
END
|
||||||
|
|
||||||
|
ZOOM F_MESSAGE 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Messaggio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_TESTEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Email prova "
|
||||||
|
FLAGS "H"
|
||||||
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_SHEET -1 -1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 9 ""
|
||||||
|
ITEM "@1"
|
||||||
|
ITEM "Email@50"
|
||||||
|
ITEM "Codice"
|
||||||
|
ITEM "Ragione Sociale@50"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "" -1 -1 80 7
|
||||||
|
|
||||||
|
BOOLEAN S_SELECTED
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Email "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_EMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Email "
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER S_CODCF 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Codice "
|
||||||
|
FLAG "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Ragione Sociale "
|
||||||
|
FLAG "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_DELREC 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
@ -1,54 +1,111 @@
|
|||||||
#include "sc2101.h"
|
#include <printer.h>
|
||||||
#include "sc2100a.h"
|
#include <progind.h>
|
||||||
|
|
||||||
bool TEC_mask::codprof_handler(TMask_field& f, KEY k)
|
#include "../pr/agenti.h"
|
||||||
{
|
|
||||||
if (!f.empty() && f.to_check(k))
|
|
||||||
{
|
|
||||||
TEdit_field & e = (TEdit_field &) f;
|
|
||||||
|
|
||||||
e.check_type(CHECK_REQUIRED);
|
|
||||||
|
|
||||||
const bool ok = e.check();
|
|
||||||
|
|
||||||
e.check_type(CHECK_NONE);
|
|
||||||
|
|
||||||
if (k == K_ENTER && !ok)
|
|
||||||
{
|
|
||||||
if (f.is_editable())
|
|
||||||
{
|
|
||||||
TEditable_field& ef = (TEditable_field&) f;
|
|
||||||
return f.error_box(ef.get_warning());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#include "sc2101.h"
|
||||||
bool TEC_mask::lingua_handler(TMask_field& f, KEY k)
|
#include "sc2100a.h"
|
||||||
{
|
#include "sc21pec.h"
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
bool TEC_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
TEdit_field& cod = f.mask().efield(F_CODPROF);
|
|
||||||
TCursor& cur = *(cod.browse()->cursor());
|
|
||||||
const TString& lin = f.get();
|
|
||||||
if (lin != cur.curr().get("CODPROF").mid(4))
|
|
||||||
cod.check(RUNNING_CHECK);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEC_mask::TEC_mask(const char* name) : TSelection_mask(name), _ditta(LF_NDITTE)
|
|
||||||
{
|
{
|
||||||
_ditta.add(LF_ANAG, "TIPOA==TIPOA|CODANAGR==CODANAGR");
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
case F_STAMPSALDO:
|
||||||
|
if (e == fe_init)
|
||||||
|
{
|
||||||
|
set(F_STAMPSALDO, true);
|
||||||
|
show(F_ULTIMOEC, _tiponumec == 'G');
|
||||||
|
set(F_ULTIMOEC, _lastnumec);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case F_CODPROF:
|
||||||
|
if (e == fe_close)
|
||||||
|
{
|
||||||
|
o.check_type(CHECK_REQUIRED);
|
||||||
|
|
||||||
|
const bool ok = o.check();
|
||||||
|
|
||||||
|
o.check_type(CHECK_NONE);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
return error_box(((TEditable_field &)o).get_warning());
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case F_LINPROF:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
TEdit_field& cod = efield(F_CODPROF);
|
||||||
|
TCursor& cur = *(cod.browse()->cursor());
|
||||||
|
const TString& lin = o.get();
|
||||||
|
|
||||||
|
if (lin != cur.curr().get("CODPROF").smid(4))
|
||||||
|
cod.check(RUNNING_CHECK);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case DLG_EDIT:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TFilename xls;
|
||||||
|
|
||||||
|
xls.temp("ec", "xls");
|
||||||
|
safe_delete(_form);
|
||||||
|
set_export();
|
||||||
|
|
||||||
|
TEC_form & f = (TEC_form &)form();
|
||||||
|
|
||||||
|
if (get_bool(F_GROUPAGENT))
|
||||||
|
print_agents();
|
||||||
|
else
|
||||||
|
print_selected();
|
||||||
|
f.recordset()->save_as(xls, fmt_html);
|
||||||
|
xvt_sys_goto_url(xls, "open");
|
||||||
|
show(F_ULTIMOEC, _tiponumec == 'G');
|
||||||
|
set(F_ULTIMOEC, _lastnumec);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case DLG_PRINT:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
update_checked();
|
||||||
|
safe_delete(_form);
|
||||||
|
set_export(false);
|
||||||
|
|
||||||
|
TForm_item& nec = form().find_field('H', odd_page, PEC_NUMPROG);
|
||||||
|
|
||||||
|
if (nec.enabled() && nec.shown())
|
||||||
|
{
|
||||||
|
nec.show(_tiponumec > ' ' && who() == "C");
|
||||||
|
_lastnumec = get_long(F_ULTIMOEC);
|
||||||
|
}
|
||||||
|
if (get_bool(F_GROUPAGENT))
|
||||||
|
print_agents();
|
||||||
|
else
|
||||||
|
print_selected();
|
||||||
|
show(F_ULTIMOEC, _tiponumec == 'G');
|
||||||
|
set(F_ULTIMOEC, _lastnumec);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TSelection_mask::on_field_event(o, e, jolly);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEC_mask::TEC_mask(const char* name) : TSelection_mask(name), _ditta(LF_NDITTE), _ec_mail("sc2100b"), _form(nullptr), _games(nullptr), _export(false)
|
||||||
|
{
|
||||||
|
_ditta.add(LF_ANAG, "TIPOA==TIPOA|CODANAGR==CODANAGR");
|
||||||
_ditta.add(LF_COMUNI, "COM==COMRF(COMRES)", 1, LF_ANAG, 101);
|
_ditta.add(LF_COMUNI, "COM==COMRF(COMRES)", 1, LF_ANAG, 101);
|
||||||
_ditta.add(LF_COMUNI, "COM==COMRES", 1, LF_ANAG, 102);
|
_ditta.add(LF_COMUNI, "COM==COMRES", 1, LF_ANAG, 102);
|
||||||
|
_tiponumec = ini_get_string(CONFIG_DITTA, "cg", "NumEC")[0];
|
||||||
set_handler(F_CODPROF, codprof_handler);
|
_lastnumec = ini_get_long(CONFIG_DITTA, "cg", "LastEC");
|
||||||
set_handler(F_LINPROF, lingua_handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEC_mask::~TEC_mask()
|
TEC_mask::~TEC_mask()
|
||||||
@ -72,26 +129,573 @@ void TEC_mask::start_run()
|
|||||||
on_firm_change();
|
on_firm_change();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TEC_mask::get_prof_base() const
|
TESSL_form & TEC_mask::form()
|
||||||
{
|
{
|
||||||
return BASE_EC_PROFILE;
|
if (_form == nullptr)
|
||||||
}
|
_form = new TEC_form(*this, ini_get_bool(CONFIG_DITTA, "cg", "GesVal"));
|
||||||
|
return *_form;
|
||||||
const TString& TEC_mask::get_prof_code() const
|
|
||||||
{
|
|
||||||
return get(F_CODPROF);
|
|
||||||
}
|
|
||||||
|
|
||||||
const TString& TEC_mask::get_prof_lang() const
|
|
||||||
{
|
|
||||||
return get(F_LINPROF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TEC_mask::get_prof_name() const
|
|
||||||
{
|
bool TEC_mask::print_selected()
|
||||||
TString& tmp=(TString&)_tmp;
|
{
|
||||||
tmp = get_prof_code();
|
TCursor_sheet& s = cur_sheet();
|
||||||
tmp << get_prof_lang();
|
TCursor& c = *s.cursor(); // Il cursore del form coincide con quello dello sheet
|
||||||
return _tmp;
|
|
||||||
|
_form->set_agente(EMPTY_STRING); // Nascondi agente
|
||||||
|
|
||||||
|
if (s.checked() == 0L)
|
||||||
|
s.check_all();
|
||||||
|
const long print_all = s.checked() == s.items(); // Se non ho selezionato nulla allora li stampo tutti
|
||||||
|
long analfabeti = 0; // Persone non stampate in quanto aventi lingua errata
|
||||||
|
const bool printing = _form->printing();
|
||||||
|
const long items = c.items();
|
||||||
|
|
||||||
|
{
|
||||||
|
TProgress_monitor pi(items, TR("Calcolo estratto conto"));
|
||||||
|
const long last = s.last_one();
|
||||||
|
|
||||||
|
if (printing)
|
||||||
|
printer().open();
|
||||||
|
|
||||||
|
_games = nullptr;
|
||||||
|
for (long i = s.first_one(); pi.addstatus() && i <= last; i++)
|
||||||
|
{
|
||||||
|
if (s.checked(i))
|
||||||
|
{
|
||||||
|
c = i; // Muove il cursore alla posizione corrente
|
||||||
|
if (print_one(who(), c.curr().get_long(CLI_CODCF)) < 0)
|
||||||
|
analfabeti++;
|
||||||
|
}
|
||||||
|
if (printing && printer().frozen())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (printing)
|
||||||
|
{
|
||||||
|
printer().close();
|
||||||
|
if (_tiponumec > ' ' && who() == "C")
|
||||||
|
save_numec();
|
||||||
|
if (analfabeti > 0)
|
||||||
|
{
|
||||||
|
const char* anag = (who() == "C") ? TR("clienti") : TR("fornitori");
|
||||||
|
warning_box(FR("%ld %s non sono stati stampati in quanto "
|
||||||
|
"il codice lingua non corrispondeva al profilo di stampa"),
|
||||||
|
analfabeti, anag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TEC_mask::find_agents_scads(TAssoc_array& agents)
|
||||||
|
{
|
||||||
|
const TString& fromage = get(F_FROM_AGENT);
|
||||||
|
const TString& toage = get(F_TO_AGENT);
|
||||||
|
const long fromcli = get_long(SC_CFCODFR);
|
||||||
|
const long tocli = get_long(SC_CFCODTO);
|
||||||
|
|
||||||
|
TRelation rel(LF_SCADENZE);
|
||||||
|
rel.add(LF_PAGSCA, "TIPOC==TIPOC|GRUPPO==GRUPPO|CONTO==CONTO|SOTTOCONTO==SOTTOCONTO|"
|
||||||
|
"ANNO==ANNO|NUMPART==NUMPART|NRIGA==NRIGA|NRATA==NRATA");
|
||||||
|
|
||||||
|
TRectype& curr = rel.curr();
|
||||||
|
const TRectype& pagsca = rel.curr(LF_PAGSCA);
|
||||||
|
|
||||||
|
curr.put(SCAD_TIPOCF, get(SC_CLIFO));
|
||||||
|
TRectype recfr(curr), recto(curr);
|
||||||
|
if (fromcli > 0)
|
||||||
|
recfr.put(PAGSCA_SOTTOCONTO, fromcli);
|
||||||
|
if (tocli >= fromcli)
|
||||||
|
recto.put(PAGSCA_SOTTOCONTO, tocli);
|
||||||
|
|
||||||
|
TString filter;
|
||||||
|
|
||||||
|
if (!get_bool(F_STAMPCHIU))
|
||||||
|
filter << "PAGATA!=\"X\"";
|
||||||
|
TCursor cur(&rel, filter, 1, &recfr, &recto);
|
||||||
|
const long items = cur.items();
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
|
||||||
|
TProgind pi(items, TR("Ricerca scadenze aperte per agente..."), true, true);
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
{
|
||||||
|
if (!pi.addstatus(1))
|
||||||
|
break;
|
||||||
|
|
||||||
|
const char* codag = pagsca.get(PAGSCA_CODAG);
|
||||||
|
if (*codag == '\0')
|
||||||
|
{
|
||||||
|
codag = curr.get(SCAD_CODAG);
|
||||||
|
if (*codag == '\0')
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (fromage.not_empty() && fromage > codag)
|
||||||
|
continue;
|
||||||
|
if (toage.not_empty() && toage < codag)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TEC_Game_list* games = (TEC_Game_list*)agents.objptr(codag);
|
||||||
|
if (games == NULL)
|
||||||
|
{
|
||||||
|
games = new TEC_Game_list;
|
||||||
|
agents.add(codag, (TObject*)games);
|
||||||
|
}
|
||||||
|
games->add_game(curr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEC_mask::find_agents_unassigned_pags(TAssoc_array& agents)
|
||||||
|
{
|
||||||
|
const char tipocf = get(SC_CLIFO)[0];
|
||||||
|
|
||||||
|
if (tipocf >= 'C')
|
||||||
|
{
|
||||||
|
const TString& fromage = get(F_FROM_AGENT);
|
||||||
|
const TString& toage = get(F_TO_AGENT);
|
||||||
|
const long fromcli = get_long(SC_CFCODFR);
|
||||||
|
const long tocli = get_long(SC_CFCODTO);
|
||||||
|
|
||||||
|
TRelation rel(LF_PAGSCA);
|
||||||
|
TRectype& curr = rel.curr();
|
||||||
|
curr.put(PAGSCA_TIPOC, tipocf); // Imposta C o F
|
||||||
|
|
||||||
|
TRectype recfr(curr), recto(curr);
|
||||||
|
if (fromcli > 0)
|
||||||
|
recfr.put(PAGSCA_SOTTOCONTO, fromcli); // Imposta cliente iniziale
|
||||||
|
if (tocli >= fromcli)
|
||||||
|
recto.put(PAGSCA_SOTTOCONTO, tocli); // Imposta cliente finale
|
||||||
|
|
||||||
|
TString filter;
|
||||||
|
filter << '(' << PAGSCA_NRATA << "==9999)";
|
||||||
|
if (fromage.full())
|
||||||
|
filter << "&&(" << PAGSCA_CODAG << ">='" << fromage << "')";
|
||||||
|
else
|
||||||
|
filter << "&&(" << PAGSCA_CODAG << "!='')";
|
||||||
|
if (toage.full())
|
||||||
|
filter << "&&(" << PAGSCA_CODAG << "<='" << toage << "')";
|
||||||
|
|
||||||
|
TCursor cur(&rel, filter, 1, &recfr, &recto);
|
||||||
|
const long items = cur.items();
|
||||||
|
if (items > 0)
|
||||||
|
{
|
||||||
|
cur.freeze();
|
||||||
|
TProgind pi(items, TR("Ricerca pagamenti non assegnati per agente..."), true, true);
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
{
|
||||||
|
if (!pi.addstatus(1))
|
||||||
|
break;
|
||||||
|
const char* codag = curr.get(PAGSCA_CODAG);
|
||||||
|
TEC_Game_list* games = (TEC_Game_list*)agents.objptr(codag);
|
||||||
|
if (games == NULL)
|
||||||
|
{
|
||||||
|
games = new TEC_Game_list;
|
||||||
|
agents.add(codag, (TObject*)games);
|
||||||
|
}
|
||||||
|
games->add_game(curr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long TEC_mask::find_agents_games(TAssoc_array& agents)
|
||||||
|
{
|
||||||
|
find_agents_scads(agents);
|
||||||
|
find_agents_unassigned_pags(agents);
|
||||||
|
return agents.items();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TEC_mask::print_agents()
|
||||||
|
{
|
||||||
|
TCursor_sheet& s = cur_sheet();
|
||||||
|
TCursor& c = *s.cursor();
|
||||||
|
|
||||||
|
// Filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
||||||
|
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
||||||
|
TCursor& fc = *(_form->cursor());
|
||||||
|
|
||||||
|
fc.setkey(key());
|
||||||
|
TRectype filter(LF_CLIFO);
|
||||||
|
filter.put(CLI_TIPOCF, who());
|
||||||
|
fc.setregion(filter, filter);
|
||||||
|
|
||||||
|
const bool printing = _form->printing();
|
||||||
|
const long print_all = !s.one_checked(); // Se non ho selezionato nulla allora li stampo tutti
|
||||||
|
long analfabeti = 0; // Persone non stampate in quanto aventi lingua errata
|
||||||
|
TAssoc_array agents;
|
||||||
|
const long totag = find_agents_games(agents);
|
||||||
|
|
||||||
|
if (totag > 0)
|
||||||
|
{
|
||||||
|
TRelation rel(LF_AGENTI);
|
||||||
|
TCursor cur(&rel);
|
||||||
|
const long items = cur.items();
|
||||||
|
cur.freeze();
|
||||||
|
|
||||||
|
{
|
||||||
|
TProgind pi(items, "Calcolo estratto conto", true, true);
|
||||||
|
|
||||||
|
if (printing)
|
||||||
|
printer().open();
|
||||||
|
for (cur = 0L; pi.addstatus() && cur.pos() < items; ++cur)
|
||||||
|
{
|
||||||
|
const TString& codag = cur.curr().get(AGE_CODAGE);
|
||||||
|
_games = (TEC_Game_list*)agents.objptr(codag);
|
||||||
|
|
||||||
|
if (_games != nullptr)
|
||||||
|
{
|
||||||
|
_form->set_agente(codag);
|
||||||
|
_form->set_pagam(fc.curr().get(CLI_CODPAG));
|
||||||
|
|
||||||
|
const long items = c.items();
|
||||||
|
|
||||||
|
for (long i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
if (print_all || s.checked(i))
|
||||||
|
{
|
||||||
|
fc = i; // Muove il cursore alla posizione corrente
|
||||||
|
|
||||||
|
const long codcf = fc.curr().get_long(CLI_CODCF);
|
||||||
|
|
||||||
|
if (_games->has_clifo(codcf))
|
||||||
|
{
|
||||||
|
if (print_one(who(), codcf) < 0)
|
||||||
|
analfabeti++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (printing && printer().frozen())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (printing)
|
||||||
|
{
|
||||||
|
printer().close();
|
||||||
|
if (_tiponumec > ' ' && who() == "C")
|
||||||
|
save_numec();
|
||||||
|
if (analfabeti > 0)
|
||||||
|
{
|
||||||
|
const char* anag = (who() == 'C') ? TR("clienti") : TR("fornitori");
|
||||||
|
warning_box(FR("%ld %s non sono stati stampati, avendo "
|
||||||
|
"il codice lingua non corrispondente al profilo di stampa"),
|
||||||
|
analfabeti, anag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEC_mask::save_numec()
|
||||||
|
{
|
||||||
|
// Ho numerato qualche estratto conto?
|
||||||
|
if (_lastnumcf.items() > 0 && _form->printing())
|
||||||
|
{
|
||||||
|
if (yesno_box(TR("Si desidera aggiornare il numero di estratto conto stampato definitivamente?")))
|
||||||
|
{
|
||||||
|
TProgind pi(_lastnumcf.items(), TR("Aggiornamento numero estratto conto..."), false, true);
|
||||||
|
const TString & tipocf = who(); // Dovrebbe essere sempre 'C'
|
||||||
|
TLocalisamfile cfven(LF_CFVEN);
|
||||||
|
FOR_EACH_ASSOC_STRING(_lastnumcf, obj, key, str)
|
||||||
|
{
|
||||||
|
pi.addstatus(1);
|
||||||
|
cfven.put(CFV_TIPOCF, tipocf);
|
||||||
|
cfven.put(CFV_CODCF, key);
|
||||||
|
const int err = cfven.read();
|
||||||
|
if (err != NOERR)
|
||||||
|
{
|
||||||
|
cfven.zero();
|
||||||
|
cfven.put(CFV_TIPOCF, tipocf);
|
||||||
|
cfven.put(CFV_CODCF, key);
|
||||||
|
}
|
||||||
|
cfven.put("NUMESC", str);
|
||||||
|
cfven.put("DATAESC", get(F_DATASEND));
|
||||||
|
if (err == NOERR)
|
||||||
|
cfven.rewrite();
|
||||||
|
else
|
||||||
|
cfven.write();
|
||||||
|
}
|
||||||
|
if (_tiponumec == 'G')
|
||||||
|
{
|
||||||
|
TConfig c(CONFIG_DITTA, "cg");
|
||||||
|
|
||||||
|
c.set("LastEC", _lastnumec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Ripristino vecchio numero di estratto conto sulla maschera
|
||||||
|
if (_tiponumec == 'G')
|
||||||
|
{
|
||||||
|
TConfig c(CONFIG_DITTA, "cg");
|
||||||
|
_lastnumec = c.get_long("LastEC");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_lastnumcf.destroy(); // Azzera comunque elenco EC stampati
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TEC_mask::update_numec(const TRectype& clf, int sign)
|
||||||
|
{
|
||||||
|
const char tipocf = clf.exist(CLI_TIPOCF) ? clf.get_char(CLI_TIPOCF) : ' ';
|
||||||
|
|
||||||
|
if (_tiponumec > ' ' && tipocf == 'C' && _form->printing())
|
||||||
|
{
|
||||||
|
TForm_item& nec = form().find_field('H', odd_page, PEC_NUMPROG);
|
||||||
|
|
||||||
|
if (nec.shown())
|
||||||
|
{
|
||||||
|
const TString8 codcf = clf.get(CLI_CODCF);
|
||||||
|
TString16 num;
|
||||||
|
switch (_tiponumec)
|
||||||
|
{
|
||||||
|
case 'A':
|
||||||
|
if (sign > 0)
|
||||||
|
{
|
||||||
|
TString16 key;
|
||||||
|
key.format("%c|%s", tipocf, (const char*)codcf);
|
||||||
|
const TRectype& cfven = cache().get(LF_CFVEN, key);
|
||||||
|
num << (cfven.get_long("NUMESC") + 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'G':
|
||||||
|
if (sign > 0)
|
||||||
|
{
|
||||||
|
_lastnumec++;
|
||||||
|
num << _lastnumec;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_lastnumec--;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (num.full())
|
||||||
|
{
|
||||||
|
nec.set(num);
|
||||||
|
_lastnumcf.add(codcf, num);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_lastnumcf.remove(codcf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TEC_mask::some_to_print(const char * tipo, const long codice)
|
||||||
|
{
|
||||||
|
TRelation rel(LF_PARTITE);
|
||||||
|
TRectype filter(rel.curr());
|
||||||
|
TRectype & fcrec = _form->cursor()->curr();
|
||||||
|
|
||||||
|
if (fcrec.num() == LF_CLIFO)
|
||||||
|
{
|
||||||
|
filter.put(PART_TIPOCF, tipo);
|
||||||
|
filter.put(PART_SOTTOCONTO, codice);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filter.zero(PART_TIPOCF);
|
||||||
|
filter.put(PART_GRUPPO, _form->cursor()->curr().get(PCN_GRUPPO));
|
||||||
|
filter.put(PART_CONTO, _form->cursor()->curr().get(PCN_CONTO));
|
||||||
|
filter.put(PART_SOTTOCONTO, _form->cursor()->curr().get(PCN_SOTTOCONTO));
|
||||||
|
}
|
||||||
|
|
||||||
|
TCursor cur(&rel, "", 1, &filter, &filter);
|
||||||
|
const long items = cur.items();
|
||||||
|
bool any_to_print = false;
|
||||||
|
const bool stampa_chiuse = get_bool(F_STAMPCHIU);
|
||||||
|
const TDate data_chiuse = get(F_DATACHIU);
|
||||||
|
TString8 last_game;
|
||||||
|
int last_year = 0;
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
for (cur = 0; cur.pos() < items; ++cur)
|
||||||
|
{
|
||||||
|
const TRectype & curr = cur.curr();
|
||||||
|
const int curr_year = curr.get_int(PART_ANNO);
|
||||||
|
const TString& curr_game = curr.get(PART_NUMPART);
|
||||||
|
|
||||||
|
if (curr_year == last_year && curr_game == last_game)
|
||||||
|
continue;
|
||||||
|
last_game = curr_game;
|
||||||
|
last_year = curr_year;
|
||||||
|
|
||||||
|
TPartita game(curr);
|
||||||
|
|
||||||
|
// Non fregare i clienti agli altri agenti!
|
||||||
|
if (_games != nullptr && !_games->has_game(curr))
|
||||||
|
continue;
|
||||||
|
const TDate& dir = _form->data_inizio_rischio();
|
||||||
|
const TDate& dlo = _form->data_limite_operazione();
|
||||||
|
const TDate& dls = _form->data_limite_scaduto();
|
||||||
|
const TImporto saldo = game.calcola_saldo_al(_form->in_valuta(), dlo, dls, dir);
|
||||||
|
|
||||||
|
if (saldo.is_zero())
|
||||||
|
{
|
||||||
|
if (stampa_chiuse)
|
||||||
|
{
|
||||||
|
int r = 0;
|
||||||
|
|
||||||
|
for (r = game.last(); r > 0; r = game.pred(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& riga = game.riga(r);
|
||||||
|
|
||||||
|
if (riga.is_fattura())
|
||||||
|
{
|
||||||
|
const TDate dd = riga.get(PART_DATADOC);
|
||||||
|
|
||||||
|
if (dd >= data_chiuse)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
any_to_print |= (r > 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
any_to_print = true;
|
||||||
|
}
|
||||||
|
return any_to_print;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nuovo modo con cursore
|
||||||
|
int TEC_mask::print_one(const char * tipo, const long codice)
|
||||||
|
{
|
||||||
|
TWait_cursor hourglass;
|
||||||
|
const bool printing = _form->printing();
|
||||||
|
int printed = 0; // Non ho stampato ancora nulla
|
||||||
|
|
||||||
|
if (printing && _form->cursor()->curr().num() == LF_CLIFO)
|
||||||
|
{
|
||||||
|
// make controllations per lingua profilo/CF
|
||||||
|
const TString & lincf = _form->cursor()->curr().get(CLI_CODLIN);
|
||||||
|
const TString & lind = ini_get_string(CONFIG_DITTA, "cg", "CodLin");
|
||||||
|
const TString & linf = _form->lingua();
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
if (linf == lind && lincf.full())
|
||||||
|
ok = (lincf == linf);
|
||||||
|
if (linf != lind)
|
||||||
|
ok = (lincf == linf);
|
||||||
|
if (!ok) // Cliente analfabeta
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (some_to_print(tipo, codice))
|
||||||
|
{
|
||||||
|
TToken_string key(tipo);
|
||||||
|
|
||||||
|
key.add(codice);
|
||||||
|
_form->set_agente(cache().get(LF_CFVEN, key, CFV_CODAG));
|
||||||
|
_form->set_pagam(cache().get(LF_CLIFO, key, CLI_CODPAG));
|
||||||
|
_form->azzera_totali(); // Azzera totali di fine pagina
|
||||||
|
|
||||||
|
// Filtra solo le partite del cliente selezionato
|
||||||
|
TRectype & fcrec = _form->cursor()->curr();
|
||||||
|
TRelation rel(LF_PARTITE);
|
||||||
|
TRectype filter(rel.curr());
|
||||||
|
|
||||||
|
if (fcrec.num() == LF_CLIFO)
|
||||||
|
{
|
||||||
|
filter.put(PART_TIPOCF, tipo);
|
||||||
|
filter.put(PART_SOTTOCONTO, codice);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filter.zero(PART_TIPOCF);
|
||||||
|
filter.put(PART_GRUPPO, _form->cursor()->curr().get(PCN_GRUPPO));
|
||||||
|
filter.put(PART_CONTO, _form->cursor()->curr().get(PCN_CONTO));
|
||||||
|
filter.put(PART_SOTTOCONTO, _form->cursor()->curr().get(PCN_SOTTOCONTO));
|
||||||
|
}
|
||||||
|
|
||||||
|
TCursor cur(&rel, "", 1, &filter, &filter);
|
||||||
|
const long items = cur.items();
|
||||||
|
const bool stampa_chiuse = get_bool(F_STAMPCHIU);
|
||||||
|
const TDate data_chiuse = get(F_DATACHIU);
|
||||||
|
TString status;
|
||||||
|
TString8 last_game;
|
||||||
|
int last_year = 0;
|
||||||
|
|
||||||
|
cur.freeze();
|
||||||
|
if (printing && fcrec.num() == LF_CLIFO)
|
||||||
|
update_numec(fcrec, +1); // Incrementa contatore
|
||||||
|
for (cur = 0; cur.pos() < items; ++cur)
|
||||||
|
{
|
||||||
|
const TRectype & curr = cur.curr();
|
||||||
|
const int curr_year = curr.get_int(PART_ANNO);
|
||||||
|
const TString& curr_game = curr.get(PART_NUMPART);
|
||||||
|
|
||||||
|
if (curr_year == last_year && curr_game == last_game)
|
||||||
|
continue;
|
||||||
|
last_game = curr_game;
|
||||||
|
last_year = curr_year;
|
||||||
|
|
||||||
|
TPartita game(curr);
|
||||||
|
|
||||||
|
// Non fregare i clienti agli altri agenti!
|
||||||
|
if (_games != nullptr && !_games->has_game(curr))
|
||||||
|
continue;
|
||||||
|
const TDate& dir = _form->data_inizio_rischio();
|
||||||
|
const TDate& dlo = _form->data_limite_operazione();
|
||||||
|
const TDate& dls = _form->data_limite_scaduto();
|
||||||
|
const TImporto saldo = game.calcola_saldo_al(_form->in_valuta(), dlo, dls, dir);
|
||||||
|
|
||||||
|
if (saldo.is_zero() && stampa_chiuse)
|
||||||
|
{
|
||||||
|
int r = 0;
|
||||||
|
|
||||||
|
for (r = game.last(); r > 0; r = game.pred(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& riga = game.riga(r);
|
||||||
|
|
||||||
|
if (riga.is_fattura())
|
||||||
|
{
|
||||||
|
const TDate dd = riga.get(PART_DATADOC);
|
||||||
|
|
||||||
|
if (dd >= data_chiuse)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (r == 0)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
status.cut(0);
|
||||||
|
status << game.anno() << ' ' << game.numero();
|
||||||
|
xvtil_statbar_set(status);
|
||||||
|
do_events();
|
||||||
|
if (printing)
|
||||||
|
{
|
||||||
|
if (printed)
|
||||||
|
{
|
||||||
|
TPrintrow empty; // Salta una riga vuota
|
||||||
|
printer().print(empty); // (Non farlo alla fine di ogni partita!)
|
||||||
|
}
|
||||||
|
if (printer().frozen())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_form->print_game(game))
|
||||||
|
printed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (printing)
|
||||||
|
{
|
||||||
|
if (printed > 0)
|
||||||
|
{
|
||||||
|
_form->ultima_pagina();
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
update_numec(_form->cursor()->curr(), -1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (printed > 0 && _form->stampa_saldo())
|
||||||
|
{
|
||||||
|
_form->export_total();
|
||||||
|
// f.recordset().new_rec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xvtil_statbar_set(nullptr);
|
||||||
|
return printed;
|
||||||
|
}
|
||||||
|
152
src/sc/sc2101.h
152
src/sc/sc2101.h
@ -1,26 +1,164 @@
|
|||||||
#ifndef __SC2101_H
|
#ifndef __SC2101_H
|
||||||
#define __SC2101_H
|
#define __SC2101_H
|
||||||
|
|
||||||
|
#ifndef __TEXTSET_H
|
||||||
|
#include "textset.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __SCSELECT_H
|
#ifndef __SCSELECT_H
|
||||||
#include "scselect.h"
|
#include "scselect.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class TEC_mask;
|
||||||
|
|
||||||
|
class TEC_recordset : public TAS400_recordset
|
||||||
|
{
|
||||||
|
TString4 _who;
|
||||||
|
TString _agente;
|
||||||
|
TString _pagam;
|
||||||
|
|
||||||
|
public:
|
||||||
|
const TString & who() const { return _who; }
|
||||||
|
TString & set_agente(const char * agente) { _agente = agente; return _agente; }
|
||||||
|
TString & set_pagam(const char * pagam) { _pagam = pagam; return _pagam; }
|
||||||
|
void add_fields();
|
||||||
|
TEC_recordset(const char * who);
|
||||||
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TEC_gamelist
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TEC_Game_list
|
||||||
|
{
|
||||||
|
TAssoc_array _games;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void signature(const TRectype& rec, TToken_string& signature) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void add_game(const TRectype& rec);
|
||||||
|
bool has_clifo(long codcf);
|
||||||
|
bool has_game(const TRectype& rec);
|
||||||
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TEC_form
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TEC_form : public TESSL_form
|
||||||
|
{
|
||||||
|
friend class TEC_row;
|
||||||
|
|
||||||
|
static TEC_form* _form;
|
||||||
|
TEC_recordset* _recordset;
|
||||||
|
|
||||||
|
enum { MAXTOT = 16 };
|
||||||
|
|
||||||
|
TCursor* _cursore;
|
||||||
|
TTotalizer _totali;
|
||||||
|
bool _export;
|
||||||
|
|
||||||
|
TString _lingua; // Codice lingua del form
|
||||||
|
TDate _dlo, _dls, _dir; // Data limite operazione, scaduto e inizio rischio
|
||||||
|
int _giorni_rischio; // Numero giorni rischio nella maschera di selezione
|
||||||
|
bool _in_valuta; // Il form e' in valuta
|
||||||
|
int _fincatura; // 0 = nessuna, 1 = testo, 2 = grafica
|
||||||
|
word _num_rip; // Numero di righe usate per i riporti
|
||||||
|
word _total_rows; // Numero di righe usate per i totali
|
||||||
|
word _maxtot; // Numero massimo di totali da stampare
|
||||||
|
bool _stampa_saldo; // Stampa il saldo di ogni partita
|
||||||
|
bool _note_scadenti; // Considera scadute le note di credito non assegnate
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void init_header(const TMask& m);
|
||||||
|
word ordina_totali_per_valuta(THash_object* tot[MAXTOT]);
|
||||||
|
|
||||||
|
int find_magic(TString& s, TString& magic1, TString& magic2) const;
|
||||||
|
void change_magic_body(const TEC_row& o, TString& s);
|
||||||
|
void change_magic_footer(const THash_object& o, TString& s);
|
||||||
|
void print_total(int riga, const THash_object& o);
|
||||||
|
|
||||||
|
void stampa_testata(TPrinter& p);
|
||||||
|
void stampa_pedata();
|
||||||
|
void stampa_riporti(TPrinter& p);
|
||||||
|
|
||||||
|
static void ec_header_handler(TPrinter& p);
|
||||||
|
static void ec_footer_handler(TPrinter& p);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TTotalizer& totali() { return _totali; }
|
||||||
|
|
||||||
|
virtual TRelation* relation() const { return _cursore->relation(); }
|
||||||
|
virtual TCursor* cursor() { return _cursore; }
|
||||||
|
virtual TEC_recordset* recordset() { return _recordset; }
|
||||||
|
|
||||||
|
const TDate& data_limite_operazione() const { return _dlo; }
|
||||||
|
const TDate& data_limite_scaduto() const { return _dls; }
|
||||||
|
int giorni_rischio() const { return _giorni_rischio; }
|
||||||
|
const TDate& data_inizio_rischio() const { return _dir; }
|
||||||
|
bool note_scadenti() const { return _note_scadenti; }
|
||||||
|
|
||||||
|
const TString& lingua() const { return _lingua; }
|
||||||
|
bool in_valuta() const { return _in_valuta; }
|
||||||
|
const TString& describe(short id, char sez = 'H', pagetype pt = last_page) const;
|
||||||
|
|
||||||
|
void azzera_totali();
|
||||||
|
void ultima_pagina();
|
||||||
|
bool print_game(const TPartita& game);
|
||||||
|
bool stampa_saldo() const { return _stampa_saldo; }
|
||||||
|
void stampa_saldo(bool ss) { _stampa_saldo = ss; }
|
||||||
|
|
||||||
|
void set_agente(const TString& codag);
|
||||||
|
|
||||||
|
bool exporting() const { return _export; }
|
||||||
|
bool printing() const { return !exporting(); }
|
||||||
|
void set_export(const bool on) { _export = on; }
|
||||||
|
void export_total();
|
||||||
|
|
||||||
|
void set_pagam(const TString& codpag);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TEC_recordset& recordset() const { CHECK(_export == true, "Not exporting"); return *_recordset; }
|
||||||
|
|
||||||
|
TEC_form(const TEC_mask& m, bool gesval);
|
||||||
|
virtual ~TEC_form();
|
||||||
|
};
|
||||||
|
|
||||||
class TEC_mask : public TSelection_mask
|
class TEC_mask : public TSelection_mask
|
||||||
{
|
{
|
||||||
TRelation _ditta;
|
TRelation _ditta;
|
||||||
TString _tmp;
|
TMail_mask _ec_mail;
|
||||||
|
TEC_form * _form;
|
||||||
|
TEC_Game_list * _games;
|
||||||
|
char _tiponumec; // Tipo numerazione EC ' ', 'G', 'A'
|
||||||
|
long _lastnumec; // Ultimo numero EC 'G'
|
||||||
|
TAssoc_array _lastnumcf; // Ultimo numero stampato 'A'
|
||||||
|
bool _export;
|
||||||
|
|
||||||
protected: // TMask
|
protected: // TMask
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual void start_run();
|
virtual void start_run();
|
||||||
|
|
||||||
static bool lingua_handler(TMask_field& f, KEY k);
|
virtual TESSL_form & form() override;
|
||||||
static bool codprof_handler(TMask_field& f, KEY k);
|
virtual const TToken_string & get_anal_filter() const override { return EMPTY_STRING; }
|
||||||
|
virtual bool some_to_print(const char * tipo, const long codice) override;
|
||||||
|
virtual int print_one(const char * tipo, const long codice) override;
|
||||||
|
bool print_selected(); // print selected items
|
||||||
|
void save_numec();
|
||||||
|
void update_numec(const TRectype& clf, int sign);
|
||||||
|
|
||||||
|
void find_agents_scads(TAssoc_array& agents);
|
||||||
|
void find_agents_unassigned_pags(TAssoc_array& agents);
|
||||||
|
long find_agents_games(TAssoc_array& agents);
|
||||||
|
bool print_agents(); // print selected items by agent
|
||||||
|
virtual TMail_mask & mail_mask() override { return _ec_mail; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const char* get_prof_base() const;
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
const TString& get_prof_code() const;
|
bool export_print() const { return _export; }
|
||||||
const TString& get_prof_lang() const;
|
void set_export(bool on = true) { _export = on; }
|
||||||
const char* get_prof_name() const;
|
|
||||||
|
|
||||||
TEC_mask(const char* name);
|
TEC_mask(const char* name);
|
||||||
virtual ~TEC_mask();
|
virtual ~TEC_mask();
|
||||||
|
@ -51,9 +51,9 @@
|
|||||||
|
|
||||||
#define PEC_PICTURE 500
|
#define PEC_PICTURE 500
|
||||||
|
|
||||||
#define RIGA_PART_PAGAMENTO 10001
|
#define RIGA_PAGAMENTO 10001
|
||||||
#define RIGA_PART_ABBUONI 10002
|
#define RIGA_ABBUONI 10002
|
||||||
#define RIGA_PART_DIFFCAM 10003
|
#define RIGA_DIFFCAMBI 10003
|
||||||
#define RIGA_PART_RITENUTE 10004
|
#define RIGA_RITENUTE 10004
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
#define PCONSCAD_ALIAS 54
|
#define PCONSCAD_ALIAS 54
|
||||||
#define MaxRowsForTotal 17
|
#define MaxRowsForTotal 17
|
||||||
|
|
||||||
#define TPString TParagraph_string // Comodita'...
|
|
||||||
|
|
||||||
struct _LinearTotal : public TObject // Oggetto base per gli elementi di tlg, tlm, tlp
|
struct _LinearTotal : public TObject // Oggetto base per gli elementi di tlg, tlm, tlp
|
||||||
{ // Contiene i totali da stampare su una linea
|
{ // Contiene i totali da stampare su una linea
|
||||||
real _is, // Importo in scadenza
|
real _is, // Importo in scadenza
|
||||||
@ -41,13 +39,10 @@ class TStampaScadenzario : public TPrintapp
|
|||||||
_cur2, _cur3, _cur4, _cur41, // piu' avanti spiega tutto.
|
_cur2, _cur3, _cur4, _cur41, // piu' avanti spiega tutto.
|
||||||
_cur5, _cur6, _cur7;
|
_cur5, _cur6, _cur7;
|
||||||
TSelection_ext_mask *_m;
|
TSelection_ext_mask *_m;
|
||||||
TPartita *_p; // Oggetto partita corrente. Viene ricaricato ad ogni cambio partita,
|
TString _annopart,_datareg,_numdoc,_datadoc, // Anno partita (2 cifre), data registrazione, nr. documento, data doc.
|
||||||
// ovvero ogni volta che la rata corrente cambia i "connotati"
|
_protiva, _codval; // Numero di protocollo IVA (TString perche' se vale 0 non stampa nulla), e codice valuta
|
||||||
TLocalisamfile *_pagsca;
|
TString _last_ban, _desc_ban; // Banca correntemente in corso di raggruppamento
|
||||||
TString _annopart,_datareg,_numdoc,_datadoc, // Anno partita (2 cifre), data registrazione, nr. documento, data doc.
|
TParagraph_string _descrizione,_ragsoc, _des_conto; // Descrizione (da LF_PARTITE), ragione sociale (da LF_CLIFO)
|
||||||
_protiva, _codval; // Numero di protocollo IVA (TString perche' se vale 0 non stampa nulla), e codice valuta
|
|
||||||
TString _last_ban, _desc_ban; // Banca correntemente in corso di raggruppamento
|
|
||||||
TPString *_descrizione,*_ragsoc,*_des_conto; // Descrizione (da LF_PARTITE), ragione sociale (da LF_CLIFO)
|
|
||||||
// Descrizione conto (da LF_PCON)
|
// Descrizione conto (da LF_PCON)
|
||||||
TString _imp_scad,_imp_pag,_rimdir,_riba,_altri,_bonifico, // Valori calcolati in preprocess_page: rimesse dirette, Ri.ba e altri
|
TString _imp_scad,_imp_pag,_rimdir,_riba,_altri,_bonifico, // Valori calcolati in preprocess_page: rimesse dirette, Ri.ba e altri
|
||||||
_cur_gr_s, _cur_co_s, _cur_codcf_s; // _imp_scad e _imp_pag vengono anch'essi calcolati in preprocess_page.
|
_cur_gr_s, _cur_co_s, _cur_codcf_s; // _imp_scad e _imp_pag vengono anch'essi calcolati in preprocess_page.
|
||||||
@ -61,7 +56,6 @@ class TStampaScadenzario : public TPrintapp
|
|||||||
_end_printed, // VERO=riepilogo finale da stampare
|
_end_printed, // VERO=riepilogo finale da stampare
|
||||||
_ratesald, // VERO=stampa anche le rate saldate
|
_ratesald, // VERO=stampa anche le rate saldate
|
||||||
_ordata, // VERO=ordine primario per data, FALSO=ordine primario impostato da _ordcod
|
_ordata, // VERO=ordine primario per data, FALSO=ordine primario impostato da _ordcod
|
||||||
_ordcod, // VERO=ordine per codice, FALSO=ordine per ragione sociale
|
|
||||||
_stvaluta, // Vero se abilitata la stampa in valuta;
|
_stvaluta, // Vero se abilitata la stampa in valuta;
|
||||||
_group_ban, // Vero se abilitato il raggruppamento per banca
|
_group_ban, // Vero se abilitato il raggruppamento per banca
|
||||||
_totbank_printed; // Vero se é stato stampato il totale per banca
|
_totbank_printed; // Vero se é stato stampato il totale per banca
|
||||||
@ -100,7 +94,8 @@ class TStampaScadenzario : public TPrintapp
|
|||||||
// chiave relativa alla partita, ed eventualmente utilizzare tale valore in memoria.
|
// chiave relativa alla partita, ed eventualmente utilizzare tale valore in memoria.
|
||||||
static bool filter_func(const TRelation *); // Funzione di filtro [_datai.._dataf]
|
static bool filter_func(const TRelation *); // Funzione di filtro [_datai.._dataf]
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
TSelection_ext_mask & mask() const { return *_m; }
|
||||||
// print functions
|
// print functions
|
||||||
virtual bool preprocess_page(int file, int counter); // Qui stampa i totali e i riepiloghi
|
virtual bool preprocess_page(int file, int counter); // Qui stampa i totali e i riepiloghi
|
||||||
virtual bool preprocess_print(int file, int counter); // Qui non fa proprio nulla!
|
virtual bool preprocess_print(int file, int counter); // Qui non fa proprio nulla!
|
||||||
@ -130,21 +125,20 @@ public:
|
|||||||
void check_add_key_to_tp(int t, char u); // controlla e aggiunge i valori relativi alla chiave k ai totali del prospetto
|
void check_add_key_to_tp(int t, char u); // controlla e aggiunge i valori relativi alla chiave k ai totali del prospetto
|
||||||
void check_add_key_to_tl(tipo_pe p, int t); // controlla e aggiunge i valori elaborati all'assoc array indicato dal periodo (_tlxxx)
|
void check_add_key_to_tl(tipo_pe p, int t); // controlla e aggiunge i valori elaborati all'assoc array indicato dal periodo (_tlxxx)
|
||||||
// Ritorna true se la partita corrente _p non e' piu' riferita alla scadenza corrente
|
// Ritorna true se la partita corrente _p non e' piu' riferita alla scadenza corrente
|
||||||
bool scad_changed(char tipo, int gruppo, int conto, long codcf, int anno, const TString& nump);
|
bool scad_changed(const TPartita & p, char tipo, int gruppo, int conto, long codcf, int anno, const TString& nump);
|
||||||
// Ritorna true se la scadenza corrente ha una banca diversa dalla precedente
|
// Ritorna true se la scadenza corrente ha una banca diversa dalla precedente
|
||||||
// bool bank_will_change();
|
// bool bank_will_change();
|
||||||
// Totalizza i pagamenti non assegnati per la partita corrente (NB si spera che siano tutti nella stessa valuta)
|
// Totalizza i pagamenti non assegnati per la partita corrente (NB si spera che siano tutti nella stessa valuta)
|
||||||
bool in_cache(const TString& k); // ritorna vero se ci sono gia' non assegnati in _uns_cache;
|
bool in_cache(const TString& k); // ritorna vero se ci sono gia' non assegnati in _uns_cache;
|
||||||
void look_in_cache(real& a, real& b, real& c, TAssoc_array& uns, TAssoc_array& unsnc, TAssoc_array& unsins, TString& k);
|
void look_in_cache(const TPartita & p, real& a, real& b, real& c, TAssoc_array& uns, TAssoc_array& unsnc, TAssoc_array& unsins, TString& k);
|
||||||
void calcola_unassigned(const TString& k);
|
void calcola_unassigned(const TPartita & p, const TString& k);
|
||||||
void calcola_pagamenti(real& imp_scad, int riga, int rata, TBill& bill); // calcola i pagamenti effettuati per questa rata e il residuo eventuale
|
void calcola_pagamenti(const TPartita & p, real& imp_scad, int riga, int rata, TBill& bill); // calcola i pagamenti effettuati per questa rata e il residuo eventuale
|
||||||
const char * tipi_tab(int tipo) const;
|
const char * tipi_tab(int tipo) const;
|
||||||
|
|
||||||
TLocalisamfile& pagamenti() const { return *_pagsca; }
|
|
||||||
|
|
||||||
void print_intestazione_banca(int &nriga);
|
void print_intestazione_banca(int &nriga);
|
||||||
|
|
||||||
TStampaScadenzario();
|
TStampaScadenzario() : _m(nullptr), _rel1(nullptr), _rel2(nullptr), _rel3(nullptr),
|
||||||
|
_descrizione(19), _ragsoc(19), _des_conto(19) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline TStampaScadenzario& app() {return (TStampaScadenzario&)main_app();}
|
inline TStampaScadenzario& app() {return (TStampaScadenzario&)main_app();}
|
||||||
@ -177,7 +171,7 @@ const TString& TScadenza_rec::get_str(const char* fieldname) const
|
|||||||
rec.put(PAGSCA_NRIGA, TRectype::get_str(SCAD_NRIGA));
|
rec.put(PAGSCA_NRIGA, TRectype::get_str(SCAD_NRIGA));
|
||||||
rec.put(PAGSCA_NRATA, TRectype::get_str(SCAD_NRATA));
|
rec.put(PAGSCA_NRATA, TRectype::get_str(SCAD_NRATA));
|
||||||
|
|
||||||
TLocalisamfile& pagamenti = app().pagamenti();
|
TLocalisamfile pagamenti(LF_PAGSCA);
|
||||||
TRectype& curpag = pagamenti.curr();
|
TRectype& curpag = pagamenti.curr();
|
||||||
bool found = curpag.compare_key(rec,1,1) == 0;
|
bool found = curpag.compare_key(rec,1,1) == 0;
|
||||||
if (!found)
|
if (!found)
|
||||||
@ -345,11 +339,10 @@ void TStampaScadenzario::check_add_key_to_tp(int t, char u)
|
|||||||
_tp.add(k,_w_imp_res);
|
_tp.add(k,_w_imp_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaScadenzario::scad_changed(char tipo, int gruppo, int conto, long codcf, int anno, const TString& nump)
|
bool TStampaScadenzario::scad_changed(const TPartita & p, char tipo, int gruppo, int conto, long codcf, int anno, const TString& nump)
|
||||||
{
|
{
|
||||||
if (_p == NULL)
|
TRiga_partite& rp = p.riga(p.first());
|
||||||
return true;
|
|
||||||
TRiga_partite& rp = _p->riga(_p->first());
|
|
||||||
if (tipo != rp.get_char(PART_TIPOCF) || gruppo != rp.get_int(PART_GRUPPO) ||
|
if (tipo != rp.get_char(PART_TIPOCF) || gruppo != rp.get_int(PART_GRUPPO) ||
|
||||||
conto != rp.get_int(PART_CONTO) || codcf != rp.get_long(PART_SOTTOCONTO) ||
|
conto != rp.get_int(PART_CONTO) || codcf != rp.get_long(PART_SOTTOCONTO) ||
|
||||||
anno != rp.get_int(PART_ANNO) || nump != rp.get(PART_NUMPART))
|
anno != rp.get_int(PART_ANNO) || nump != rp.get(PART_NUMPART))
|
||||||
@ -391,7 +384,7 @@ bool TStampaScadenzario::in_cache(const TString& k)
|
|||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaScadenzario::calcola_unassigned(const TString& k)
|
void TStampaScadenzario::calcola_unassigned(const TPartita & p, const TString& k)
|
||||||
// Calcola i pagamenti non assegnati normali, e quelli riferiti a note di credito
|
// Calcola i pagamenti non assegnati normali, e quelli riferiti a note di credito
|
||||||
// ovvero quelli con tipo di movimento 2. Vanno percio' tenuti separati due totali:
|
// ovvero quelli con tipo di movimento 2. Vanno percio' tenuti separati due totali:
|
||||||
// _uns_cache[0] per i non assegnati normali, utilizzato per i pagamenti;
|
// _uns_cache[0] per i non assegnati normali, utilizzato per i pagamenti;
|
||||||
@ -401,13 +394,13 @@ void TStampaScadenzario::calcola_unassigned(const TString& k)
|
|||||||
TAssoc_array& unsnc = (TAssoc_array&) _uns_cache[1];
|
TAssoc_array& unsnc = (TAssoc_array&) _uns_cache[1];
|
||||||
TAssoc_array& unsins = (TAssoc_array&) _uns_cache[2];
|
TAssoc_array& unsins = (TAssoc_array&) _uns_cache[2];
|
||||||
|
|
||||||
real a,b,c;
|
real a, b, c;
|
||||||
|
TRecord_array& ra = ((TPartita &) p).unassigned();
|
||||||
TRecord_array& ra = _p->unassigned();
|
|
||||||
for (int r = ra.last_row(); r > 0; r = ra.pred_row(r))
|
for (int r = ra.last_row(); r > 0; r = ra.pred_row(r))
|
||||||
{
|
{
|
||||||
const TRectype& rec = ra.row(r);
|
const TRectype& rec = ra.row(r);
|
||||||
const TRiga_partite& sum = _p->riga(rec.get_int(PAGSCA_NRIGP));
|
const TRiga_partite& sum = p.riga(rec.get_int(PAGSCA_NRIGP));
|
||||||
const char* field = (_stvaluta && sum.in_valuta() ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);
|
const char* field = (_stvaluta && sum.in_valuta() ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);
|
||||||
|
|
||||||
const tipo_movimento tm = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
const tipo_movimento tm = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
||||||
@ -428,12 +421,13 @@ void TStampaScadenzario::calcola_unassigned(const TString& k)
|
|||||||
unsins.add(k,c,true);
|
unsins.add(k,c,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaScadenzario::look_in_cache(real& a, real& b, real& c,
|
void TStampaScadenzario::look_in_cache(const TPartita & p, real& a, real& b, real& c,
|
||||||
TAssoc_array& uns, TAssoc_array& unsnc, TAssoc_array& unsins,
|
TAssoc_array& uns, TAssoc_array& unsnc, TAssoc_array& unsins,
|
||||||
TString& k)
|
TString& k)
|
||||||
//Estrae dai tassoc_array i valori, relativi alla partita corrente, di uns e unsnc, mettendoli in a e b
|
//Estrae dai tassoc_array i valori, relativi alla partita corrente, di uns e unsnc, mettendoli in a e b
|
||||||
{
|
{
|
||||||
TRiga_partite& rp = _p->riga(_p->first());
|
TRiga_partite& rp = p.riga(p.first());
|
||||||
|
|
||||||
k << rp.get_char(PART_TIPOCF) << rp.get_int(PART_GRUPPO);
|
k << rp.get_char(PART_TIPOCF) << rp.get_int(PART_GRUPPO);
|
||||||
k << rp.get_int(PART_CONTO) << rp.get_long(PART_SOTTOCONTO);
|
k << rp.get_int(PART_CONTO) << rp.get_long(PART_SOTTOCONTO);
|
||||||
k << rp.get_int(PART_ANNO);
|
k << rp.get_int(PART_ANNO);
|
||||||
@ -445,20 +439,20 @@ void TStampaScadenzario::look_in_cache(real& a, real& b, real& c,
|
|||||||
if (unsins.is_key(k)) c = (real&)unsins[k];
|
if (unsins.is_key(k)) c = (real&)unsins[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaScadenzario::calcola_pagamenti(real& imp_scad, int riga, int rata, TBill& bill)
|
void TStampaScadenzario::calcola_pagamenti(const TPartita & p, real& imp_scad, int riga, int rata, TBill& bill)
|
||||||
{
|
{
|
||||||
_w_imp_blocked = false;
|
_w_imp_blocked = false;
|
||||||
if (!_p->esiste(riga, rata))
|
if (!p.esiste(riga, rata))
|
||||||
{
|
{
|
||||||
imp_scad = _w_imp_pag = _w_imp_res = ZERO;
|
imp_scad = _w_imp_pag = _w_imp_res = ZERO;
|
||||||
error_box("Nella partita %c %ld %d %s la rata %d non corrisponde ad una riga di fattura (%d)",
|
error_box("Nella partita %c %ld %d %s la rata %d non corrisponde ad una riga di fattura (%d)",
|
||||||
bill.tipo(), bill.codclifo(), _p->anno(), (const char*)_p->numero(), rata, riga);
|
bill.tipo(), bill.codclifo(), p.anno(), (const char*) p.numero(), rata, riga);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const TRiga_scadenze& rs = _p->rata(riga, rata);
|
const TRiga_scadenze& rs = p.rata(riga, rata);
|
||||||
|
|
||||||
// Non perder tempo con partite chiuse!
|
// Non perder tempo con partite chiuse!
|
||||||
if (!_ratesald && (rs.chiusa() || _p->chiusa(true)))
|
if (!_ratesald && (rs.chiusa() || p.chiusa(true)))
|
||||||
{
|
{
|
||||||
imp_scad = rs.importo(_stvaluta).valore();
|
imp_scad = rs.importo(_stvaluta).valore();
|
||||||
_w_imp_pag = imp_scad;
|
_w_imp_pag = imp_scad;
|
||||||
@ -470,22 +464,23 @@ void TStampaScadenzario::calcola_pagamenti(real& imp_scad, int riga, int rata, T
|
|||||||
TAssoc_array& unsnc = (TAssoc_array&)_uns_cache[1];
|
TAssoc_array& unsnc = (TAssoc_array&)_uns_cache[1];
|
||||||
TAssoc_array& unsins = (TAssoc_array&)_uns_cache[2];
|
TAssoc_array& unsins = (TAssoc_array&)_uns_cache[2];
|
||||||
|
|
||||||
const char ssez = _p->riga(riga).sezione();
|
const char ssez = p.riga(riga).sezione();
|
||||||
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
||||||
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
||||||
TImporto totalep, // Totale dei pagamenti
|
TImporto totalep, // Totale dei pagamenti
|
||||||
scdz; // Importo in scadenza
|
scdz; // Importo in scadenza
|
||||||
scdz += TImporto(ssez,rs.get_real(sfield));
|
scdz += TImporto(ssez,rs.get_real(sfield));
|
||||||
totalep += rs.importo_pagato(_stvaluta); // Quanto e' stato pagato per questa scadenza?
|
totalep += rs.importo_pagato(_stvaluta); // Quanto e' stato pagato per questa scadenza?
|
||||||
for (int p = rs.last(); p > 0; p = rs.pred(p)) // Calcola il totale pagamenti e discrimina
|
for (int r = rs.last(); r > 0; r = rs.pred(r)) // Calcola il totale pagamenti e discrimina
|
||||||
{ // Il TIPOMOV: 1,5 : fattura insoluto
|
{ // Il TIPOMOV: 1,5 : fattura insoluto
|
||||||
const TRectype pag = rs.row(p); // 2 : nota di credito
|
const TRectype pag = rs.row(r); // 2 : nota di credito
|
||||||
const TRiga_partite& sum = _p->riga(p); // 3,4,6 : incasso/pagamento/abbuono/pag.insoluto/diff.cambio/rit.prof
|
const TRiga_partite& sum = p.riga(r); // 3,4,6 : incasso/pagamento/abbuono/pag.insoluto/diff.cambio/rit.prof
|
||||||
const char sez = sum.sezione();
|
const char sez = sum.sezione();
|
||||||
const tipo_movimento tipomov = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
const tipo_movimento tipomov = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
||||||
// se tipomov e' 2 (Nota di credito assegnata)
|
// se tipomov e' 2 (Nota di credito assegnata)
|
||||||
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
||||||
// compresa la sezione opposta
|
// compresa la sezione opposta
|
||||||
|
|
||||||
if (tipomov == tm_nota_credito)
|
if (tipomov == tm_nota_credito)
|
||||||
{
|
{
|
||||||
const TImporto work_imp = TImporto(sez,pag.get_real(field));
|
const TImporto work_imp = TImporto(sez,pag.get_real(field));
|
||||||
@ -505,7 +500,7 @@ void TStampaScadenzario::calcola_pagamenti(real& imp_scad, int riga, int rata, T
|
|||||||
imp_scad = scdz.valore();
|
imp_scad = scdz.valore();
|
||||||
real a,b,c;
|
real a,b,c;
|
||||||
TString80 k;
|
TString80 k;
|
||||||
look_in_cache(a,b,c,uns,unsnc,unsins,k);
|
look_in_cache(p, a, b, c,uns, unsnc, unsins, k);
|
||||||
if (b > ZERO) // Scala le note di credito dalle scadenze
|
if (b > ZERO) // Scala le note di credito dalle scadenze
|
||||||
{
|
{
|
||||||
const real gap = b > imp_scad ? imp_scad : b;
|
const real gap = b > imp_scad ? imp_scad : b;
|
||||||
@ -561,7 +556,7 @@ const char* TStampaScadenzario::tipi_tab(int tipo) const
|
|||||||
case 9: return TR("Bonifici");
|
case 9: return TR("Bonifici");
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return "";
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaScadenzario::preprocess_page(int file, int counter)
|
bool TStampaScadenzario::preprocess_page(int file, int counter)
|
||||||
@ -603,38 +598,30 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
if (!_m->selected(bill))
|
if (!_m->selected(bill))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_descrizione->restart();
|
// _descrizione.restart();
|
||||||
if (scad_changed(tipoc,gruppo,conto,codcf,annop,nump))
|
|
||||||
{
|
TPartita p(bill, annop, nump);
|
||||||
TRectype rp(LF_PARTITE);
|
TString80 k; // compone la chiave dei tassoc_array dentro a _uns_cache
|
||||||
rp.put(PART_TIPOCF,tipoc);
|
|
||||||
rp.put(PART_GRUPPO,gruppo);
|
k << tipoc << gruppo ;
|
||||||
rp.put(PART_CONTO,conto);
|
k << conto << codcf;
|
||||||
rp.put(PART_SOTTOCONTO,codcf);
|
k << annop << nump;
|
||||||
rp.put(PART_ANNO,annop);
|
if (!in_cache(k))
|
||||||
rp.put(PART_NUMPART,nump);
|
calcola_unassigned(p, k);
|
||||||
if (_p) delete _p;
|
|
||||||
_p = new TPartita(rp);
|
TRiga_partite& row = p.riga(nrigap);
|
||||||
|
|
||||||
TString80 k; // compone la chiave dei tassoc_array dentro a _uns_cache
|
_datareg = row.get_date(PART_DATAREG).string(brief);
|
||||||
k << tipoc << gruppo ;
|
_datadoc = row.get_date(PART_DATADOC).string(brief);
|
||||||
k << conto << codcf;
|
_numdoc = row.get(PART_NUMDOC);
|
||||||
k << annop << nump;
|
_protiva.format("%5ld",row.get_long(PART_PROTIVA));
|
||||||
if (!in_cache(k))
|
_descrizione = row.get(PART_DESCR);
|
||||||
calcola_unassigned(k);
|
_codval = row.get(PART_CODVAL);
|
||||||
TRiga_partite& row = _p->riga(nrigap);
|
//Per indicare che non e' indicata la valuta o e' Euro (se la stampa in valuta is disabled)
|
||||||
_datareg = row.get_date(PART_DATAREG).string(brief);
|
if (_codval.empty() || !_stvaluta) _codval = " ";
|
||||||
_datadoc = row.get_date(PART_DATADOC).string(brief);
|
if (_descrizione.blank()) // Se sulla partita non c'e' descrizione allora va leggerla sulla causale.
|
||||||
_numdoc = row.get(PART_NUMDOC);
|
_descrizione = cache().get(LF_CAUSALI, row.get(PART_CODCAUS), CAU_DESCR);
|
||||||
_protiva.format("%5ld",row.get_long(PART_PROTIVA));
|
calcola_pagamenti(p, imp_scad, nrigap, nratap, bill);
|
||||||
*_descrizione = row.get(PART_DESCR);
|
|
||||||
_codval = row.get(PART_CODVAL);
|
|
||||||
//Per indicare che non e' indicata la valuta o e' Euro (se la stampa in valuta is disabled)
|
|
||||||
if (_codval.empty() || !_stvaluta) _codval = " ";
|
|
||||||
if (_descrizione->items() == 0) // Se sulla partita non c'e' descrizione allora va leggerla sulla causale.
|
|
||||||
*_descrizione = cache().get(LF_CAUSALI, row.get(PART_CODCAUS), CAU_DESCR);
|
|
||||||
}
|
|
||||||
calcola_pagamenti(imp_scad,nrigap,nratap, bill);
|
|
||||||
|
|
||||||
// Se la rata e' stata saldata e non e' abilitato il flag di stampa
|
// Se la rata e' stata saldata e non e' abilitato il flag di stampa
|
||||||
// oppure l'importo in scadenza e' 0 allora salta alla prossima scadenza
|
// oppure l'importo in scadenza e' 0 allora salta alla prossima scadenza
|
||||||
@ -644,11 +631,11 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
_annopart.format("%d",annop);
|
_annopart.format("%d",annop);
|
||||||
_annopart.ltrim(2);
|
_annopart.ltrim(2);
|
||||||
_rimdir = "";
|
_rimdir = EMPTY_STRING;
|
||||||
_riba = "";
|
_riba = EMPTY_STRING;
|
||||||
_bonifico = "";
|
_bonifico = EMPTY_STRING;
|
||||||
_altri = "";
|
_altri = EMPTY_STRING;
|
||||||
_imp_pag = "";
|
_imp_pag = EMPTY_STRING;
|
||||||
|
|
||||||
const bool print_in_valuta = _stvaluta && is_true_value(_codval);
|
const bool print_in_valuta = _stvaluta && is_true_value(_codval);
|
||||||
const TString& divisa = print_in_valuta ? _codval : EMPTY_STRING;
|
const TString& divisa = print_in_valuta ? _codval : EMPTY_STRING;
|
||||||
@ -680,11 +667,11 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
if (file == LF_CLIFO)
|
if (file == LF_CLIFO)
|
||||||
{
|
{
|
||||||
TString80 xxx = current_cursor()->curr(LF_CLIFO).get(CLI_RAGSOC);
|
_ragsoc = current_cursor()->curr(LF_CLIFO).get(CLI_RAGSOC);
|
||||||
*_ragsoc = xxx.strip_double_spaces();
|
_ragsoc.strip_double_spaces();
|
||||||
}
|
}
|
||||||
if (file == LF_PCON)
|
if (file == LF_PCON)
|
||||||
*_des_conto = current_cursor()->curr(LF_PCON).get(PCN_DESCR);
|
_des_conto = current_cursor()->curr(LF_PCON).get(PCN_DESCR);
|
||||||
|
|
||||||
// Se l'ordinamento principale e' per data scadenza stampa il totale del giorno e del mese
|
// Se l'ordinamento principale e' per data scadenza stampa il totale del giorno e del mese
|
||||||
if (_ordata && !_end_printed)
|
if (_ordata && !_end_printed)
|
||||||
@ -705,7 +692,7 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
for (int i=1; i<MaxRowsForTotal; i++) reset_row(i);
|
for (int i=1; i<MaxRowsForTotal; i++) reset_row(i);
|
||||||
int n = 1;
|
int n = 1;
|
||||||
set_row(n++,"");
|
set_row(n++,EMPTY_STRING);
|
||||||
print_totali(n,month_changed,false);
|
print_totali(n,month_changed,false);
|
||||||
switch (_tipost)
|
switch (_tipost)
|
||||||
{
|
{
|
||||||
@ -756,7 +743,7 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
{
|
{
|
||||||
reset_print();
|
reset_print();
|
||||||
int n=1;
|
int n=1;
|
||||||
set_row(n++,"");
|
set_row(n++,EMPTY_STRING);
|
||||||
print_totali(n,true,true);
|
print_totali(n,true,true);
|
||||||
}
|
}
|
||||||
// Qui stampa il totale di ogni cli/fo o conto, nel caso che l'ordinamento
|
// Qui stampa il totale di ogni cli/fo o conto, nel caso che l'ordinamento
|
||||||
@ -769,9 +756,12 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
if (_cur_gr != -1 && _cur_co != -1 && _cur_codcf != -1)
|
if (_cur_gr != -1 && _cur_co != -1 && _cur_codcf != -1)
|
||||||
if (_cur_gr != gruppo || _cur_co != conto || _cur_codcf != codcf)
|
if (_cur_gr != gruppo || _cur_co != conto || _cur_codcf != codcf)
|
||||||
{
|
{
|
||||||
for (int i=1; i<MaxRowsForTotal; i++) reset_row(i);
|
for (int i=1; i<MaxRowsForTotal; i++)
|
||||||
int n = 1;
|
reset_row(i);
|
||||||
set_row(n++,"");
|
|
||||||
|
int n = 1;
|
||||||
|
|
||||||
|
set_row(n++,EMPTY_STRING);
|
||||||
print_totali_c(n,false);
|
print_totali_c(n,false);
|
||||||
if (_tipost == altri)
|
if (_tipost == altri)
|
||||||
set_page_pcon(n);
|
set_page_pcon(n);
|
||||||
@ -784,11 +774,11 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // If group/count/codcf Remains The Same don't repeat _ragsoc, _des_conto...
|
{ // If group/count/codcf Remains The Same don't repeat _ragsoc, _des_conto...
|
||||||
*_ragsoc = "";
|
_ragsoc = EMPTY_STRING;
|
||||||
*_des_conto = "";
|
_des_conto = EMPTY_STRING;
|
||||||
_cur_gr_s = "";
|
_cur_gr_s = EMPTY_STRING;
|
||||||
_cur_co_s = "";
|
_cur_co_s = EMPTY_STRING;
|
||||||
_cur_codcf_s = "";
|
_cur_codcf_s = EMPTY_STRING;
|
||||||
changed = false;
|
changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,7 +813,7 @@ bool TStampaScadenzario::preprocess_page(int file, int counter)
|
|||||||
{
|
{
|
||||||
reset_print();
|
reset_print();
|
||||||
int n=1;
|
int n=1;
|
||||||
set_row(n++,"");
|
set_row(n++,EMPTY_STRING);
|
||||||
// Il confronto posso farlo solo su clienti/fornitori/altri, anche perche'
|
// Il confronto posso farlo solo su clienti/fornitori/altri, anche perche'
|
||||||
// per tutti e' obbligatorio l'ordinamento principale per data.
|
// per tutti e' obbligatorio l'ordinamento principale per data.
|
||||||
print_totali_c(n,true);
|
print_totali_c(n,true);
|
||||||
@ -870,37 +860,30 @@ bool TStampaScadenzario::user_create()
|
|||||||
{
|
{
|
||||||
_rel1 = new TRelation(LF_SCADENZE); // Scadenze per data scadenza + CliFo (Codice & Ragione sociale)
|
_rel1 = new TRelation(LF_SCADENZE); // Scadenze per data scadenza + CliFo (Codice & Ragione sociale)
|
||||||
_rel1->lfile().set_curr(new TScadenza_rec);
|
_rel1->lfile().set_curr(new TScadenza_rec);
|
||||||
_rel1->add(LF_CLIFO,"TIPOCF=TIPOC|CODCF=SOTTOCONTO",1,0,SCADCLIFO_ALIAS);
|
_rel1->add(LF_CLIFO, "TIPOCF=TIPOC|CODCF=SOTTOCONTO",1,0,SCADCLIFO_ALIAS);
|
||||||
_cur1 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|SOTTOCONTO|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur1 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|SOTTOCONTO|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
// Per data scadenza + ragione sociale e' necessario un TSorted_cursor con update del file collegato:
|
// Per data scadenza + ragione sociale e' necessario un TSorted_cursor con update del file collegato:
|
||||||
_cur11 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|UPPER(20->RAGSOC)|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur11 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|UPPER(20->RAGSOC)|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
|
|
||||||
// Scadenze per CliFo (Codice & Ragione sociale) + data scadenza
|
// Scadenze per CliFo (Codice & Ragione sociale) + data scadenza
|
||||||
_cur2 = add_cursor(new TSorted_cursor(_rel1,"SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur2 = add_cursor(new TSorted_cursor(_rel1,"SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
_cur3 = add_cursor(new TSorted_cursor(_rel1,"UPPER(20->RAGSOC)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur3 = add_cursor(new TSorted_cursor(_rel1,"UPPER(20->RAGSOC)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
|
|
||||||
_rel2 = new TRelation(LF_SCADENZE); // Scadenze per data scadenza + piano dei conti (Codice & Descrizione)
|
_rel2 = new TRelation(LF_SCADENZE); // Scadenze per data scadenza + piano dei conti (Codice & Descrizione)
|
||||||
_rel2->lfile().set_curr(new TScadenza_rec);
|
_rel2->lfile().set_curr(new TScadenza_rec);
|
||||||
_rel2->add(LF_PCON,"GRUPPO=GRUPPO|CONTO=CONTO|SOTTOCONTO=SOTTOCONTO",1,0,SCADPCON_ALIAS);
|
_rel2->add(LF_PCON,"GRUPPO=GRUPPO|CONTO=CONTO|SOTTOCONTO=SOTTOCONTO",1,0,SCADPCON_ALIAS);
|
||||||
_cur4 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|GRUPPO|CONTO|SOTTOCONTO|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur4 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|GRUPPO|CONTO|SOTTOCONTO|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
// Per data scadenza + descrizione e' necessario un TSorted_cursor con update del file collegato:
|
// Per data scadenza + descrizione e' necessario un TSorted_cursor con update del file collegato:
|
||||||
_cur41 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|UPPER(19->DESCR)|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur41 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|UPPER(19->DESCR)|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
|
|
||||||
// Scadenze per Conti (Codice & descrizione) + data scadenza
|
// Scadenze per Conti (Codice & descrizione) + data scadenza
|
||||||
_cur5 = add_cursor(new TSorted_cursor(_rel2,"GRUPPO|CONTO|SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur5 = add_cursor(new TSorted_cursor(_rel2,"GRUPPO|CONTO|SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
_cur6 = add_cursor(new TSorted_cursor(_rel2,"UPPER(19->DESCR)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
|
_cur6 = add_cursor(new TSorted_cursor(_rel2,"UPPER(19->DESCR)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA",EMPTY_STRING,2));
|
||||||
|
|
||||||
_rel3 = new TRelation(LF_SCADENZE); // Scadenze (Tutte) per data scadenza
|
_rel3 = new TRelation(LF_SCADENZE); // Scadenze (Tutte) per data scadenza
|
||||||
_rel3->lfile().set_curr(new TScadenza_rec);
|
_rel3->lfile().set_curr(new TScadenza_rec);
|
||||||
_cur7 = add_cursor(new TCursor(_rel3,"",2));
|
_cur7 = add_cursor(new TCursor(_rel3,EMPTY_STRING,2));
|
||||||
|
|
||||||
open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_PARTITE, LF_PAGSCA, 0);
|
open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_PARTITE, LF_PAGSCA, 0);
|
||||||
|
|
||||||
_pagsca = new TLocalisamfile(LF_PAGSCA);
|
|
||||||
_descrizione = new TParagraph_string("",19);
|
|
||||||
_ragsoc = new TParagraph_string("",19);
|
|
||||||
_des_conto = new TParagraph_string("",19);
|
|
||||||
|
|
||||||
_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);
|
_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);_tl.add(new TAssoc_array);
|
||||||
_uns_cache.add(new TAssoc_array); // Pagamenti
|
_uns_cache.add(new TAssoc_array); // Pagamenti
|
||||||
_uns_cache.add(new TAssoc_array); // Note di credito
|
_uns_cache.add(new TAssoc_array); // Note di credito
|
||||||
@ -928,17 +911,9 @@ bool TStampaScadenzario::user_destroy()
|
|||||||
// dalla printapp, poiche' e' lei stessa che
|
// dalla printapp, poiche' e' lei stessa che
|
||||||
// effettua tale operazione nella propria destroy().
|
// effettua tale operazione nella propria destroy().
|
||||||
//
|
//
|
||||||
if (_rel1) delete _rel1;
|
safe_delete(_rel1);
|
||||||
if (_rel2) delete _rel2;
|
safe_delete(_rel2);
|
||||||
if (_rel3) delete _rel3;
|
safe_delete(_rel3);
|
||||||
if (_pagsca)
|
|
||||||
delete _pagsca;
|
|
||||||
if (_descrizione)
|
|
||||||
delete _descrizione;
|
|
||||||
if (_des_conto)
|
|
||||||
delete _des_conto;
|
|
||||||
if (_ragsoc)
|
|
||||||
delete _ragsoc;
|
|
||||||
_tl.destroy();
|
_tl.destroy();
|
||||||
_uns_cache.destroy();
|
_uns_cache.destroy();
|
||||||
_tm.destroy();
|
_tm.destroy();
|
||||||
@ -965,20 +940,39 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
_m->reset(F_SORTBAN);
|
_m->reset(F_SORTBAN);
|
||||||
_m->reset(F_CODAG);
|
_m->reset(F_CODAG);
|
||||||
_m->reset(F_TIPOPAG);
|
_m->reset(F_TIPOPAG);
|
||||||
const bool ok = _m->run() == K_ENTER;
|
|
||||||
|
TDate data = today;
|
||||||
|
|
||||||
|
data.set_day(1);
|
||||||
|
if (!_m->get_date(F_DATASCADENZAI).ok())
|
||||||
|
_m->set(F_DATASCADENZAI, data);
|
||||||
|
if (!_m->get_date(F_DATAFATTI).ok())
|
||||||
|
_m->set(F_DATAFATTI, data);
|
||||||
|
data.set_end_month();
|
||||||
|
if (!_m->get_date(F_DATASCADENZAF).ok())
|
||||||
|
_m->set(F_DATASCADENZAF, data);
|
||||||
|
if (!_m->get_date(F_DATAFATTF).ok())
|
||||||
|
_m->set(F_DATAFATTF, data);
|
||||||
|
|
||||||
|
const bool ok = _m->run() == K_ENTER;
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
_last_bank_rec = 0;
|
_last_bank_rec = 0;
|
||||||
_end_printed = false;
|
_end_printed = false;
|
||||||
_totbank_printed = false;
|
_totbank_printed = false;
|
||||||
|
_m->update_assoc();
|
||||||
reset_files();
|
reset_files();
|
||||||
reset_print();
|
reset_print();
|
||||||
// Inizializza i membri necessari al calcolo totali nel caso sia stato scelto l'ordine
|
// Inizializza i membri necessari al calcolo totali nel caso sia stato scelto l'ordine
|
||||||
// primario secondo la data di scadenza.
|
// primario secondo la data di scadenza.
|
||||||
if (_m->get_who() == 'P') _tipost = altri;
|
if (_m->conti())
|
||||||
else if (_m->get_who() == 'C') _tipost = clienti;
|
_tipost = altri;
|
||||||
else _tipost = fornitori;
|
else
|
||||||
_ordcod = _m->get_selected_key() == 1; // Stampa ordinata per codice?
|
if (_m->clienti())
|
||||||
|
_tipost = clienti;
|
||||||
|
else
|
||||||
|
_tipost = fornitori;
|
||||||
_group_ban = _m->get_bool(F_SORTBAN); // Raggruppamento per banca di presentazione
|
_group_ban = _m->get_bool(F_SORTBAN); // Raggruppamento per banca di presentazione
|
||||||
_codag = _m->get(F_CODAG); // codice agente selezionato
|
_codag = _m->get(F_CODAG); // codice agente selezionato
|
||||||
_tipopag = _m->get_int(F_TIPOPAG); // tipo pagamento selezionato
|
_tipopag = _m->get_int(F_TIPOPAG); // tipo pagamento selezionato
|
||||||
@ -998,9 +992,9 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
// Per calcolare i totali nel caso l'ordine primario non sia per data scadenze
|
// Per calcolare i totali nel caso l'ordine primario non sia per data scadenze
|
||||||
// utilizzera' le variabili _tp_* per il totale generale e _tm_* per i singoli totali.
|
// utilizzera' le variabili _tp_* per il totale generale e _tm_* per i singoli totali.
|
||||||
// E' necessario resettare anche queste TParagraph_string... Puo' servire in futuro...
|
// E' necessario resettare anche queste TParagraph_string... Puo' servire in futuro...
|
||||||
*_ragsoc = "";
|
_ragsoc = EMPTY_STRING;
|
||||||
*_des_conto = "";
|
_des_conto = EMPTY_STRING;
|
||||||
*_descrizione = "";
|
_descrizione = EMPTY_STRING;
|
||||||
_ratesald = _m->get_bool(F_RATESALDATE);
|
_ratesald = _m->get_bool(F_RATESALDATE);
|
||||||
_ordata = _m->get_bool(F_ORDDATA);
|
_ordata = _m->get_bool(F_ORDDATA);
|
||||||
_stvaluta = _m->get_bool(F_VALUTA);
|
_stvaluta = _m->get_bool(F_VALUTA);
|
||||||
@ -1043,6 +1037,7 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
if (!sel_datafatt)
|
if (!sel_datafatt)
|
||||||
{
|
{
|
||||||
TRectype da_data(LF_SCADENZE), a_data(LF_SCADENZE);
|
TRectype da_data(LF_SCADENZE), a_data(LF_SCADENZE);
|
||||||
|
|
||||||
da_data.put(SCAD_DATASCAD,_datai);
|
da_data.put(SCAD_DATASCAD,_datai);
|
||||||
a_data.put(SCAD_DATASCAD,_dataf);
|
a_data.put(SCAD_DATASCAD,_dataf);
|
||||||
get_cursor(_cur1)->setregion(da_data,a_data);
|
get_cursor(_cur1)->setregion(da_data,a_data);
|
||||||
@ -1055,15 +1050,15 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
get_cursor(_cur6)->setregion(da_data,a_data);
|
get_cursor(_cur6)->setregion(da_data,a_data);
|
||||||
get_cursor(_cur7)->setregion(da_data,a_data);
|
get_cursor(_cur7)->setregion(da_data,a_data);
|
||||||
}
|
}
|
||||||
get_cursor(_cur1)->setfilter("");
|
get_cursor(_cur1)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur11)->setfilter("");
|
get_cursor(_cur11)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur2)->setfilter("");
|
get_cursor(_cur2)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur3)->setfilter("");
|
get_cursor(_cur3)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur4)->setfilter("");
|
get_cursor(_cur4)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur41)->setfilter("");
|
get_cursor(_cur41)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur5)->setfilter("");
|
get_cursor(_cur5)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur6)->setfilter("");
|
get_cursor(_cur6)->setfilter(EMPTY_STRING);
|
||||||
get_cursor(_cur7)->setfilter("");
|
get_cursor(_cur7)->setfilter(EMPTY_STRING);
|
||||||
switch (_tipost)
|
switch (_tipost)
|
||||||
{
|
{
|
||||||
case tutti:
|
case tutti:
|
||||||
@ -1072,76 +1067,75 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
break;
|
break;
|
||||||
case clienti:
|
case clienti:
|
||||||
case fornitori:
|
case fornitori:
|
||||||
if (_ordata) // Ordine primario per data
|
{
|
||||||
{ // Controlla l'ordine secondario (codice o ragione sociale)
|
TString filter("(TIPOC = \"");
|
||||||
if (_ordcod) // Per codice...
|
|
||||||
{
|
filter << _m->who() << "\")";
|
||||||
select_cursor(_cur1);
|
if (_ordata) // Ordine primario per data
|
||||||
if (_tipost==clienti)
|
{
|
||||||
get_cursor(_cur1)->setfilter("(TIPOC=\"C\")");
|
|
||||||
else
|
get_cursor(_cur3)->setfilter(filter);
|
||||||
get_cursor(_cur1)->setfilter("(TIPOC=\"F\")");
|
if (_m->key() == 1) // Per codice...
|
||||||
}
|
{
|
||||||
else
|
select_cursor(_cur1);
|
||||||
{
|
get_cursor(_cur1)->setfilter(filter);
|
||||||
select_cursor(_cur11); // Per ragione sociale
|
}
|
||||||
if (_tipost==clienti)
|
else
|
||||||
get_cursor(_cur11)->setfilter("(TIPOC=\"C\")");
|
{
|
||||||
else
|
select_cursor(_cur11); // Per ragione sociale
|
||||||
get_cursor(_cur11)->setfilter("(TIPOC=\"F\")");
|
get_cursor(_cur11)->setfilter(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Ordine primario per codice o ragione sociale
|
else // Ordine primario per codice o ragione sociale
|
||||||
{
|
{
|
||||||
if (_ordcod) // Codice...
|
if (_m->key() == 1) // Codice...
|
||||||
{
|
{
|
||||||
select_cursor(_cur2);
|
select_cursor(_cur2);
|
||||||
if (_tipost==clienti)
|
get_cursor(_cur2)->setfilter(filter);
|
||||||
get_cursor(_cur2)->setfilter("(TIPOC=\"C\")");
|
}
|
||||||
else
|
else // Ragione sociale
|
||||||
get_cursor(_cur2)->setfilter("(TIPOC=\"F\")");
|
{
|
||||||
}
|
select_cursor(_cur3);
|
||||||
else // Ragione sociale
|
get_cursor(_cur3)->setfilter(filter);
|
||||||
{
|
}
|
||||||
select_cursor(_cur3);
|
}
|
||||||
if (_tipost==clienti)
|
add_file(LF_SCADENZE);
|
||||||
get_cursor(_cur3)->setfilter("(TIPOC=\"C\")");
|
add_file(LF_CLIFO, LF_SCADENZE);
|
||||||
else
|
}
|
||||||
get_cursor(_cur3)->setfilter("(TIPOC=\"F\")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_file(LF_SCADENZE);
|
|
||||||
add_file(LF_CLIFO,LF_SCADENZE);
|
|
||||||
break;
|
break;
|
||||||
case altri:
|
case altri:
|
||||||
if (_ordata) // Ordine primario per data
|
{
|
||||||
{ // Controlla l'ordine secondario (Codice o descrizione)
|
const TString filter = "(TIPOC=\"\")";
|
||||||
if (_ordcod) // Per codice ...
|
|
||||||
{
|
if (_ordata) // Ordine primario per data
|
||||||
select_cursor(_cur4);
|
{ // Controlla l'ordine secondario (Codice o descrizione)
|
||||||
get_cursor(_cur4)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
|
if (_m->key() == 1) // Per codice ...
|
||||||
}
|
{
|
||||||
else
|
select_cursor(_cur4);
|
||||||
{
|
get_cursor(_cur4)->setfilter(filter); // Filtro per i conti normali!
|
||||||
select_cursor(_cur41); // Per descrizione.
|
}
|
||||||
get_cursor(_cur41)->setfilter("(TIPOC=\"\")");
|
else
|
||||||
}
|
{
|
||||||
}
|
select_cursor(_cur41); // Per descrizione.
|
||||||
else // Ordine primario per codice o descrizione
|
get_cursor(_cur41)->setfilter(filter);
|
||||||
{
|
}
|
||||||
if (_ordcod) // Codice...
|
}
|
||||||
{
|
else // Ordine primario per codice o descrizione
|
||||||
select_cursor(_cur5);
|
{
|
||||||
get_cursor(_cur5)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
|
if (_m->key() == 1) // Codice...
|
||||||
}
|
{
|
||||||
else // Descrizione
|
select_cursor(_cur5);
|
||||||
{
|
get_cursor(_cur5)->setfilter(filter); // Filtro per i conti normali!
|
||||||
select_cursor(_cur6);
|
}
|
||||||
get_cursor(_cur6)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
|
else // Descrizione
|
||||||
}
|
{
|
||||||
}
|
select_cursor(_cur6);
|
||||||
add_file(LF_SCADENZE);
|
get_cursor(_cur6)->setfilter(filter); // Filtro per i conti normali!
|
||||||
add_file(LF_PCON,LF_SCADENZE);
|
}
|
||||||
|
}
|
||||||
|
add_file(LF_SCADENZE);
|
||||||
|
add_file(LF_PCON, LF_SCADENZE);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1180,16 +1174,10 @@ bool TStampaScadenzario::set_print(int)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_p)
|
|
||||||
{
|
|
||||||
delete _p; // Questo deve essere cancellato, altrimenti rimane in memoria,
|
|
||||||
_p = NULL; // provocando casini al prossimo "giro"
|
|
||||||
}
|
|
||||||
|
|
||||||
TAssoc_array& a =(TAssoc_array&) _uns_cache[0];
|
TAssoc_array& a =(TAssoc_array&) _uns_cache[0];
|
||||||
TAssoc_array& b =(TAssoc_array&) _uns_cache[1];
|
TAssoc_array& b =(TAssoc_array&) _uns_cache[1];
|
||||||
|
|
||||||
a.destroy(); b.destroy(); // Libera i TAssoc_array impiegati.
|
a.destroy(); b.destroy(); // Libera i TAssoc_array impiegati.
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1225,7 +1213,7 @@ void TStampaScadenzario::print_header()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_header(soh++,FR("@56g** SCADENZARIO CLIENTI **"));
|
set_header(soh++,FR("@56g** SCADENZARIO CLIENTI **"));
|
||||||
s1 = s2 = "";
|
s1 = s2 = EMPTY_STRING;
|
||||||
}
|
}
|
||||||
set_header (soh++,FR("@56gPeriodo dal %s al %s"),(const char*)datai,(const char*)dataf);
|
set_header (soh++,FR("@56gPeriodo dal %s al %s"),(const char*)datai,(const char*)dataf);
|
||||||
|
|
||||||
@ -1282,7 +1270,7 @@ void TStampaScadenzario::print_header()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
set_header(soh,"");
|
set_header(soh,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaScadenzario::set_page_clifo(int nriga)
|
void TStampaScadenzario::set_page_clifo(int nriga)
|
||||||
@ -1290,13 +1278,13 @@ void TStampaScadenzario::set_page_clifo(int nriga)
|
|||||||
{
|
{
|
||||||
if (_group_ban)
|
if (_group_ban)
|
||||||
print_intestazione_banca(nriga);
|
print_intestazione_banca(nriga);
|
||||||
set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);
|
||||||
set_row(nriga,"@b#6t@r",&_cur_codcf_s);
|
set_row(nriga,"@b#6t@r",&_cur_codcf_s);
|
||||||
set_row(nriga,"@b@7g#a@r",_ragsoc);
|
set_row(nriga,"@b@7g#a@r",&_ragsoc);
|
||||||
set_row(nriga,"@28g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
|
set_row(nriga,"@28g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
|
||||||
set_row(nriga,"@38g@d",FLD(LF_SCADENZE,SCAD_DATASCAD));
|
set_row(nriga,"@38g@d",FLD(LF_SCADENZE,SCAD_DATASCAD));
|
||||||
set_row(nriga,"@47g#t",&_datareg);
|
set_row(nriga,"@47g#t",&_datareg);
|
||||||
set_row(nriga,"@56g#a",_descrizione);
|
set_row(nriga,"@56g#a",&_descrizione);
|
||||||
set_row(nriga,"@77g@4,rs/@1n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG));
|
set_row(nriga,"@77g@4,rs/@1n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG));
|
||||||
set_row(nriga,"@86g@4n",FLD(LF_SCADENZE,SCAD_NRATA));
|
set_row(nriga,"@86g@4n",FLD(LF_SCADENZE,SCAD_NRATA));
|
||||||
if (_tipost == fornitori)
|
if (_tipost == fornitori)
|
||||||
@ -1309,7 +1297,7 @@ void TStampaScadenzario::set_page_clifo(int nriga)
|
|||||||
set_row(nriga,"@164g#15t",&_bonifico); // Bonifico
|
set_row(nriga,"@164g#15t",&_bonifico); // Bonifico
|
||||||
set_row(nriga,"@180g#15t",&_altri); // Altri tipi di pagamento
|
set_row(nriga,"@180g#15t",&_altri); // Altri tipi di pagamento
|
||||||
//set_row(nriga,"@198g@1s",FLD(LF_SCADENZE,SCAD_BLOCCATA));
|
//set_row(nriga,"@198g@1s",FLD(LF_SCADENZE,SCAD_BLOCCATA));
|
||||||
set_row(nriga,"@197g%s", _w_imp_blocked ? "Si" : "");
|
set_row(nriga,"@197g%s", _w_imp_blocked ? "Si" : EMPTY_STRING);
|
||||||
nriga++;
|
nriga++;
|
||||||
set_row(nriga,"@28g#t",&_datadoc);
|
set_row(nriga,"@28g#t",&_datadoc);
|
||||||
set_row(nriga,"@38g#8t",&_numdoc);
|
set_row(nriga,"@38g#8t",&_numdoc);
|
||||||
@ -1321,12 +1309,12 @@ void TStampaScadenzario::set_page_pcon(int nriga)
|
|||||||
{
|
{
|
||||||
if (_group_ban)
|
if (_group_ban)
|
||||||
print_intestazione_banca(nriga);
|
print_intestazione_banca(nriga);
|
||||||
set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);
|
||||||
set_row(nriga,"@b#3t@5g#3t@9g#6t@r",&_cur_gr_s,&_cur_co_s,&_cur_codcf_s);
|
set_row(nriga,"@b#3t@5g#3t@9g#6t@r",&_cur_gr_s,&_cur_co_s,&_cur_codcf_s);
|
||||||
set_row(nriga,"@b@16g#a@r",_des_conto);
|
set_row(nriga,"@b@16g#a@r", &_des_conto);
|
||||||
set_row(nriga,"@33g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
|
set_row(nriga,"@33g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
|
||||||
set_row(nriga,"@43g@d@53g#t",FLD(LF_SCADENZE,SCAD_DATASCAD),&_datareg);
|
set_row(nriga,"@43g@d@53g#t",FLD(LF_SCADENZE,SCAD_DATASCAD),&_datareg);
|
||||||
set_row(nriga,"@61g#a",_descrizione);
|
set_row(nriga,"@61g#a",&_descrizione);
|
||||||
set_row(nriga,"@82g@4,rs/@1n@89g@4n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG),
|
set_row(nriga,"@82g@4,rs/@1n@89g@4n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG),
|
||||||
FLD(LF_SCADENZE,SCAD_NRATA));
|
FLD(LF_SCADENZE,SCAD_NRATA));
|
||||||
set_row(nriga,"@96g#t", &_codval);
|
set_row(nriga,"@96g#t", &_codval);
|
||||||
@ -1376,14 +1364,17 @@ void TStampaScadenzario::print_rows_riepilogo(int& nriga, bool type, TAssoc_arra
|
|||||||
if (v.is_zero())
|
if (v.is_zero())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const TString4 val = k.right(3);
|
const TString4 val = k.sright(3);
|
||||||
const int tipo = k[0]-'0';
|
const int tipo = k[0]-'0';
|
||||||
const char ult = k[1];
|
const char ult = k[1];
|
||||||
|
|
||||||
TString80 ult_class;
|
TString80 ult_class;
|
||||||
|
|
||||||
if (ult > ' ')
|
if (ult > ' ')
|
||||||
{
|
{
|
||||||
const char cod[3] = { tipo+'0', ult, '\0' };
|
TString cod;
|
||||||
|
|
||||||
|
cod << (tipo + '0') << ult;
|
||||||
ult_class = cache().get("%CLR", cod, "S0");
|
ult_class = cache().get("%CLR", cod, "S0");
|
||||||
ult_class.cut(27);
|
ult_class.cut(27);
|
||||||
}
|
}
|
||||||
@ -1391,6 +1382,7 @@ void TStampaScadenzario::print_rows_riepilogo(int& nriga, bool type, TAssoc_arra
|
|||||||
const bool stampa_in_valuta = _stvaluta && is_true_value(val);
|
const bool stampa_in_valuta = _stvaluta && is_true_value(val);
|
||||||
const TString& divisa = stampa_in_valuta ? val : EMPTY_STRING;
|
const TString& divisa = stampa_in_valuta ? val : EMPTY_STRING;
|
||||||
TString80 value;
|
TString80 value;
|
||||||
|
|
||||||
print_real(value, v, divisa);
|
print_real(value, v, divisa);
|
||||||
set_row(nriga++,"@0g! %s@25g! %s@55g! %s@61g!@64g%18s@82g!",
|
set_row(nriga++,"@0g! %s@25g! %s@55g! %s@61g!@64g%18s@82g!",
|
||||||
tipi_tab(tipo), (const char*)ult_class, (const char*)val, (const char*)value);
|
tipi_tab(tipo), (const char*)ult_class, (const char*)val, (const char*)value);
|
||||||
@ -1532,9 +1524,9 @@ void TStampaScadenzario::print_rows_totali(int &nriga, tipo_pe p)
|
|||||||
if (v._al != ZERO)
|
if (v._al != ZERO)
|
||||||
set_row(nriga,"@180g%15s",(const char*) value);
|
set_row(nriga,"@180g%15s",(const char*) value);
|
||||||
|
|
||||||
set_row(++nriga,"");
|
set_row(++nriga,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
set_row(++nriga,"");
|
set_row(++nriga,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaScadenzario::print_totali(int &nriga, bool month_changed, bool ended)
|
void TStampaScadenzario::print_totali(int &nriga, bool month_changed, bool ended)
|
||||||
@ -1558,15 +1550,15 @@ void TStampaScadenzario::print_totali(int &nriga, bool month_changed, bool ended
|
|||||||
if (_group_ban)
|
if (_group_ban)
|
||||||
{
|
{
|
||||||
print_totali_bank(nriga);
|
print_totali_bank(nriga);
|
||||||
set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);
|
||||||
set_row(nriga, TR("@36g** TOTALI PERIODO"));
|
set_row(nriga, TR("@36g** TOTALI PERIODO"));
|
||||||
print_rows_totali(nriga, period);
|
print_rows_totali(nriga, period);
|
||||||
if (_striepilogo > 0)
|
if (_striepilogo > 0)
|
||||||
print_riepilogo(nriga,true);
|
print_riepilogo(nriga,true);
|
||||||
set_row(nriga++,"");set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);set_row(nriga++,EMPTY_STRING);
|
||||||
set_row(nriga++,"");set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);set_row(nriga++,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1594,14 +1586,14 @@ void TStampaScadenzario::print_totali_c(int &nriga, bool ended)
|
|||||||
if (_group_ban)
|
if (_group_ban)
|
||||||
{
|
{
|
||||||
print_totali_bank(nriga);
|
print_totali_bank(nriga);
|
||||||
set_row(nriga++,"");set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);set_row(nriga++,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
set_row(nriga, TR("@56g** TOTALE GENERALE"));
|
set_row(nriga, TR("@56g** TOTALE GENERALE"));
|
||||||
print_rows_totali(nriga, period);
|
print_rows_totali(nriga, period);
|
||||||
if (_striepilogo > 0 )
|
if (_striepilogo > 0 )
|
||||||
print_riepilogo(nriga,true);
|
print_riepilogo(nriga,true);
|
||||||
set_row(nriga++,"");set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);set_row(nriga++,EMPTY_STRING);
|
||||||
set_row(nriga++,"");set_row(nriga++,"");
|
set_row(nriga++,EMPTY_STRING);set_row(nriga++,EMPTY_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1668,18 +1660,12 @@ void TStampaScadenzario::print_intestazione_banca(int &nriga)
|
|||||||
if (_last_bank_rec != 0)
|
if (_last_bank_rec != 0)
|
||||||
print_totali_bank(nriga);
|
print_totali_bank(nriga);
|
||||||
|
|
||||||
set_row(nriga++, "");
|
set_row(nriga++, EMPTY_STRING);
|
||||||
set_row(nriga++, FR("@bBANCA DI PRESENTAZIONE %s@r"), (const char*)_desc_ban);
|
set_row(nriga++, FR("@bBANCA DI PRESENTAZIONE %s@r"), (const char*)_desc_ban);
|
||||||
set_row(nriga++, "");
|
set_row(nriga++, EMPTY_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TStampaScadenzario::TStampaScadenzario()
|
|
||||||
{
|
|
||||||
_rel1=_rel2=_rel3=NULL;
|
|
||||||
_p = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sc2200(int argc, char** argv)
|
int sc2200(int argc, char** argv)
|
||||||
{
|
{
|
||||||
TStampaScadenzario app;
|
TStampaScadenzario app;
|
||||||
|
@ -54,7 +54,6 @@ BEGIN
|
|||||||
HELP "Data di inizio scadenza"
|
HELP "Data di inizio scadenza"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
WARNING "Data di inizio scadenza non valida"
|
WARNING "Data di inizio scadenza non valida"
|
||||||
FLAGS "A"
|
|
||||||
GROUP 10
|
GROUP 10
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -74,7 +73,6 @@ BEGIN
|
|||||||
HELP "Data di inizio scadenza"
|
HELP "Data di inizio scadenza"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
WARNING "Data di inizio scadenza non valida"
|
WARNING "Data di inizio scadenza non valida"
|
||||||
FLAGS "A"
|
|
||||||
GROUP 11
|
GROUP 11
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -141,7 +139,7 @@ BEGIN
|
|||||||
PROMPT 68 10 "A~zzera"
|
PROMPT 68 10 "A~zzera"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_NSEL 3
|
NUMBER SC_NSEL 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 55 11 "Selezionati "
|
PROMPT 55 11 "Selezionati "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
|
@ -9,6 +9,208 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// TSelection_ext_mask //
|
// TSelection_ext_mask //
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool TSelection_ext_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
case SC_SORTCF:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
const int ordine = atoi(o.get());
|
||||||
|
const TString & tipo = get(SC_CLIFO);
|
||||||
|
bool g3 = false, g4 = false, g5 = false, g6 = false;
|
||||||
|
|
||||||
|
if (tipo != "P")
|
||||||
|
{
|
||||||
|
g3 = ordine == 1;
|
||||||
|
g4 = !g3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g5 = ordine == 1;
|
||||||
|
g6 = !g5;
|
||||||
|
}
|
||||||
|
show(-3, g3); // Abilita clifo per codice
|
||||||
|
show(-4, g4); // Abilita clifo per ragsoc
|
||||||
|
show(-5, g5); // Abilita pcon per conto
|
||||||
|
show(-6, g6); // Abilita pcon per descrizione
|
||||||
|
set_key(ordine);
|
||||||
|
reset_sheets();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case SC_SELECT:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TCursor_sheet& c = cur_sheet();
|
||||||
|
|
||||||
|
c.enable_check();
|
||||||
|
c.run();
|
||||||
|
if (who() == "P")
|
||||||
|
{
|
||||||
|
if (key() == 2)
|
||||||
|
set_des_pcon_limits();
|
||||||
|
else
|
||||||
|
set_pcon_limits();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (key() == 2)
|
||||||
|
set_des_clifo_limits();
|
||||||
|
else
|
||||||
|
set_clifo_limits();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case SC_PCONCODFR3:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
int grf, grt, cof, cot;
|
||||||
|
long sof, sot;
|
||||||
|
|
||||||
|
grf = get_int(SC_PCONCODFR1);
|
||||||
|
cof = get_int(SC_PCONCODFR2);
|
||||||
|
sof = get_long(SC_PCONCODFR3);
|
||||||
|
grt = get_int(SC_PCONCODTO1);
|
||||||
|
cot = get_int(SC_PCONCODTO2);
|
||||||
|
sot = get_long(SC_PCONCODTO3);
|
||||||
|
select_pcon_range(grf, cof, sof, grt, cot, sot);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TCursor_sheet& c = cur_sheet();
|
||||||
|
|
||||||
|
c.disable_check();
|
||||||
|
c.disable(DLG_USER);
|
||||||
|
if (c.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
TToken_string& t = c.row(c.selected());
|
||||||
|
int grf, grt, cof, cot;
|
||||||
|
long sof, sot;
|
||||||
|
int g = key();
|
||||||
|
|
||||||
|
grf = t.get_int(g++);
|
||||||
|
cof = t.get_int(g++);
|
||||||
|
sof = t.get_long(g);
|
||||||
|
grt = get_int(SC_PCONCODTO1);
|
||||||
|
cot = get_int(SC_PCONCODTO2);
|
||||||
|
sot = get_long(SC_PCONCODTO3);
|
||||||
|
set(SC_PCONCODFR1, grf);
|
||||||
|
set(SC_PCONCODFR2, cof);
|
||||||
|
set(SC_PCONCODFR3, sof);
|
||||||
|
select_pcon_range(grf, cof, sof, grt, cot, sot);
|
||||||
|
}
|
||||||
|
c.enable(DLG_USER);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case SC_PCONCODTO3:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
int grf, grt, cof, cot;
|
||||||
|
long sof, sot;
|
||||||
|
|
||||||
|
grf = get_int(SC_PCONCODFR1);
|
||||||
|
cof = get_int(SC_PCONCODFR2);
|
||||||
|
sof = get_long(SC_PCONCODFR3);
|
||||||
|
grt = get_int(SC_PCONCODTO1);
|
||||||
|
cot = get_int(SC_PCONCODTO2);
|
||||||
|
sot = get_long(SC_PCONCODTO3);
|
||||||
|
select_pcon_range(grf, cof, sof, grt, cot, sot);
|
||||||
|
}
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TCursor_sheet& c = cur_sheet();
|
||||||
|
|
||||||
|
c.disable_check();
|
||||||
|
c.disable(DLG_USER);
|
||||||
|
if (c.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
TToken_string& t = c.row(c.selected());
|
||||||
|
int grf, grt, cof, cot;
|
||||||
|
long sof, sot;
|
||||||
|
int g = key();
|
||||||
|
|
||||||
|
grt = t.get_int(g++);
|
||||||
|
cot = t.get_int(g++);
|
||||||
|
sot = t.get_long(g);
|
||||||
|
grf = get_int(SC_PCONCODFR1);
|
||||||
|
cof = get_int(SC_PCONCODFR2);
|
||||||
|
sof = get_long(SC_PCONCODFR3);
|
||||||
|
set(SC_PCONCODTO1, grt);
|
||||||
|
set(SC_PCONCODTO2, cot);
|
||||||
|
set(SC_PCONCODTO3, sot);
|
||||||
|
select_pcon_range(grf, cof, sof, grt, cot, sot);
|
||||||
|
}
|
||||||
|
c.enable(DLG_USER);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case SC_PCONDESFR:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
const TString des1(o.get());
|
||||||
|
const TString des2(get(SC_PCONDESTO));
|
||||||
|
|
||||||
|
select_des_pcon_range(des1, des2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TCursor_sheet& c = cur_sheet();
|
||||||
|
|
||||||
|
c.disable_check();
|
||||||
|
c.disable(DLG_USER);
|
||||||
|
if (c.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
TToken_string& t = c.row(c.selected());
|
||||||
|
const TString des1(t.get(3 - key()));
|
||||||
|
const TString des2 = get(SC_PCONDESTO);
|
||||||
|
|
||||||
|
set(SC_PCONDESFR, des1);
|
||||||
|
select_des_pcon_range(des1, des2);
|
||||||
|
}
|
||||||
|
c.enable(DLG_USER);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SC_PCONDESTO:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
const TString des2(o.get());
|
||||||
|
const TString des1(get(SC_PCONDESFR));
|
||||||
|
|
||||||
|
select_des_pcon_range(des1, des2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TCursor_sheet& c = cur_sheet();
|
||||||
|
|
||||||
|
c.disable_check();
|
||||||
|
c.disable(DLG_USER);
|
||||||
|
if (c.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
TToken_string& t = c.row(c.selected());
|
||||||
|
const TString des1(get(SC_PCONDESFR));
|
||||||
|
const TString des2(t.get(3 - key()));
|
||||||
|
|
||||||
|
set(SC_PCONDESTO, des2);
|
||||||
|
select_des_pcon_range(des1, des2);
|
||||||
|
}
|
||||||
|
c.enable(DLG_USER);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case DLG_PRINT:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TSelection_mask::on_field_event(o, e, jolly);
|
||||||
|
}
|
||||||
|
|
||||||
TSelection_ext_mask::TSelection_ext_mask(const char* name) : TSelection_mask(name),
|
TSelection_ext_mask::TSelection_ext_mask(const char* name) : TSelection_mask(name),
|
||||||
_pcon_rel(NULL), _pcon_cur_k1(NULL), _pcon_cur_k2(NULL), _pcon_sh_k1(NULL), _pcon_sh_k2(NULL)
|
_pcon_rel(NULL), _pcon_cur_k1(NULL), _pcon_cur_k2(NULL), _pcon_sh_k1(NULL), _pcon_sh_k2(NULL)
|
||||||
@ -23,15 +225,6 @@ TSelection_ext_mask::TSelection_ext_mask(const char* name) : TSelection_mask(nam
|
|||||||
HR("@1|Gruppo|Conto|Sottoconto|Descrizione@50"),0,1);
|
HR("@1|Gruppo|Conto|Sottoconto|Descrizione@50"),0,1);
|
||||||
_pcon_sh_k2 = new TCursor_sheet(_pcon_cur_k2, " |DESCR|GRUPPO|CONTO|SOTTOCONTO", "Selezione conti per descrizione",
|
_pcon_sh_k2 = new TCursor_sheet(_pcon_cur_k2, " |DESCR|GRUPPO|CONTO|SOTTOCONTO", "Selezione conti per descrizione",
|
||||||
HR("@1|Descrizione@50|Gruppo|Conto|Sottoconto"),0,1);
|
HR("@1|Descrizione@50|Gruppo|Conto|Sottoconto"),0,1);
|
||||||
|
|
||||||
set_handler(SC_CLIFO, rpcon_handler); // Redefined handler...
|
|
||||||
set_handler(SC_SORTCF, rsortpcon_handler); // Redefined handler...
|
|
||||||
set_handler(SC_SELECT, bselectpcon_handler); // Redefined handler...
|
|
||||||
set_handler(SC_RESET, bresetpcon_handler); // Redefined handler...
|
|
||||||
set_handler(SC_PCONCODFR3, ffrompcon_handler); // New handler...
|
|
||||||
set_handler(SC_PCONCODTO3, ftopcon_handler); // New handler...
|
|
||||||
set_handler(SC_PCONDESFR, fdfrompcon_handler); // New handler...
|
|
||||||
set_handler(SC_PCONDESTO, fdtopcon_handler); // New handler...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TSelection_ext_mask::~TSelection_ext_mask()
|
TSelection_ext_mask::~TSelection_ext_mask()
|
||||||
@ -46,15 +239,113 @@ TSelection_ext_mask::~TSelection_ext_mask()
|
|||||||
TCursor_sheet& TSelection_ext_mask::cur_sheet()
|
TCursor_sheet& TSelection_ext_mask::cur_sheet()
|
||||||
{
|
{
|
||||||
TCursor_sheet* cs;
|
TCursor_sheet* cs;
|
||||||
if (get_selected_key() == 1) cs = get_who() == 'P' ? _pcon_sh_k1 : NULL;
|
const bool pconti = who() == "P";
|
||||||
else cs = get_who() == 'P' ? _pcon_sh_k2 : NULL;
|
|
||||||
|
if (key() == 1)
|
||||||
|
cs = pconti ? _pcon_sh_k1 : nullptr;
|
||||||
|
else
|
||||||
|
cs = pconti ? _pcon_sh_k2 : nullptr;
|
||||||
|
|
||||||
if (get_who() != 'P')
|
if (!pconti)
|
||||||
return TSelection_mask::cur_sheet();
|
return TSelection_mask::cur_sheet();
|
||||||
CHECK(cs, "Can't use a NULL TCursor_sheet");
|
CHECK(cs, "Can't use a NULL TCursor_sheet");
|
||||||
return *cs;
|
return *cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TSelection_ext_mask::update_assoc()
|
||||||
|
{
|
||||||
|
_assoc.destroy();
|
||||||
|
update_checked();
|
||||||
|
|
||||||
|
TCursor_sheet& cs = cur_sheet(); // Sheet di selezione (CLI/FO/PCON)
|
||||||
|
|
||||||
|
if (cs.checked() != cs.items())
|
||||||
|
{
|
||||||
|
const int first = key();
|
||||||
|
TString16 key;
|
||||||
|
|
||||||
|
for (long i = cs.items() - 1; i >= 0; i--)
|
||||||
|
if (cs.checked(i))
|
||||||
|
{
|
||||||
|
TToken_string& row = cs.row(i);
|
||||||
|
if (who() == "C" || who() == "F")
|
||||||
|
{
|
||||||
|
key.format("000000%06ld", row.get_long(first));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const TBill b(row, first, 0x0);
|
||||||
|
key.format("%03d%03d%06ld",
|
||||||
|
b.gruppo(), b.conto(), b.sottoconto());
|
||||||
|
}
|
||||||
|
_assoc.add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSelection_ext_mask::selected(int g, int c, long s)
|
||||||
|
{
|
||||||
|
TCursor_sheet & cs = cur_sheet(); // Sheet di selezione (CLI/FO/PCON)
|
||||||
|
|
||||||
|
if (cs.checked() != cs.items())
|
||||||
|
{
|
||||||
|
TString16 key;
|
||||||
|
|
||||||
|
key.format("%03d%03d%06ld", g, c, s);
|
||||||
|
return _assoc.is_key(key);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRecnotype TSelection_ext_mask::get_clifo_range(long& first, long& last)
|
||||||
|
{
|
||||||
|
first = last = 0L;
|
||||||
|
|
||||||
|
TRecnotype items = 0;
|
||||||
|
|
||||||
|
if (who() >= "C")
|
||||||
|
{
|
||||||
|
TCursor_sheet & s = cur_sheet(); // Sheet di selezione (CLI/FO/PCON)
|
||||||
|
|
||||||
|
if (s.checked() == s.items())
|
||||||
|
{
|
||||||
|
items = s.items();
|
||||||
|
if (items > 0)
|
||||||
|
{
|
||||||
|
TToken_string & firstrow = s.row(0L);
|
||||||
|
|
||||||
|
first = firstrow.get_long(0);
|
||||||
|
|
||||||
|
TToken_string & lastrow = s.row(s.items() - 1L);
|
||||||
|
|
||||||
|
last = lastrow.get_long(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TAssoc_array& ass = (TAssoc_array&)_assoc; // Trick the compiler
|
||||||
|
FOR_EACH_ASSOC_OBJECT(ass, obj, key, item)
|
||||||
|
{
|
||||||
|
const TFixed_string gcs(key);
|
||||||
|
const long codcf = atol(gcs.sright(6));
|
||||||
|
if (first == 0 || codcf < first)
|
||||||
|
first = codcf;
|
||||||
|
if (last == 0 || codcf > last)
|
||||||
|
last = codcf;
|
||||||
|
items++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
TESSL_form & TSelection_ext_mask::form()
|
||||||
|
{
|
||||||
|
if (_form == nullptr)
|
||||||
|
_form = new TESSL_form(*this, false);
|
||||||
|
return *_form;
|
||||||
|
}
|
||||||
|
|
||||||
void TSelection_ext_mask::reset_sheets()
|
void TSelection_ext_mask::reset_sheets()
|
||||||
{
|
{
|
||||||
_pcon_sh_k1->uncheck(-1);
|
_pcon_sh_k1->uncheck(-1);
|
||||||
@ -74,15 +365,13 @@ void TSelection_ext_mask::select_des_pcon_range(const TString& from, const TStri
|
|||||||
{
|
{
|
||||||
TCursor_sheet& c = cur_sheet();
|
TCursor_sheet& c = cur_sheet();
|
||||||
const long items = c.items();
|
const long items = c.items();
|
||||||
const int key = get_selected_key();
|
|
||||||
CHECK(key == 2, "La chiave deve essere la 2");
|
|
||||||
TString s_from(from), s_to(to);
|
TString s_from(from), s_to(to);
|
||||||
|
|
||||||
if (s_to.empty() && items)
|
CHECK(key() == 2, "La chiave deve essere la 2");
|
||||||
|
if (s_to.empty() && items)
|
||||||
s_to = c.row(items-1).get(1);
|
s_to = c.row(items-1).get(1);
|
||||||
s_from.upper();
|
s_from.upper();
|
||||||
s_to.upper();
|
s_to.upper();
|
||||||
|
|
||||||
if (s_from > s_to) // Controlla limiti
|
if (s_from > s_to) // Controlla limiti
|
||||||
{
|
{
|
||||||
s_to = from;
|
s_to = from;
|
||||||
@ -131,9 +420,8 @@ void TSelection_ext_mask::set_des_pcon_limits()
|
|||||||
TString from,to;
|
TString from,to;
|
||||||
TCursor_sheet& c = cur_sheet();
|
TCursor_sheet& c = cur_sheet();
|
||||||
const long items = c.items();
|
const long items = c.items();
|
||||||
const int key = get_selected_key();
|
|
||||||
CHECK(key == 2, "La chiave deve essere la 2");
|
CHECK(key() == 2, "La chiave deve essere la 2");
|
||||||
|
|
||||||
for (long i = 0; i < items; i++)
|
for (long i = 0; i < items; i++)
|
||||||
if (c.checked(i))
|
if (c.checked(i))
|
||||||
{
|
{
|
||||||
@ -170,15 +458,15 @@ void TSelection_ext_mask::select_pcon_range(int grf, int cof,long sof,int grt,in
|
|||||||
{
|
{
|
||||||
TCursor_sheet& c = cur_sheet();
|
TCursor_sheet& c = cur_sheet();
|
||||||
const long items = c.items();
|
const long items = c.items();
|
||||||
const int key = get_selected_key();
|
const int k = key();
|
||||||
|
|
||||||
TCursor* crs = c.cursor();
|
TCursor* crs = c.cursor();
|
||||||
if (grt==0 && cot==0 && sot==0 && items)
|
if (grt==0 && cot==0 && sot==0 && items)
|
||||||
{
|
{
|
||||||
TToken_string& t = c.row(items-1);
|
TToken_string& t = c.row(items-1);
|
||||||
grt = t.get_int(key);
|
grt = t.get_int(k);
|
||||||
cot = t.get_int(key+1);
|
cot = t.get_int(k+1);
|
||||||
sot = t.get_long(key+2);
|
sot = t.get_long(k+2);
|
||||||
}
|
}
|
||||||
if (grf > grt || (grf==grt && cof > cot) || (grf==grt && cof==cot && sof>sot))
|
if (grf > grt || (grf==grt && cof > cot) || (grf==grt && cof==cot && sof>sot))
|
||||||
{ // Swap them...
|
{ // Swap them...
|
||||||
@ -230,7 +518,7 @@ void TSelection_ext_mask::set_pcon_limits()
|
|||||||
|
|
||||||
TCursor_sheet& c = cur_sheet();
|
TCursor_sheet& c = cur_sheet();
|
||||||
const long items = c.items();
|
const long items = c.items();
|
||||||
const int key = get_selected_key();
|
const int k = key();
|
||||||
long first = -1, last = -1;
|
long first = -1, last = -1;
|
||||||
|
|
||||||
// Ricerca veloce di estremi (vale solo su GR/CO/SO)
|
// Ricerca veloce di estremi (vale solo su GR/CO/SO)
|
||||||
@ -252,12 +540,13 @@ void TSelection_ext_mask::set_pcon_limits()
|
|||||||
{
|
{
|
||||||
TToken_string fitem(c.row(first));
|
TToken_string fitem(c.row(first));
|
||||||
TToken_string litem(c.row(last));
|
TToken_string litem(c.row(last));
|
||||||
gf = fitem.get_int(key);
|
|
||||||
cf = fitem.get_int(key+1);
|
gf = fitem.get_int(k);
|
||||||
sf = fitem.get_long(key+2);
|
cf = fitem.get_int(k+1);
|
||||||
gl = litem.get_int(key);
|
sf = fitem.get_long(k+2);
|
||||||
cl = litem.get_int(key+1);
|
gl = litem.get_int(k);
|
||||||
sl = litem.get_long(key+2);
|
cl = litem.get_int(k+1);
|
||||||
|
sl = litem.get_long(k+2);
|
||||||
if (gf > gl || (gf==gl && cf > cl) || (gf==gl && cf==cl && sf>sl))
|
if (gf > gl || (gf==gl && cf > cl) || (gf==gl && cf==cl && sf>sl))
|
||||||
{ // Swap them...
|
{ // Swap them...
|
||||||
int t1 = gf,t2 = cf;long t3 = sf;
|
int t1 = gf,t2 = cf;long t3 = sf;
|
||||||
@ -273,233 +562,3 @@ void TSelection_ext_mask::set_pcon_limits()
|
|||||||
set(SC_PCONCODTO3, sl);
|
set(SC_PCONCODTO3, sl);
|
||||||
set(SC_NSEL, c.checked());
|
set(SC_NSEL, c.checked());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TSelection_ext_mask::ffrompcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
|
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
TCursor_sheet& c = m.cur_sheet();
|
|
||||||
const int key = m.get_selected_key();
|
|
||||||
c.disable_check();
|
|
||||||
c.disable(DLG_USER);
|
|
||||||
if (c.run() == K_ENTER)
|
|
||||||
{
|
|
||||||
TToken_string& t = c.row(c.selected());
|
|
||||||
int grf,grt,cof,cot;
|
|
||||||
long sof,sot;
|
|
||||||
grf =t.get_int(key);
|
|
||||||
cof =t.get_int(key+1);
|
|
||||||
sof =t.get_long(key+2);
|
|
||||||
grt = m.get_int(SC_PCONCODTO1);
|
|
||||||
cot = m.get_int(SC_PCONCODTO2);
|
|
||||||
sot = m.get_long(SC_PCONCODTO3);
|
|
||||||
m.set(SC_PCONCODFR1, grf);
|
|
||||||
m.set(SC_PCONCODFR2, cof);
|
|
||||||
m.set(SC_PCONCODFR3, sof);
|
|
||||||
m.select_pcon_range(grf,cof,sof,grt,cot,sot);
|
|
||||||
}
|
|
||||||
c.enable(DLG_USER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
|
||||||
int grf,grt,cof,cot;
|
|
||||||
long sof,sot;
|
|
||||||
grf = m.get_int(SC_PCONCODFR1);
|
|
||||||
cof = m.get_int(SC_PCONCODFR2);
|
|
||||||
sof = m.get_long(SC_PCONCODFR3);
|
|
||||||
grt = m.get_int(SC_PCONCODTO1);
|
|
||||||
cot = m.get_int(SC_PCONCODTO2);
|
|
||||||
sot = m.get_long(SC_PCONCODTO3);
|
|
||||||
m.select_pcon_range(grf,cof,sof,grt,cot,sot);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::ftopcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
|
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
TCursor_sheet& c = m.cur_sheet();
|
|
||||||
const int key = m.get_selected_key();
|
|
||||||
c.disable_check();
|
|
||||||
c.disable(DLG_USER);
|
|
||||||
if (c.run() == K_ENTER)
|
|
||||||
{
|
|
||||||
TToken_string& t = c.row(c.selected());
|
|
||||||
int grf,grt,cof,cot;
|
|
||||||
long sof,sot;
|
|
||||||
grt =t.get_int(key);
|
|
||||||
cot =t.get_int(key+1);
|
|
||||||
sot =t.get_long(key+2);
|
|
||||||
grf = m.get_int(SC_PCONCODFR1);
|
|
||||||
cof = m.get_int(SC_PCONCODFR2);
|
|
||||||
sof = m.get_long(SC_PCONCODFR3);
|
|
||||||
m.set(SC_PCONCODTO1, grt);
|
|
||||||
m.set(SC_PCONCODTO2, cot);
|
|
||||||
m.set(SC_PCONCODTO3, sot);
|
|
||||||
m.select_pcon_range(grf,cof,sof,grt,cot,sot);
|
|
||||||
}
|
|
||||||
c.enable(DLG_USER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
|
||||||
int grf,grt,cof,cot;
|
|
||||||
long sof,sot;
|
|
||||||
grf = m.get_int(SC_PCONCODFR1);
|
|
||||||
cof = m.get_int(SC_PCONCODFR2);
|
|
||||||
sof = m.get_long(SC_PCONCODFR3);
|
|
||||||
grt = m.get_int(SC_PCONCODTO1);
|
|
||||||
cot = m.get_int(SC_PCONCODTO2);
|
|
||||||
sot = m.get_long(SC_PCONCODTO3);
|
|
||||||
m.select_pcon_range(grf,cof,sof,grt,cot,sot);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::fdfrompcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
|
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
TCursor_sheet& c = m.cur_sheet();
|
|
||||||
|
|
||||||
c.disable_check();
|
|
||||||
c.disable(DLG_USER);
|
|
||||||
if (c.run() == K_ENTER)
|
|
||||||
{
|
|
||||||
TToken_string& t = c.row(c.selected());
|
|
||||||
const TString des1(t.get(3 - m.get_selected_key()));
|
|
||||||
const TString des2 = m.get(SC_PCONDESTO);
|
|
||||||
m.set(SC_PCONDESFR, des1);
|
|
||||||
m.select_des_pcon_range(des1, des2);
|
|
||||||
}
|
|
||||||
c.enable(DLG_USER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
|
||||||
const TString des1(f.get());
|
|
||||||
const TString des2(m.get(SC_PCONDESTO));
|
|
||||||
m.select_des_pcon_range(des1, des2);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::fdtopcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
|
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
TCursor_sheet& c = m.cur_sheet();
|
|
||||||
|
|
||||||
c.disable_check();
|
|
||||||
c.disable(DLG_USER);
|
|
||||||
if (c.run() == K_ENTER)
|
|
||||||
{
|
|
||||||
TToken_string& t = c.row(c.selected());
|
|
||||||
const TString des1(m.get(SC_PCONDESFR));
|
|
||||||
const TString des2(t.get(3 - m.get_selected_key()));
|
|
||||||
m.set(SC_PCONDESTO, des2);
|
|
||||||
m.select_des_pcon_range(des1, des2);
|
|
||||||
}
|
|
||||||
c.enable(DLG_USER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
|
||||||
const TString des2(f.get());
|
|
||||||
const TString des1(m.get(SC_PCONDESFR));
|
|
||||||
m.select_des_pcon_range(des1, des2);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::bresetpcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
m.reset_sheets();
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::bselectpcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
TCursor_sheet& c = m.cur_sheet();
|
|
||||||
c.enable_check();
|
|
||||||
c.run();
|
|
||||||
char who = m.get_who();
|
|
||||||
int key = m.get_selected_key();
|
|
||||||
if (who =='P')
|
|
||||||
if (key == 2)
|
|
||||||
m.set_des_pcon_limits();
|
|
||||||
else
|
|
||||||
m.set_pcon_limits();
|
|
||||||
else
|
|
||||||
if (key == 2)
|
|
||||||
m.set_des_clifo_limits();
|
|
||||||
else
|
|
||||||
m.set_clifo_limits();
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::rpcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
char who = f.get()[0];
|
|
||||||
if (who != m.get_who())
|
|
||||||
{
|
|
||||||
m.set_key(1);
|
|
||||||
m.set_who(who);
|
|
||||||
}
|
|
||||||
m.reset_sheets();
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TSelection_ext_mask::rsortpcon_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TSelection_ext_mask& m = (TSelection_ext_mask&)f.mask();
|
|
||||||
const int ordine = atoi(f.get());
|
|
||||||
TString tipo = m.get(SC_CLIFO);
|
|
||||||
bool g3 = FALSE, g4 = FALSE, g5 = FALSE, g6 = FALSE;
|
|
||||||
if (tipo != "P")
|
|
||||||
{
|
|
||||||
g3 = ordine == 1;
|
|
||||||
g4 = !g3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g5 = ordine == 1;
|
|
||||||
g6 = !g5;
|
|
||||||
}
|
|
||||||
m.show(-3, g3); // Abilita clifo per codice
|
|
||||||
m.show(-4, g4); // Abilita clifo per ragsoc
|
|
||||||
m.show(-5, g5); // Abilita pcon per conto
|
|
||||||
m.show(-6, g6); // Abilita pcon per descrizione
|
|
||||||
m.set_key(ordine);
|
|
||||||
m.reset_sheets();
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
@ -7,31 +7,30 @@
|
|||||||
|
|
||||||
class TSelection_ext_mask : public TSelection_mask
|
class TSelection_ext_mask : public TSelection_mask
|
||||||
{
|
{
|
||||||
|
TAssoc_array _assoc;
|
||||||
TRelation* _pcon_rel;
|
TRelation* _pcon_rel;
|
||||||
TCursor* _pcon_cur_k1;
|
TCursor* _pcon_cur_k1;
|
||||||
TCursor* _pcon_cur_k2;
|
TCursor* _pcon_cur_k2;
|
||||||
|
|
||||||
TCursor_sheet* _pcon_sh_k1;
|
TCursor_sheet* _pcon_sh_k1;
|
||||||
TCursor_sheet* _pcon_sh_k2;
|
TCursor_sheet* _pcon_sh_k2;
|
||||||
|
TESSL_form * _form;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void select_pcon_range(int grf, int cof,long sof,int grt,int cot, long sot);
|
void select_pcon_range(int grf, int cof,long sof,int grt,int cot, long sot);
|
||||||
void select_des_pcon_range(const TString& from, const TString& to);
|
void select_des_pcon_range(const TString& from, const TString& to);
|
||||||
void set_pcon_limits();
|
void set_pcon_limits();
|
||||||
void set_des_pcon_limits();
|
void set_des_pcon_limits();
|
||||||
|
|
||||||
virtual void reset_sheets();
|
virtual void reset_sheets();
|
||||||
static bool ffrompcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool ftopcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool bresetpcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool bselectpcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool rpcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool rsortpcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool fdfrompcon_handler(TMask_field& f, KEY k);
|
|
||||||
static bool fdtopcon_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TCursor_sheet& cur_sheet();
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||||
|
virtual TCursor_sheet& cur_sheet();
|
||||||
|
virtual const TToken_string & get_anal_filter() const override { return EMPTY_STRING; }
|
||||||
|
virtual TESSL_form & form() override;
|
||||||
|
void update_assoc();
|
||||||
|
bool selected(const TBill& b) { return selected(b.gruppo(), b.conto(), b.sottoconto()); }
|
||||||
|
bool selected(int g, int c, long s);
|
||||||
|
TRecnotype get_clifo_range(long& first, long& last);
|
||||||
|
|
||||||
TSelection_ext_mask(const char* name);
|
TSelection_ext_mask(const char* name);
|
||||||
virtual ~TSelection_ext_mask();
|
virtual ~TSelection_ext_mask();
|
||||||
|
@ -231,10 +231,9 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
return; // Ignora partite chiuse da tempo immemorabile
|
return; // Ignora partite chiuse da tempo immemorabile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TGameLog gl(p);
|
||||||
TGameLog gl(p);
|
|
||||||
|
|
||||||
real residuo,nonscad,buonf,s1,s2,s3,s4,s5,s6,s7,res_pagati;
|
real residuo,nonscad,buonf,s1,s2,s3,s4,s5,s6,s7,res_pagati;
|
||||||
|
|
||||||
compute_unassigned(p);
|
compute_unassigned(p);
|
||||||
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
||||||
{
|
{
|
||||||
@ -242,6 +241,7 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
// se la data di registrazione della partita ' > di _limop (data lim operazione)
|
// se la data di registrazione della partita ' > di _limop (data lim operazione)
|
||||||
// non deve scorrere le scadenze
|
// non deve scorrere le scadenze
|
||||||
const TDate data_reg = rp.get_date(PART_DATAREG);
|
const TDate data_reg = rp.get_date(PART_DATAREG);
|
||||||
|
|
||||||
if (data_reg > _limop)
|
if (data_reg > _limop)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -252,8 +252,8 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
||||||
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
||||||
const char ssez = rp.sezione();
|
const char ssez = rp.sezione();
|
||||||
|
|
||||||
TImporto scd,pag,bf,work_imp;
|
TImporto scd,pag,bf,work_imp;
|
||||||
|
|
||||||
scd += TImporto(ssez,rs.get_real(sfield)); // Importo in scadenza...
|
scd += TImporto(ssez,rs.get_real(sfield)); // Importo in scadenza...
|
||||||
pag += rs.importo_pagato(_stvaluta); // Quanto e' stato pagato per questa scadenza?
|
pag += rs.importo_pagato(_stvaluta); // Quanto e' stato pagato per questa scadenza?
|
||||||
|
|
||||||
@ -263,6 +263,7 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
const int lst = rs.last();
|
const int lst = rs.last();
|
||||||
int prima_riga_pagamento = -1;
|
int prima_riga_pagamento = -1;
|
||||||
TDate first_date;// data relativa alla prima riga di pagamento
|
TDate first_date;// data relativa alla prima riga di pagamento
|
||||||
|
|
||||||
int pp;
|
int pp;
|
||||||
for (pp = rs.first(); pp <= lst; pp = rs.succ(pp))
|
for (pp = rs.first(); pp <= lst; pp = rs.succ(pp))
|
||||||
{
|
{
|
||||||
@ -285,17 +286,17 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
// se tipomov e' 2 (Nota di credito assegnata)
|
// se tipomov e' 2 (Nota di credito assegnata)
|
||||||
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
||||||
// compresa la sezione opposta
|
// compresa la sezione opposta
|
||||||
if (tipomov==tm_nota_credito)
|
if (tipomov == tm_nota_credito)
|
||||||
{
|
{
|
||||||
work_imp = TImporto(sez,pg.get_real(field));
|
work_imp = TImporto(sez,pg.get_real(field));
|
||||||
scd += work_imp;
|
scd += work_imp;
|
||||||
pag -= work_imp;
|
pag -= work_imp;
|
||||||
}
|
}
|
||||||
if ((tipomov==3 || tipomov==5) && _tipost==clienti && _gcr!=0)
|
if ((tipomov == tm_pagamento || tipomov == tm_insoluto) && _tipost==clienti && _gcr!=0)
|
||||||
{
|
{
|
||||||
TDate data_pag(sum.get_date(PART_DATAPAG));
|
TDate data_pag(sum.get_date(PART_DATAPAG));
|
||||||
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
||||||
if (tipo_pag>=2 && tipo_pag<=7 && data_pag.ok()) //Incasso tramite effetto
|
if (tipo_pag >= tm_nota_credito && tipo_pag <= tm_pagamento_insoluto && data_pag.ok()) //Incasso tramite effetto
|
||||||
{
|
{
|
||||||
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
||||||
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
||||||
@ -330,17 +331,6 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
|||||||
if (b == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
|
if (b == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
|
||||||
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
|
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
|
||||||
|
|
||||||
/*
|
|
||||||
if (res < ZERO) // Significa che l'importo pagato e' maggiore dell'importo in scadenza
|
|
||||||
{ // c'e' un residuo positivo, e quindi va memorizzato
|
|
||||||
res *= -1.0; // cambia il segno
|
|
||||||
res_pagati+= res; // Residui pagati in piu'
|
|
||||||
res = ZERO;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
#ifdef __LONGDOUBLE__
|
|
||||||
res.round(5);
|
|
||||||
#endif
|
|
||||||
if (res.sign() * b.sign() < 0) // Ho pagato piu' della scadenza
|
if (res.sign() * b.sign() < 0) // Ho pagato piu' della scadenza
|
||||||
{
|
{
|
||||||
res_pagati -= res; // Residui pagati in piu'
|
res_pagati -= res; // Residui pagati in piu'
|
||||||
@ -476,7 +466,8 @@ bool TStampaScaduto::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (curr.empty()) // Attenzione: Possono succedere anche queste cose!
|
if (curr.empty()) // Attenzione: Possono succedere anche queste cose!
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TPartita p(curr);
|
TPartita p(curr);
|
||||||
|
|
||||||
//Pesca gli estremi dalla prima riga di fattura, che non e' necessariamente la riga #1
|
//Pesca gli estremi dalla prima riga di fattura, che non e' necessariamente la riga #1
|
||||||
@ -620,17 +611,25 @@ bool TStampaScaduto::user_destroy()
|
|||||||
|
|
||||||
bool TStampaScaduto::set_print(int)
|
bool TStampaScaduto::set_print(int)
|
||||||
{
|
{
|
||||||
|
TDate data = today;
|
||||||
|
|
||||||
|
data.set_end_month();
|
||||||
|
if (!_m->get_date(F_DATASCADUTO).ok())
|
||||||
|
_m->set(F_DATASCADUTO, data);
|
||||||
|
|
||||||
const bool rt = _m->run() == K_ENTER;
|
const bool rt = _m->run() == K_ENTER;
|
||||||
|
|
||||||
if (rt)
|
if (rt)
|
||||||
{
|
{
|
||||||
|
_m->update_assoc();
|
||||||
reset_files();
|
reset_files();
|
||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
if (_m->get_who() == 'P')
|
if (_m->conti())
|
||||||
_tipost = altri;
|
_tipost = altri;
|
||||||
else
|
else
|
||||||
_tipost = _m->get_who() == 'C' ? clienti : fornitori;
|
_tipost = _m->clienti() ? clienti : fornitori;
|
||||||
_ordcod = _m->get_selected_key() == 1;
|
_ordcod = _m->key() == 1;
|
||||||
_end_printed = _pending_clifo = false;
|
_end_printed = _pending_clifo = false;
|
||||||
_gcr = _m->get_int(F_GIORNI);
|
_gcr = _m->get_int(F_GIORNI);
|
||||||
_stvaluta = _m->get_bool(F_VALUTA);
|
_stvaluta = _m->get_bool(F_VALUTA);
|
||||||
|
@ -74,7 +74,7 @@ END
|
|||||||
|
|
||||||
RADIOBUTTON SC_CLIFO 20
|
RADIOBUTTON SC_CLIFO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 9 "Selezione"
|
PROMPT 1 10 "Selezione"
|
||||||
ITEM "C|Clienti" MESSAGE ENABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
ITEM "C|Clienti" MESSAGE ENABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
||||||
ITEM "F|Fornitori" MESSAGE DISABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
ITEM "F|Fornitori" MESSAGE DISABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
||||||
ITEM "P|Conti" MESSAGE DISABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
ITEM "P|Conti" MESSAGE DISABLE, F_GIORNI|K_SPACE,SC_SORTCF
|
||||||
@ -83,104 +83,104 @@ END
|
|||||||
RADIOBUTTON SC_SORTCF 29
|
RADIOBUTTON SC_SORTCF 29
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUP 1
|
GROUP 1
|
||||||
PROMPT 23 9 "Ordinamento"
|
PROMPT 23 10 "Ordinamento"
|
||||||
ITEM "1|Per codice/conto"
|
ITEM "1|Per codice/conto"
|
||||||
ITEM "2|Per rag.soc./descrizione"
|
ITEM "2|Per rag.soc./descrizione"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON SC_SELECT 10 1
|
BUTTON SC_SELECT 10 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 55 10 "S~elezione"
|
PROMPT 55 11 "S~elezione"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON SC_RESET 10 1
|
BUTTON SC_RESET 10 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 55 11 "A~zzera"
|
PROMPT 55 12 "A~zzera"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_CFCODFR 6
|
NUMBER SC_CFCODFR 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Da codice "
|
PROMPT 2 15 "Da codice "
|
||||||
FLAGS "B"
|
FLAGS "B"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_CFCODTO 6
|
NUMBER SC_CFCODTO 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 37 14 "a codice "
|
PROMPT 37 15 "a codice "
|
||||||
FLAGS "B"
|
FLAGS "B"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING SC_CFDESFR 50 40
|
STRING SC_CFDESFR 50 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Da ragione sociale "
|
PROMPT 2 15 "Da ragione sociale "
|
||||||
GROUP 4
|
GROUP 4
|
||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING SC_CFDESTO 50 40
|
STRING SC_CFDESTO 50 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 15 "A ragione sociale "
|
PROMPT 2 16 "A ragione sociale "
|
||||||
GROUP 4
|
GROUP 4
|
||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODFR1 3
|
NUMBER SC_PCONCODFR1 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Da conto "
|
PROMPT 2 15 "Da conto "
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODFR2 3
|
NUMBER SC_PCONCODFR2 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 15 14 ""
|
PROMPT 15 15 ""
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODFR3 6
|
NUMBER SC_PCONCODFR3 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 19 14 ""
|
PROMPT 19 15 ""
|
||||||
FLAGS "B"
|
FLAGS "B"
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODTO1 3
|
NUMBER SC_PCONCODTO1 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 31 14 "a conto "
|
PROMPT 31 15 "a conto "
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODTO2 3
|
NUMBER SC_PCONCODTO2 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 14 ""
|
PROMPT 43 15 ""
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_PCONCODTO3 6
|
NUMBER SC_PCONCODTO3 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 47 14 ""
|
PROMPT 47 15 ""
|
||||||
FLAGS "B"
|
FLAGS "B"
|
||||||
GROUP 5
|
GROUP 5
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING SC_PCONDESFR 50 40
|
STRING SC_PCONDESFR 50 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Da descrizione "
|
PROMPT 2 15 "Da descrizione "
|
||||||
GROUP 6
|
GROUP 6
|
||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING SC_PCONDESTO 50 40
|
STRING SC_PCONDESTO 50 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 15 "A descrizione "
|
PROMPT 2 16 "A descrizione "
|
||||||
GROUP 6
|
GROUP 6
|
||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_NSEL 3
|
NUMBER SC_NSEL 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 60 13 "N. "
|
PROMPT 48 14 "Selezionati "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#include <reputils.h>
|
#include <reputils.h>
|
||||||
|
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
|
|
||||||
|
#include "sc2402.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Stampa solleciti
|
// Stampa solleciti
|
||||||
@ -20,10 +22,7 @@
|
|||||||
|
|
||||||
class TStampaSol_application: public TSkeleton_application
|
class TStampaSol_application: public TSkeleton_application
|
||||||
{
|
{
|
||||||
TString _lingua_ditta;
|
|
||||||
TSol_mask* _msk;
|
TSol_mask* _msk;
|
||||||
bool _gesval;
|
|
||||||
TSol_form* _form;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
@ -31,500 +30,18 @@ protected:
|
|||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual void on_config_change();
|
virtual void on_config_change();
|
||||||
|
virtual void print() override { _msk->on_field_event((TButton_field &)_msk->field(DLG_PRINT), fe_button, 0L); }
|
||||||
bool get_mail_address(TToken_string& to, TToken_string& cc) const;
|
|
||||||
virtual bool get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
|
||||||
TString& subj, TString& text, TToken_string& attach, short& ui) const;
|
|
||||||
|
|
||||||
const TString& game_key(const TRectype& part) const; // Costruisce chiave univoca per TAssoc_array partite
|
|
||||||
bool ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al, const TDate& data_rischio) const;
|
|
||||||
bool puoi_scartare(const TPartita& game, const TDate& datalim) const;
|
|
||||||
int print_sol(); // stampa l'elemento corrente
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TSol_mask& mask() const { return *_msk; }
|
TSol_mask& mask() const { return *_msk; }
|
||||||
TSol_form& form() const { return *_form; }
|
|
||||||
TCursor_sheet& sheet() { return _msk->cur_sheet(); }
|
TCursor_sheet& sheet() { return _msk->cur_sheet(); }
|
||||||
|
|
||||||
bool print_selected(); // cicla la stampa sugli elementi selezionati
|
|
||||||
bool mail_selected(); // manda email agli elementi selezionati
|
bool mail_selected(); // manda email agli elementi selezionati
|
||||||
|
|
||||||
TStampaSol_application();
|
TStampaSol_application();
|
||||||
virtual ~TStampaSol_application() {}
|
virtual ~TStampaSol_application() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TStampaSol_application::print_selected()
|
|
||||||
{
|
|
||||||
TCursor_sheet &s = sheet();
|
|
||||||
TCursor &c = *s.cursor();
|
|
||||||
|
|
||||||
const char who = mask().get_who();
|
|
||||||
const int key = mask().get_selected_key();
|
|
||||||
|
|
||||||
// Attiva la stampa del saldo partita
|
|
||||||
form().stampa_saldo(mask().stampa_saldo());
|
|
||||||
form().anal_filter(mask().get_anal_filter());
|
|
||||||
|
|
||||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
|
||||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
|
||||||
TCursor &fc = *form().cursor();
|
|
||||||
fc.setkey(key);
|
|
||||||
TRectype filter(LF_CLIFO);
|
|
||||||
filter.put(CLI_TIPOCF, who);
|
|
||||||
fc.setregion(filter, filter);
|
|
||||||
|
|
||||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
|
||||||
long analfabeti = 0; // persone non stampate in quanto aventi lingua errata
|
|
||||||
|
|
||||||
TPrinter& pr = printer();
|
|
||||||
pr.open();
|
|
||||||
|
|
||||||
const long items = c.items();
|
|
||||||
for (long i=0; i < items; i++)
|
|
||||||
{
|
|
||||||
if (print_all || s.checked(i))
|
|
||||||
{
|
|
||||||
fc = i; // muove il cursore alla posizione corrente
|
|
||||||
const int ret = print_sol();
|
|
||||||
if (ret < 0)
|
|
||||||
analfabeti++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pr.frozen())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pr.close();
|
|
||||||
|
|
||||||
if (analfabeti > 0)
|
|
||||||
warning_box(FR("%ld clienti non sono stati stampati in quanto "
|
|
||||||
"il codice lingua non corrispondeva al profilo di stampa"), analfabeti);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TStampaSol_application::ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al, const TDate& data_rischio) const
|
|
||||||
{
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
for (int r = game.last(); r > 0; r = game.pred(r))
|
|
||||||
{
|
|
||||||
const TRiga_partite& row = game.riga(r);
|
|
||||||
if (row.is_fattura() && row.get_date(PART_DATAREG) <= al)
|
|
||||||
{
|
|
||||||
for (int s = row.rate(); s > 0 ;s--)
|
|
||||||
{
|
|
||||||
const TRiga_scadenze& rata = row.rata(s);
|
|
||||||
const TDate data = rata.get(SCAD_DATASCAD);
|
|
||||||
if (data >= dal && data <= al)
|
|
||||||
{
|
|
||||||
found = !rata.chiusa();
|
|
||||||
if (!found)
|
|
||||||
{
|
|
||||||
TImporto rat = rata.importo(true);
|
|
||||||
TImporto imp = rata.importo_pagato_al(true, data_rischio);
|
|
||||||
imp.normalize(rat.sezione());
|
|
||||||
const real saldo = rat.valore() + imp.valore();
|
|
||||||
found = saldo > ZERO;
|
|
||||||
}
|
|
||||||
if (found)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const TString& TStampaSol_application::game_key(const TRectype& part) const
|
|
||||||
{
|
|
||||||
TToken_string& tok = get_tmp_string();
|
|
||||||
tok = part.get(PART_ANNO);
|
|
||||||
tok.add(part.get(PART_NUMPART));
|
|
||||||
return tok;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TStampaSol_application::puoi_scartare(const TPartita& game, const TDate& datalim) const
|
|
||||||
{
|
|
||||||
bool yes = game.chiusa();
|
|
||||||
if (yes && datalim.ok())
|
|
||||||
{
|
|
||||||
TDate last;
|
|
||||||
for (int r = game.last(); r > 0; r = game.pred(r))
|
|
||||||
{
|
|
||||||
const TRiga_partite& riga = game.riga(r);
|
|
||||||
if (riga.tipo() > tm_fattura)
|
|
||||||
{
|
|
||||||
const TDate d = riga.get(PART_DATAPAG);
|
|
||||||
if (d > last)
|
|
||||||
last = d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
yes = last < datalim;
|
|
||||||
}
|
|
||||||
return yes;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TStampaSol_application::print_sol()
|
|
||||||
{
|
|
||||||
TSol_form& f = form();
|
|
||||||
|
|
||||||
// preparazione variabili per controllo lingua
|
|
||||||
const TRectype &clf= f.cursor()->file().curr();
|
|
||||||
const TString4 lincf = clf.get(CLI_CODLIN);
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
// controllo lingua ditta corrente
|
|
||||||
if ((f.lingua() == _lingua_ditta && !lincf.empty()) || f.lingua() != _lingua_ditta) ok= (lincf == f.lingua());
|
|
||||||
if (!ok) return -1; // cliente analfabeta
|
|
||||||
|
|
||||||
f.azzera_totali();
|
|
||||||
// filtra solo le partite del cliente selezionato
|
|
||||||
TLocalisamfile partite(LF_PARTITE);
|
|
||||||
partite.zero();
|
|
||||||
partite.put(PART_TIPOCF, clf.get(CLI_TIPOCF));
|
|
||||||
partite.put(PART_SOTTOCONTO, clf.get(CLI_CODCF));
|
|
||||||
|
|
||||||
const TRectype& parkur = partite.curr();
|
|
||||||
const TRectype filter(parkur);
|
|
||||||
|
|
||||||
bool one_printed = false; // booleano di controllo di riuscita della stampa
|
|
||||||
const bool sel_tot_saldo = f.get_sel_tot_saldo(); // selezione sul saldo totale cliente
|
|
||||||
const real sel_importo(f.get_sel_importo()); // importo di selezione
|
|
||||||
const TDate data_inizio_soll = _msk->get(F_DATAINISCAD);
|
|
||||||
const TDate data_limite_soll = f.data_limite_operazione();
|
|
||||||
const TDate data_limite_scaduto = f.data_limite_scaduto();
|
|
||||||
TToken_string anal_filter = form().get_anal_filter();
|
|
||||||
const bool select_analitica = (dongle().active(CAAUT) || dongle().active(CMAUT)) && anal_filter.full() ;
|
|
||||||
TDecoder anal(LF_MOVANA, MOVANA_NUMREG, 3);
|
|
||||||
const TDate data_rischio = f.data_inizio_rischio();
|
|
||||||
|
|
||||||
TAssoc_array games_in_range;
|
|
||||||
|
|
||||||
if ((sel_tot_saldo && sel_importo > ZERO) || data_inizio_soll.ok())
|
|
||||||
{
|
|
||||||
real saldo;
|
|
||||||
for (int err = partite.read(_isgteq);
|
|
||||||
err == NOERR && parkur == filter;
|
|
||||||
err = partite.read(_isgreat))
|
|
||||||
{
|
|
||||||
const TPartita game(parkur);
|
|
||||||
if (!puoi_scartare(game, data_rischio))
|
|
||||||
{
|
|
||||||
if (sel_tot_saldo)
|
|
||||||
{
|
|
||||||
const real sld = game.calcola_scaduto_al(false, data_limite_soll);
|
|
||||||
saldo += sld;
|
|
||||||
}
|
|
||||||
if (data_inizio_soll.ok())
|
|
||||||
{
|
|
||||||
if (ci_sono_scadenze_aperte(game, data_inizio_soll, data_limite_soll, data_rischio))
|
|
||||||
games_in_range.add(game_key(parkur));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
partite.put(PART_NRIGA, 9999);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sel_tot_saldo && sel_importo > ZERO && saldo < sel_importo)
|
|
||||||
return 0;
|
|
||||||
if (data_inizio_soll.ok() && games_in_range.empty())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
partite.curr() = filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int err = partite.read(_isgteq);
|
|
||||||
err == NOERR && parkur == filter;
|
|
||||||
err = partite.read(_isgreat))
|
|
||||||
{
|
|
||||||
if (data_inizio_soll.ok() && !games_in_range.is_key(game_key(parkur)))
|
|
||||||
continue; // Scarta parite fuori range di date
|
|
||||||
|
|
||||||
const TPartita game(parkur);
|
|
||||||
if (!puoi_scartare(game, data_rischio))
|
|
||||||
{
|
|
||||||
const real saldo = game.calcola_scaduto_al(false, data_limite_scaduto);
|
|
||||||
|
|
||||||
TImporto unreferenced; //Totale non assegnati per questa partita.
|
|
||||||
{
|
|
||||||
// E' giusto calcolare il saldo, comprendente i non assegnati.
|
|
||||||
// se il saldo della partita chiude in avere va sommato ad unreferenced
|
|
||||||
const TRiga_partite& sum = game.riga(game.first());
|
|
||||||
unreferenced = game.calcola_saldo_al(game.in_valuta() && f.in_valuta(),data_limite_soll, data_limite_scaduto, data_rischio);
|
|
||||||
if (unreferenced.valore() > ZERO && unreferenced.sezione() == 'A')
|
|
||||||
{
|
|
||||||
unreferenced.normalize('A'); //per i non assegnati/anticipi c'e' solo la colonna AVERE
|
|
||||||
const TString4 valuta = sum.get(PART_CODVAL);
|
|
||||||
form().totali().add(unreferenced,valuta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (select_analitica)
|
|
||||||
{
|
|
||||||
bool print = false;
|
|
||||||
for (int r = game.first(); !print && r <= game.last(); r = game.succ(r))
|
|
||||||
{
|
|
||||||
const TRiga_partite& row = game.riga(r);
|
|
||||||
const TString& numregcg = row.get(PART_NREG);
|
|
||||||
const long numreg = atol(anal.decode(numregcg));
|
|
||||||
|
|
||||||
if (numreg > 0)
|
|
||||||
{
|
|
||||||
TAnal_mov anal_mov(numreg);
|
|
||||||
TRecord_array & rows = anal_mov.body();
|
|
||||||
const int nrows = rows.rows();
|
|
||||||
TString s;
|
|
||||||
|
|
||||||
for (int i = 1; !print && i <= nrows; i++)
|
|
||||||
{
|
|
||||||
const TRectype & row = anal_mov.body().row(i);
|
|
||||||
TString f = anal_filter.get(0);
|
|
||||||
f.trim();
|
|
||||||
|
|
||||||
if (f.full())
|
|
||||||
{
|
|
||||||
s = row.get(RMOVANA_CODCMS);
|
|
||||||
print |= s.match(f);
|
|
||||||
}
|
|
||||||
f = anal_filter.get();
|
|
||||||
if (f.full())
|
|
||||||
{
|
|
||||||
s = row.get(RMOVANA_CODCCOSTO);
|
|
||||||
print |= s.match(f);
|
|
||||||
}
|
|
||||||
f = anal_filter.get();
|
|
||||||
if (f.full())
|
|
||||||
{
|
|
||||||
s = row.get(RMOVANA_CODFASE);
|
|
||||||
print |= s.match(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!print)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (sel_tot_saldo || (saldo > ZERO && saldo >= sel_importo ) || (saldo.is_zero() && !unreferenced.is_zero() && data_rischio < data_limite_scaduto))
|
|
||||||
{
|
|
||||||
const bool printed = form().print_game(game);
|
|
||||||
one_printed |= printed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
partite.put(PART_NRIGA, 9999);
|
|
||||||
|
|
||||||
if (printer().frozen())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (one_printed)
|
|
||||||
{
|
|
||||||
f.ultima_pagina();
|
|
||||||
printer().formfeed();
|
|
||||||
}
|
|
||||||
|
|
||||||
return one_printed ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TStampaSol_application::get_mail_address(TToken_string& to, TToken_string& cc) const
|
|
||||||
{
|
|
||||||
const TRectype& fc = form().cursor()->curr();
|
|
||||||
const long codcf = fc.get_long(CLI_CODCF);
|
|
||||||
TString8 clifo; clifo.format("C%06ld", codcf);
|
|
||||||
TISAM_recordset contacts("USE MULTIREL\nFROM COD=BACON FIRST=#CLIFO\nTO COD=BACON FIRST=#CLIFO");
|
|
||||||
contacts.set_var("#CLIFO", clifo);
|
|
||||||
|
|
||||||
TToken_string data;
|
|
||||||
for (bool ok = contacts.move_first(); ok; ok = contacts.move_next())
|
|
||||||
{
|
|
||||||
data = contacts.get("DATA").as_string();
|
|
||||||
FOR_EACH_TOKEN(data, tok)
|
|
||||||
{
|
|
||||||
const TFixed_string doc(tok);
|
|
||||||
if (doc.starts_with("sc2400", true) || doc.starts_with("sollec", true))
|
|
||||||
{
|
|
||||||
const TRectype& rub = cache().get(LF_CONTACT, contacts.get("SECOND").as_int());
|
|
||||||
TString80 mail = rub.get("MAIL");
|
|
||||||
if (mail.blank())
|
|
||||||
mail = rub.get("MAIL2");
|
|
||||||
if (mail.full())
|
|
||||||
{
|
|
||||||
if (to.blank())
|
|
||||||
to = mail;
|
|
||||||
else
|
|
||||||
cc.add(mail);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (to.blank())
|
|
||||||
{
|
|
||||||
TString8 key; key << "C|" << codcf;
|
|
||||||
to = cache().get(LF_CLIFO, key, CLI_DOCMAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return to.full();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TStampaSol_application::get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
|
||||||
TString& subj, TString& text, TToken_string& attach, short& ui) const
|
|
||||||
{
|
|
||||||
bool ok = TApplication::get_next_mail(to, cc, ccn, subj, text, attach, ui) && get_mail_address(to, cc);
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
{
|
|
||||||
const TRectype& clifo = form().cursor()->curr();
|
|
||||||
TDate oggi = mask().get(F_DATALIMSOL);
|
|
||||||
if (!oggi.ok())
|
|
||||||
oggi = mask().get_date(F_DATASEND);
|
|
||||||
|
|
||||||
subj << TR("Sollecito ") << prefix().firm().ragione_sociale();
|
|
||||||
TString ragsoc = clifo.get(CLI_RAGSOC); ragsoc.strip_double_spaces();
|
|
||||||
text << "Spett. " << ragsoc << '\n'
|
|
||||||
<< TR("Si ricorda il rispetto delle scadenze aperte al ") << oggi << '\n'
|
|
||||||
<< TR(" riepilogate nel file allegato ") << attach << '\n'
|
|
||||||
<< prefix().firm().ragione_sociale();
|
|
||||||
if (to.full())
|
|
||||||
ui &= ~0x1; // No user interface
|
|
||||||
ui |= 0x2; // Query receipt
|
|
||||||
|
|
||||||
const long codcf = clifo.get_long(CLI_CODCF);
|
|
||||||
TFilename pdf;
|
|
||||||
ok = get_next_pdf(oggi.year(), -1, "SOLL", oggi.date2ansi(), codcf, pdf);
|
|
||||||
attach = pdf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct TMail_message : public TObject
|
|
||||||
{
|
|
||||||
TToken_string _to, _cc, _ccn;
|
|
||||||
TString _subj, _text;
|
|
||||||
TToken_string _attach;
|
|
||||||
short _ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool TStampaSol_application::mail_selected()
|
|
||||||
{
|
|
||||||
TCursor_sheet &s = sheet();
|
|
||||||
TCursor &c = *s.cursor();
|
|
||||||
|
|
||||||
const char who = mask().get_who();
|
|
||||||
const int key = mask().get_selected_key();
|
|
||||||
|
|
||||||
// Attiva la stampa del saldo partita
|
|
||||||
form().stampa_saldo(mask().stampa_saldo());
|
|
||||||
form().anal_filter(mask().get_anal_filter());
|
|
||||||
|
|
||||||
// filtra il cursore del form in modo che diventi uguale al cursor_sheet corrente
|
|
||||||
// Qui sarebbe bello copiarsi l'indice dell'altro cursore
|
|
||||||
TCursor &fc = *form().cursor();
|
|
||||||
fc.setkey(key);
|
|
||||||
TRectype filter(LF_CLIFO);
|
|
||||||
filter.put(CLI_TIPOCF, who);
|
|
||||||
fc.setregion(filter, filter);
|
|
||||||
|
|
||||||
const long print_all = !s.one_checked(); // se non ho selezionato nulla allora li stampo tutti
|
|
||||||
|
|
||||||
TLog_report log;
|
|
||||||
|
|
||||||
TArray mail;
|
|
||||||
|
|
||||||
const long items = c.items();
|
|
||||||
if (items > 0)
|
|
||||||
{
|
|
||||||
const TDate oggi(TODAY);
|
|
||||||
TProgind pi(items);
|
|
||||||
|
|
||||||
TPrinter& pr = printer();
|
|
||||||
for (long i=0; i < items; i++)
|
|
||||||
{
|
|
||||||
if (!pi.addstatus(1))
|
|
||||||
break;
|
|
||||||
if (print_all || s.checked(i))
|
|
||||||
{
|
|
||||||
fc = i; // muove il cursore alla posizione corrente
|
|
||||||
|
|
||||||
pr.set_export_file("soll.pdf", true);
|
|
||||||
pr.open();
|
|
||||||
const int ret = print_sol();
|
|
||||||
pr.close();
|
|
||||||
|
|
||||||
if (ret > 0)
|
|
||||||
{
|
|
||||||
TString msg;
|
|
||||||
msg << fc.curr().get(CLI_RAGSOC) << ": ";
|
|
||||||
msg.strip_double_spaces();
|
|
||||||
|
|
||||||
TMail_message* m = new TMail_message;
|
|
||||||
bool done = false;
|
|
||||||
if (get_next_mail(m->_to, m->_cc, m->_ccn, m->_subj, m->_text, m->_attach, m->_ui))
|
|
||||||
{
|
|
||||||
const TFilename fn = m->_attach;
|
|
||||||
xvt_vobj_destroy(883);
|
|
||||||
done = pr.print_pdf(printer().get_txt(), fn);
|
|
||||||
if (done)
|
|
||||||
{
|
|
||||||
msg << TR("invio ") << fn.name() << TR(" a ") << m->_to;
|
|
||||||
log.log(0, msg);
|
|
||||||
mail.add(m);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
msg << TR("Impossibile genereare ") << fn;
|
|
||||||
log.log(2, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
msg << TR("Impossibile trovare un indirizzo e-mail valido");
|
|
||||||
log.log(2, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!done)
|
|
||||||
delete m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pr.read_configuration();
|
|
||||||
}
|
|
||||||
|
|
||||||
log.preview();
|
|
||||||
|
|
||||||
if (!mail.empty())
|
|
||||||
{
|
|
||||||
TArray_sheet sheet(-1, -1, 78, 20, TR("Mail"), HR("@1|Destinatario@32|Messaggio@50"), 0, 1);
|
|
||||||
FOR_EACH_ARRAY_ITEM(mail, r, obj)
|
|
||||||
{
|
|
||||||
const TMail_message& m = *(TMail_message*)obj;
|
|
||||||
TToken_string* row = new TToken_string;
|
|
||||||
*row = "X";
|
|
||||||
row->add(m._to);
|
|
||||||
row->add(m._text.before('\n'));
|
|
||||||
sheet.add(row);
|
|
||||||
}
|
|
||||||
if (sheet.run() == K_ENTER)
|
|
||||||
{
|
|
||||||
const long m = sheet.checked();
|
|
||||||
if (m > 0 && yesno_box(FR("Confermare l'invio di %ld mail?"), m))
|
|
||||||
{
|
|
||||||
FOR_EACH_CHECKED_ROW(sheet, r, row)
|
|
||||||
{
|
|
||||||
const TMail_message& m = (const TMail_message&)mail[r];
|
|
||||||
xvt_mail_send(m._to, m._cc, m._ccn, m._subj, m._text, m._attach, m._ui);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TStampaSol_application::create()
|
bool TStampaSol_application::create()
|
||||||
{
|
{
|
||||||
TApplication::create();
|
TApplication::create();
|
||||||
@ -550,10 +67,6 @@ void TStampaSol_application::on_config_change()
|
|||||||
mask().set(F_STAMPSALDO, "X");
|
mask().set(F_STAMPSALDO, "X");
|
||||||
|
|
||||||
TApplication::on_firm_change();
|
TApplication::on_firm_change();
|
||||||
|
|
||||||
TConfig c(CONFIG_DITTA, "cg");
|
|
||||||
_lingua_ditta= c.get("CodLin");
|
|
||||||
_gesval= c.get_bool("GesVal");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaSol_application::on_firm_change()
|
void TStampaSol_application::on_firm_change()
|
||||||
@ -565,23 +78,11 @@ void TStampaSol_application::on_firm_change()
|
|||||||
void TStampaSol_application::main_loop()
|
void TStampaSol_application::main_loop()
|
||||||
{
|
{
|
||||||
TSol_mask& m = mask();
|
TSol_mask& m = mask();
|
||||||
for (;;)
|
|
||||||
{
|
while (m.run() != K_QUIT);
|
||||||
const KEY key = m.run();
|
|
||||||
if (key == K_QUIT)
|
|
||||||
break;
|
|
||||||
|
|
||||||
_form= new TSol_form(m, _gesval, F_DATALIMOP, F_DATALIMSOL, F_GGRISCHIO);
|
|
||||||
if (key == 'M')
|
|
||||||
mail_selected();
|
|
||||||
else
|
|
||||||
print_selected();
|
|
||||||
delete _form;
|
|
||||||
_form= NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TStampaSol_application::TStampaSol_application(): _lingua_ditta(1), _msk(NULL), _form(NULL) {}
|
TStampaSol_application::TStampaSol_application(): _msk(nullptr) {}
|
||||||
|
|
||||||
int sc2400(int argc, char** argv)
|
int sc2400(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -5,21 +5,20 @@ TOOLBAR "" 0 0 0 2
|
|||||||
|
|
||||||
BUTTON DLG_PRINT 2 2
|
BUTTON DLG_PRINT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Stampa"
|
PROMPT 1 3 "Stampa"
|
||||||
PICTURE TOOL_PRINT
|
PICTURE TOOL_PRINT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_SETPRINT 2 2
|
BUTTON DLG_SETPRINT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 1 "Imposta"
|
PROMPT 2 3 "Imposta"
|
||||||
PICTURE TOOL_SETPRINT
|
PICTURE TOOL_SETPRINT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_EMAIL 2 2
|
BUTTON DLG_EMAIL 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Mail"
|
PROMPT 3 3 "Mail"
|
||||||
PICTURE TOOL_EMAIL
|
PICTURE TOOL_EMAIL
|
||||||
MESSAGE EXIT,77
|
|
||||||
END
|
END
|
||||||
|
|
||||||
#include <helpbar.h>
|
#include <helpbar.h>
|
||||||
@ -95,6 +94,7 @@ END
|
|||||||
DATE F_DATALIMOP
|
DATE F_DATALIMOP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Data limite operazione "
|
PROMPT 2 4 "Data limite operazione "
|
||||||
|
FLAGS "A"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_GGRISCHIO 3
|
NUMBER F_GGRISCHIO 3
|
||||||
@ -108,7 +108,6 @@ DATE F_DATALIMSOL
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Data limite solleciti "
|
PROMPT 2 5 "Data limite solleciti "
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATAINISCAD
|
DATE F_DATAINISCAD
|
||||||
@ -199,9 +198,9 @@ BEGIN
|
|||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_NSEL 3
|
NUMBER SC_NSEL 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 60 13 "N. "
|
PROMPT 49 13 "Selezionati "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
1
src/sc/sc2400b.h
Normal file
1
src/sc/sc2400b.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "sc2100b.h"
|
135
src/sc/sc2400b.uml
Normal file
135
src/sc/sc2400b.uml
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
#include "sc2400b.h"
|
||||||
|
|
||||||
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_ALL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "~Tutti"
|
||||||
|
PICTURE TOOL_MULTISEL
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Invia"
|
||||||
|
PICTURE TOOL_EMAIL
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_PREVIEW 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 3 "~Anteprima"
|
||||||
|
PICTURE TOOL_PREVIEW
|
||||||
|
END
|
||||||
|
|
||||||
|
#include <helpbar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Invio solleciti" 0 2 0 0
|
||||||
|
|
||||||
|
LISTBOX F_SORT 1 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 0 "Ordinamento "
|
||||||
|
ITEM "1|Codice"
|
||||||
|
ITEM "2|Ragione sociale"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_FROMEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Email di invio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_PASSWORD 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Password "
|
||||||
|
FLAGS "*"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CCEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Conoscenza "
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_RECEIPT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 70 3 "Ricevuta"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CCNEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Conosc.nascosta "
|
||||||
|
END
|
||||||
|
|
||||||
|
ZOOM F_SUBJ 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Oggetto "
|
||||||
|
END
|
||||||
|
|
||||||
|
ZOOM F_MESSAGE 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Messaggio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_TESTEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Email prova "
|
||||||
|
FLAGS "H"
|
||||||
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_SHEET -1 -1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 9 ""
|
||||||
|
ITEM "@1"
|
||||||
|
ITEM "Email@50"
|
||||||
|
ITEM "Codice"
|
||||||
|
ITEM "Ragione Sociale@50"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "" -1 -1 80 7
|
||||||
|
|
||||||
|
BOOLEAN S_SELECTED
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Email "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_EMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Email "
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER S_CODCF 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Codice "
|
||||||
|
FLAG "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Ragione Sociale "
|
||||||
|
FLAG "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_DELREC 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
1215
src/sc/sc2401.cpp
1215
src/sc/sc2401.cpp
File diff suppressed because it is too large
Load Diff
196
src/sc/sc2401.h
196
src/sc/sc2401.h
@ -41,203 +41,11 @@ protected:
|
|||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual void start_run();
|
virtual void start_run();
|
||||||
|
|
||||||
static bool lingua_handler(TMask_field& f, KEY k);
|
|
||||||
static bool codprof_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const char *get_prof_base() const;
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
const TString &get_prof_code() const;
|
|
||||||
const char *get_prof_name() const;
|
|
||||||
const TString &get_prof_lang() const;
|
|
||||||
|
|
||||||
bool stampa_saldo() const;
|
|
||||||
|
|
||||||
TESSL_mask(const char *name);
|
TESSL_mask(const char *name);
|
||||||
virtual ~TESSL_mask();
|
virtual ~TESSL_mask() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TESSL_form;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// TESSL_row
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class TESSL_row : public TSortable
|
|
||||||
{
|
|
||||||
TDate _data; // Data scadenza o pagamento
|
|
||||||
int _riga; // Riga della fattura
|
|
||||||
int _rata; // Numero rata o progrssivo
|
|
||||||
|
|
||||||
TString _causale; // Codice causale
|
|
||||||
TString _descrizione; // Sua descrizione
|
|
||||||
|
|
||||||
TDate _data_doc; // Data del documento
|
|
||||||
TString _num_doc; // Numero documento
|
|
||||||
long _num_prot; // Protocollo IVA
|
|
||||||
long _num_reg; // Numero registrazione
|
|
||||||
TImporto _importo; // Importo in valuta
|
|
||||||
real _importo_euro; // Importo in euro
|
|
||||||
real _scaduto; // Importo scaduto
|
|
||||||
real _esposto; // Importo esposto
|
|
||||||
bool _salvo_buon_fine; // Importo esposto salvo buon fine
|
|
||||||
real _totale; // Totale documento
|
|
||||||
TValuta _valuta; // Codice valuta, data cambio e cambio
|
|
||||||
bool _bloccata; // Rata bloccata
|
|
||||||
TString _codici_analitica; // codici analitica corrispondenti alle fatture
|
|
||||||
|
|
||||||
protected: // TSortable
|
|
||||||
virtual int compare(const TSortable& s) const;
|
|
||||||
void set_imp(TForm_item& fi, const real& imp, const char* cod_val) const;
|
|
||||||
|
|
||||||
TESSL_form& form() const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
int riga() const { return _riga; }
|
|
||||||
int rata() const { return _rata; }
|
|
||||||
|
|
||||||
void reset_uguali();
|
|
||||||
void descrizione(const char* s) { _descrizione = s; }
|
|
||||||
void importo(const TImporto& i) { _importo = i; }
|
|
||||||
void scaduto(const real& s) { _scaduto = s; }
|
|
||||||
void esposto(const real& e) { _esposto = e; }
|
|
||||||
void importo_in_euro(const real& imp) { _importo_euro = imp; }
|
|
||||||
void salvo_buon_fine(bool sbf) { _salvo_buon_fine = sbf; }
|
|
||||||
void rata_bloccata(bool rb) { _bloccata = rb; }
|
|
||||||
void codici_analitica(const char * s) { _codici_analitica = s; }
|
|
||||||
|
|
||||||
const TString& causale() const { return _causale; }
|
|
||||||
const TString& descrizione() const { return _descrizione; }
|
|
||||||
long num_reg() const { return _num_reg; }
|
|
||||||
const TValuta& valuta() const { return _valuta; }
|
|
||||||
const TImporto& importo() const { return _importo; }
|
|
||||||
const real& importo_in_euro() const { return _importo_euro; }
|
|
||||||
const real& scaduto() const { return _scaduto; }
|
|
||||||
const real& esposto() const { return _esposto; }
|
|
||||||
const TDate& data() const { return _data; }
|
|
||||||
bool in_valuta() const { return _valuta.in_valuta(); }
|
|
||||||
|
|
||||||
void print_on(TPrint_section& body);
|
|
||||||
|
|
||||||
TESSL_row(const TRiga_partite& row, const TDate& data, const TImporto& imp, int rata);
|
|
||||||
TESSL_row(const char* desc, const TImporto& imp, const TValuta& val);
|
|
||||||
virtual ~TESSL_row() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// TESSL_form: form speciale per estratti conto
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class TESSL_form : public TForm
|
|
||||||
{
|
|
||||||
friend class TESSL_row;
|
|
||||||
|
|
||||||
static TESSL_form* _form;
|
|
||||||
|
|
||||||
enum { MAXTOT = 16 };
|
|
||||||
|
|
||||||
TCursor* _cursore;
|
|
||||||
TTotalizer _totali;
|
|
||||||
|
|
||||||
TString _lingua;
|
|
||||||
TDate _dlo, _dls, _dir;
|
|
||||||
|
|
||||||
int _fincatura; // 0 = nessuna, 1 = testo, 2 = grafica
|
|
||||||
char _who;
|
|
||||||
|
|
||||||
int _giorni_rischio;
|
|
||||||
word _maxtot; // numero massimo di totali
|
|
||||||
|
|
||||||
bool _in_valuta;
|
|
||||||
bool _stampa_esp;
|
|
||||||
bool _stampa_saldo; // Stampa il saldo di ogni partita
|
|
||||||
|
|
||||||
TToken_string _anal_filter;
|
|
||||||
|
|
||||||
word _num_rip; // numero di righe usate per i riporti
|
|
||||||
word _total_rows; // numero di righe usate per i totali
|
|
||||||
|
|
||||||
TDecoder _causali; // Decodificatore dei codici causale
|
|
||||||
TDecoder _movimenti; // Decodificatore delle descrizioni dei movimenti
|
|
||||||
TDecoder _valute; // Decodificatore dei codici valuta
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void init_header(const TMask& m);
|
|
||||||
word ordina_totali_per_valuta(THash_object* tot[MAXTOT]);
|
|
||||||
int find_magic(TString& s, TString& magic1, TString& magic2) const;
|
|
||||||
void change_magic_body(const TESSL_row& o, TString& s);
|
|
||||||
void change_magic_footer(const THash_object& o, TString& s);
|
|
||||||
// void modify_picture(TForm_item& fi, TString_array& op, const bool in_valuta);
|
|
||||||
void print_total(int riga, const THash_object& o);
|
|
||||||
|
|
||||||
void stampa_testata(TPrinter& p);
|
|
||||||
void stampa_pedata(TPrinter& p);
|
|
||||||
void stampa_riporti(TPrinter& p);
|
|
||||||
|
|
||||||
static void header_handler(TPrinter& p);
|
|
||||||
static void footer_handler(TPrinter& p);
|
|
||||||
|
|
||||||
public:
|
|
||||||
TTotalizer& totali() { return _totali; }
|
|
||||||
TDecoder& causali() { return _causali; }
|
|
||||||
TDecoder& valute() { return _valute; }
|
|
||||||
TDecoder& movimenti() { return _movimenti; }
|
|
||||||
|
|
||||||
const TDate& data_limite_operazione() const { return _dlo; }
|
|
||||||
const TDate& data_limite_scaduto() const { return _dls; }
|
|
||||||
int giorni_rischio() const { return _giorni_rischio; }
|
|
||||||
const TDate& data_inizio_rischio() const { return _dir; }
|
|
||||||
|
|
||||||
const TString& lingua() const { return _lingua; }
|
|
||||||
bool in_valuta() const { return _in_valuta; }
|
|
||||||
const TString& describe(short id, char sez = 'H', pagetype pt = last_page) const;
|
|
||||||
const char sezione_normale() const { return _who == 'C' ? 'D' : 'A' ; }
|
|
||||||
|
|
||||||
void stampa_saldo(bool ss = TRUE) { _stampa_saldo = ss; }
|
|
||||||
void anal_filter(const TToken_string & f) { _anal_filter = f; }
|
|
||||||
const TToken_string &get_anal_filter() const { return _anal_filter; }
|
|
||||||
|
|
||||||
void azzera_totali();
|
|
||||||
void ultima_pagina();
|
|
||||||
virtual bool print_game(const TPartita& game);
|
|
||||||
|
|
||||||
TESSL_form(const TESSL_mask& m, bool gesval, short id_datalim = 0 , short id_datascad = 0, short id_giorni_rischio = 0);
|
|
||||||
virtual ~TESSL_form();
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// TESSL_array
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class TESSL_array : public TArray
|
|
||||||
{
|
|
||||||
TArray _scaduto; // Array di importi scaduti
|
|
||||||
TDecoder _anal;
|
|
||||||
|
|
||||||
|
|
||||||
const TESSL_form* _form;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
TESSL_row& new_row(const TRiga_partite& row, const TDate& data, const TImporto& imp, int rata = 0);
|
|
||||||
void add_row(const TRiga_partite& row);
|
|
||||||
|
|
||||||
const TESSL_form& form() const { return *_form; }
|
|
||||||
real calcola_scaduto(const TRiga_scadenze& rata, bool valuta);
|
|
||||||
|
|
||||||
|
|
||||||
TImporto* importo_riga_scaduto_ptr(int n) const { return (TImporto*)_scaduto.objptr(n); }
|
|
||||||
TImporto& importo_riga_scaduto(int n);
|
|
||||||
|
|
||||||
TImporto importo(const TPartita& game, const TRectype& pag, bool valuta) const;
|
|
||||||
|
|
||||||
static TPartita* _sort_game;
|
|
||||||
static int ordina_pag(const void* pag1, const void* pag2);
|
|
||||||
void arrange_scaduto(const TPartita& game);
|
|
||||||
|
|
||||||
public:
|
|
||||||
TESSL_row& row(int r) const { return (TESSL_row&)operator[](r); }
|
|
||||||
|
|
||||||
TESSL_array(const TPartita& game, const TESSL_form* f);
|
|
||||||
virtual ~TESSL_array() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __SC2401_H
|
#endif // __SC2401_H
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
#include "sc21pec.h"
|
#include "sc21pec.h"
|
||||||
#include "sc2102.h"
|
|
||||||
|
#ifndef __SC2402_H
|
||||||
#include "sc2402.h"
|
#include "sc2402.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../cg/cgsaldac.h"
|
#include "../cg/cgsaldac.h"
|
||||||
#include "../ca/calib01.h"
|
#include "../ca/calib01.h"
|
||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
|
#include "../ca/movana.h"
|
||||||
|
#include "../ca/rmovana.h"
|
||||||
|
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
#include <modaut.h>
|
#include <modaut.h>
|
||||||
|
#include <printer.h>
|
||||||
|
|
||||||
TSol_mask::TSol_mask(const char *name)
|
TSol_mask::TSol_mask(const char *name) : _sol_mail("sc2400b"), TESSL_mask(name), _form(nullptr)
|
||||||
:TESSL_mask(name)
|
|
||||||
{
|
{
|
||||||
_cdc_start = 0;
|
_cdc_start = 0;
|
||||||
_cdc_end = 0;
|
_cdc_end = 0;
|
||||||
@ -71,15 +75,23 @@ TSol_mask::TSol_mask(const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TESSL_form & TSol_mask::form()
|
||||||
|
{
|
||||||
|
if (_form == nullptr)
|
||||||
|
_form = new TSol_form(*this, ini_get_bool(CONFIG_DITTA, "cg", "GesVal"), F_DATALIMOP, F_DATALIMSOL, F_GGRISCHIO);
|
||||||
|
return *_form;
|
||||||
|
}
|
||||||
|
|
||||||
int TSol_mask::insert_anal_fields(TMask& m, int page, int lf, int& y,
|
int TSol_mask::insert_anal_fields(TMask& m, int page, int lf, int& y,
|
||||||
short& dlg, short& dlgd)
|
short& dlg, short& dlgd)
|
||||||
{
|
{
|
||||||
const int h = ca_create_fields(m, page, lf, 2, y, dlg, dlgd);
|
const int h = ca_create_fields(m, page, lf, 2, y, dlg, dlgd);
|
||||||
|
|
||||||
for (int i = 0; i < h; i++)
|
for (int i = 0; i < h; i++)
|
||||||
{
|
{
|
||||||
TEdit_field& fld = m.efield(dlg+i);
|
TEdit_field& fld = m.efield(dlg + i);
|
||||||
int logic = lf;
|
int logic = lf;
|
||||||
|
|
||||||
if (logic == LF_FASI)
|
if (logic == LF_FASI)
|
||||||
{
|
{
|
||||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||||
@ -91,17 +103,265 @@ int TSol_mask::insert_anal_fields(TMask& m, int page, int lf, int& y,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEdit_field& dfld = m.efield(dlgd+i);
|
TEdit_field& dfld = m.efield(dlgd + i);
|
||||||
|
|
||||||
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
|
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
y += h+1;
|
y += h+1;
|
||||||
dlg += h; dlgd += h;
|
dlg += h; dlgd += h;
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSol_mask::~TSol_mask() {}
|
bool TSol_mask::ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al, const TDate& data_rischio) const
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
|
for (int r = game.last(); r > 0; r = game.pred(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& row = game.riga(r);
|
||||||
|
if (row.is_fattura() && row.get_date(PART_DATAREG) <= al)
|
||||||
|
{
|
||||||
|
for (int s = row.rate(); s > 0; s--)
|
||||||
|
{
|
||||||
|
const TRiga_scadenze& rata = row.rata(s);
|
||||||
|
const TDate data = rata.get(SCAD_DATASCAD);
|
||||||
|
if (data >= dal && data <= al)
|
||||||
|
{
|
||||||
|
found = !rata.chiusa();
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
TImporto rat = rata.importo(true);
|
||||||
|
TImporto imp = rata.importo_pagato_al(true, data_rischio);
|
||||||
|
imp.normalize(rat.sezione());
|
||||||
|
const real saldo = rat.valore() + imp.valore();
|
||||||
|
found = saldo > ZERO;
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TString& TSol_mask::game_key(const TRectype& part) const
|
||||||
|
{
|
||||||
|
TToken_string& tok = get_tmp_string();
|
||||||
|
|
||||||
|
tok = part.get(PART_ANNO);
|
||||||
|
tok.add(part.get(PART_NUMPART));
|
||||||
|
return tok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSol_mask::puoi_scartare(const TPartita& game, const TDate& datalim) const
|
||||||
|
{
|
||||||
|
bool yes = game.chiusa();
|
||||||
|
|
||||||
|
if (yes && datalim.ok())
|
||||||
|
{
|
||||||
|
TDate last;
|
||||||
|
|
||||||
|
for (int r = game.last(); r > 0; r = game.pred(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& riga = game.riga(r);
|
||||||
|
|
||||||
|
if (riga.tipo() > tm_fattura)
|
||||||
|
{
|
||||||
|
const TDate d = riga.get(PART_DATAPAG);
|
||||||
|
|
||||||
|
if (d > last)
|
||||||
|
last = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yes = last < datalim;
|
||||||
|
}
|
||||||
|
return yes;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSol_mask::some_to_print(const char * tipo, const long codice)
|
||||||
|
{
|
||||||
|
TSol_form& f = (TSol_form&) form();
|
||||||
|
const bool sel_tot_saldo = f.get_sel_tot_saldo(); // selezione sul saldo totale cliente
|
||||||
|
const real sel_importo(f.get_sel_importo()); // importo di selezione
|
||||||
|
const TDate data_inizio_soll = get(F_DATAINISCAD);
|
||||||
|
const TDate data_limite_soll = f.data_limite_operazione();
|
||||||
|
const TDate data_limite_scaduto = f.data_limite_scaduto();
|
||||||
|
const TDate data_rischio = f.data_inizio_rischio();
|
||||||
|
TAssoc_array games_in_range;
|
||||||
|
real saldo;
|
||||||
|
bool any_to_print = false;
|
||||||
|
// filtra solo le partite del cliente selezionato
|
||||||
|
TRectype filter(LF_PARTITE);
|
||||||
|
TLocalisamfile partite(LF_PARTITE);
|
||||||
|
const TRectype& parkur = partite.curr();
|
||||||
|
|
||||||
|
filter.put(PART_TIPOCF, tipo);
|
||||||
|
filter.put(PART_SOTTOCONTO, codice);
|
||||||
|
partite.curr() = filter;
|
||||||
|
for (int err = partite.read(_isgteq);
|
||||||
|
err == NOERR && parkur == filter;
|
||||||
|
err = partite.read(_isgreat))
|
||||||
|
{
|
||||||
|
const TPartita game(parkur);
|
||||||
|
|
||||||
|
if (!puoi_scartare(game, data_rischio))
|
||||||
|
{
|
||||||
|
if (sel_tot_saldo)
|
||||||
|
{
|
||||||
|
const real sld = game.calcola_scaduto_al(false, data_limite_soll);
|
||||||
|
saldo += sld;
|
||||||
|
}
|
||||||
|
if (data_inizio_soll.ok())
|
||||||
|
{
|
||||||
|
if (ci_sono_scadenze_aperte(game, data_inizio_soll, data_limite_soll, data_rischio))
|
||||||
|
any_to_print = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
any_to_print = true;
|
||||||
|
}
|
||||||
|
partite.put(PART_NRIGA, 9999);
|
||||||
|
}
|
||||||
|
if (sel_tot_saldo && sel_importo > ZERO && saldo < sel_importo)
|
||||||
|
any_to_print = false;
|
||||||
|
return any_to_print;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TSol_mask::print_one(const char * tipo, const long codice)
|
||||||
|
{
|
||||||
|
TSol_form& f = (TSol_form&)form();
|
||||||
|
|
||||||
|
// preparazione variabili per controllo lingua
|
||||||
|
;
|
||||||
|
const TString4 lincf = f.cursor()->file().curr().get(CLI_CODLIN);
|
||||||
|
bool ok = true;
|
||||||
|
TString lind = ini_get_string(CONFIG_DITTA, "cg", "CodLin");
|
||||||
|
TString linf = f.lingua();
|
||||||
|
|
||||||
|
// controllo lingua ditta corrente
|
||||||
|
if (linf == lind && lincf.full())
|
||||||
|
ok = (lincf == linf);
|
||||||
|
if (linf != lind)
|
||||||
|
ok = (lincf == linf);
|
||||||
|
if (!ok)
|
||||||
|
return -1; // cliente analfabeta
|
||||||
|
f.azzera_totali();
|
||||||
|
// filtra solo le partite del cliente selezionato
|
||||||
|
TLocalisamfile partite(LF_PARTITE);
|
||||||
|
partite.zero();
|
||||||
|
partite.put(PART_TIPOCF, tipo);
|
||||||
|
partite.put(PART_SOTTOCONTO, codice);
|
||||||
|
|
||||||
|
const TRectype& parkur = partite.curr();
|
||||||
|
const TRectype filter(parkur);
|
||||||
|
bool one_printed = false; // booleano di controllo di riuscita della stampa
|
||||||
|
const bool sel_tot_saldo = f.get_sel_tot_saldo(); // selezione sul saldo totale cliente
|
||||||
|
const real sel_importo(f.get_sel_importo()); // importo di selezione
|
||||||
|
const TDate data_inizio_soll = get(F_DATAINISCAD);
|
||||||
|
const TDate data_limite_soll = f.data_limite_operazione();
|
||||||
|
const TDate data_limite_scaduto = f.data_limite_scaduto();
|
||||||
|
TToken_string anal_filter = form().get_anal_filter();
|
||||||
|
const bool select_analitica = (dongle().active(CAAUT) || dongle().active(CMAUT)) && anal_filter.full();
|
||||||
|
TDecoder anal(LF_MOVANA, MOVANA_NUMREG, 3);
|
||||||
|
const TDate data_rischio = f.data_inizio_rischio();
|
||||||
|
TAssoc_array games_in_range;
|
||||||
|
|
||||||
|
if (some_to_print(tipo, codice))
|
||||||
|
{
|
||||||
|
partite.curr() = filter;
|
||||||
|
|
||||||
|
for (int err = partite.read(_isgteq);
|
||||||
|
err == NOERR && parkur == filter;
|
||||||
|
err = partite.read(_isgreat))
|
||||||
|
{
|
||||||
|
if (data_inizio_soll.ok() && !games_in_range.is_key(game_key(parkur)))
|
||||||
|
continue; // Scarta parite fuori range di date
|
||||||
|
|
||||||
|
const TPartita game(parkur);
|
||||||
|
if (!puoi_scartare(game, data_rischio))
|
||||||
|
{
|
||||||
|
const real saldo = game.calcola_scaduto_al(false, data_limite_scaduto);
|
||||||
|
|
||||||
|
TImporto unreferenced; //Totale non assegnati per questa partita.
|
||||||
|
{
|
||||||
|
// E' giusto calcolare il saldo, comprendente i non assegnati.
|
||||||
|
// se il saldo della partita chiude in avere va sommato ad unreferenced
|
||||||
|
const TRiga_partite& sum = game.riga(game.first());
|
||||||
|
unreferenced = game.calcola_saldo_al(game.in_valuta() && f.in_valuta(), data_limite_soll, data_limite_scaduto, data_rischio);
|
||||||
|
if (unreferenced.valore() > ZERO && unreferenced.sezione() == 'A')
|
||||||
|
{
|
||||||
|
unreferenced.normalize('A'); //per i non assegnati/anticipi c'e' solo la colonna AVERE
|
||||||
|
const TString4 valuta = sum.get(PART_CODVAL);
|
||||||
|
form().totali().add(unreferenced, valuta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (select_analitica)
|
||||||
|
{
|
||||||
|
bool print = false;
|
||||||
|
for (int r = game.first(); !print && r <= game.last(); r = game.succ(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& row = game.riga(r);
|
||||||
|
const TString& numregcg = row.get(PART_NREG);
|
||||||
|
const long numreg = atol(anal.decode(numregcg));
|
||||||
|
|
||||||
|
if (numreg > 0)
|
||||||
|
{
|
||||||
|
TAnal_mov anal_mov(numreg);
|
||||||
|
TRecord_array & rows = anal_mov.body();
|
||||||
|
const int nrows = rows.rows();
|
||||||
|
TString s;
|
||||||
|
|
||||||
|
for (int i = 1; !print && i <= nrows; i++)
|
||||||
|
{
|
||||||
|
const TRectype & row = anal_mov.body().row(i);
|
||||||
|
TString f = anal_filter.get(0);
|
||||||
|
f.trim();
|
||||||
|
|
||||||
|
if (f.full())
|
||||||
|
{
|
||||||
|
s = row.get(RMOVANA_CODCMS);
|
||||||
|
print |= s.match(f);
|
||||||
|
}
|
||||||
|
f = anal_filter.get();
|
||||||
|
if (f.full())
|
||||||
|
{
|
||||||
|
s = row.get(RMOVANA_CODCCOSTO);
|
||||||
|
print |= s.match(f);
|
||||||
|
}
|
||||||
|
f = anal_filter.get();
|
||||||
|
if (f.full())
|
||||||
|
{
|
||||||
|
s = row.get(RMOVANA_CODFASE);
|
||||||
|
print |= s.match(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!print)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (sel_tot_saldo || (saldo > ZERO && saldo >= sel_importo) || (saldo.is_zero() && !unreferenced.is_zero() && data_rischio < data_limite_scaduto))
|
||||||
|
{
|
||||||
|
const bool printed = form().print_game(game);
|
||||||
|
one_printed |= printed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
partite.put(PART_NRIGA, 9999);
|
||||||
|
|
||||||
|
if (printer().frozen())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (one_printed)
|
||||||
|
{
|
||||||
|
f.ultima_pagina();
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return one_printed ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool TSol_mask::get_sel_tot_saldo() const
|
bool TSol_mask::get_sel_tot_saldo() const
|
||||||
{
|
{
|
||||||
@ -198,6 +458,7 @@ const TToken_string & TSol_mask::get_anal_filter() const
|
|||||||
f.cut(0);
|
f.cut(0);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TSol_row
|
// TSol_row
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -220,6 +481,7 @@ TSol_form::TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id
|
|||||||
{
|
{
|
||||||
_sel_tot_saldo = m.get_sel_tot_saldo();
|
_sel_tot_saldo = m.get_sel_tot_saldo();
|
||||||
_sel_importo = m.get_sel_importo();
|
_sel_importo = m.get_sel_importo();
|
||||||
|
_stampa_esposto = m.get_bool(F_STAMPESP);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -5,23 +5,7 @@
|
|||||||
#include "sc2401.h"
|
#include "sc2401.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TSol_mask: public TESSL_mask
|
class TSol_mask;
|
||||||
{
|
|
||||||
short _cdc_start, _cdc_end,
|
|
||||||
_cms_start, _cms_end,
|
|
||||||
_fas_start, _fas_end;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int insert_anal_fields(TMask& m, int page, int lf, int& y, short& dlg, short& dlgd);
|
|
||||||
|
|
||||||
public:
|
|
||||||
bool get_sel_tot_saldo() const ;
|
|
||||||
real get_sel_importo() const ;
|
|
||||||
const TToken_string &get_anal_filter() const;
|
|
||||||
|
|
||||||
TSol_mask(const char *name);
|
|
||||||
virtual ~TSol_mask();
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TSol_row
|
// TSol_row
|
||||||
@ -44,12 +28,14 @@ public:
|
|||||||
|
|
||||||
class TSol_form : public TESSL_form
|
class TSol_form : public TESSL_form
|
||||||
{
|
{
|
||||||
bool _sel_tot_saldo;
|
bool _sel_tot_saldo;
|
||||||
real _sel_importo;
|
real _sel_importo;
|
||||||
|
bool _stampa_esposto;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual bool stampa_esposto() const override{ return _stampa_esposto; }
|
||||||
bool get_sel_tot_saldo() const { return _sel_tot_saldo;}
|
bool get_sel_tot_saldo() const { return _sel_tot_saldo;}
|
||||||
const real& get_sel_importo() const { return _sel_importo; }
|
const real& get_sel_importo() const { return _sel_importo; }
|
||||||
TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id_datascad, short id_ggrischio);
|
TSol_form(const TSol_mask& m, bool gesval, short id_datalim, short id_datascad, short id_ggrischio);
|
||||||
@ -66,5 +52,34 @@ public:
|
|||||||
virtual ~TSol_array() {}
|
virtual ~TSol_array() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TSol_mask : public TESSL_mask
|
||||||
|
{
|
||||||
|
TMail_mask _sol_mail;
|
||||||
|
short _cdc_start,
|
||||||
|
_cdc_end,
|
||||||
|
_cms_start,
|
||||||
|
_cms_end,
|
||||||
|
_fas_start,
|
||||||
|
_fas_end;
|
||||||
|
TSol_form * _form;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int insert_anal_fields(TMask& m, int page, int lf, int& y, short& dlg, short& dlgd);
|
||||||
|
const TString& game_key(const TRectype& part) const; // Costruisce chiave univoca per TAssoc_array partite
|
||||||
|
bool ci_sono_scadenze_aperte(const TPartita& game, const TDate& dal, const TDate& al, const TDate& data_rischio) const;
|
||||||
|
bool puoi_scartare(const TPartita& game, const TDate& datalim) const;
|
||||||
|
virtual TMail_mask & mail_mask() override { return _sol_mail; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool get_sel_tot_saldo() const;
|
||||||
|
real get_sel_importo() const;
|
||||||
|
virtual const TToken_string & get_anal_filter() const override;
|
||||||
|
virtual bool some_to_print(const char * tipo, const long codice) override; // c'è qualcosa da stampare
|
||||||
|
virtual int print_one(const char * tipo, const long codice) override; // stampa l'elemento corrente
|
||||||
|
virtual TESSL_form & form() override;
|
||||||
|
|
||||||
|
TSol_mask(const char *name);
|
||||||
|
virtual ~TSol_mask() { safe_delete(_form); };
|
||||||
|
};
|
||||||
|
|
||||||
#endif // __SC2402_H
|
#endif // __SC2402_H
|
||||||
|
@ -108,8 +108,6 @@ class TProspettoScadenze : public TPrintapp
|
|||||||
bool _excel;
|
bool _excel;
|
||||||
TPRSC_recordset * _recset;
|
TPRSC_recordset * _recset;
|
||||||
|
|
||||||
//static TString80 _last_game;
|
|
||||||
//static bool fil_function(const TRelation *);
|
|
||||||
TString_array _colnames;
|
TString_array _colnames;
|
||||||
int _limiti[NUMERO_FASCE];
|
int _limiti[NUMERO_FASCE];
|
||||||
|
|
||||||
@ -136,7 +134,7 @@ public:
|
|||||||
void compute_unassigned(TPartita& p, const TDate & datalim);
|
void compute_unassigned(TPartita& p, const TDate & datalim);
|
||||||
void compute_all(TPartita& p);
|
void compute_all(TPartita& p);
|
||||||
void print_real(TString& dest, const real& num);
|
void print_real(TString& dest, const real& num);
|
||||||
void riempi_conti_mastro(const char cf);
|
void riempi_conti_mastro(const char * cf);
|
||||||
void calcola_saldo();
|
void calcola_saldo();
|
||||||
TProspettoScadenze();
|
TProspettoScadenze();
|
||||||
};
|
};
|
||||||
@ -292,7 +290,8 @@ void TProspettoScadenze::compute_all(TPartita& p)
|
|||||||
{
|
{
|
||||||
TDate data_pag(sum.get_date(PART_DATAPAG));
|
TDate data_pag(sum.get_date(PART_DATAPAG));
|
||||||
int tipo_pag = sum.get_int(PART_TIPOPAG);
|
int tipo_pag = sum.get_int(PART_TIPOPAG);
|
||||||
if (tipo_pag>=2 && tipo_pag<=7 && data_pag.ok()) //Incasso tramite effetto
|
|
||||||
|
if (tipo_pag >= tm_nota_credito && tipo_pag <= tm_pagamento_insoluto && data_pag.ok()) //Incasso tramite effetto
|
||||||
{
|
{
|
||||||
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
||||||
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
||||||
@ -498,12 +497,12 @@ bool TProspettoScadenze::open_print()
|
|||||||
reset_files();
|
reset_files();
|
||||||
reset_print();
|
reset_print();
|
||||||
printer().footerlen(5);
|
printer().footerlen(5);
|
||||||
if (_m->get_who() == 'C')
|
if (_m->who() == "C")
|
||||||
_tipost = clienti;
|
_tipost = clienti;
|
||||||
else
|
else
|
||||||
_tipost = fornitori;
|
_tipost = fornitori;
|
||||||
riempi_conti_mastro(_m->get_who());
|
riempi_conti_mastro(_m->who());
|
||||||
if (_m->get_selected_key() == 1)
|
if (_m->key() == 1)
|
||||||
_ordcod = true;
|
_ordcod = true;
|
||||||
else
|
else
|
||||||
_ordcod = false;
|
_ordcod = false;
|
||||||
@ -711,12 +710,12 @@ bool TProspettoScadenze::user_destroy()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::riempi_conti_mastro(const char cf)
|
void TProspettoScadenze::riempi_conti_mastro(const char * cf)
|
||||||
{
|
{
|
||||||
_conti_cf.destroy();
|
_conti_cf.destroy();
|
||||||
TRelation rel = TRelation(LF_PCON);
|
TRelation rel = TRelation(LF_PCON);
|
||||||
TString80 filtro;
|
TString80 filtro;
|
||||||
filtro.format("TMCF==\'%c\'", cf);
|
filtro.format("TMCF==\"%s\"", cf);
|
||||||
TCursor cur(&rel, filtro);
|
TCursor cur(&rel, filtro);
|
||||||
TToken_string gc(10);
|
TToken_string gc(10);
|
||||||
for (cur=0; cur.pos() < cur.items(); ++cur)
|
for (cur=0; cur.pos() < cur.items(); ++cur)
|
||||||
@ -736,9 +735,18 @@ bool TProspettoScadenze::set_print(int)
|
|||||||
|
|
||||||
if (!repeat)
|
if (!repeat)
|
||||||
{
|
{
|
||||||
|
TDate data = today;
|
||||||
|
|
||||||
|
data.set_end_month();
|
||||||
|
if (!_m->get_date(F_DATASCADUTO).ok())
|
||||||
|
_m->set(F_DATASCADUTO, data);
|
||||||
|
|
||||||
KEY k = _m->run();
|
KEY k = _m->run();
|
||||||
|
|
||||||
_excel = k != K_ENTER;
|
_excel = k != K_ENTER;
|
||||||
print = k != K_QUIT;
|
print = k != K_QUIT;
|
||||||
|
if (print || _excel)
|
||||||
|
_m->update_assoc();
|
||||||
int nmesi = _m->get_int(F_NMESI);
|
int nmesi = _m->get_int(F_NMESI);
|
||||||
|
|
||||||
if (nmesi == 0)
|
if (nmesi == 0)
|
||||||
|
@ -185,9 +185,9 @@ BEGIN
|
|||||||
FLAGS "HB"
|
FLAGS "HB"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER SC_NSEL 3
|
NUMBER SC_NSEL 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 60 13 "N. "
|
PROMPT 48 13 "Selezionati "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
2049
src/sc/scselect.cpp
2049
src/sc/scselect.cpp
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,12 @@
|
|||||||
#include <assoc.h>
|
#include <assoc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MASK_H
|
#ifndef __AUTOMASK_H
|
||||||
#include <mask.h>
|
#include <automask.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __FORM_H
|
||||||
|
#include <form.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __RELATION_H
|
#ifndef __RELATION_H
|
||||||
@ -21,6 +25,10 @@
|
|||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CGSALDAC_H
|
||||||
|
#include "../cg/cgsaldac.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __SCSELMSK_H
|
#ifndef __SCSELMSK_H
|
||||||
#include "scselmsk.h"
|
#include "scselmsk.h"
|
||||||
#endif
|
#endif
|
||||||
@ -29,8 +37,213 @@
|
|||||||
#include "../cg/cglib.h"
|
#include "../cg/cglib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TSelection_mask : public TMask
|
#ifndef __SC2102_H
|
||||||
{
|
#include "sc2102.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class TESSL_form;
|
||||||
|
class TSelection_mask;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TESSL_row
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TESSL_row : public TSortable
|
||||||
|
{
|
||||||
|
TDate _data; // Data scadenza o pagamento
|
||||||
|
int _riga; // Riga della fattura
|
||||||
|
int _rata; // Numero rata o progrssivo
|
||||||
|
|
||||||
|
TString _causale; // Codice causale
|
||||||
|
TString _descrizione; // Sua descrizione
|
||||||
|
|
||||||
|
TDate _data_doc; // Data del documento
|
||||||
|
TString _num_doc; // Numero documento
|
||||||
|
long _num_prot; // Protocollo IVA
|
||||||
|
long _num_reg; // Numero registrazione
|
||||||
|
TImporto _importo; // Importo in valuta
|
||||||
|
real _importo_euro; // Importo in euro
|
||||||
|
real _scaduto; // Importo scaduto
|
||||||
|
real _esposto; // Importo esposto
|
||||||
|
bool _salvo_buon_fine; // Importo esposto salvo buon fine
|
||||||
|
real _totale; // Totale documento
|
||||||
|
TValuta _valuta; // Codice valuta, data cambio e cambio
|
||||||
|
bool _bloccata; // Rata bloccata
|
||||||
|
TString _codici_analitica; // codici analitica corrispondenti alle fatture
|
||||||
|
|
||||||
|
protected: // TSortable
|
||||||
|
virtual int compare(const TSortable& s) const;
|
||||||
|
void set_imp(TForm_item& fi, const real& imp, const char* cod_val) const;
|
||||||
|
|
||||||
|
TESSL_form & form() const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
int riga() const { return _riga; }
|
||||||
|
int rata() const { return _rata; }
|
||||||
|
|
||||||
|
void reset_uguali();
|
||||||
|
void descrizione(const char* s) { _descrizione = s; }
|
||||||
|
void importo(const TImporto& i) { _importo = i; }
|
||||||
|
void scaduto(const real& s) { _scaduto = s; }
|
||||||
|
void esposto(const real& e) { _esposto = e; }
|
||||||
|
void importo_in_euro(const real& imp) { _importo_euro = imp; }
|
||||||
|
void salvo_buon_fine(bool sbf) { _salvo_buon_fine = sbf; }
|
||||||
|
void rata_bloccata(bool rb) { _bloccata = rb; }
|
||||||
|
void codici_analitica(const char * s) { _codici_analitica = s; }
|
||||||
|
|
||||||
|
const TString& causale() const { return _causale; }
|
||||||
|
const TString& descrizione() const { return _descrizione; }
|
||||||
|
long num_reg() const { return _num_reg; }
|
||||||
|
const TValuta& valuta() const { return _valuta; }
|
||||||
|
const TImporto& importo() const { return _importo; }
|
||||||
|
const real& importo_in_euro() const { return _importo_euro; }
|
||||||
|
const real& scaduto() const { return _scaduto; }
|
||||||
|
const real& esposto() const { return _esposto; }
|
||||||
|
const TDate& data() const { return _data; }
|
||||||
|
bool in_valuta() const { return _valuta.in_valuta(); }
|
||||||
|
|
||||||
|
void print_on(TPrint_section& body);
|
||||||
|
|
||||||
|
TESSL_row(const TRiga_partite& row, const TDate& data, const TImporto& imp, int rata);
|
||||||
|
TESSL_row(const char* desc, const TImporto& imp, const TValuta& val);
|
||||||
|
virtual ~TESSL_row() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TESSL_form: form speciale per estratti conto
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TESSL_form : public TForm
|
||||||
|
{
|
||||||
|
friend class TESSL_row;
|
||||||
|
|
||||||
|
static TESSL_form* _form;
|
||||||
|
|
||||||
|
enum { MAXTOT = 16 };
|
||||||
|
|
||||||
|
TCursor* _cursore;
|
||||||
|
TTotalizer _totali;
|
||||||
|
|
||||||
|
TString _lingua;
|
||||||
|
TDate _dlo, _dls, _dir;
|
||||||
|
|
||||||
|
int _fincatura; // 0 = nessuna, 1 = testo, 2 = grafica
|
||||||
|
TString4 _who;
|
||||||
|
|
||||||
|
int _giorni_rischio;
|
||||||
|
word _maxtot; // numero massimo di totali
|
||||||
|
|
||||||
|
bool _in_valuta;
|
||||||
|
bool _stampa_esp;
|
||||||
|
bool _stampa_saldo; // Stampa il saldo di ogni partita
|
||||||
|
|
||||||
|
TToken_string _anal_filter;
|
||||||
|
|
||||||
|
word _num_rip; // numero di righe usate per i riporti
|
||||||
|
word _total_rows; // numero di righe usate per i totali
|
||||||
|
|
||||||
|
TDecoder _causali; // Decodificatore dei codici causale
|
||||||
|
TDecoder _movimenti; // Decodificatore delle descrizioni dei movimenti
|
||||||
|
TDecoder _valute; // Decodificatore dei codici valuta
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void init_header(const TMask& m);
|
||||||
|
word ordina_totali_per_valuta(THash_object* tot[MAXTOT]);
|
||||||
|
int find_magic(TString& s, TString& magic1, TString& magic2) const;
|
||||||
|
void change_magic_body(const TESSL_row& o, TString& s);
|
||||||
|
void change_magic_footer(const THash_object& o, TString& s);
|
||||||
|
// void modify_picture(TForm_item& fi, TString_array& op, const bool in_valuta);
|
||||||
|
void print_total(int riga, const THash_object& o);
|
||||||
|
|
||||||
|
void stampa_testata(TPrinter& p);
|
||||||
|
void stampa_pedata(TPrinter& p);
|
||||||
|
void stampa_riporti(TPrinter& p);
|
||||||
|
|
||||||
|
static void header_handler(TPrinter& p);
|
||||||
|
static void footer_handler(TPrinter& p);
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual TESSL_form & form() { return *_form; }
|
||||||
|
TTotalizer& totali() { return _totali; }
|
||||||
|
TDecoder& causali() { return _causali; }
|
||||||
|
TDecoder& valute() { return _valute; }
|
||||||
|
TDecoder& movimenti() { return _movimenti; }
|
||||||
|
|
||||||
|
const TDate& data_limite_operazione() const { return _dlo; }
|
||||||
|
const TDate& data_limite_scaduto() const { return _dls; }
|
||||||
|
int giorni_rischio() const { return _giorni_rischio; }
|
||||||
|
const TDate& data_inizio_rischio() const { return _dir; }
|
||||||
|
|
||||||
|
const TString& lingua() const { return _lingua; }
|
||||||
|
bool in_valuta() const { return _in_valuta; }
|
||||||
|
const TString& describe(short id, char sez = 'H', pagetype pt = last_page) const;
|
||||||
|
const char sezione_normale() const { return _who == 'C' ? 'D' : 'A'; }
|
||||||
|
|
||||||
|
void stampa_saldo(bool ss = true) { _stampa_saldo = ss; }
|
||||||
|
void anal_filter(const TToken_string & f) { _anal_filter = f; }
|
||||||
|
const TToken_string &get_anal_filter() const { return _anal_filter; }
|
||||||
|
|
||||||
|
void azzera_totali();
|
||||||
|
void ultima_pagina();
|
||||||
|
virtual bool print_game(const TPartita& game);
|
||||||
|
virtual bool stampa_esposto() const { return false; }
|
||||||
|
|
||||||
|
TESSL_form(const TSelection_mask & m, bool gesval, short id_datalim = 0, short id_datascad = 0,
|
||||||
|
short id_giorni_rischio = 0);
|
||||||
|
virtual ~TESSL_form();
|
||||||
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TESSL_array
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TESSL_array : public TArray
|
||||||
|
{
|
||||||
|
TArray _scaduto; // Array di importi scaduti
|
||||||
|
TDecoder _anal;
|
||||||
|
|
||||||
|
const TESSL_form* _form;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
TESSL_row& new_row(const TRiga_partite& row, const TDate& data, const TImporto& imp, int rata = 0);
|
||||||
|
void add_row(const TRiga_partite& row);
|
||||||
|
|
||||||
|
const TESSL_form& form() const { return *_form; }
|
||||||
|
real calcola_scaduto(const TRiga_scadenze& rata, bool valuta);
|
||||||
|
|
||||||
|
|
||||||
|
TImporto* importo_riga_scaduto_ptr(int n) const { return (TImporto*)_scaduto.objptr(n); }
|
||||||
|
TImporto& importo_riga_scaduto(int n);
|
||||||
|
|
||||||
|
TImporto importo(const TPartita& game, const TRectype& pag, bool valuta) const;
|
||||||
|
|
||||||
|
static TPartita* _sort_game;
|
||||||
|
static int ordina_pag(const void* pag1, const void* pag2);
|
||||||
|
void arrange_scaduto(const TPartita& game);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TESSL_row& row(int r) const { return (TESSL_row&)operator[](r); }
|
||||||
|
|
||||||
|
TESSL_array(const TPartita& game, const TESSL_form* f);
|
||||||
|
virtual ~TESSL_array() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TMail_mask : public TAutomask
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual bool on_key(KEY k) override;
|
||||||
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TMail_mask() : TAutomask() {}
|
||||||
|
TMail_mask(const char * name) : TAutomask(name) {}
|
||||||
|
~TMail_mask() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TSelection_mask : public TAutomask
|
||||||
|
{
|
||||||
|
TMail_mask _empty_mask;
|
||||||
TCursor_sheet* _cli_sh_k1;
|
TCursor_sheet* _cli_sh_k1;
|
||||||
TCursor_sheet* _cli_sh_k2;
|
TCursor_sheet* _cli_sh_k2;
|
||||||
TCursor_sheet* _for_sh_k1;
|
TCursor_sheet* _for_sh_k1;
|
||||||
@ -38,7 +251,7 @@ class TSelection_mask : public TMask
|
|||||||
TCursor_sheet* _pdc_sh_k1;
|
TCursor_sheet* _pdc_sh_k1;
|
||||||
TCursor_sheet* _pdc_sh_k2;
|
TCursor_sheet* _pdc_sh_k2;
|
||||||
|
|
||||||
char _who; // Clienti, fornitori, conti
|
TString4 _who; // Clienti, fornitori, conti
|
||||||
int _key; // 1 = per codice, 2 = per descrizione
|
int _key; // 1 = per codice, 2 = per descrizione
|
||||||
TRelation* _clifo_rel;
|
TRelation* _clifo_rel;
|
||||||
TCursor* _cli_cur_k1;
|
TCursor* _cli_cur_k1;
|
||||||
@ -48,49 +261,49 @@ class TSelection_mask : public TMask
|
|||||||
TRelation* _pdc_rel;
|
TRelation* _pdc_rel;
|
||||||
TCursor* _pdc_cur_k1;
|
TCursor* _pdc_cur_k1;
|
||||||
TCursor* _pdc_cur_k2;
|
TCursor* _pdc_cur_k2;
|
||||||
|
|
||||||
TAssoc_array _assoc;
|
protected:
|
||||||
bool _all_selected;
|
virtual TESSL_form & form() pure;
|
||||||
|
bool stampa_saldo() const;
|
||||||
protected: // TMask
|
virtual const TToken_string & get_anal_filter() const pure ;
|
||||||
virtual void set_handler(short fld_id, CONTROL_HANDLER handler);
|
virtual bool some_to_print(const char * tipo, const long codice) { return true; }
|
||||||
virtual bool stop_run(KEY k);
|
virtual int print_one(const char * tipo, const long codice) { return true; }
|
||||||
|
virtual TMail_mask & mail_mask() { return _empty_mask; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void select_clifo_range(long from, long to);
|
void select_clifo_range(long from, long to);
|
||||||
void select_des_clifo_range(const TString & from, const TString & to);
|
void select_des_clifo_range(const TString & from, const TString & to);
|
||||||
void set_clifo_limits();
|
void set_clifo_limits();
|
||||||
void set_des_clifo_limits();
|
void set_des_clifo_limits();
|
||||||
|
|
||||||
void set_who(char w) { _who = w; }
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||||
|
|
||||||
|
void set_who(const char * w) { _who = w; }
|
||||||
void set_key (int k) { _key = k; }
|
void set_key (int k) { _key = k; }
|
||||||
|
|
||||||
void reset_sheets();
|
void reset_sheets();
|
||||||
void update_assoc();
|
void update_checked();
|
||||||
|
|
||||||
// handlers
|
bool get_cc_address(const char * tipo, const long cod, TToken_string& cc) const;
|
||||||
static bool bfrom_handler(TMask_field& f, KEY k);
|
int send_doc(long codice, const TString & ragsoc, const TToken_string& email,
|
||||||
static bool bto_handler(TMask_field& f, KEY k);
|
TToken_string & cc, TToken_string & ccn, bool rcpt,
|
||||||
static bool ffrom_handler(TMask_field& f, KEY k);
|
const TString & test_email, const TString & subj, const TString & msg, TLog_report & log);
|
||||||
static bool fto_handler(TMask_field& f, KEY k);
|
|
||||||
static bool breset_handler(TMask_field& f, KEY k);
|
|
||||||
static bool bselect_handler(TMask_field& f, KEY k);
|
|
||||||
static bool rclifo_handler(TMask_field& f, KEY k);
|
|
||||||
static bool rsortcf_handler(TMask_field& f, KEY k);
|
|
||||||
static bool bdfrom_handler(TMask_field& f, KEY k);
|
|
||||||
static bool bdto_handler(TMask_field& f, KEY k);
|
|
||||||
static bool fdfrom_handler(TMask_field& f, KEY k);
|
|
||||||
static bool fdto_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
const TString & get_prof_lang() const;
|
||||||
|
const TString & get_prof_base() const;
|
||||||
|
const TString & get_prof_code() const;
|
||||||
|
const TString & get_prof_name() const;
|
||||||
|
|
||||||
TCursor_sheet& cur_sheet() const;
|
TCursor_sheet& cur_sheet() const;
|
||||||
|
|
||||||
char get_who() const { return _who; }
|
const TString & who() const { return _who; }
|
||||||
int get_selected_key() const { return _key; }
|
const bool clienti() const { return who() == "C"; }
|
||||||
|
const bool conti() const { return who() == "P"; }
|
||||||
bool selected(const TBill& c) const;
|
const bool fornitori() const { return who() == "F"; }
|
||||||
bool selected(int g, int c, long s) const;
|
int key() const { return _key; }
|
||||||
TRecnotype get_clifo_range(long& first, long& last) const;
|
|
||||||
|
TRecnotype get_clifo_range(long& first, long& last);
|
||||||
|
|
||||||
TSelection_mask(const char* name);
|
TSelection_mask(const char* name);
|
||||||
virtual ~TSelection_mask();
|
virtual ~TSelection_mask();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user