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
125 lines
2.8 KiB
C++
Executable File
125 lines
2.8 KiB
C++
Executable File
#include <printer.h>
|
|
|
|
#include "../cg/cgsaldac.h"
|
|
#include "sc21pec.h"
|
|
#include "sc2401.h"
|
|
#include "../ca/calib01.h"
|
|
#include "../ca/movana.h"
|
|
|
|
#include <causali.h>
|
|
#include <modaut.h>
|
|
#include <mov.h>
|
|
|
|
TESSL_mask::TESSL_mask(const char *name) : TSelection_mask(name), _ditta(LF_NDITTE)
|
|
{
|
|
_ditta.add(LF_ANAG, "TIPOA==TIPOA|CODANAGR==CODANAGR");
|
|
_ditta.add(LF_COMUNI, "COM==COMRF(COMRES)", 1, LF_ANAG, 101);
|
|
_ditta.add(LF_COMUNI, "COM==COMRES", 1, LF_ANAG, 102);
|
|
}
|
|
|
|
bool TESSL_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|
{
|
|
switch (o.dlg())
|
|
{
|
|
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;
|
|
}
|
|
return true;
|
|
break;
|
|
case DLG_PRINT:
|
|
if (e == fe_button)
|
|
{
|
|
TCursor_sheet &s = cur_sheet();
|
|
TCursor &c = *s.cursor();
|
|
|
|
// Attiva la stampa del saldo partita
|
|
form().stampa_saldo(stampa_saldo());
|
|
form().anal_filter(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);
|
|
|
|
long failed = 0; // persone non stampate in quanto aventi lingua errata
|
|
TPrinter& pr = printer();
|
|
|
|
pr.open();
|
|
update_checked();
|
|
|
|
const int last = s.last_one();
|
|
|
|
for (long pos = s.first_one(); pos <= last; pos++)
|
|
{
|
|
if (s.checked(pos))
|
|
{
|
|
fc = pos; // muove il cursore alla posizione corrente
|
|
|
|
const int ret = print_one(fc.curr().get(CLI_TIPOCF), fc.curr().get_long(CLI_CODCF));
|
|
|
|
if (ret < 0)
|
|
failed++;
|
|
}
|
|
if (pr.frozen())
|
|
break;
|
|
}
|
|
pr.close();
|
|
if (failed > 0)
|
|
warning_box(FR("%ld clienti non sono stati stampati in quanto "
|
|
"il codice lingua non corrispondeva al profilo di stampa"), failed);
|
|
}
|
|
return true;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return TSelection_mask::on_field_event(o, e, jolly);
|
|
}
|
|
|
|
void TESSL_mask::on_firm_change()
|
|
{
|
|
TMask::on_firm_change();
|
|
|
|
_ditta[0].put("CODDITTA", prefix().get_codditta());
|
|
if (_ditta.read() == NOERR) {
|
|
const int alias = _ditta[LF_ANAG].get_char("TIPOA") == 'F' ? -101 : -102;
|
|
set(F_LUOGOSEND, _ditta.lfile(alias).get("DENCOM"));
|
|
}
|
|
}
|
|
|
|
void TESSL_mask::start_run()
|
|
{
|
|
on_firm_change();
|
|
}
|
|
|
|
|
|
|