Patch level : 12.00 1412
Files correlati : cg4.exe Commento : Corretta stampa registri
This commit is contained in:
parent
e09b886b9c
commit
f5b1b74396
@ -754,7 +754,9 @@ void TStampa_registri_app::build_ditte_sheet(int flags)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
d.insert(" |", 0);
|
d.insert(" |", 0);
|
||||||
|
|
||||||
const long pos = _ditte->add(d);
|
const long pos = _ditte->add(d);
|
||||||
|
|
||||||
if (vers == '?')
|
if (vers == '?')
|
||||||
_ditte->disable_row(pos);
|
_ditte->disable_row(pos);
|
||||||
else
|
else
|
||||||
@ -942,10 +944,10 @@ bool TStampa_registri_app::user_create()
|
|||||||
|
|
||||||
bool TStampa_registri_app::user_destroy()
|
bool TStampa_registri_app::user_destroy()
|
||||||
{
|
{
|
||||||
delete _ditte;
|
safe_delete(_ditte);
|
||||||
delete _nditte;
|
safe_delete(_nditte);
|
||||||
delete _tabreg;
|
safe_delete(_tabreg);
|
||||||
delete _rel;
|
safe_delete(_rel);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1115,6 +1117,7 @@ int TStampa_registri_app::riga_rmoviva(const bool fattrit)
|
|||||||
|
|
||||||
const TRectype& mov = _cur->curr(LF_MOV);
|
const TRectype& mov = _cur->curr(LF_MOV);
|
||||||
const int mese_liq = mov.get_int(MOV_MESELIQ);
|
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);
|
TLocalisamfile& rmoviva = _cur->file(LF_RMOVIVA);
|
||||||
const TRecnotype nr = rmoviva.recno();
|
const TRecnotype nr = rmoviva.recno();
|
||||||
@ -1149,20 +1152,20 @@ int TStampa_registri_app::riga_rmoviva(const bool fattrit)
|
|||||||
{
|
{
|
||||||
const real somma = -(impo + impos);
|
const real somma = -(impo + impos);
|
||||||
_tot_iva_array.add_riga(ZERO,ZERO,somma,ZERO,ZERO,ZERO,codiva);
|
_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);
|
_tot_prec_iva_array.add_riga(ZERO,ZERO,somma,ZERO,ZERO,ZERO,codiva);
|
||||||
}
|
}
|
||||||
else if (_tipodoc == "CR" || _tipodoc == "RF" || _tipodoc == "SC")
|
else if (_tipodoc == "CR" || _tipodoc == "RF" || _tipodoc == "SC")
|
||||||
{
|
{
|
||||||
_tot_iva_array.add_riga(ZERO,ZERO,impo+impos,ZERO,ZERO,ZERO,codiva);
|
_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);
|
_tot_prec_iva_array.add_riga(ZERO,ZERO,impo+impos,ZERO,ZERO,ZERO,codiva);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tipodoc != "CR" && _tipodoc != "SC" && _tipodoc != "RF")
|
if (_tipodoc != "CR" && _tipodoc != "SC" && _tipodoc != "RF")
|
||||||
{
|
{
|
||||||
_tot_iva_array.add_riga(impo,impos,codiva);
|
_tot_iva_array.add_riga(impo,impos,codiva);
|
||||||
if (mese_liq != 0)
|
if (mese_liq > 0 && mese_liq < mese_corr)
|
||||||
_tot_prec_iva_array.add_riga(impo,impos,codiva);
|
_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);
|
TString descrizione = descr_iva(riga._codiva);
|
||||||
if (riga._tipocr > 0)
|
if (riga._tipocr > 0)
|
||||||
{
|
{
|
||||||
const char* cr = NULL;
|
const char* cr = nullptr;
|
||||||
|
|
||||||
switch (riga._tipocr)
|
switch (riga._tipocr)
|
||||||
{
|
{
|
||||||
case 1: cr = TR("Beni per rivendita"); break;
|
case 1: cr = TR("Beni per rivendita"); break;
|
||||||
@ -1355,7 +1359,6 @@ bool TStampa_registri_app::controlla_mov(long & numreg, TDate & data)
|
|||||||
|
|
||||||
if (datareg.year() < _annoIVA)
|
if (datareg.year() < _annoIVA)
|
||||||
{
|
{
|
||||||
// const long numreg = mov.get_long(MOV_NUMREG);
|
|
||||||
if (!stampato)
|
if (!stampato)
|
||||||
{
|
{
|
||||||
numreg = mov.get_long(MOV_NUMREG);
|
numreg = mov.get_long(MOV_NUMREG);
|
||||||
@ -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)
|
if (tipo_prosp == 2)
|
||||||
{
|
{
|
||||||
@ -2055,7 +2058,6 @@ bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TPrinter& pr = printer();
|
TPrinter& pr = printer();
|
||||||
TPrintrow riga;
|
TPrintrow riga;
|
||||||
const TString linea(_stampa_width, '-');
|
const TString linea(_stampa_width, '-');
|
||||||
@ -2365,6 +2367,10 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
TLocalisamfile& mov = _cur->file(LF_MOV);
|
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||||
TLocalisamfile& caus = _cur->file(LF_CAUSALI);
|
TLocalisamfile& caus = _cur->file(LF_CAUSALI);
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
if (mov.get_long(MOV_NUMREG) == 67834)
|
||||||
|
int q = 1;
|
||||||
|
#endif
|
||||||
_datareg = mov.get_date(MOV_DATAREG);
|
_datareg = mov.get_date(MOV_DATAREG);
|
||||||
|
|
||||||
if (_tipo_stampa != libro_unico && _liquidazione)
|
if (_tipo_stampa != libro_unico && _liquidazione)
|
||||||
@ -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
|
if (totdoc < ZERO) // Controlla il segno corretto da assegnare alle ritenute
|
||||||
{
|
{
|
||||||
ritsoc = -ritsoc;
|
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)
|
if (_cur->pos() == 0)
|
||||||
@ -2571,7 +2581,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (meseliq > 0)
|
if (meseliq > 0 && meseliq != mov.get_date(MOV_DATAREG).month())
|
||||||
set_row(_r, "@62g%02d", meseliq);
|
set_row(_r, "@62g%02d", meseliq);
|
||||||
set_row(_r, "@67g%2s", (const char*) _tipodoc);
|
set_row(_r, "@67g%2s", (const char*) _tipodoc);
|
||||||
if (fattrit)
|
if (fattrit)
|
||||||
@ -2607,7 +2617,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
TString s_dataregcoll(dataregcoll.string(brief, '/'));
|
TString s_dataregcoll(dataregcoll.string(brief, '/'));
|
||||||
TString s_datadoccoll(datadoccoll.string(brief, '/'));
|
TString s_datadoccoll(datadoccoll.string(brief, '/'));
|
||||||
|
|
||||||
while ((r = desc.get()) != NULL)
|
while ((r = desc.get()) != nullptr)
|
||||||
{
|
{
|
||||||
set_row(i, "@38g%s", r);
|
set_row(i, "@38g%s", r);
|
||||||
i++;
|
i++;
|
||||||
@ -2635,7 +2645,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
set_row(i, "@31g%6ld", codcf);
|
set_row(i, "@31g%6ld", codcf);
|
||||||
TParagraph_string desc(ragsoc, 23);
|
TParagraph_string desc(ragsoc, 23);
|
||||||
|
|
||||||
while ((r = desc.get()) != NULL)
|
while ((r = desc.get()) != nullptr)
|
||||||
{
|
{
|
||||||
set_row (i, "@38g%s", r);
|
set_row (i, "@38g%s", r);
|
||||||
i++;
|
i++;
|
||||||
@ -2715,7 +2725,15 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
}
|
}
|
||||||
//*****aggiornamento del totale documento,imponibile e imposta progressivi
|
//*****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;
|
_progr_doc = totdoc;
|
||||||
|
|
||||||
if (_rows_left > 0)
|
if (_rows_left > 0)
|
||||||
@ -4167,7 +4185,7 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
|||||||
mov_from.put(MOV_DATAREG, _data_da);
|
mov_from.put(MOV_DATAREG, _data_da);
|
||||||
mov_to.put(MOV_DATAREG, _data_a);
|
mov_to.put(MOV_DATAREG, _data_a);
|
||||||
_cur->setregion(mov_from, mov_to);
|
_cur->setregion(mov_from, mov_to);
|
||||||
_cur->set_filterfunction(NULL);
|
_cur->set_filterfunction(nullptr);
|
||||||
_cur->set_filterfunction(filter_func, true);
|
_cur->set_filterfunction(filter_func, true);
|
||||||
(*_cur) = 0L;
|
(*_cur) = 0L;
|
||||||
ok = setta_mask(i);
|
ok = setta_mask(i);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user