Patch level : 12.00 1412
Files correlati : cg4.exe Commento : Corretta stampa registri
This commit is contained in:
parent
e09b886b9c
commit
f5b1b74396
@ -137,7 +137,7 @@ const TRectype& TStampa_registri_app::look_comuni (const char* cod)
|
||||
void TStampa_registri_app::get_dati_ditta()
|
||||
{
|
||||
const TRectype& nditte = cache().get(LF_NDITTE, get_firm());
|
||||
|
||||
|
||||
_ragsoc = nditte.get(NDT_RAGSOC);
|
||||
|
||||
TToken_string key; key.format("%ld|%s", get_firm(), (const char*) _codatt);
|
||||
@ -737,7 +737,7 @@ void TStampa_registri_app::build_ditte_sheet(int flags)
|
||||
|
||||
TBit_array sel;
|
||||
FOR_EACH_CHECKED_ROW(*_ditte, r, riga)
|
||||
{
|
||||
{
|
||||
const long ditta = riga->get_long(1);
|
||||
sel.set(ditta);
|
||||
}
|
||||
@ -754,11 +754,13 @@ void TStampa_registri_app::build_ditte_sheet(int flags)
|
||||
continue;
|
||||
|
||||
d.insert(" |", 0);
|
||||
const long pos = _ditte->add(d);
|
||||
if (vers == '?')
|
||||
|
||||
const long pos = _ditte->add(d);
|
||||
|
||||
if (vers == '?')
|
||||
_ditte->disable_row(pos);
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
const long ditta = d.get_long(1);
|
||||
if (sel[ditta])
|
||||
_ditte->check(pos); // Ripristino eventuale selezione precedente
|
||||
@ -766,8 +768,8 @@ void TStampa_registri_app::build_ditte_sheet(int flags)
|
||||
good_one = pos; else
|
||||
if (good_one >= 0)
|
||||
good_one = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (good_one >= 0 && !_ditte->one_checked())
|
||||
_ditte->check(good_one);
|
||||
}
|
||||
@ -942,10 +944,10 @@ bool TStampa_registri_app::user_create()
|
||||
|
||||
bool TStampa_registri_app::user_destroy()
|
||||
{
|
||||
delete _ditte;
|
||||
delete _nditte;
|
||||
delete _tabreg;
|
||||
delete _rel;
|
||||
safe_delete(_ditte);
|
||||
safe_delete(_nditte);
|
||||
safe_delete(_tabreg);
|
||||
safe_delete(_rel);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1115,6 +1117,7 @@ int TStampa_registri_app::riga_rmoviva(const bool fattrit)
|
||||
|
||||
const TRectype& mov = _cur->curr(LF_MOV);
|
||||
const int mese_liq = mov.get_int(MOV_MESELIQ);
|
||||
const int mese_corr = mov.get_date(MOV_DATAREG).month();
|
||||
|
||||
TLocalisamfile& rmoviva = _cur->file(LF_RMOVIVA);
|
||||
const TRecnotype nr = rmoviva.recno();
|
||||
@ -1149,20 +1152,20 @@ int TStampa_registri_app::riga_rmoviva(const bool fattrit)
|
||||
{
|
||||
const real somma = -(impo + impos);
|
||||
_tot_iva_array.add_riga(ZERO,ZERO,somma,ZERO,ZERO,ZERO,codiva);
|
||||
if (mese_liq != 0)
|
||||
if (mese_liq > 0 && mese_liq < mese_corr)
|
||||
_tot_prec_iva_array.add_riga(ZERO,ZERO,somma,ZERO,ZERO,ZERO,codiva);
|
||||
}
|
||||
else if (_tipodoc == "CR" || _tipodoc == "RF" || _tipodoc == "SC")
|
||||
{
|
||||
_tot_iva_array.add_riga(ZERO,ZERO,impo+impos,ZERO,ZERO,ZERO,codiva);
|
||||
if (mese_liq != 0)
|
||||
if (mese_liq > 0 && mese_liq < mese_corr)
|
||||
_tot_prec_iva_array.add_riga(ZERO,ZERO,impo+impos,ZERO,ZERO,ZERO,codiva);
|
||||
}
|
||||
|
||||
if (_tipodoc != "CR" && _tipodoc != "SC" && _tipodoc != "RF")
|
||||
{
|
||||
_tot_iva_array.add_riga(impo,impos,codiva);
|
||||
if (mese_liq != 0)
|
||||
_tot_iva_array.add_riga(impo,impos,codiva);
|
||||
if (mese_liq > 0 && mese_liq < mese_corr)
|
||||
_tot_prec_iva_array.add_riga(impo,impos,codiva);
|
||||
}
|
||||
|
||||
@ -1185,7 +1188,8 @@ int TStampa_registri_app::setta_riga(int r, const TRigaiva& riga, real& tot1,
|
||||
TString descrizione = descr_iva(riga._codiva);
|
||||
if (riga._tipocr > 0)
|
||||
{
|
||||
const char* cr = NULL;
|
||||
const char* cr = nullptr;
|
||||
|
||||
switch (riga._tipocr)
|
||||
{
|
||||
case 1: cr = TR("Beni per rivendita"); break;
|
||||
@ -1335,7 +1339,7 @@ bool TStampa_registri_app::controlla_mov(long & numreg, TDate & data)
|
||||
{
|
||||
TLocalisamfile mov (LF_MOV);
|
||||
bool ok = true;
|
||||
TRecnotype rec = _tabreg->recno();
|
||||
TRecnotype rec = _tabreg->recno();
|
||||
|
||||
numreg = 0L;
|
||||
data = botime;
|
||||
@ -1355,13 +1359,12 @@ bool TStampa_registri_app::controlla_mov(long & numreg, TDate & data)
|
||||
|
||||
if (datareg.year() < _annoIVA)
|
||||
{
|
||||
// const long numreg = mov.get_long(MOV_NUMREG);
|
||||
if (!stampato)
|
||||
{
|
||||
numreg = mov.get_long(MOV_NUMREG);
|
||||
data = mov.get_date(MOV_DATAREG);
|
||||
ok = false;
|
||||
}
|
||||
if (!stampato)
|
||||
{
|
||||
numreg = mov.get_long(MOV_NUMREG);
|
||||
data = mov.get_date(MOV_DATAREG);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1404,7 +1407,7 @@ int TStampa_registri_app::stampa_prospetto_IVA(int rr, int tipo_prosp)
|
||||
}
|
||||
}
|
||||
|
||||
if (_esiste_riga_iva && _stampa)
|
||||
if (_st_tot_fin && _esiste_riga_iva && _stampa)
|
||||
{
|
||||
if (tipo_prosp == 2)
|
||||
{
|
||||
@ -2055,8 +2058,7 @@ bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TPrinter& pr = printer();
|
||||
TPrinter& pr = printer();
|
||||
TPrintrow riga;
|
||||
const TString linea(_stampa_width, '-');
|
||||
|
||||
@ -2365,9 +2367,13 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||
TLocalisamfile& caus = _cur->file(LF_CAUSALI);
|
||||
|
||||
_datareg = mov.get_date(MOV_DATAREG);
|
||||
#ifdef DBG
|
||||
if (mov.get_long(MOV_NUMREG) == 67834)
|
||||
int q = 1;
|
||||
#endif
|
||||
_datareg = mov.get_date(MOV_DATAREG);
|
||||
|
||||
if (_tipo_stampa != libro_unico && _liquidazione)
|
||||
if (_tipo_stampa != libro_unico && _liquidazione)
|
||||
{
|
||||
const int da = (_tipo_stampa == prova) ? _data_da.month() : 1;
|
||||
const int a = _datareg.month();
|
||||
@ -2462,8 +2468,12 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
if (totdoc < ZERO) // Controlla il segno corretto da assegnare alle ritenute
|
||||
{
|
||||
ritsoc = -ritsoc;
|
||||
ritfis = -ritfis;
|
||||
revcha = -revcha;
|
||||
|
||||
// const TCausale & caus = cached_causale(mov.get(MOV_CODCAUS));
|
||||
|
||||
// if (!caus.intra())
|
||||
// ritfis = -ritfis;
|
||||
// revcha = -revcha;
|
||||
}
|
||||
|
||||
if (_cur->pos() == 0)
|
||||
@ -2571,8 +2581,8 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
|
||||
}*/
|
||||
}
|
||||
if (meseliq > 0)
|
||||
set_row(_r, "@62g%02d", meseliq);
|
||||
if (meseliq > 0 && meseliq != mov.get_date(MOV_DATAREG).month())
|
||||
set_row(_r, "@62g%02d", meseliq);
|
||||
set_row(_r, "@67g%2s", (const char*) _tipodoc);
|
||||
if (fattrit)
|
||||
set_row(_r, "@69gD");
|
||||
@ -2607,7 +2617,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
TString s_dataregcoll(dataregcoll.string(brief, '/'));
|
||||
TString s_datadoccoll(datadoccoll.string(brief, '/'));
|
||||
|
||||
while ((r = desc.get()) != NULL)
|
||||
while ((r = desc.get()) != nullptr)
|
||||
{
|
||||
set_row(i, "@38g%s", r);
|
||||
i++;
|
||||
@ -2635,7 +2645,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
set_row(i, "@31g%6ld", codcf);
|
||||
TParagraph_string desc(ragsoc, 23);
|
||||
|
||||
while ((r = desc.get()) != NULL)
|
||||
while ((r = desc.get()) != nullptr)
|
||||
{
|
||||
set_row (i, "@38g%s", r);
|
||||
i++;
|
||||
@ -2715,7 +2725,15 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
||||
|
||||
}
|
||||
//*****aggiornamento del totale documento,imponibile e imposta progressivi
|
||||
const real totdoc = mov.get_real(MOV_TOTDOC);
|
||||
|
||||
real totdoc = mov.get(MOV_TOTDOC);
|
||||
real ritsoc = mov.get(MOV_RITSOC);
|
||||
real ritfis = mov.get(MOV_RITFIS);
|
||||
real revcha = is_reverse_charge(mov.curr()) ? mov.get_real(MOV_REVCHARGE) : ZERO;
|
||||
|
||||
if (totdoc < ZERO) // Controlla il segno corretto da assegnare alle ritenute
|
||||
ritsoc = -ritsoc;
|
||||
totdoc += ritsoc + ritfis + revcha;
|
||||
_progr_doc = totdoc;
|
||||
|
||||
if (_rows_left > 0)
|
||||
@ -4029,12 +4047,12 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
||||
long numreg;
|
||||
TDate data;
|
||||
|
||||
if (!controlla_mov(numreg, data))
|
||||
if (!controlla_mov(numreg, data))
|
||||
{
|
||||
TApplication::set_firm(__firm);
|
||||
|
||||
return error_box(TR("Finire di stampare registri anno precedente\n"
|
||||
"Il primo è il numero %ld del %s."), numreg, data.stringa());
|
||||
return error_box(TR("Finire di stampare registri anno precedente\n"
|
||||
"Il primo è il numero %ld del %s."), numreg, data.stringa());
|
||||
}
|
||||
}
|
||||
if (!_stampa_tutti_i_registri)
|
||||
@ -4167,7 +4185,7 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
||||
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(nullptr);
|
||||
_cur->set_filterfunction(filter_func, true);
|
||||
(*_cur) = 0L;
|
||||
ok = setta_mask(i);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user