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 << "|+";
|
key << "|+";
|
||||||
}
|
}
|
||||||
if (_caus->reg().tipo_registro() == acquisto && _caus->reverse_charge_pubb())
|
if (_caus->reg().tipo_registro() == acquisto && _caus->reverse_charge_pubb())
|
||||||
key << '|' << revcharge;
|
key << '|' << (revcharge ? "X" : "");
|
||||||
|
|
||||||
|
|
||||||
TRectype* iva = (TRectype*)objptr(key);
|
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_CODCAUS, caus.codice());
|
||||||
head.put(MOV_TIPODOC, caus.tipo_doc());
|
head.put(MOV_TIPODOC, caus.tipo_doc());
|
||||||
head.put(MOV_PROTIVA, protiva);
|
head.put(MOV_PROTIVA, protiva);
|
||||||
|
mov.destroy_cg_row(-1);
|
||||||
|
mov.destroy_iva_row(-1);
|
||||||
|
|
||||||
TString descr;
|
TString descr;
|
||||||
|
|
||||||
descr << TR("Regolarizzazione ") << doc.get(DOC_CODNUM) << '/' << doc.numero() << TR(" del ") << doc.get(DOC_DATADOC);
|
descr << TR("Regolarizzazione ") << doc.get(DOC_CODNUM) << '/' << doc.numero() << TR(" del ") << doc.get(DOC_DATADOC);
|
||||||
head.put(MOV_DESCR,descr);
|
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));
|
head.put(MOV_CONTSEP, doc.get(DOC_CONTSEP));
|
||||||
|
|
||||||
real totdoc;
|
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 TRectype& rmoviva = _movimento->iva(i);
|
||||||
const bool revcharge = rmoviva.get(RMI_REVCHARGE);
|
const bool revcharge = rmoviva.get_bool(RMI_REVCHARGE);
|
||||||
|
|
||||||
if (revcharge)
|
if (revcharge)
|
||||||
{
|
{
|
||||||
const real imponibile = rmoviva.get(RMI_IMPONIBILE);
|
const real imponibile = rmoviva.get(RMI_IMPONIBILE);
|
||||||
const real imposta = rmoviva.get(RMI_IMPOSTA);
|
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_IMPONIBILE, imponibile);
|
||||||
rmi.put(RMI_IMPOSTA, imposta);
|
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);
|
TBill zio; caus.bill(2, zio);
|
||||||
zio.put(rmi);
|
zio.put(rmi);
|
||||||
totdoc += imponibile + imposta; // Incrementa totdoc
|
totdoc += imponibile + imposta; // Incrementa totdoc
|
||||||
@ -5087,5 +5091,4 @@ bool TContabilizzazione::call_exe(const TDocumento& doc, const TMovimentoPN& mov
|
|||||||
ininame.fremove();
|
ininame.fremove();
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user