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:
alex 2006-03-09 18:49:55 +00:00
parent 3b4005d7bf
commit bbb4d3e0bf
2 changed files with 12 additions and 25 deletions

View File

@ -248,7 +248,7 @@ public:
void set_caus(TCausale * c) { _caus = c;}
bool movement_ok() ;
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 destroy_iva_row(int i = -1);
int recalc_cg_rows(const TString & descr_cr, TCausale & caus);

View File

@ -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);
bool inserted_row = false;
TBill c(cur);
map_conto_re(c);
TBill c;
TImporto imp = real2imp(doc.imponibile(), 'T');
if (c.ok())
{
int poscg = bill2pos(c, ' ');
if (poscg < 0)
{
poscg = insert_cg_rec(0, real2imp(ZERO, 'P'), 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;
_caus->bill(1, c);
if (c.tipo() > ' ')
c.set(c.gruppo(), c.conto(), curr().get_long(MOV_CODCF), c.tipo());
imp.normalize();
insert_cg_rec(0, imp, c, _caus->desc_agg(1), ' ');
}
void TMovimentoPN_VE::map_conto_re(TBill& c)
@ -2398,13 +2388,10 @@ error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc)
if (good())
{
int righe = _movimento->iva_items();
for (int i=0; i<righe; i++)
_movimento->add_row_re(i);
righe = _movimento->cg_items();
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->add_row_tot_re(doc);
}
_movimento->destroy_iva_row();
return _error;