Patch level : 10.0 patch 820

Files correlati     : ve0.exe ve6.exe
Ricompilazione Demo : [ ]
Commento

Nella distribuzione delle spese  senza conto sui movimenti contabile e analitico ora non cosidera piu' le righe di spesa.
NB queste spese devono essere esenti per poter utilizzare questo meccanismo.


git-svn-id: svn://10.65.10.50/branches/R_10_00@21000 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-10-12 16:17:48 +00:00
parent fc9dc01bba
commit 8e11b8a91a
4 changed files with 36 additions and 15 deletions

View File

@ -46,7 +46,6 @@ bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
else
ok = error_box("Errore %d durante l'aggiornamento dei documenti da raggruppare!", err);
}
else
return ok;
}

View File

@ -617,7 +617,7 @@ class TContabilizzazione_analitica : public TElaborazione // velib04f
protected:
bool find_conti_iva_indetraibile(const TRiga_documento& riga, const TBill & bill, TString_array& conti, int annoes, const char tipomov, bool & pareggio);
bool spalma_spese() const { return get("I2") == "X"; }
void split_sp_amount(TAnal_mov & mov, bool pareggio, const TImporto & totdoc, const real & amount, const real & no_ca_amount, int decimals);
void split_sp_amount(TAnal_mov & mov, bool pareggio, const TImporto & totdoc, const TBit_array & spese, const real & amount, const real & no_ca_amount, int decimals);
bool find_conti(const TRiga_documento& riga, TString_array& conti, int annoes, bool riclassifica_fdr_fde, const char tipomov, real & amount_to_split, real & no_ca_amount, const real & valore, bool & pareggio);
void init();

View File

@ -1782,7 +1782,7 @@ error_type TContabilizzazione::search_costo_ricavo(TBill& conto, const TRiga_doc
{
const char tipo = r.doc()[i].tipo().tipo();
if (tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_OMAGGI)
if (tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_OMAGGI && tipo != RIGA_SPESEDOC)
row = i;
}
if (row > 0)
@ -2239,15 +2239,24 @@ void TContabilizzazione::split_sp_amount(const real & amount, int decimals)
FOR_EACH_ASSOC_OBJECT((*_righe_iva), obj, key, itm)
{
const bool spese = key && *key == '3';
TRectype & r = (TRectype &)*itm;
const real imp = r.get_real(RMI_IMPONIBILE);
if (spese)
d.add(ZERO);
else
d.add(imp);
}
FOR_EACH_ASSOC_OBJECT((*_righe_iva), obj1, key1, itm1)
{
const bool spese = key1 && *key1 == '3';
TRectype & r = (TRectype &)*itm1;
if (spese)
d.get();
else
{
real imp = r.get_real(RMI_IMPONIBILE);
const TCodiceIVA i(r.get(RMI_CODIVA));
@ -2256,6 +2265,7 @@ void TContabilizzazione::split_sp_amount(const real & amount, int decimals)
real const imposta = i.imposta(imp);
r.put(RMI_IMPOSTA, imposta);
}
}
}
error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)

View File

@ -274,7 +274,7 @@ bool TContabilizzazione_analitica::search_costo_ricavo(const TRiga_documento& r,
for (int i = 1; row < 0 && i <= rows; i++)
{
const char tipo = r.doc()[i].tipo().tipo();
if (tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_OMAGGI)
if (tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_OMAGGI && tipo != RIGA_SPESEDOC)
row = i;
}
if (row > 0)
@ -507,7 +507,9 @@ void TContabilizzazione_analitica::calcola_date_comp(const TDocumento& doc, TDat
annoes = esercizi().date2esc(datacomp); //ci potrebbe andare datacomp? All'analisi l'ardua sentenza
}
void TContabilizzazione_analitica::split_sp_amount(TAnal_mov & mov, bool pareggio, const TImporto & totdoc, const real & amount, const real & no_ca_amount, int decimals)
void TContabilizzazione_analitica::split_sp_amount(TAnal_mov & mov, bool pareggio, const TImporto & totdoc,
const TBit_array & spese, const real & amount, const real & no_ca_amount,
int decimals)
{
char sezione = totdoc.sezione();
TGeneric_distrib w(amount, decimals);
@ -525,6 +527,9 @@ void TContabilizzazione_analitica::split_sp_amount(TAnal_mov & mov, bool pareggi
TImporto imp(r.get_char(RMOVANA_SEZIONE), r.get_real(RMOVANA_IMPORTO));
imp.normalize(sezione);
if (spese[r.get_int(RMOVANA_NUMRIG)])
d.add(ZERO);
else
d.add(imp.valore());
}
for (int i = pareggio ? 2 : 1; i <= rows; i++)
@ -547,6 +552,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
TString descr, msg, codcaus;
bool dare = false;
TCausale & caus = (TCausale &) doc2caus(doc);
TBit_array spese;
if (numreg_cg > 0)
{
@ -671,6 +677,8 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
FOR_EACH_ARRAY_ROW(conti_ind, j, row_ind)
{
TRectype& rmov = mov.new_row();
spese.set(rmov.get_int(RMOVANA_NUMRIG), riga.is_spese());
rmov.put(RMOVANA_ANNOES, annoes);
rmov.put(RMOVANA_CODCONTO, row_ind->get(0));
rmov.put(RMOVANA_CODCCOSTO,row_ind->get());
@ -722,6 +730,8 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
FOR_EACH_ARRAY_ROW(conti, i, row)
{
TRectype& rmov = mov.new_row();
spese.set(rmov.get_int(RMOVANA_NUMRIG), riga.is_spese());
rmov.put(RMOVANA_ANNOES, annoes);
rmov.put(RMOVANA_CODCONTO, row->get(0));
rmov.put(RMOVANA_CODCCOSTO,row->get());
@ -762,6 +772,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
{
TRectype& rmov = mov.new_row();
spese.set(rmov.get_int(RMOVANA_NUMRIG));
rmov.put(RMOVANA_ANNOES, annoes);
rmov.put(RMOVANA_CODCONTO, cinc.string(0x8));
rmov.put(RMOVANA_CODCCOSTO, doc.codice_costo());
@ -781,6 +792,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
{
TRectype& rmov = mov.new_row();
spese.set(rmov.get_int(RMOVANA_NUMRIG));
rmov.put(RMOVANA_ANNOES, annoes);
rmov.put(RMOVANA_CODCONTO, cbol.string(0x8));
rmov.put(RMOVANA_CODCCOSTO, doc.codice_costo());
@ -798,7 +810,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
}
if (amount_to_split != ZERO)
split_sp_amount(mov, has_pareggio, totdoc, amount_to_split, no_ca_amount, doc.decimals());
split_sp_amount(mov, has_pareggio, totdoc, spese, amount_to_split, no_ca_amount, doc.decimals());
if (can_write && mov.rows() > 0)
{