Patch level : 12.0 1062

Files correlati     : ve0.exe ve6.exe

Commento        :

Modificato calcolo plafond
Contabilizzazione con causale per tipo documenti SDI
This commit is contained in:
Alessandro Bonazzi 2021-06-11 19:03:51 +02:00
parent 95279dd5bf
commit 1091feb25a
4 changed files with 28 additions and 10 deletions

View File

@ -883,7 +883,7 @@ public:
const TRiepilogo_iva * riepilogo_iva(int index) const { return (index >= 0 && index < _cod_iva.items()) ? riepilogo_iva(_cod_iva.row(index)) : NULL; }
TCli_for& clifor(bool force_reload = false) const;
TLi_manager & plafond(bool force_reload = false);
const real importo_plafond() const;
const real importo_plafond(bool diff = false) const;
const real importo_plafond_salvato() const;
TOccasionale& occas() const;
const TAgente& agente(bool first = true) const;

View File

@ -2801,7 +2801,7 @@ TCli_for& TDocumento::clifor(bool force_reload) const
return cf;
}
const real TDocumento::importo_plafond() const
const real TDocumento::importo_plafond(bool diff) const
{
real importo_plafond;
@ -2816,6 +2816,8 @@ const real TDocumento::importo_plafond() const
}
if (is_nota_credito())
importo_plafond = -importo_plafond;
if (diff)
importo_plafond -= importo_plafond_salvato();
return importo_plafond;
}

View File

@ -17,6 +17,7 @@
#include "../m770/scperc.h"
#include "../m770/rver.h"
#include "../m770/perc.h"
#include "../f9/f9lib.h"
void TMovimentoPN_VE::destroy_iva_row(int i)
@ -1037,8 +1038,26 @@ TCausale* TContabilizzazione::get_caus(const TDocumento& doc, const int year) co
{
TString4 codcaus;
TToken_string key;
static TCategorie_doc __cats;
if (_fld_cms_cont.full())
if (main_app().has_module(F9AUT, CHK_DONGLE))
{
const TString & tipodoc = doc.get(DOC_TIPODOCSDI);
if (tipodoc.full())
{
#ifdef NEW_FP
TClasse_doc * classe = __cats.tipo2class(tipodoc);
if (classe != nullptr)
codcaus = classe->caus_cont();
#else
codcaus =__cats.tipo2caus_cont(tipodoc);
#endif
}
}
if (codcaus.blank() && _fld_cms_cont.full())
{
const TString& cms = doc.commessa_principale();
if (cms.full())
@ -1065,13 +1084,10 @@ TCausale* TContabilizzazione::get_caus(const TDocumento& doc, const int year) co
codcaus = doc.tipo().causale(); // Istanzia la causale del documento corrente...
}
if (_caus != NULL && _caus->codice() == codcaus && _caus->reg().year() == year)
if (_caus != nullptr && _caus->codice() == codcaus && _caus->reg().year() == year)
return _caus;
if (_caus != NULL)
{
delete _caus;
_caus = NULL;
}
if (_caus != nullptr)
safe_delete(_caus);
if (codcaus.full())
_caus = new TCausale(codcaus, year);

View File

@ -3065,7 +3065,7 @@ bool codcms_handler(TMask_field& f, KEY key)
} //if (main_app().has_module(CTAUT) && (...
//aggiornamento automatico del campo codice contabilita' separata nel caso di commessa che ce lo abbia
if (main_app().has_module(NPAUT, CHK_DONGLE) && f.running_check(key))
if (mask.id2pos(F_CONTSEP) >= 0 && main_app().has_module(NPAUT, CHK_DONGLE) && mask.get(F_CONTSEP).full() && f.running_check(key))
{
const TString& contsep = cache().get(LF_COMMESSE, codcms, COMMESSE_CONTSEP);