Patch level : 12.0 1244
Files correlati : ve0.exe cg5.exe Mcg5500c.msk Commento: Aggiunto un controllo opzionale sulla contbilizzazione fatture che derivano da una fattura da emettere o ricevere se la fattura appartiene alo strsso esercizio della da emettere o ricevere viene contabilizzata normlmente e non storna la fattura da emettere o ricevere.
This commit is contained in:
parent
ebd79dffd1
commit
e7d97d4305
@ -261,7 +261,7 @@ void TCopydoc_app::main_loop()
|
||||
}
|
||||
else
|
||||
newdoc.put(DOC_NDOC, ndoc++);
|
||||
newdoc.copy_contents(olddoc);
|
||||
newdoc.copy_contents(olddoc, false);
|
||||
newdoc.put(DOC_DATADOC, data);
|
||||
|
||||
const TString& oldstr = m.get(F_OLD_STR);
|
||||
|
@ -854,7 +854,7 @@ void TDocumento::copy_data(TRiga_documento& dst, const TRiga_documento& src)
|
||||
dst.put(RDOC_CODCOSTO, src.codice_costo());
|
||||
}
|
||||
|
||||
void TDocumento::copy_contents(const TDocumento& src, bool copy_header)
|
||||
void TDocumento::copy_contents(const TDocumento& src, bool link_row, bool copy_header)
|
||||
{
|
||||
if (copy_header)
|
||||
copy_data(head(), src.head());
|
||||
@ -866,6 +866,7 @@ void TDocumento::copy_contents(const TDocumento& src, bool copy_header)
|
||||
TRiga_documento & r = new_row(s.tipo().codice());
|
||||
|
||||
copy_data(r, s);
|
||||
if (link_row)
|
||||
r.set_original_rdoc_key(s);
|
||||
}
|
||||
}
|
||||
|
@ -302,12 +302,20 @@ bool TContabilizzazione_analitica::search_costo_ricavo(const TRiga_documento& r,
|
||||
if (rdoc != NULL && rdoc->get(RDOC_PROVV).not_empty())
|
||||
{
|
||||
TString80 key = rdoc->get(RDOC_CODNUM);
|
||||
|
||||
const TCodice_numerazione& num = cached_numerazione(key);
|
||||
const TRectype * orig_doc = r.find_original_doc();
|
||||
const TRectype * rdoc = r.find_original_rdoc();
|
||||
|
||||
if (num.fattura_emettere_ricevere())
|
||||
{
|
||||
const int act_es = esercizi().date2esc(r.doc().get_date(DOC_DATADOC));
|
||||
const int orig_es = esercizi().date2esc(orig_doc->get_date(DOC_DATADOC));
|
||||
|
||||
if (!num.fattura_emettere_ricevere_check_ese() || act_es != orig_es)
|
||||
{
|
||||
key.format("%3d%3d%6ld", conto.gruppo(), conto.conto(), conto.sottoconto());
|
||||
const TRectype* rs = &cache().get("MRE", key);
|
||||
|
||||
if (rs->empty())
|
||||
{
|
||||
key.cut(6);
|
||||
@ -330,6 +338,7 @@ bool TContabilizzazione_analitica::search_costo_ricavo(const TRiga_documento& r,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return conto.ok() && conto.find();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user