Merge branch 'R12.00.1136' of http://10.65.20.33/sirio/CAMPO/campo into R12.00.1136
This commit is contained in:
commit
bf3431d917
@ -749,7 +749,7 @@ error_type TIVA_array::add(const TRiga_documento& r, const TBill& conto, const i
|
||||
key << "|+";
|
||||
}
|
||||
if (_caus->reg().tipo_registro() == acquisto && _caus->reverse_charge_pubb())
|
||||
key << '|' << revcharge;
|
||||
key << '|' << (revcharge ? "X" : "");
|
||||
|
||||
|
||||
TRectype* iva = (TRectype*)objptr(key);
|
||||
@ -4529,8 +4529,11 @@ error_type TContabilizzazione::write_regolarizzazione(const TDocumento& doc, TMo
|
||||
head.put(MOV_CODCAUS, caus.codice());
|
||||
head.put(MOV_TIPODOC, caus.tipo_doc());
|
||||
head.put(MOV_PROTIVA, protiva);
|
||||
mov.destroy_cg_row(-1);
|
||||
mov.destroy_iva_row(-1);
|
||||
|
||||
TString descr;
|
||||
|
||||
descr << TR("Regolarizzazione ") << doc.get(DOC_CODNUM) << '/' << doc.numero() << TR(" del ") << doc.get(DOC_DATADOC);
|
||||
head.put(MOV_DESCR,descr);
|
||||
|
||||
@ -4557,20 +4560,21 @@ error_type TContabilizzazione::write_regolarizzazione(const TDocumento& doc, TMo
|
||||
head.put(MOV_CONTSEP, doc.get(DOC_CONTSEP));
|
||||
|
||||
real totdoc;
|
||||
for (int ri = 0; ri < _movimento->iva_items(); ri++)
|
||||
int ri = 0;
|
||||
for (int i = 0; i < _movimento->iva_items(); i++)
|
||||
{
|
||||
const TRectype& rmoviva = _movimento->iva(ri);
|
||||
const bool revcharge = rmoviva.get(RMI_REVCHARGE);
|
||||
const TRectype& rmoviva = _movimento->iva(i);
|
||||
const bool revcharge = rmoviva.get_bool(RMI_REVCHARGE);
|
||||
|
||||
if (revcharge)
|
||||
{
|
||||
const real imponibile = rmoviva.get(RMI_IMPONIBILE);
|
||||
const real imposta = rmoviva.get(RMI_IMPOSTA);
|
||||
|
||||
TRectype& rmi = mov.iva(ri);
|
||||
TRectype& rmi = mov.iva(ri++);
|
||||
rmi.put(RMI_IMPONIBILE, imponibile);
|
||||
rmi.put(RMI_IMPOSTA, imposta);
|
||||
rmi.put(RMI_CODIVA, rmoviva.get(RMI_CODIVA));
|
||||
rmi.put(RMI_CODIVA, rmoviva.get(RMI_CODIVA));
|
||||
TBill zio; caus.bill(2, zio);
|
||||
zio.put(rmi);
|
||||
totdoc += imponibile + imposta; // Incrementa totdoc
|
||||
@ -5087,5 +5091,4 @@ bool TContabilizzazione::call_exe(const TDocumento& doc, const TMovimentoPN& mov
|
||||
ininame.fremove();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user