Patch level : 12.0

Files correlati     : cg4400.cpp
Commento:
Stampa dei registri iva con riferimento ai documenti di integrazione
This commit is contained in:
Simoe 2022-07-18 12:57:12 +02:00
parent 2f92c4df5d
commit 8f32812816

View File

@ -2435,6 +2435,8 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
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;
bool integrazione = false;
if (totdoc < ZERO) // Controlla il segno corretto da assegnare alle ritenute
{
ritsoc = -ritsoc;
@ -2523,19 +2525,21 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
set_row(_r, "@9g%5ld", protiva);
if (datadoc.ok())
set_row(_r, "@15g%s", (const char*) app);
if (codcf != 0l)
if (codcf != 0l && !cached_causale(mov.curr()).reverse_charge_pubb())
set_row(_r, "@31g%6ld", codcf);
if (cached_causale(mov.curr()).reverse_charge_pubb())
{
const TRectype movcoll = cache().get(LF_MOV, mov.get_long(MOV_MOVCOLL));
const TCausale & caus = cached_causale(movcoll);
/*
if (caus.is_reg_autof() && tipomov == acquisto)
{
app = movcoll.get_date(MOV_DATADOC).string(brief, '/');
set_row(_r + 1, "@15g%s", (const char*)app);
TString numdoccoll = movcoll.get(MOV_NUMDOC);
const TString & prefisso = caus.reg().prefisso();
if (prefisso.full())
@ -2543,8 +2547,8 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
numdoccoll.insert("/");
numdoccoll.insert(prefisso);
}
set_row(_r + 1, "@24g%s", (const char*)numdoccoll);
}
}*/
}
if (meseliq > 0)
set_row(_r, "@62g%02d", meseliq);
@ -2558,28 +2562,6 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
set_row(_r, "@70g%r", &totdoc);
else
set_row(_r, "@78g%r", &totdoc);
if (_tipo_stampa == prova) //in caso di stampa di prova
{
if (! (_tipo_reg == vendita && _corrispettivi)) //e se non si tratta di registro vendite corrispettivi
{
if (_cur->pos()!=0 || protiva <= 0) //il primo movimento non va controllato
{
if (protiva != _uprotivap + 1)
{
set_row(_r+1, FR(" @b*** NUM.PROT.FUORI SEQUENZA@r"));
riga = _r+2;
}
_uprotivap = uprotiva ? uprotiva : protiva;
}
}
if (IVAxcassa && mov.get_int(MOV_TIPOMOV) <= 0)
{
set_row(_r+1, FR(" @b*** IVA PER CASSA SENZA SALDACONTO@r"));
riga = _r+2;
}
}
const char* r;
int i = 1;
@ -2588,10 +2570,22 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
{
const TRectype movcoll = cache().get(LF_MOV, mov.get_long(MOV_MOVCOLL));
if (cached_causale(movcoll).is_reg_autof() && tipomov == vendita)
{
integrazione = true;
TParagraph_string desc(cache().get(LF_NDITTE, get_firm()).get(NDT_RAGSOC), 23);
TString numdoccoll = movcoll.get(MOV_NUMDOC);
long numregcoll = movcoll.get_long(MOV_NUMREG);
TDate dataregcoll = movcoll.get_date(MOV_DATAREG);
TDate datadoccoll = movcoll.get_date(MOV_DATADOC);
const long protivacoll = movcoll.get_long(MOV_PROTIVA);
TString s_dataregcoll(dataregcoll.string(brief, '/'));
TString s_datadoccoll(datadoccoll.string(brief, '/'));
while ((r = desc.get()) != NULL)
{
set_row(i, "@38g%s", r);
@ -2604,8 +2598,17 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
numdoc.insert("/");
numdoc.insert(prefisso);
}
set_row(_r + 1, "@0g%s", (const char*)s_dataregcoll);
set_row(_r + 1, "@9g%5ld", protivacoll);
set_row(_r + 1, "@15g%s", (const char*)s_datadoccoll);
set_row(_r + 1, "@24g%s", (const char*)numdoccoll);
set_row(_r + 1, "@126g%6ld", numregcoll);
}
}
else
integrazione = false;
set_row(_r, "@24g%s", (const char*)numdoc);
if (codcf != 0l)
set_row(i, "@31g%6ld", codcf);
@ -2775,6 +2778,44 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
vall.right_just(19);
set_row(riga, FR("@24gCodice valuta %-3s Corrispettivo in valuta %s"), (const char*)codval, (const char*)vall);
}
if (_tipo_stampa == prova) //in caso di stampa di prova
{
if (!(_tipo_reg == vendita && _corrispettivi)) //e se non si tratta di registro vendite corrispettivi
{
if (_cur->pos() != 0 || protiva <= 0) //il primo movimento non va controllato
{
if (protiva != _uprotivap + 1)
{
if (!integrazione)
{
set_row(_r + 1, FR(" @b*** NUM.PROT.FUORI SEQUENZA@r"));
riga = _r + 2;
}
else
{
set_row(_r + 2, FR(" @b*** NUM.PROT.FUORI SEQUENZA@r"));
riga = _r + 3;
}
}
_uprotivap = uprotiva ? uprotiva : protiva;
}
}
if (IVAxcassa && mov.get_int(MOV_TIPOMOV) <= 0)
{
if (!integrazione)
{
set_row(_r + 1, FR(" @b*** NUM.PROT.FUORI SEQUENZA@r"));
riga = _r + 2;
}
else
{
set_row(_r + 2, FR(" @b*** NUM.PROT.FUORI SEQUENZA@r"));
riga = _r + 3;
}
}
}
}
return true;
}