Patch level : 4.0 464
Files correlati : Ricompilazione Demo : [ ] Commento : Riinserito il meccanismo delle fatture da emettere/ricevere ERA SPARITO !!! git-svn-id: svn://10.65.10.50/trunk@14202 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b3c97c4866
commit
8751f7fa59
@ -251,6 +251,7 @@ public:
|
||||
bool movement_ok() ;
|
||||
void add_row_re(int i);
|
||||
void add_row_tot_re(TDocumento& doc);
|
||||
bool add_row_cp_re(int i);
|
||||
void map_conto_re(TBill & c);
|
||||
void destroy_iva_row(int i = -1);
|
||||
int recalc_cg_rows(const TString & descr_cr, TCausale & caus);
|
||||
|
@ -367,6 +367,35 @@ void TMovimentoPN_VE::add_row_tot_re(TDocumento& doc)
|
||||
insert_cg_rec(0, imp, c, _caus->desc_agg(1), ' ');
|
||||
}
|
||||
|
||||
bool TMovimentoPN_VE::add_row_cp_re(int i)
|
||||
{
|
||||
TRectype& cur = cg(i);
|
||||
bool inserted_row = FALSE;
|
||||
|
||||
TBill c;
|
||||
const int gr = cur.get_int(RMV_GRUPPO);
|
||||
const int co = cur.get_int(RMV_CONTO);
|
||||
const long so = cur.get_long(RMV_SOTTOCONTO);
|
||||
|
||||
c.set(gr,co,so);
|
||||
TBill cp;
|
||||
map_conto_re(c);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void TMovimentoPN_VE::map_conto_re(TBill& c)
|
||||
{
|
||||
TString16 key;
|
||||
@ -2413,10 +2442,13 @@ 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);
|
||||
_movimento->add_row_tot_re(doc);
|
||||
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->destroy_iva_row();
|
||||
return _error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user