Patch level : 12.0 520

Files correlati     : ve6.exe

richieste da CRPA

Non aggiornava il protocollo IVA se preso dal registro

git-svn-id: svn://10.65.10.50/branches/R_10_00@24327 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2018-01-31 19:54:01 +00:00
parent 5c66638271
commit f5b5873eba
2 changed files with 1487 additions and 1477 deletions

View File

@ -595,8 +595,9 @@ bool TRegistro::update(long protiva, const TDate& datareg)
if (!updated)
{
TTable reg("REG");
updated = reg.rewrite(_rec) == NOERR;
cache().discard(_rec); // Forza rilettura registro in cache
cache().discard("REG", _rec.get("CODTAB")); // Forza rilettura registro in cache
}
return updated;
@ -714,6 +715,12 @@ real TCodiceIVA::scorpora(real& lordo, int ndec, const char* codval) const
real TCodiceIVA::lordo(const real& imponibile, int ndec, const char* codval) const
{ return imponibile + imposta(imponibile, ndec, codval); }
bool TCodiceIVA::reverse_charge() const
{
const int rsi = regime_speciale();
return rsi == 13 || rsi == 50 || rsi == 51; // Reverse charge!
}
///////////////////////////////////////////////////////////
// TBill
///////////////////////////////////////////////////////////

View File

@ -164,6 +164,9 @@ public: // TObject
real scorpora(real& imponibile, int ndec = AUTO_DECIMALS, const char * codval = "") const; // Scorpora dall'imponibile l'imposta e la ritorna
real lordo(const real& imponibile, int ndec = AUTO_DECIMALS, const char * codval = "") const; // Calcola il lordo dell'imponibile l'imposta e la ritorna
bool reverse_charge() const;
int regime_speciale() const { return get_int("I5");}
TCodiceIVA(const char* codice = NULL);
TCodiceIVA(const TRectype & rec) : TRectype(rec) {}
TCodiceIVA(const TCodiceIVA & iva) : TRectype(iva) {}