Patch level : 2.2 380
Files correlati : ve0.exe ve6.exe Ricompilazione Demo : [ ] Commento : La contabilizzazione delle fatture da emettere o ricevere sbagliava il totale documento con importi negativi git-svn-id: svn://10.65.10.50/trunk@13841 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3b4005d7bf
commit
bbb4d3e0bf
@ -248,7 +248,7 @@ public:
|
|||||||
void set_caus(TCausale * c) { _caus = c;}
|
void set_caus(TCausale * c) { _caus = c;}
|
||||||
bool movement_ok() ;
|
bool movement_ok() ;
|
||||||
void add_row_re(int i);
|
void add_row_re(int i);
|
||||||
bool add_row_cp_re(int i);
|
void add_row_tot_re(TDocumento& doc);
|
||||||
void map_conto_re(TBill & c);
|
void map_conto_re(TBill & c);
|
||||||
void destroy_iva_row(int i = -1);
|
void destroy_iva_row(int i = -1);
|
||||||
int recalc_cg_rows(const TString & descr_cr, TCausale & caus);
|
int recalc_cg_rows(const TString & descr_cr, TCausale & caus);
|
||||||
|
@ -342,27 +342,17 @@ void TMovimentoPN_VE::add_row_re(int i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMovimentoPN_VE::add_row_cp_re(int i)
|
void TMovimentoPN_VE::add_row_tot_re(TDocumento& doc)
|
||||||
{
|
{
|
||||||
TRectype& cur = cg(i);
|
TBill c;
|
||||||
bool inserted_row = false;
|
TImporto imp = real2imp(doc.imponibile(), 'T');
|
||||||
|
|
||||||
TBill c(cur);
|
|
||||||
map_conto_re(c);
|
|
||||||
|
|
||||||
if (c.ok())
|
_caus->bill(1, c);
|
||||||
{
|
if (c.tipo() > ' ')
|
||||||
int poscg = bill2pos(c, ' ');
|
c.set(c.gruppo(), c.conto(), curr().get_long(MOV_CODCF), c.tipo());
|
||||||
if (poscg < 0)
|
imp.normalize();
|
||||||
{
|
|
||||||
poscg = insert_cg_rec(0, real2imp(ZERO, 'P'), c, _caus->desc_agg(1), ' ');
|
insert_cg_rec(0, imp, c, _caus->desc_agg(1), ' ');
|
||||||
inserted_row = true;
|
|
||||||
}
|
|
||||||
TImporto val(real2imp(cur.get_real(RMV_IMPORTO), 'P'));
|
|
||||||
|
|
||||||
add_cg_rec(poscg, val);
|
|
||||||
}
|
|
||||||
return inserted_row;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMovimentoPN_VE::map_conto_re(TBill& c)
|
void TMovimentoPN_VE::map_conto_re(TBill& c)
|
||||||
@ -2398,13 +2388,10 @@ error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc)
|
|||||||
if (good())
|
if (good())
|
||||||
{
|
{
|
||||||
int righe = _movimento->iva_items();
|
int righe = _movimento->iva_items();
|
||||||
|
|
||||||
for (int i=0; i<righe; i++)
|
for (int i=0; i<righe; i++)
|
||||||
_movimento->add_row_re(i);
|
_movimento->add_row_re(i);
|
||||||
righe = _movimento->cg_items();
|
_movimento->add_row_tot_re(doc);
|
||||||
int row_to_add = righe - 1;
|
|
||||||
for (int j = row_to_add; j >= 0; j--)
|
|
||||||
if (!_movimento->add_row_cp_re(row_to_add))
|
|
||||||
row_to_add--;
|
|
||||||
}
|
}
|
||||||
_movimento->destroy_iva_row();
|
_movimento->destroy_iva_row();
|
||||||
return _error;
|
return _error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user