git-svn-id: svn://10.65.10.50/branches/R_10_00@23029 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b120057874
commit
083b4b84f8
703
cg/cg4400.cpp
703
cg/cg4400.cpp
@ -50,7 +50,7 @@ bool TStampa_registri_app::filter_func (const TRelation * r)
|
|||||||
const bool regst = mov.get_bool(MOV_REGST);
|
const bool regst = mov.get_bool(MOV_REGST);
|
||||||
if (regst) //il movimento e' gia'
|
if (regst) //il movimento e' gia'
|
||||||
return false; //stato stampato in forma definitiva
|
return false; //stato stampato in forma definitiva
|
||||||
const tipo_sospensione ts = (tipo_sospensione) r->lfile("REG").get_int("I9");
|
const tipo_sospensione ts = (tipo_sospensione)r->lfile("REG").get_int("I9");
|
||||||
if (ts == liquidazione) // Movimento valido solo ai fini della liquidazione
|
if (ts == liquidazione) // Movimento valido solo ai fini della liquidazione
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -84,18 +84,10 @@ HIDDEN int compare_righeiva(const TObject** o1, const TObject** o2)
|
|||||||
//********* funzioni accessorie e di ricerca *********//
|
//********* funzioni accessorie e di ricerca *********//
|
||||||
|
|
||||||
bool TStampa_registri_app::stampa_totali_finali()
|
bool TStampa_registri_app::stampa_totali_finali()
|
||||||
{
|
{ return ini_get_bool(CONFIG_DITTA, "cg", "StTfFr"); }
|
||||||
//TConfig conf(CONFIG_DITTA);
|
|
||||||
//return conf.get_bool("StTfFr");
|
|
||||||
return ini_get_bool(CONFIG_DITTA, "cg", "StTfFr");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TStampa_registri_app::stampa_datareg()
|
bool TStampa_registri_app::stampa_datareg()
|
||||||
{
|
{ return ini_get_bool(CONFIG_STUDIO, "cg", "NoDtRg"); }
|
||||||
//TConfig conf(CONFIG_STUDIO);
|
|
||||||
//return conf.get_bool("NoDtRg");
|
|
||||||
return ini_get_bool(CONFIG_STUDIO, "cg", "NoDtRg");
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* TStampa_registri_app::descr_doc()
|
const char* TStampa_registri_app::descr_doc()
|
||||||
{ return cache().get("%TPD", _tipodoc, "S0"); }
|
{ return cache().get("%TPD", _tipodoc, "S0"); }
|
||||||
@ -220,11 +212,9 @@ bool TStampa_registri_app::ricalcola(int mese)
|
|||||||
//_frequiva == 'T' => esiste la lim solo se m == 3/6/9/12
|
//_frequiva == 'T' => esiste la lim solo se m == 3/6/9/12
|
||||||
//(no problem: la Prima Nota pensa lei a invalidare B0 e B1
|
//(no problem: la Prima Nota pensa lei a invalidare B0 e B1
|
||||||
//dei trimestri a cui appartiene il mese modificato)
|
//dei trimestri a cui appartiene il mese modificato)
|
||||||
if (_frequiva == 'M' ||
|
if (_frequiva == 'M' || (m == 3 || m == 6 || m == 9 || m == 12))
|
||||||
(m == 3 || m == 6 || m == 9 || m == 12))
|
|
||||||
{
|
{
|
||||||
TString8 key; key.format("%04d%02d", _annoes, m);
|
TString8 key; key.format("%04d%02d", _annoes, m);
|
||||||
lim.setkey(1);
|
|
||||||
lim.put("CODTAB", key);
|
lim.put("CODTAB", key);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
||||||
return true;
|
return true;
|
||||||
@ -234,7 +224,6 @@ bool TStampa_registri_app::ricalcola(int mese)
|
|||||||
if (_frequiva == 'M')
|
if (_frequiva == 'M')
|
||||||
{
|
{
|
||||||
TString8 key; key.format("%04d%02d", _annoes, mese);
|
TString8 key; key.format("%04d%02d", _annoes, mese);
|
||||||
lim.setkey(1);
|
|
||||||
lim.put("CODTAB", key);
|
lim.put("CODTAB", key);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
||||||
return true;
|
return true;
|
||||||
@ -244,7 +233,6 @@ bool TStampa_registri_app::ricalcola(int mese)
|
|||||||
//aggiusta il mese al trimestre a cui appartiene
|
//aggiusta il mese al trimestre a cui appartiene
|
||||||
mese += 2 - ((mese-1) % 3);
|
mese += 2 - ((mese-1) % 3);
|
||||||
TString8 key; key.format("%04d%02d", _annoes, mese);
|
TString8 key; key.format("%04d%02d", _annoes, mese);
|
||||||
lim.setkey(1);
|
|
||||||
lim.put("CODTAB", key);
|
lim.put("CODTAB", key);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
if (lim.read() != NOERR || !lim.get_bool("B1"))
|
||||||
return true;
|
return true;
|
||||||
@ -254,10 +242,10 @@ bool TStampa_registri_app::ricalcola(int mese)
|
|||||||
|
|
||||||
void TStampa_registri_app::look_reg()
|
void TStampa_registri_app::look_reg()
|
||||||
{
|
{
|
||||||
_liquidazione = _tabreg->get_bool("B7");
|
_liquidazione = _tabreg->get_bool("B7");
|
||||||
_riep_liq = _tabreg->get_bool("B6");
|
_riep_liq = _tabreg->get_bool("B6");
|
||||||
_corrispettivi = _tabreg->get_bool("B0");
|
_corrispettivi = _tabreg->get_bool("B0");
|
||||||
_sosp_imposta = _tabreg->get_bool("B1");
|
_sosp_imposta = _tabreg->get_bool("B1");
|
||||||
_pagine_stampate = _tabreg->get_long("I1");
|
_pagine_stampate = _tabreg->get_long("I1");
|
||||||
_numini = _pagine_stampate;
|
_numini = _pagine_stampate;
|
||||||
_cod_un_loc = _tabreg->get_int("I7");
|
_cod_un_loc = _tabreg->get_int("I7");
|
||||||
@ -267,12 +255,12 @@ void TStampa_registri_app::look_reg()
|
|||||||
_tipoatt = tipo_attivita();
|
_tipoatt = tipo_attivita();
|
||||||
_attivita = desc_attivita(_codatt);
|
_attivita = desc_attivita(_codatt);
|
||||||
_desc_lib = _tabreg->get ("S0");
|
_desc_lib = _tabreg->get ("S0");
|
||||||
_stampa_ind_ditta = _tabreg->get_bool ("B9");
|
_stampa_ind_ditta = _tabreg->get_bool("B9");
|
||||||
_stampa_ind_comp = _tabreg->get_bool ("B5");
|
_stampa_ind_comp = _tabreg->get_bool("B5");
|
||||||
_stampa_cred_pre = _tabreg->get_bool ("B4");
|
_stampa_cred_pre = _tabreg->get_bool("B4");
|
||||||
_freq_riepilogo = _tabreg->get_char ("S9");
|
_freq_riepilogo = _tabreg->get_char("S9");
|
||||||
_stampa_plafonds = _tabreg->get_char ("S10") == 'X';
|
_stampa_plafonds = _tabreg->get_char("S10") == 'X';
|
||||||
_stampa_num_pag = _tabreg->get_char ("S11") == 'X';
|
_stampa_num_pag = _tabreg->get_char("S11") == 'X';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_registri_app::compila_reg(const TMask& m)
|
bool TStampa_registri_app::compila_reg(const TMask& m)
|
||||||
@ -426,7 +414,6 @@ bool TStampa_registri_app::mask_azzera (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
app()._selected.reset();
|
|
||||||
f.mask().reset(F_SELECT);
|
f.mask().reset(F_SELECT);
|
||||||
f.mask().reset(DA_CODICE);
|
f.mask().reset(DA_CODICE);
|
||||||
f.mask().reset(A_CODICE);
|
f.mask().reset(A_CODICE);
|
||||||
@ -493,7 +480,7 @@ bool TStampa_registri_app::mask_mese (TMask_field& f, KEY k)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_registri_app::look_reg(int i, int anno, TString& codlib, int m, const char* cod, int* umese, long ditta)
|
bool TStampa_registri_app::look_reg(int i, int anno, const TString& codlib, int m, const char* cod, int* umese, long ditta)
|
||||||
{
|
{
|
||||||
TString8 y;
|
TString8 y;
|
||||||
|
|
||||||
@ -506,20 +493,19 @@ bool TStampa_registri_app::look_reg(int i, int anno, TString& codlib, int m, con
|
|||||||
tiporeg tipo = (tiporeg)_tabreg->get_int("I0");
|
tiporeg tipo = (tiporeg)_tabreg->get_int("I0");
|
||||||
if (tipo == vendita || tipo == acquisto || tipo == riepilogativo)
|
if (tipo == vendita || tipo == acquisto || tipo == riepilogativo)
|
||||||
{
|
{
|
||||||
|
const bool only_you = _ditte->one_checked() && _ditte->checked() == 1;
|
||||||
TString16 cod_lib_un = _tabreg->get("S6");
|
TString16 cod_lib_un = _tabreg->get("S6");
|
||||||
TDate u_data = _tabreg->get_date("D3");
|
TDate u_data = _tabreg->get_date("D3");
|
||||||
TDate sca_vid = _tabreg->get_date("D1");
|
TDate sca_vid = _tabreg->get_date("D1");
|
||||||
if (codlib != cod_lib_un)
|
if (codlib != cod_lib_un)
|
||||||
{
|
{
|
||||||
if (_selected.ones() == 1L)
|
if (only_you && _ditte->checked(i))
|
||||||
if (_selected[i])
|
|
||||||
message_box(FR("Ditta %ld: il codice libro unico del registro non e' uguale al codice libro unico indicato"), ditta);
|
message_box(FR("Ditta %ld: il codice libro unico del registro non e' uguale al codice libro unico indicato"), ditta);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (m < *umese)
|
if (m < *umese)
|
||||||
{
|
{
|
||||||
if (_selected.ones() == 1L)
|
if (only_you && _ditte->checked(i))
|
||||||
if (_selected[i])
|
|
||||||
message_box(FR("Ditta %ld: il mese indicato e' inferiore al mese dell'ultima data di stampa del registro"), ditta);
|
message_box(FR("Ditta %ld: il mese indicato e' inferiore al mese dell'ultima data di stampa del registro"), ditta);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -530,8 +516,7 @@ bool TStampa_registri_app::look_reg(int i, int anno, TString& codlib, int m, con
|
|||||||
if (sca_vid.ok())
|
if (sca_vid.ok())
|
||||||
if (sca_vid.month() < m)
|
if (sca_vid.month() < m)
|
||||||
{
|
{
|
||||||
if (_selected.ones() == 1L)
|
if (only_you && _ditte->checked(i))
|
||||||
if (_selected[i])
|
|
||||||
message_box(FR("Ditta %ld: la data scadenza di vidimazione del registro non deve essere inferiore al mese indicato"), ditta);
|
message_box(FR("Ditta %ld: la data scadenza di vidimazione del registro non deve essere inferiore al mese indicato"), ditta);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -541,7 +526,7 @@ bool TStampa_registri_app::look_reg(int i, int anno, TString& codlib, int m, con
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_registri_app::look_regs(int anno, TString& codlib, int m, int* umese, long ditta, TProgind* prog)
|
bool TStampa_registri_app::look_regs(int anno, const TString& codlib, int m, int* umese, long ditta, TProgind* prog)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
@ -597,17 +582,14 @@ bool TStampa_registri_app::mask_libun (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k==K_TAB && f.mask().is_running())
|
if (k==K_TAB && f.mask().is_running())
|
||||||
{
|
{
|
||||||
TString16 codlib(f.mask().get(CODICE_LIB_UN));
|
const TString& codlib = f.mask().get(CODICE_LIB_UN);
|
||||||
if (codlib.empty())
|
if (codlib.empty())
|
||||||
{
|
return app()._test = true;
|
||||||
app()._test = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (app()._selected.ones() == 0l)
|
if (!app()._ditte->one_checked())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
TProgind* p = new TProgind(2,TR("Verifica parametri in corso..."),false,true,30);
|
TProgind* p = new TProgind(2,TR("Verifica parametri in corso..."),false,true);
|
||||||
|
|
||||||
TString16 cod(f.mask().get(CODICE_LIBRO_IVA));
|
TString16 cod(f.mask().get(CODICE_LIBRO_IVA));
|
||||||
int fino_a_mese = f.mask().get_int(MESE);
|
int fino_a_mese = f.mask().get_int(MESE);
|
||||||
@ -644,8 +626,8 @@ bool TStampa_registri_app::mask_libun (TMask_field& f, KEY k)
|
|||||||
ok = app().look_regs(anno,codlib,fino_a_mese,&mese,ditta,p);
|
ok = app().look_regs(anno,codlib,fino_a_mese,&mese,ditta,p);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (app()._selected.ones() == 1L) //solo se ho selezionato 1 ditta devo dare il messaggio
|
if (app()._ditte->checked() == 1L) //solo se ho selezionato 1 ditta devo dare il messaggio
|
||||||
if (app()._selected[i]) //ed e' proprio quella selezionata
|
if (app()._ditte->checked(i)) //ed e' proprio quella selezionata
|
||||||
{
|
{
|
||||||
p->addstatus(1);
|
p->addstatus(1);
|
||||||
app().set_firm(app().__firm);
|
app().set_firm(app().__firm);
|
||||||
@ -728,31 +710,46 @@ bool TStampa_registri_app::year_handler(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (key == K_TAB && f.focusdirty())
|
if (key == K_TAB && f.focusdirty())
|
||||||
{
|
{
|
||||||
TWait_cursor hourglass;
|
|
||||||
app().set_year(atoi(f.get()));
|
app().set_year(atoi(f.get()));
|
||||||
app().build_nomiditte();
|
const int freq = f.mask().get_int(F_FREQUENZA);
|
||||||
app().build_ditte_sheet();
|
app().build_ditte_sheet(freq);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampa_registri_app::build_ditte_sheet()
|
void TStampa_registri_app::build_ditte_sheet(int flags)
|
||||||
{
|
{
|
||||||
|
TWait_cursor hourglass;
|
||||||
|
if (_nomiditte.empty())
|
||||||
|
build_nomiditte();
|
||||||
|
|
||||||
|
TBit_array sel;
|
||||||
|
FOR_EACH_CHECKED_ROW(*_ditte, r, riga)
|
||||||
|
{
|
||||||
|
const long ditta = riga->get_long(1);
|
||||||
|
sel.set(ditta);
|
||||||
|
}
|
||||||
|
|
||||||
// build sheet
|
// build sheet
|
||||||
_ditte->destroy();
|
_ditte->destroy();
|
||||||
_ditte->enable_row(-1);
|
_ditte->enable_row(-1);
|
||||||
for (int i = 0; i < _nomiditte.items(); i++)
|
for (int i = 0; i < _nomiditte.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string* d = new TToken_string(63);
|
TToken_string d = (const TToken_string&)_nomiditte[i];
|
||||||
*d = (const TToken_string&)_nomiditte[i];
|
const char vers = d.get_char(2);
|
||||||
const char vers = d->get_char(2);
|
if ((flags == 0x1 && vers != 'M') || (flags == 0x2 && vers != 'T'))
|
||||||
const bool selectable = vers == '?';
|
continue;
|
||||||
d->insert(" |", 0);
|
|
||||||
|
d.insert(" |", 0);
|
||||||
const long pos = _ditte->add(d);
|
const long pos = _ditte->add(d);
|
||||||
if (selectable)
|
if (vers == '?')
|
||||||
_ditte->disable_row(pos);
|
_ditte->disable_row(pos);
|
||||||
else if (_selected[i])
|
else
|
||||||
_ditte->check(pos);
|
{
|
||||||
|
const long ditta = d.get_long(1);
|
||||||
|
if (sel[ditta])
|
||||||
|
_ditte->check(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,7 +812,7 @@ void TStampa_registri_app::set_choice_limits(TMask& m)
|
|||||||
long first = -1l, last = -1l;
|
long first = -1l, last = -1l;
|
||||||
for (int i = 0; i < _ditte->items(); i++)
|
for (int i = 0; i < _ditte->items(); i++)
|
||||||
{
|
{
|
||||||
if (_selected[i])
|
if (_ditte->checked(i))
|
||||||
{
|
{
|
||||||
const long dit = _ditte->row(i).get_long(1);
|
const long dit = _ditte->row(i).get_long(1);
|
||||||
if (first < 0) first = dit;
|
if (first < 0) first = dit;
|
||||||
@ -824,14 +821,14 @@ void TStampa_registri_app::set_choice_limits(TMask& m)
|
|||||||
}
|
}
|
||||||
if (first > 0) m.set(DA_CODICE, first);
|
if (first > 0) m.set(DA_CODICE, first);
|
||||||
if (last > 0) m.set(A_CODICE, last);
|
if (last > 0) m.set(A_CODICE, last);
|
||||||
m.set(F_SELECT, _selected.ones());
|
m.set(F_SELECT, _ditte->checked());
|
||||||
if (m.is_running() && first > 0)
|
if (m.is_running() && first > 0)
|
||||||
app().set_firm(first);
|
app().set_firm(first);
|
||||||
}
|
}
|
||||||
|
|
||||||
long TStampa_registri_app::select_firm_range(long from, long to)
|
long TStampa_registri_app::select_firm_range(long from, long to)
|
||||||
{
|
{
|
||||||
if (to == 0l) to = 99999L;
|
if (to <= 0l) to = 99999L;
|
||||||
for (int i = 0; i < _ditte->items(); i++)
|
for (int i = 0; i < _ditte->items(); i++)
|
||||||
{
|
{
|
||||||
if (_ditte->row_disabled(i))
|
if (_ditte->row_disabled(i))
|
||||||
@ -844,17 +841,11 @@ long TStampa_registri_app::select_firm_range(long from, long to)
|
|||||||
|
|
||||||
const long cod = d.get_long(1);
|
const long cod = d.get_long(1);
|
||||||
if (cod >= from && cod <= to)
|
if (cod >= from && cod <= to)
|
||||||
{
|
|
||||||
_selected.set(i);
|
|
||||||
_ditte->check(i);
|
_ditte->check(i);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_selected.set(i,false);
|
|
||||||
_ditte->uncheck(i);
|
_ditte->uncheck(i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return _selected.ones();
|
return _ditte->checked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampa_registri_app::build_nomiditte(TProgind* pnd)
|
void TStampa_registri_app::build_nomiditte(TProgind* pnd)
|
||||||
@ -898,11 +889,7 @@ bool TStampa_registri_app::set_ditte(TMask& m)
|
|||||||
_ditte->enable_check();
|
_ditte->enable_check();
|
||||||
// seleziona e aggiungi alle gia' selezionate
|
// seleziona e aggiungi alle gia' selezionate
|
||||||
if (_ditte->run() == K_ENTER)
|
if (_ditte->run() == K_ENTER)
|
||||||
{
|
|
||||||
for (long j = 0; j < _ditte->items(); j++)
|
|
||||||
_selected.set(j, _ditte->checked(j));
|
|
||||||
set_choice_limits(m);
|
set_choice_limits(m);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} while (tasto != K_ENTER && tasto != K_QUIT);
|
} while (tasto != K_ENTER && tasto != K_QUIT);
|
||||||
return tasto == K_ENTER;
|
return tasto == K_ENTER;
|
||||||
@ -919,7 +906,7 @@ bool TStampa_registri_app::user_create()
|
|||||||
_rel->add(LF_RMOVIVA,"NUMREG=NUMREG",1,LF_MOV);
|
_rel->add(LF_RMOVIVA,"NUMREG=NUMREG",1,LF_MOV);
|
||||||
_rel->add ("REG", "CODTAB[1,4]=ANNOIVA|CODTAB[5,7]=REG");
|
_rel->add ("REG", "CODTAB[1,4]=ANNOIVA|CODTAB[5,7]=REG");
|
||||||
_cur = new TSorted_cursor(_rel, "DATAREG|PROTIVA|NUMREG","", 2);
|
_cur = new TSorted_cursor(_rel, "DATAREG|PROTIVA|NUMREG","", 2);
|
||||||
_ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"),
|
_ditte = new TArray_sheet(-1, 4, -4, -4, TR("Selezione Ditte"),
|
||||||
HR("@1|Cod.@5R|Ragione Sociale@50|Vers."));
|
HR("@1|Cod.@5R|Ragione Sociale@50|Vers."));
|
||||||
_n_ditte = 0l;
|
_n_ditte = 0l;
|
||||||
__firm = TApplication::get_firm();
|
__firm = TApplication::get_firm();
|
||||||
@ -927,8 +914,7 @@ bool TStampa_registri_app::user_create()
|
|||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
_annoes = oggi.year();
|
_annoes = oggi.year();
|
||||||
|
|
||||||
build_nomiditte();
|
build_ditte_sheet(0x3);
|
||||||
build_ditte_sheet();
|
|
||||||
add_cursor(_cur);
|
add_cursor(_cur);
|
||||||
add_file(LF_MOV);
|
add_file(LF_MOV);
|
||||||
add_file(LF_RMOVIVA);
|
add_file(LF_RMOVIVA);
|
||||||
@ -3393,16 +3379,23 @@ void TStampa_registri_app::no_movimenti()
|
|||||||
if (_tipo_stampa == rif_giornale)
|
if (_tipo_stampa == rif_giornale)
|
||||||
da = 1;
|
da = 1;
|
||||||
else
|
else
|
||||||
da = _frequiva == 'M' ? _fino_a_mese : _fino_a_mese-2; // Mi sembra più sensato 19/06/2013
|
{
|
||||||
}
|
// da = _frequiva == 'M' ? _fino_a_mese : _fino_a_mese-2; // Mi sembra più sensato 19/06/2013
|
||||||
|
da = _data_da.month(); // Mi sembra ancora più sensato 18/12/2014
|
||||||
|
if (_frequiva == 'T')
|
||||||
|
{
|
||||||
|
da = ((da-1) / 3) * 3 + 1;
|
||||||
|
CHECKD(da < a, "Mese iniziale non valido per trimestrale ", da);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (_tipo_stampa == libro_unico)
|
if (_tipo_stampa == libro_unico)
|
||||||
da = _fino_a_mese;
|
da = _fino_a_mese; else
|
||||||
if (_tipo_stampa == prova)
|
if (_tipo_stampa == prova)
|
||||||
|
{
|
||||||
da = _data_da.month();
|
da = _data_da.month();
|
||||||
if (_tipo_stampa == prova)
|
a = _data_a.month();
|
||||||
a = _data_a.month();
|
}
|
||||||
else
|
|
||||||
a = _fino_a_mese;
|
|
||||||
|
|
||||||
//RICALCOLO PROGRESSIVI per registro riepilogativo
|
//RICALCOLO PROGRESSIVI per registro riepilogativo
|
||||||
//il ricalcolo dei progressivi mensili viene sempre
|
//il ricalcolo dei progressivi mensili viene sempre
|
||||||
@ -3620,11 +3613,12 @@ bool TStampa_registri_app::set_print(int n)
|
|||||||
m.set_handler (A_CODICE, to_ditt_handler);
|
m.set_handler (A_CODICE, to_ditt_handler);
|
||||||
m.set_handler (DA_CODICE, fr_ditt_handler);
|
m.set_handler (DA_CODICE, fr_ditt_handler);
|
||||||
m.set_handler (ANNO, year_handler);
|
m.set_handler (ANNO, year_handler);
|
||||||
|
m.set_handler (F_FREQUENZA, year_handler);
|
||||||
|
|
||||||
m.set(DA_CODICE, get_firm());
|
m.set(DA_CODICE, get_firm());
|
||||||
m.set(A_CODICE, get_firm(), 0x3);
|
m.set(A_CODICE, get_firm(), 0x3);
|
||||||
|
|
||||||
m.field(F_SELECT).set(format("%ld",_selected.ones()));
|
m.set(F_SELECT, _ditte->checked());
|
||||||
set_choice_limits(m);
|
set_choice_limits(m);
|
||||||
|
|
||||||
set_real_picture("###.###.###.###");
|
set_real_picture("###.###.###.###");
|
||||||
@ -3633,90 +3627,86 @@ bool TStampa_registri_app::set_print(int n)
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
while (ok = set_ditte(m))
|
while (ok = set_ditte(m))
|
||||||
{
|
{
|
||||||
if (_selected.ones() > 0l)
|
if (!_ditte->one_checked())
|
||||||
{
|
|
||||||
//*****azzeramento dei totali progressivi e dei flag di controllo della loro stampa
|
|
||||||
_totdoc_prog = 0;
|
|
||||||
_totimpn_prog = 0;
|
|
||||||
_totimps_prog = 0;
|
|
||||||
_rows_left = 69;
|
|
||||||
_riporti_stampati = false;
|
|
||||||
_totali_stampati = false;
|
|
||||||
|
|
||||||
_annoes = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
|
||||||
_tipo_stampa = (tipo_stampa) m.get_int(TIPO_STAMPA);
|
|
||||||
_stampa_width = m.get_int(STAMPA_WIDTH);
|
|
||||||
_stampa_len = m.get_int(STAMPA_LEN);
|
|
||||||
_tabname = (_annoes > 1997) ? "PRM" : "PIM"; // Dal 1998 in poi utilizza i PRM e non i PIM
|
|
||||||
if (_stampa_width == 1)
|
|
||||||
_stampa_width = 132;
|
|
||||||
else _stampa_width = 198;
|
|
||||||
if (_stampa_len != 0)
|
|
||||||
printer().formlen(_stampa_len);
|
|
||||||
printer().footerlen(RIGHE_FOOTER);
|
|
||||||
//Se stampa di prova l'utente indica data_da e data_a
|
|
||||||
if (_tipo_stampa == prova)
|
|
||||||
{
|
|
||||||
_data_stampa = m.get(DATA_STAMPA);
|
|
||||||
_data_da = m.get(DA_DATA);
|
|
||||||
_data_a = m.get(A_DATA);
|
|
||||||
|
|
||||||
if (!_data_da.ok())
|
|
||||||
_data_da = TDate(1, 1, _annoes); // Meglio cosi'
|
|
||||||
|
|
||||||
if (!_data_a.ok())
|
|
||||||
_data_a = TDate(31, 12, _annoes); // Meglio cosi'
|
|
||||||
|
|
||||||
const TDate d(31,12,_annoes);
|
|
||||||
if (_data_a == d)
|
|
||||||
_tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0];
|
|
||||||
else
|
|
||||||
_tipo_riepilogativo = ' ';
|
|
||||||
printer().setdate(_data_stampa);
|
|
||||||
}
|
|
||||||
else //stampe definitive
|
|
||||||
{
|
|
||||||
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
|
||||||
{
|
|
||||||
_fino_a_mese = m.get_int(FINO_A_MESE);
|
|
||||||
_data_da = TDate(1, 1, _annoes); // Meglio cosi'
|
|
||||||
}
|
|
||||||
else //stampa su libro unico
|
|
||||||
{
|
|
||||||
_codlib = m.get(CODICE_LIB_UN);
|
|
||||||
_fino_a_mese = m.get_int(MESE);
|
|
||||||
_u_stampata = m.get_int(ULTIMA_PAGINA);
|
|
||||||
_rif_vid = m.get_bool(RIF_VID);
|
|
||||||
_primast = _u_stampata;
|
|
||||||
_data_da = TDate(1, _fino_a_mese, _annoes); // Meglio cosi'
|
|
||||||
}
|
|
||||||
|
|
||||||
int giorni_del_mese = 31;
|
|
||||||
if (_fino_a_mese == 12)
|
|
||||||
{
|
|
||||||
giorni_del_mese = 31;
|
|
||||||
_tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_tipo_riepilogativo = ' ';
|
|
||||||
TDate primo(1, _fino_a_mese, _annoes);
|
|
||||||
primo.set_end_month(); // Meglio cosi'
|
|
||||||
|
|
||||||
giorni_del_mese = primo.day();
|
|
||||||
}
|
|
||||||
_data_a = TDate(giorni_del_mese, _fino_a_mese, _annoes); // Meglio cosi'
|
|
||||||
}
|
|
||||||
_stampa_data_reg = stampa_datareg();
|
|
||||||
if (_tipo_stampa == libro_unico)
|
|
||||||
compila_lib();
|
|
||||||
stampa_registri_IVA(m);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
warning_box(TR("Nessuna ditta selezionata!"));
|
warning_box(TR("Nessuna ditta selezionata!"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//*****azzeramento dei totali progressivi e dei flag di controllo della loro stampa
|
||||||
|
_totdoc_prog = 0;
|
||||||
|
_totimpn_prog = 0;
|
||||||
|
_totimps_prog = 0;
|
||||||
|
_rows_left = 69;
|
||||||
|
_riporti_stampati = false;
|
||||||
|
_totali_stampati = false;
|
||||||
|
|
||||||
|
_annoes = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
||||||
|
_tipo_stampa = (tipo_stampa) m.get_int(TIPO_STAMPA);
|
||||||
|
_stampa_len = m.get_int(STAMPA_LEN);
|
||||||
|
_tabname = (_annoes > 1997) ? "PRM" : "PIM"; // Dal 1998 in poi utilizza i PRM e non i PIM
|
||||||
|
if (m.get_int(STAMPA_WIDTH) == 1)
|
||||||
|
_stampa_width = 132;
|
||||||
|
else
|
||||||
|
_stampa_width = 198;
|
||||||
|
if (_stampa_len != 0)
|
||||||
|
printer().formlen(_stampa_len);
|
||||||
|
printer().footerlen(RIGHE_FOOTER);
|
||||||
|
//Se stampa di prova l'utente indica data_da e data_a
|
||||||
|
if (_tipo_stampa == prova)
|
||||||
|
{
|
||||||
|
_data_stampa = m.get(DATA_STAMPA);
|
||||||
|
_data_da = m.get(DA_DATA);
|
||||||
|
_data_a = m.get(A_DATA);
|
||||||
|
|
||||||
|
if (!_data_da.ok())
|
||||||
|
_data_da = TDate(1, 1, _annoes); // Meglio cosi'
|
||||||
|
|
||||||
|
if (!_data_a.ok())
|
||||||
|
_data_a = TDate(31, 12, _annoes); // Meglio cosi'
|
||||||
|
|
||||||
|
const TDate d(31,12,_annoes);
|
||||||
|
if (_data_a == d)
|
||||||
|
_tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0];
|
||||||
|
else
|
||||||
|
_tipo_riepilogativo = ' ';
|
||||||
|
printer().setdate(_data_stampa);
|
||||||
|
}
|
||||||
|
else //stampe definitive
|
||||||
|
{
|
||||||
|
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
||||||
|
{
|
||||||
|
_fino_a_mese = m.get_int(FINO_A_MESE);
|
||||||
|
_data_da = TDate(1, 1, _annoes); // Meglio cosi'
|
||||||
|
}
|
||||||
|
else //stampa su libro unico
|
||||||
|
{
|
||||||
|
_codlib = m.get(CODICE_LIB_UN);
|
||||||
|
_fino_a_mese = m.get_int(MESE);
|
||||||
|
_u_stampata = m.get_int(ULTIMA_PAGINA);
|
||||||
|
_rif_vid = m.get_bool(RIF_VID);
|
||||||
|
_primast = _u_stampata;
|
||||||
|
_data_da = TDate(1, _fino_a_mese, _annoes); // Meglio cosi'
|
||||||
|
}
|
||||||
|
|
||||||
|
int giorni_del_mese = 31;
|
||||||
|
if (_fino_a_mese == 12)
|
||||||
|
{
|
||||||
|
giorni_del_mese = 31;
|
||||||
|
_tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_tipo_riepilogativo = ' ';
|
||||||
|
TDate primo(1, _fino_a_mese, _annoes);
|
||||||
|
primo.set_end_month(); // Meglio cosi'
|
||||||
|
giorni_del_mese = primo.day();
|
||||||
|
}
|
||||||
|
_data_a = TDate(giorni_del_mese, _fino_a_mese, _annoes); // Meglio cosi'
|
||||||
|
}
|
||||||
|
_stampa_data_reg = stampa_datareg();
|
||||||
|
if (_tipo_stampa == libro_unico)
|
||||||
|
compila_lib();
|
||||||
|
stampa_registri_IVA(m);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3727,216 +3717,215 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
|||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
TRectype mov_from(LF_MOV), mov_to(LF_MOV);
|
TRectype mov_from(LF_MOV), mov_to(LF_MOV);
|
||||||
for (int i = 0; i < _ditte->items(); i++)
|
|
||||||
|
FOR_EACH_CHECKED_ROW(*_ditte, i, riga)
|
||||||
{
|
{
|
||||||
if (_selected[(long)i])
|
bool msg = true;
|
||||||
|
_ditta = riga->get_long(1);
|
||||||
|
_frequiva = riga->get_char(3);
|
||||||
|
_intesta_liq = false;
|
||||||
|
_intesta_vidi = false;
|
||||||
|
_primast = _u_stampata;
|
||||||
|
_ok_vidi = false;
|
||||||
|
_stampa_mese = 13;
|
||||||
|
|
||||||
|
TApplication::set_firm(_ditta);
|
||||||
|
_st_tot_fin = stampa_totali_finali();
|
||||||
|
look_lia();
|
||||||
|
ok = compila_reg(m);
|
||||||
|
if (!ok) continue;
|
||||||
|
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
||||||
{
|
{
|
||||||
bool msg = true;
|
if (!controlla_mov())
|
||||||
_ditta = _ditte->row(i).get_long(1);
|
|
||||||
_frequiva = _ditte->row(i).get_char(3);
|
|
||||||
_intesta_liq = false;
|
|
||||||
_intesta_vidi = false;
|
|
||||||
_primast = _u_stampata;
|
|
||||||
_ok_vidi = false;
|
|
||||||
_stampa_mese = 13;
|
|
||||||
|
|
||||||
TApplication::set_firm(_ditta);
|
|
||||||
_st_tot_fin = stampa_totali_finali();
|
|
||||||
look_lia();
|
|
||||||
ok = compila_reg(m);
|
|
||||||
if (!ok) continue;
|
|
||||||
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
|
||||||
if (!controlla_mov())
|
|
||||||
{
|
|
||||||
TApplication::set_firm(__firm);
|
|
||||||
return error_box(TR("Finire di stampare registri anno precedente"));
|
|
||||||
}
|
|
||||||
if (!_stampa_tutti_i_registri)
|
|
||||||
{
|
{
|
||||||
_scelta = no_liquidazione;
|
TApplication::set_firm(__firm);
|
||||||
mov_from.put(MOV_DATAREG, _data_da);
|
return error_box(TR("Finire di stampare registri anno precedente"));
|
||||||
mov_to.put(MOV_DATAREG, _data_a);
|
|
||||||
_cur->setregion(mov_from, mov_to);
|
|
||||||
_cur->set_filterfunction(filter_func, true);
|
|
||||||
//la filter function viene chiamata quando posiziono il cursore
|
|
||||||
//e' lei che determina _stampa_mese da settare in setta_mask
|
|
||||||
(*_cur) = 0L;
|
|
||||||
ok = setta_mask(i);
|
|
||||||
if (!ok) continue;
|
|
||||||
if (_liquidazione)
|
|
||||||
{
|
|
||||||
_size_header = 3;
|
|
||||||
if ((_tipo_stampa == bollato || _tipo_stampa == rif_giornale) && !_stampa_ind_ditta) _size_header++;
|
|
||||||
clear_stliq();
|
|
||||||
//l'inizializzazione di _scelta vale per tutti
|
|
||||||
//i mesi da stampare di un certo registro (su
|
|
||||||
//cui c'e' la X di stampa liquidazione). Cio'
|
|
||||||
//e' molto importante (per capire vedi appunti)
|
|
||||||
_scelta = controlla_liquidazione();
|
|
||||||
if (_scelta == non_proseguire)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const long item = _cur->items();
|
|
||||||
|
|
||||||
// 17.5.95 Leggo parametri di stampa del registro
|
|
||||||
|
|
||||||
const long codditta = get_firm();
|
|
||||||
TString16 config; config.format("REG%05ld%s", codditta, (const char*)_codreg);
|
|
||||||
printer().read_configuration(config);
|
|
||||||
|
|
||||||
_mov_empty = true;
|
|
||||||
|
|
||||||
if (item > 0l)
|
|
||||||
{
|
|
||||||
print();
|
|
||||||
if (is_cancelled())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else //non ci sono movimenti da stampare nel periodo richiesto!
|
|
||||||
no_movimenti();
|
|
||||||
|
|
||||||
if (_tipo_stampa == libro_unico && _rif_vid)
|
|
||||||
{
|
|
||||||
_intesta_vidi = true;
|
|
||||||
stampa_vidi(); //stampa riferimenti vidimazione
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else //stampa tutti i registri
|
}
|
||||||
|
if (!_stampa_tutti_i_registri)
|
||||||
|
{
|
||||||
|
_scelta = no_liquidazione;
|
||||||
|
mov_from.put(MOV_DATAREG, _data_da);
|
||||||
|
mov_to.put(MOV_DATAREG, _data_a);
|
||||||
|
_cur->setregion(mov_from, mov_to);
|
||||||
|
_cur->set_filterfunction(filter_func, true);
|
||||||
|
//la filter function viene chiamata quando posiziono il cursore
|
||||||
|
//e' lei che determina _stampa_mese da settare in setta_mask
|
||||||
|
(*_cur) = 0L;
|
||||||
|
ok = setta_mask(i);
|
||||||
|
if (!ok) continue;
|
||||||
|
if (_liquidazione)
|
||||||
{
|
{
|
||||||
|
_size_header = 3;
|
||||||
|
if ((_tipo_stampa == bollato || _tipo_stampa == rif_giornale) && !_stampa_ind_ditta) _size_header++;
|
||||||
|
clear_stliq();
|
||||||
|
//l'inizializzazione di _scelta vale per tutti
|
||||||
|
//i mesi da stampare di un certo registro (su
|
||||||
|
//cui c'e' la X di stampa liquidazione). Cio'
|
||||||
|
//e' molto importante (per capire vedi appunti)
|
||||||
_scelta = controlla_liquidazione();
|
_scelta = controlla_liquidazione();
|
||||||
if (_scelta == non_proseguire)
|
if (_scelta == non_proseguire)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
const long item = _cur->items();
|
||||||
|
|
||||||
TDate sca_vid;
|
// 17.5.95 Leggo parametri di stampa del registro
|
||||||
bool one_printed = false; // Flag per vedere se ha stampato almeno un registro (solo per rif. al libro giornale)
|
|
||||||
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
|
||||||
{
|
|
||||||
_tipo_reg = (tiporeg)_tabreg->get_int("I0");
|
|
||||||
const TString16 codtab = _tabreg->get("CODTAB");
|
|
||||||
const int anno = atoi(codtab.left(4));
|
|
||||||
if (anno > _annoes)
|
|
||||||
break;
|
|
||||||
if (anno == _annoes)
|
|
||||||
//registro iva
|
|
||||||
if (_tipo_reg == vendita || _tipo_reg == acquisto || _tipo_reg == riepilogativo)
|
|
||||||
{
|
|
||||||
_codreg = codtab.mid(4,3);
|
|
||||||
const TString8 cod_lib_un = _tabreg->get("S6");
|
|
||||||
sca_vid = _tabreg->get_date("D1");
|
|
||||||
_stampa_plafonds = _tabreg->get_char ("S10") == 'X';
|
|
||||||
_stampa_num_pag = _tabreg->get_char ("S11") == 'X';
|
|
||||||
_stampa_ind_ditta = _tabreg->get_bool("B9");
|
|
||||||
_liquidazione = _tabreg->get_bool("B7");
|
|
||||||
if (_tipo_stampa != prova)
|
|
||||||
_u_data = _tabreg->get_date("D3");
|
|
||||||
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
|
||||||
{
|
|
||||||
if (cod_lib_un.not_empty())
|
|
||||||
continue;
|
|
||||||
if (sca_vid.ok())
|
|
||||||
if (sca_vid.month() < _fino_a_mese)
|
|
||||||
continue;
|
|
||||||
if (_u_data.ok())
|
|
||||||
if (_data_a < _u_data) //e' molto imp. che rimanga < e non <= !!!
|
|
||||||
{ //(per via del discorso liq. annuale)
|
|
||||||
message_box(FR("Ditta %ld: Il registro %s e' gia' stato stampato come bollato di %s"),
|
|
||||||
_ditta, (const char*) _codreg, itom(_fino_a_mese));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_tipo_stampa == rif_giornale) //stampa con riferimenti al libro giornale
|
|
||||||
{
|
|
||||||
TDate d;
|
|
||||||
bool good;
|
|
||||||
bool trovato = cerca_libro_gio(d, good);
|
|
||||||
if (trovato)
|
|
||||||
one_printed = true;
|
|
||||||
else
|
|
||||||
continue;
|
|
||||||
} else
|
|
||||||
if (_tipo_stampa == libro_unico) //stampa su libro unico
|
|
||||||
{
|
|
||||||
if (cod_lib_un != _codlib)
|
|
||||||
continue;
|
|
||||||
if (sca_vid.ok())
|
|
||||||
if (sca_vid.month() < _fino_a_mese)
|
|
||||||
continue;
|
|
||||||
if (_u_data.ok())
|
|
||||||
if (_fino_a_mese < _u_data.month()) //significa che e' gia'
|
|
||||||
continue; //stato stampato
|
|
||||||
}
|
|
||||||
msg = false;
|
|
||||||
|
|
||||||
look_reg();
|
const long codditta = get_firm();
|
||||||
|
TString16 config; config.format("REG%05ld%s", codditta, (const char*)_codreg);
|
||||||
|
printer().read_configuration(config);
|
||||||
|
|
||||||
_intesta_liq = false;
|
_mov_empty = true;
|
||||||
_intesta_vidi = false;
|
|
||||||
_primast = _u_stampata; //per la numerazione dei registri successivi
|
|
||||||
_ok_vidi = false;
|
|
||||||
_stampa_mese = 13;
|
|
||||||
_scelta = no_liquidazione;
|
|
||||||
|
|
||||||
//modifica del 09/11/1995
|
if (item > 0l)
|
||||||
mov_from.put(MOV_DATAREG, _data_da);
|
{
|
||||||
mov_to.put(MOV_DATAREG, _data_a);
|
print();
|
||||||
_cur->setregion(mov_from, mov_to);
|
if (is_cancelled())
|
||||||
_cur->set_filterfunction(NULL);
|
return false;
|
||||||
_cur->set_filterfunction(filter_func, true);
|
}
|
||||||
(*_cur) = 0L;
|
else //non ci sono movimenti da stampare nel periodo richiesto!
|
||||||
ok = setta_mask(i);
|
no_movimenti();
|
||||||
if (!ok) continue;
|
|
||||||
|
|
||||||
if (_liquidazione)
|
if (_tipo_stampa == libro_unico && _rif_vid)
|
||||||
{
|
{
|
||||||
_size_header = 3;
|
_intesta_vidi = true;
|
||||||
if ((_tipo_stampa == bollato || _tipo_stampa == rif_giornale) && !_stampa_ind_ditta)
|
stampa_vidi(); //stampa riferimenti vidimazione
|
||||||
_size_header++;
|
}
|
||||||
clear_stliq();
|
|
||||||
//N.B. E' fondamentale che _scelta venga ri-inizializzata ad ogni
|
|
||||||
//registro(cioe' dopo la stampa di ciascuno). Infatti il B0 di un
|
|
||||||
//certo mese puo' essere cambiato durante la stampa di un certo
|
|
||||||
//registro
|
|
||||||
_scelta = controlla_liquidazione();
|
|
||||||
if (_scelta == non_proseguire)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Guardo se ci sono movimenti
|
|
||||||
const long items = _cur->items();
|
|
||||||
|
|
||||||
//Leggo parametri di stampa del registro
|
|
||||||
TString16 config;
|
|
||||||
const long codditta = get_firm();
|
|
||||||
const char* reg = (const char*)_codreg;
|
|
||||||
config.format("REG%05ld%s", codditta, reg);
|
|
||||||
printer().read_configuration(config);
|
|
||||||
|
|
||||||
_mov_empty = true;
|
|
||||||
|
|
||||||
if (items > 0l)
|
|
||||||
{
|
|
||||||
print();
|
|
||||||
if (is_cancelled())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
no_movimenti();
|
|
||||||
|
|
||||||
if (_tipo_stampa == libro_unico && _rif_vid)
|
|
||||||
{
|
|
||||||
_intesta_vidi = true;
|
|
||||||
stampa_vidi(); //stampa riferimenti vidimazione
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} //for
|
|
||||||
|
|
||||||
if (_tipo_stampa == rif_giornale && !one_printed) // stampa con rif libro giornale
|
|
||||||
message_box(FR("Ditta %ld: nessun registro soddisfa i parametri indicati"), _ditta);
|
|
||||||
|
|
||||||
if (msg)
|
|
||||||
if(_tipo_stampa == libro_unico && _fino_a_mese == 1 && _selected.ones() == 1L)
|
|
||||||
message_box(FR("Ditta %ld: nessun registro soddisfa i parametri indicati"), _ditta); //viene gia' dato nell'handler
|
|
||||||
} //da Gennaio)
|
|
||||||
}
|
}
|
||||||
|
else //stampa tutti i registri
|
||||||
|
{
|
||||||
|
_scelta = controlla_liquidazione();
|
||||||
|
if (_scelta == non_proseguire)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
TDate sca_vid;
|
||||||
|
bool one_printed = false; // Flag per vedere se ha stampato almeno un registro (solo per rif. al libro giornale)
|
||||||
|
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
||||||
|
{
|
||||||
|
_tipo_reg = (tiporeg)_tabreg->get_int("I0");
|
||||||
|
const TString16 codtab = _tabreg->get("CODTAB");
|
||||||
|
const int anno = atoi(codtab.left(4));
|
||||||
|
if (anno > _annoes)
|
||||||
|
break;
|
||||||
|
if (anno == _annoes)
|
||||||
|
//registro iva
|
||||||
|
if (_tipo_reg == vendita || _tipo_reg == acquisto || _tipo_reg == riepilogativo)
|
||||||
|
{
|
||||||
|
_codreg = codtab.mid(4,3);
|
||||||
|
const TString8 cod_lib_un = _tabreg->get("S6");
|
||||||
|
sca_vid = _tabreg->get_date("D1");
|
||||||
|
_stampa_plafonds = _tabreg->get_char ("S10") == 'X';
|
||||||
|
_stampa_num_pag = _tabreg->get_char ("S11") == 'X';
|
||||||
|
_stampa_ind_ditta = _tabreg->get_bool("B9");
|
||||||
|
_liquidazione = _tabreg->get_bool("B7");
|
||||||
|
if (_tipo_stampa != prova)
|
||||||
|
_u_data = _tabreg->get_date("D3");
|
||||||
|
if (_tipo_stampa == bollato || _tipo_stampa == rif_giornale)
|
||||||
|
{
|
||||||
|
if (cod_lib_un.not_empty())
|
||||||
|
continue;
|
||||||
|
if (sca_vid.ok())
|
||||||
|
if (sca_vid.month() < _fino_a_mese)
|
||||||
|
continue;
|
||||||
|
if (_u_data.ok())
|
||||||
|
if (_data_a < _u_data) //e' molto imp. che rimanga < e non <= !!!
|
||||||
|
{ //(per via del discorso liq. annuale)
|
||||||
|
message_box(FR("Ditta %ld: Il registro %s è già stato stampato come bollato di %s"),
|
||||||
|
_ditta, (const char*) _codreg, itom(_fino_a_mese));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_tipo_stampa == rif_giornale) //stampa con riferimenti al libro giornale
|
||||||
|
{
|
||||||
|
TDate d;
|
||||||
|
bool good;
|
||||||
|
bool trovato = cerca_libro_gio(d, good);
|
||||||
|
if (trovato)
|
||||||
|
one_printed = true;
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
} else
|
||||||
|
if (_tipo_stampa == libro_unico) //stampa su libro unico
|
||||||
|
{
|
||||||
|
if (cod_lib_un != _codlib)
|
||||||
|
continue;
|
||||||
|
if (sca_vid.ok())
|
||||||
|
if (sca_vid.month() < _fino_a_mese)
|
||||||
|
continue;
|
||||||
|
if (_u_data.ok())
|
||||||
|
if (_fino_a_mese < _u_data.month()) //significa che e' gia'
|
||||||
|
continue; //stato stampato
|
||||||
|
}
|
||||||
|
msg = false;
|
||||||
|
|
||||||
|
look_reg();
|
||||||
|
|
||||||
|
_intesta_liq = false;
|
||||||
|
_intesta_vidi = false;
|
||||||
|
_primast = _u_stampata; //per la numerazione dei registri successivi
|
||||||
|
_ok_vidi = false;
|
||||||
|
_stampa_mese = 13;
|
||||||
|
_scelta = no_liquidazione;
|
||||||
|
|
||||||
|
//modifica del 09/11/1995
|
||||||
|
mov_from.put(MOV_DATAREG, _data_da);
|
||||||
|
mov_to.put(MOV_DATAREG, _data_a);
|
||||||
|
_cur->setregion(mov_from, mov_to);
|
||||||
|
_cur->set_filterfunction(NULL);
|
||||||
|
_cur->set_filterfunction(filter_func, true);
|
||||||
|
(*_cur) = 0L;
|
||||||
|
ok = setta_mask(i);
|
||||||
|
if (!ok) continue;
|
||||||
|
|
||||||
|
if (_liquidazione)
|
||||||
|
{
|
||||||
|
_size_header = 3;
|
||||||
|
if ((_tipo_stampa == bollato || _tipo_stampa == rif_giornale) && !_stampa_ind_ditta)
|
||||||
|
_size_header++;
|
||||||
|
clear_stliq();
|
||||||
|
//N.B. E' fondamentale che _scelta venga ri-inizializzata ad ogni
|
||||||
|
//registro(cioe' dopo la stampa di ciascuno). Infatti il B0 di un
|
||||||
|
//certo mese puo' essere cambiato durante la stampa di un certo
|
||||||
|
//registro
|
||||||
|
_scelta = controlla_liquidazione();
|
||||||
|
if (_scelta == non_proseguire)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Guardo se ci sono movimenti
|
||||||
|
const long items = _cur->items();
|
||||||
|
|
||||||
|
//Leggo parametri di stampa del registro
|
||||||
|
const long codditta = get_firm();
|
||||||
|
const char* reg = (const char*)_codreg;
|
||||||
|
TString16 config; config.format("REG%05ld%s", codditta, reg);
|
||||||
|
printer().read_configuration(config);
|
||||||
|
|
||||||
|
_mov_empty = true;
|
||||||
|
|
||||||
|
if (items > 0l)
|
||||||
|
{
|
||||||
|
print();
|
||||||
|
if (is_cancelled())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
no_movimenti();
|
||||||
|
|
||||||
|
if (_tipo_stampa == libro_unico && _rif_vid)
|
||||||
|
{
|
||||||
|
_intesta_vidi = true;
|
||||||
|
stampa_vidi(); //stampa riferimenti vidimazione
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //for
|
||||||
|
|
||||||
|
if (_tipo_stampa == rif_giornale && !one_printed) // stampa con rif libro giornale
|
||||||
|
message_box(FR("Ditta %ld: nessun registro soddisfa i parametri indicati"), _ditta);
|
||||||
|
|
||||||
|
if (msg)
|
||||||
|
if(_tipo_stampa == libro_unico && _fino_a_mese == 1 && _ditte->checked() == 1L)
|
||||||
|
message_box(FR("Ditta %ld: nessun registro soddisfa i parametri indicati"), _ditta); //viene gia' dato nell'handler
|
||||||
|
} //da Gennaio)
|
||||||
}
|
}
|
||||||
printer().read_configuration();
|
printer().read_configuration();
|
||||||
TApplication::set_firm(__firm);
|
TApplication::set_firm(__firm);
|
||||||
|
10
cg/cg4400.h
10
cg/cg4400.h
@ -40,7 +40,6 @@ class TStampa_registri_app : public TPrintapp
|
|||||||
TRiga_array _riga_prospettoXcassa;
|
TRiga_array _riga_prospettoXcassa;
|
||||||
TTipodoc_array _doc_array;
|
TTipodoc_array _doc_array;
|
||||||
TRiga_array _tot_iva_array, _tot_prec_iva_array;
|
TRiga_array _tot_iva_array, _tot_prec_iva_array;
|
||||||
TBit_array _selected;
|
|
||||||
TArray_sheet *_ditte;
|
TArray_sheet *_ditte;
|
||||||
TArray _nomiditte;
|
TArray _nomiditte;
|
||||||
tiporeg _tipo_reg;
|
tiporeg _tipo_reg;
|
||||||
@ -111,8 +110,8 @@ public:
|
|||||||
bool stampo_liquidazione(int);
|
bool stampo_liquidazione(int);
|
||||||
bool ventilazione(const char*);
|
bool ventilazione(const char*);
|
||||||
bool cerca_libro_gio(TDate&, bool&);
|
bool cerca_libro_gio(TDate&, bool&);
|
||||||
bool look_reg (int, int, TString&, int, const char*, int*, long);
|
bool look_reg (int, int, const TString&, int, const char*, int*, long);
|
||||||
bool look_regs(int, TString&, int, int*, long, TProgind*);
|
bool look_regs(int, const TString&, int, int*, long, TProgind*);
|
||||||
bool stampa_totali_finali();
|
bool stampa_totali_finali();
|
||||||
bool stampa_datareg();
|
bool stampa_datareg();
|
||||||
bool stampa_registri_IVA(const TMask&);
|
bool stampa_registri_IVA(const TMask&);
|
||||||
@ -122,7 +121,7 @@ public:
|
|||||||
void stampa_prospetto_riepilogo(tiporeg, const TString&, const TString&, const bool);
|
void stampa_prospetto_riepilogo(tiporeg, const TString&, const TString&, const bool);
|
||||||
void stampa_progressivi(TRiga_array&, TRigaiva_array&, tiporeg, const bool);
|
void stampa_progressivi(TRiga_array&, TRigaiva_array&, tiporeg, const bool);
|
||||||
void set_choice_limits(TMask&);
|
void set_choice_limits(TMask&);
|
||||||
void build_ditte_sheet();
|
void build_ditte_sheet(int flags);
|
||||||
tiporeg cerca_reg(const TString&);
|
tiporeg cerca_reg(const TString&);
|
||||||
void set_page_tot_reg();
|
void set_page_tot_reg();
|
||||||
void send_message(char,const TFilename&,int);
|
void send_message(char,const TFilename&,int);
|
||||||
@ -160,8 +159,7 @@ public:
|
|||||||
virtual void preprocess_footer();
|
virtual void preprocess_footer();
|
||||||
virtual void on_page_printed(int file);
|
virtual void on_page_printed(int file);
|
||||||
|
|
||||||
TStampa_registri_app() : TPrintapp(), _ditte(NULL), _selected(10000), _nomiditte(100), _test(FALSE) {}
|
TStampa_registri_app() : TPrintapp(), _ditte(NULL), _nomiditte(100), _test(FALSE) {}
|
||||||
virtual ~TStampa_registri_app() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#define RIF_VID 122
|
#define RIF_VID 122
|
||||||
#define STAMPA_WIDTH 123
|
#define STAMPA_WIDTH 123
|
||||||
#define STAMPA_LEN 124
|
#define STAMPA_LEN 124
|
||||||
|
#define F_FREQUENZA 125
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ END
|
|||||||
|
|
||||||
NUMBER ANNO 4
|
NUMBER ANNO 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Anno "
|
PROMPT 41 3 "Anno "
|
||||||
HELP "Anno di cui si vuole stampare il registro"
|
HELP "Anno di cui si vuole stampare il registro"
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
WARNING "Inserire l'anno"
|
WARNING "Inserire l'anno"
|
||||||
@ -30,9 +30,17 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 35 5
|
GROUPBOX DLG_NULL 35 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Scelta ditte"
|
PROMPT 2 2 "Scelta ditte"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_FREQUENZA 1 12
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 3 "Frequenza "
|
||||||
|
ITEM "0|"
|
||||||
|
ITEM "1|Mensile"
|
||||||
|
ITEM "2|Trimestrale"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER DA_CODICE 5
|
NUMBER DA_CODICE 5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user