Patch level : 12.0 1190
Files correlati : cg2.exe Commento: modificato il metodo di aggiornamento dell'ultimo protocollo dei registri controllare le regolarizzazioni
This commit is contained in:
parent
27c6cb6ef5
commit
ebacbbfba6
@ -371,6 +371,7 @@ void TCausale::calcIVA()
|
||||
if (td.full())
|
||||
{
|
||||
const TRectype& tpd = cache().get("%TPD", td);
|
||||
|
||||
if (!tpd.empty())
|
||||
{
|
||||
i = (TipoIVA) tpd.get_int("I0"); // IVA acquisti, vendite, generica
|
||||
@ -450,35 +451,36 @@ bool TCausale::IVA2bill(const TCodiceIVA& iva, TBill& c) const
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCache_causali
|
||||
///////////////////////////////////////////////////////////
|
||||
class TCache_causale : public TCache
|
||||
class TCache_causale : public TFile_cache
|
||||
{
|
||||
int _year;
|
||||
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key);
|
||||
virtual TObject* rec2obj(const TRectype & rec) const;
|
||||
|
||||
public:
|
||||
const TCausale & caus(const char* key, const int anno = 0);
|
||||
const TCausale & caus(const char* cod, const int anno = 0);
|
||||
|
||||
TCache_causale() : TCache() { }
|
||||
TCache_causale() : TFile_cache(LF_CAUSALI), _year(0) { }
|
||||
virtual ~TCache_causale() { }
|
||||
};
|
||||
|
||||
TObject* TCache_causale::key2obj(const char* key)
|
||||
TObject* TCache_causale::rec2obj(const TRectype & rec) const
|
||||
{
|
||||
TToken_string k(key);
|
||||
TString4 cod;
|
||||
k.get(0, cod);
|
||||
TString4 cod = rec.get(CAU_CODCAUS);
|
||||
|
||||
cod.trim();
|
||||
int year; k.get(1, year);
|
||||
return new TCausale(cod, year);
|
||||
return new TCausale(cod, _year);
|
||||
}
|
||||
|
||||
const TCausale & TCache_causale::caus(const char* key, const int anno)
|
||||
const TCausale & TCache_causale::caus(const char* cod, const int anno)
|
||||
{
|
||||
TToken_string k;
|
||||
|
||||
k.add(key);
|
||||
k.add(anno, 1);
|
||||
return (const TCausale &)*objptr(k);
|
||||
TToken_string key;
|
||||
|
||||
key.add(cod);
|
||||
key.add(anno, 1);
|
||||
_year = anno;
|
||||
return (const TCausale &)query(key);
|
||||
}
|
||||
|
||||
const TCausale & cached_causale(const char * codcaus, int year)
|
||||
@ -1063,37 +1065,40 @@ bool TRegistro::update(long protiva, const TDate& datareg)
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCache_registri
|
||||
///////////////////////////////////////////////////////////
|
||||
class TCache_registri : public TCache
|
||||
class TCache_registri : public TFile_cache
|
||||
{
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key);
|
||||
virtual TObject* rec2obj(const TRectype& rec) const;
|
||||
|
||||
public:
|
||||
const TRegistro & registro(const char* key, const int anno = 0);
|
||||
const TRegistro & registro(const char* cod, const int anno = 0);
|
||||
|
||||
TCache_registri() : TCache() { }
|
||||
TCache_registri() : TFile_cache("REG") { }
|
||||
virtual ~TCache_registri() { }
|
||||
};
|
||||
|
||||
TObject* TCache_registri::key2obj(const char* key)
|
||||
TObject* TCache_registri::rec2obj(const TRectype& rec) const
|
||||
{
|
||||
TToken_string k(key);
|
||||
TString16 cod;
|
||||
TString k = rec.get("CODTAB");
|
||||
|
||||
k.get(0, cod);
|
||||
cod.trim();
|
||||
int year;
|
||||
|
||||
k.get(1, year);
|
||||
return new TRegistro(cod, year);
|
||||
return new TRegistro(k.mid(4), atoi(k.left(4)));
|
||||
}
|
||||
|
||||
const TRegistro & TCache_registri::registro(const char* key, const int anno)
|
||||
const TRegistro & TCache_registri::registro(const char* cod, const int anno)
|
||||
{
|
||||
TToken_string k(key);
|
||||
|
||||
k.add(anno);
|
||||
return (const TRegistro &)*objptr(k);
|
||||
TToken_string key("REG");
|
||||
int year = anno;
|
||||
|
||||
if (year == 0)
|
||||
year = ini_get_int(CONFIG_DITTA, "cg", "AnLiIv");
|
||||
|
||||
TString16 codtab;
|
||||
|
||||
codtab << format("%04d", year) << cod;
|
||||
|
||||
key.add(codtab);
|
||||
return (const TRegistro &)query(key);
|
||||
}
|
||||
|
||||
const TRegistro & cached_registro(const char * codreg, int year)
|
||||
@ -1234,20 +1239,27 @@ bool TCodiceIVA::reverse_charge_pubb() const
|
||||
} */
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCache_clifor
|
||||
// TCache_codIVA
|
||||
///////////////////////////////////////////////////////////
|
||||
class TCache_codIVA : public TCache
|
||||
class TCache_codIVA : public TFile_cache
|
||||
{
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key) { return new TCodiceIVA(key); }
|
||||
virtual TObject* rec2obj(const TRectype & rec) const { return new TCodiceIVA(rec.get("CODTAB")); }
|
||||
|
||||
public:
|
||||
const TCodiceIVA & codIVA(const char * codice) { return (const TCodiceIVA &)*objptr(codice); }
|
||||
|
||||
TCache_codIVA() : TCache() { }
|
||||
const TCodiceIVA & codIVA(const char * codice);
|
||||
TCache_codIVA() : TFile_cache("%IVA") { }
|
||||
virtual ~TCache_codIVA() { }
|
||||
};
|
||||
|
||||
const TCodiceIVA & TCache_codIVA::codIVA(const char * codice)
|
||||
{
|
||||
TToken_string key("IVA");
|
||||
|
||||
key.add(codice);
|
||||
return (const TCodiceIVA &)query(key);
|
||||
}
|
||||
|
||||
const TCodiceIVA & cached_codIVA(const char * codiva)
|
||||
{
|
||||
HIDDEN TCache_codIVA __cache_codIVA;
|
||||
@ -2035,7 +2047,7 @@ int TMovimentoPN::registra(bool re, bool force)
|
||||
{
|
||||
TTable tab("%DET");
|
||||
tab.curr() = det;
|
||||
tab.curr().put("FPC", "X");
|
||||
tab.curr().put("FPC", true);
|
||||
tab.rewrite();
|
||||
}
|
||||
}
|
||||
|
@ -917,9 +917,9 @@ void TSaldo_agg::clear_saldi(int year)
|
||||
}
|
||||
else
|
||||
{
|
||||
saldi.put(SLD_FLSCA, "");
|
||||
saldi.put(SLD_FLSCA, false);
|
||||
saldi.write();
|
||||
saldi.put(SLD_FLSCA, "X");
|
||||
saldi.put(SLD_FLSCA, true);
|
||||
saldi.read(_isequal,_unlock);
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ int TMovimento_contabile::write_rewrite(TBaseisamfile& f, bool re) const
|
||||
{
|
||||
TTable tab("%DET");
|
||||
tab.curr() = det;
|
||||
tab.curr().put("FPC", "X");
|
||||
tab.curr().put("FPC", true);
|
||||
tab.rewrite();
|
||||
}
|
||||
}
|
||||
|
@ -593,34 +593,32 @@ bool TAnagrafica::init(char tipocf, long codice, const TString& ocfpi)
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCache_clifor
|
||||
///////////////////////////////////////////////////////////
|
||||
class TCache_clifor : public TCache
|
||||
class TCache_clifor : public TFile_cache
|
||||
{
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key);
|
||||
virtual TObject* rec2obj(const TRectype & rec) const ;
|
||||
|
||||
public:
|
||||
const TCli_for & clifor(const char tipo, const long codice);
|
||||
|
||||
TCache_clifor() : TCache() { }
|
||||
TCache_clifor() : TFile_cache(LF_CLIFO) { }
|
||||
virtual ~TCache_clifor() { }
|
||||
};
|
||||
|
||||
TObject* TCache_clifor::key2obj(const char* key)
|
||||
TObject* TCache_clifor::rec2obj(const TRectype & rec) const
|
||||
{
|
||||
TToken_string k(key);
|
||||
TString4 tipo;
|
||||
long codice;
|
||||
const char tipo = rec.get_char(CLI_TIPOCF);
|
||||
long codice = rec.get_long(CLI_CODCF);
|
||||
|
||||
k.get(0, tipo);
|
||||
k.get(1, codice);
|
||||
return new TCli_for(tipo[0], codice);
|
||||
return new TCli_for(tipo, codice);
|
||||
}
|
||||
|
||||
const TCli_for & TCache_clifor::clifor(const char tipo, const long codice)
|
||||
{
|
||||
TToken_string k; k << tipo;
|
||||
|
||||
k.add(codice);
|
||||
return (const TCli_for &)*objptr(k);
|
||||
return (const TCli_for &)query(k);
|
||||
}
|
||||
|
||||
const TCli_for & cached_clifor(const char tipo, long codice)
|
||||
|
Loading…
x
Reference in New Issue
Block a user