Patch level : 12.0 1244

Files correlati     : cg4.exe cg5.exe Mcg5500c.msk

Commento:
Ricorretta ventilazione dei corrispettivi
Considerato anche il credito utilizzato iva durante l'anno nell'annuale

Interno :
Bisogna provare qualche liquidazione con utilizzo del credito iva
This commit is contained in:
Alessandro Bonazzi 2023-02-15 16:56:59 +01:00
parent 8f8c5f4a19
commit 22fd96658d
5 changed files with 36 additions and 29 deletions

View File

@ -2440,7 +2440,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
true_corrisp = true;
_pim->put("I0",LORDO);
// questi sono corrispettivi davvero; comportamento normale
if (tipoiva == "VE") // da ventilare
if (civa.iva_da_ventilare()) // da ventilare
{
lor += imponibile;
add_vendite(month, reg, tipodet, imponibile);
@ -2471,7 +2471,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
// perche' si e' gia' registrato lo scontrino medesimo
true_corrisp = true; // non e' vero ma non devono essere sommate ai falsi
// corrispettivi
if (tipoiva == "VE")
if (civa.iva_da_ventilare())
{
const real rr = imponibile + imposta;
imp += rr;
@ -2535,7 +2535,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
if (corrisp)
if (tipodoc == "FS")
{
if (tipoiva == "VE")
if (civa.iva_da_ventilare())
vendite += iiimmm;
}
else
@ -3251,7 +3251,7 @@ void TLiquidazione_app::iva11_set_arr_phase_1(const TString& codatt)
array.add(imponibile,TAB11_EC112);
}
if (!(corrisp && tipoiva != "VE" && (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC")))
if (!(corrisp && civa.iva_da_ventilare() && (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC")))
{
if (!autofattura && tipoiva != "NS")
if (tipodoc == "AF")
@ -4471,7 +4471,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
if (month == 13)
{
// Riporta eventuale credito nella tabella parametri liquidazione dell'anno successivo
real riporto = credito_utilizzabile - risultato;
real riporto = credito_utilizzabile - risultato + credito_utilizzato_iva;
if (riporto < ZERO)
riporto = ZERO;

View File

@ -158,12 +158,11 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
if (tipodet == 1 ||( tipocr == 5 && tipodet == 3) || tipodet == 9)
continue;
TString att(codatt);
const TString8 curr_att((const char*)(*_pim_codatt));
if (tipocr == 1 && (mese == m) &&
att == (const char*)(*_pim_codatt))
if (tipocr == 1 && (mese == m) && att == curr_att)
{
if (civa.iva_da_ventilare())
if (!civa.iva_da_ventilare())
{
real lurd = _pim->get_real("R0");
lurd += _pim->get_real("R1");

View File

@ -599,7 +599,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
const TCodiceIVA & civa1 = cached_codIVA(codiva); // codice IVA aggiornato per eventuale ventilazione
// se e' corrispettivo da ventilare non scrivo un cannolo ripieno visto che e' stato ventilato
if (tipomov == vendita && tipoiva == "VE" && !describe_pis)
if (tipomov == vendita && civa.iva_da_ventilare() && !describe_pis)
continue;
// se e' il dettaglio di una attivita' mista non stampa gli acquisti, il perche' losalamadonna
@ -699,9 +699,9 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
cx._totale = 0;
_CorrItem& ca = is_key ? (_CorrItem&) corr_ann[codiva] : cx;
if (sosp_imp != vol_affari)
ca._totale += tab->get_real(tipoiva == "VE" ? "R2" : "R3"); // Se e' codice IVA da Vent. stiamo scorrendo i PIS: va stampato il lordo dei progressivi successivi
ca._totale += tab->get_real(civa.iva_da_ventilare() ? "R2" : "R3"); // Se e' codice IVA da Vent. stiamo scorrendo i PIS: va stampato il lordo dei progressivi successivi
if (sosp_imp != liquidazione)
ca._totale_vf += tab->get_real(tipoiva == "VE" ? "R2" : "R3");
ca._totale_vf += tab->get_real(civa.iva_da_ventilare() ? "R2" : "R3");
if (!is_key) // se non c'e' lo aggiunge
{
ca._aliquota = civa.moltiplicatore_percentuale(); // Se e' nuovo setta l'aliquota
@ -2423,9 +2423,12 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
set_row(rw++,FR("@11gCredito utilizzabile@58g%r"), &cred_prec);
if (_month < 13)
set_row(rw++, FR("@11gCredito IVA compensabile detratto@75g%r"), &credito_utilizzato_IVA );
set_row(rw++, FR("@11gCredito IVA compensabile detratto@58g%r"), &TLiquidazione_app::credito_utilizzato_IVA(13));
}
if (_month == 13) cre_deb_per += versamenti;
if (_month == 13)
cre_deb_per += versamenti;
print_importo(rw++, TR("IVA dovuta o a credito per il periodo"), cre_deb_per + corr_acc);
@ -2454,12 +2457,16 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
if (_is_visliq) rw++;
const real tot_vers = acc_dec + versamenti + vers_int;
if (!tot_vers.is_zero() && (_month == 13 || !_is_visliq))
set_row(rw++, FR("@11gTotale versamenti effettuati@58g%r"), &tot_vers);
else
if (_is_visliq) rw++;
const real iva = risultato + interessi + corr_acc;
real iva = risultato + interessi + corr_acc;
if (_month == 13)
iva -= TLiquidazione_app::credito_utilizzato_IVA(13);
if (_month == 13 && credito_compensabile)
{
real credito_utilizzabile = lia.get_real("R0");

View File

@ -1693,7 +1693,7 @@ void Visliq_app::read_general(TMask& m)
bool enable_date = r1 != ZERO;
sh.set_row_cell(S_CREDIVA, criva, row);
sh.enable_cell(row, S_CREDIVA, criva > ZERO ? debcred1 == "D" : debcred3 == "D");
sh.enable_cell(row, S_CREDIVA, criva > ZERO ? debcred1 != "C" : debcred3 != "C");
sh.set_row_cell(S_CREDF24PRE, crf24, row);
sh.set_row_cell(S_CREDF24, autf24, row);
enable_date |= autf24 != ZERO;
@ -1797,21 +1797,22 @@ void Visliq_app::read_general(TMask& m)
}
}
}
sv.insert(11, false);
int rowacc = 11 / step;
sv.insert(rowacc, false);
nomemese = itoname(12);
nomemese << " acconto";
sv.set_row_cell(S_MESE, nomemese, 11); // mese
sv.set_row_cell(S_MESE, nomemese, rowacc); // mese
if (date.objptr(14) != nullptr)
{
TToken_string & banca = (TToken_string &)banche[14];
sv.set_row_cell(S_DATA, (TDate &)date[14], 11); // data vers.
sv.set_row_cell(S_ABI, banca.get(0), 11); // azienda
sv.set_row_cell(S_CAB, banca.get(1), 11); // dipendenza
sv.set_row_cell(S_CONC, banca.get(2), 11); // concessionaria
sv.set_row_cell(S_VERSAMENTO, (real &) versamenti[14], 11);// versamenti
sv.set_row_cell(S_INTERESSI, (real &) interessi[14], 11);// interessi
sv.set_row_cell(S_STAMPATO, stampato[14], 11);// stampato
sv.set_row_cell(S_DATA, (TDate &)date[14], rowacc); // data vers.
sv.set_row_cell(S_ABI, banca.get(0), rowacc); // azienda
sv.set_row_cell(S_CAB, banca.get(1), rowacc); // dipendenza
sv.set_row_cell(S_CONC, banca.get(2), rowacc); // concessionaria
sv.set_row_cell(S_VERSAMENTO, (real &) versamenti[14], rowacc);// versamenti
sv.set_row_cell(S_INTERESSI, (real &) interessi[14], rowacc);// interessi
sv.set_row_cell(S_STAMPATO, stampato[14], rowacc);// stampato
}
sv.force_update();

View File

@ -58,7 +58,7 @@ BEGIN
PROMPT 1 6 "Credito utilizzato a Gennaio "
END
SPREADSHEET F_VISLIQ1 -2 -1
SPREADSHEET F_VISLIQ1 -2 7
BEGIN
PROMPT 0 7 "Liquidazione"
ITEM "Mese@10"