Patch level : 12.0 1142
Files correlati : fplib01, fp0400 Commento: RISOLTO bug sull invio fatture. il contatore con il numero delle linee era sballato. questo causava errori di incongruenza dopo l'inserimento del record nel paf e di conseguenza la fattura non veniva spedita. Sistamto il contatore
This commit is contained in:
parent
83f3051b24
commit
ecbec09804
@ -50,7 +50,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\src\xvaga;..\src\xi;..\src\gfm;..\src\include;..\src\xvtdb;..\src\xvturl</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\libraries\SQLAPI\include; ..\src\xvaga;..\src\xi;..\src\gfm;..\src\include;..\src\xvtdb;..\src\xvturl</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -64,7 +64,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\libraries\SQLAPI\include; ..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
|
@ -64,7 +64,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\libraries\SQLAPI\include;..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;__LONGDOUBLE__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
|
@ -371,7 +371,7 @@ void TProtocollo::sset(const char* prot)
|
||||
_progres = p.get();
|
||||
}
|
||||
|
||||
const TString& TProtocollo::get_prot() const
|
||||
const TString& TProtocollo::get_prot_str() const
|
||||
{
|
||||
return prot_in(_year, _tipoprot, _progres);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
void set(const TProtocollo& prot);
|
||||
void sset(const char* prot);
|
||||
const TString& get_prot() const;
|
||||
const TString& get_prot_str() const;
|
||||
prot_s get_prot();
|
||||
|
||||
int get_year() const { return _year; }
|
||||
|
@ -313,37 +313,32 @@ void TPassive_mask::aggiungi_riga(TLocalisamfile& clifo, TSheet_field& sf, TShee
|
||||
|| filter_elab == FILTER_CONT && forn_code == 0 && is_contab && data_range // Filtro solo contabilizzati e data
|
||||
|| filter_elab == FILTER_ALL) // Tutte
|
||||
{
|
||||
TToken_string& row = sf.row(-1);
|
||||
if (denom.blank()) {
|
||||
denom = fp_db().sq_get("NOME");
|
||||
denom << " " << fp_db().sq_get("COGNOME");
|
||||
}
|
||||
denom.cut(50);
|
||||
|
||||
row.add(fp_db().sq_get_int("ANNO"), 1);
|
||||
row.add(fp_db().sq_get("TIPO_SDI"));
|
||||
row.add(fp_db().sq_get("NUM_DOC"));
|
||||
row.add(fp_db().sq_get_date("DATA_RIC"));
|
||||
row.add(fp_db().sq_get_date("DATA_DOC"));
|
||||
row.add(fp_db().sq_get("TOT_DOC"));
|
||||
row.add(fppro_db().set_keys(keys).get_ritenute());
|
||||
const int row = sf.set_row_cell(S_ANNO, fp_db().sq_get_int("ANNO"));
|
||||
sf.set_row_cell(S_TIPODOCSDI, fp_db().sq_get("TIPO_SDI"), row);
|
||||
sf.set_row_cell(S_NDOC, fp_db().sq_get("NUM_DOC"), row);
|
||||
sf.set_row_cell(S_DATARIC, fp_db().sq_get_date("DATA_RIC"), row);
|
||||
sf.set_row_cell(S_DATADOC, fp_db().sq_get_date("DATA_DOC"), row);
|
||||
sf.set_row_cell(S_TOTDOC, fp_db().sq_get("TOT_DOC"), row);
|
||||
sf.set_row_cell(S_TOTRIT, fppro_db().set_keys(keys).get_ritenute(), row);
|
||||
|
||||
// Decido se mettere o meno il flag
|
||||
if (forn_code == 0)
|
||||
row.add("X");
|
||||
else
|
||||
row.add("");
|
||||
sf.set_row_cell(S_FPPRO, forn_code == 0, row);
|
||||
sf.set_row_cell(S_NUMREGCONT, fp_db().sq_get("NUMREGCONT"), row);
|
||||
|
||||
row.add(fp_db().sq_get("NUMREGCONT"));
|
||||
if(dataregcont == TDate("20010101"))
|
||||
row.add("");
|
||||
else
|
||||
row.add(dataregcont);
|
||||
|
||||
if(dataregcont > TDate("20010101"))
|
||||
sf.set_row_cell(S_DATAREGCONT, dataregcont, row);
|
||||
// Valorizzo le colonne rimanenti o la tabella degli errori
|
||||
if (forn_code >= 0)
|
||||
{
|
||||
row.add(clifo.get(CLI_CODCF));
|
||||
row.add(clifo.get(CLI_RAGSOC));
|
||||
sf.set_row_cell(S_FORNITORE, clifo.get(CLI_CODCF), row);
|
||||
sf.set_row_cell(S_RAGSOC, clifo.get(CLI_RAGSOC), row);
|
||||
}
|
||||
else if (_list_fatt_err.find(denom) == _list_fatt_err.end())
|
||||
{
|
||||
@ -354,13 +349,13 @@ void TPassive_mask::aggiungi_riga(TLocalisamfile& clifo, TSheet_field& sf, TShee
|
||||
add_row_err_forn(forn_code, sf_err, denom);
|
||||
}
|
||||
|
||||
row.add(paa_codpaese, sf.cid2index(S_STATOPAIV));
|
||||
row.add(paa_piva);
|
||||
row.add(paa_codfisc);
|
||||
row.add(fp_db().sq_get("ATTACHMENT") != "0" ? "" : "X");
|
||||
row.add(denom);
|
||||
row.add(TProtocollo(fp_db().sq_get_int("ANNO_PROT"), fp_db().sq_get("TIPO_PROT"), fp_db().sq_get("NUM_PROT")));
|
||||
row.add(keys);
|
||||
sf.set_row_cell(S_STATOPAIV, paa_codpaese, row);
|
||||
sf.set_row_cell(S_PARIVA, paa_piva, row);
|
||||
sf.set_row_cell(S_CODFISC, paa_codfisc, row);
|
||||
sf.set_row_cell(S_ATTACH, fp_db().sq_get("ATTACHMENT")!="0", row);
|
||||
sf.set_row_cell(S_RAGXML, denom, row);
|
||||
sf.set_row_cell(S_NPROT, TProtocollo(fp_db().sq_get_int("ANNO_PROT"), fp_db().sq_get("TIPO_PROT"), fp_db().sq_get("NUM_PROT")).get_prot_str(), row);
|
||||
sf.set_row_cell(S_PROKEY, keys, row);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -481,6 +481,7 @@ class TDoc_fp : public TObject
|
||||
|
||||
private:
|
||||
TRectype* _doc_rec;
|
||||
TDocumentoEsteso* _doc;
|
||||
TCli_for _rec_clifo;
|
||||
TAnagrafica _ditta;
|
||||
TString16 _cofi;
|
||||
@ -528,13 +529,14 @@ private:
|
||||
|
||||
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
||||
|
||||
/*
|
||||
struct
|
||||
{
|
||||
bool _is_valuta_estera{ false }; // Se il documento in valuta estera
|
||||
TString4 _cod_val;
|
||||
real _cambio;
|
||||
} _doc_cambio;
|
||||
|
||||
*/
|
||||
//int parse_line(const TString& line, TString& var, TString& val) const;
|
||||
//bool create_table(TScanner& paf, const TString& table);
|
||||
|
||||
|
@ -1260,9 +1260,9 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
// Preparo il record del cliente
|
||||
_rec_clifo = doc.clifor();
|
||||
// Valorizzo la gestione del cambio
|
||||
_doc_cambio._cod_val = doc.valuta();
|
||||
_doc_cambio._is_valuta_estera = doc.valuta().full() && !is_euro_value(doc.valuta());
|
||||
_doc_cambio._cambio = doc.cambio();
|
||||
//_doc_cambio._cod_val = doc.valuta();
|
||||
//_doc_cambio._is_valuta_estera = doc.valuta().full() && !is_euro_value(doc.valuta());
|
||||
//_doc_cambio._cambio = doc.cambio();
|
||||
// Paese del documento
|
||||
_paese = "IT";
|
||||
_has_bolla = false;
|
||||
@ -1359,19 +1359,19 @@ int TDoc_fp::commit()
|
||||
int r = 0;
|
||||
if (_to_commit)
|
||||
{
|
||||
// Controllo stato diagnosticato
|
||||
if (get_no_export_pronto())
|
||||
{
|
||||
_log.log(2, "Le fatture sono state esportate in stato diagnosticato");
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.log(2, "Le fatture sono state esportate correttamente in stato pronto");
|
||||
}
|
||||
|
||||
if (r >= 0 && fp_db().sq_commit())
|
||||
{
|
||||
r += 2;
|
||||
|
||||
// Controllo stato diagnosticato
|
||||
if (get_no_export_pronto())
|
||||
{
|
||||
_log.log(2, "Le fatture sono state esportate in stato diagnosticato");
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.log(2, "Le fatture sono state esportate correttamente in stato pronto");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1493,9 +1493,11 @@ const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
||||
{
|
||||
TString& ret = get_tmp_string();
|
||||
ret.cut(0);
|
||||
if (_doc_cambio._is_valuta_estera)
|
||||
|
||||
|
||||
if (_doc->in_valuta())
|
||||
{
|
||||
TCurrency app(prezzo, _doc_cambio._cod_val, _doc_cambio._cambio, true);
|
||||
TCurrency_documento app(prezzo, *_doc, true);
|
||||
app.change_to_euro_val();
|
||||
ret << app.get_num().string(0);
|
||||
}
|
||||
@ -1791,6 +1793,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
ok &= export_paf3200f();
|
||||
|
||||
TBit_array ddt_linee;
|
||||
|
||||
// <CedentePrestatore>
|
||||
TPaf_record& paf0200f = _paf_container.get_paf("PAF0200F");
|
||||
@ -2158,6 +2161,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
paf1600f.set("PF_DATADDT", dataddt);
|
||||
paf1600f.set("PF_GESTIONE", stato_paf());
|
||||
ddt_linee.set(numlinea);
|
||||
paf1600f.set("PF_RIFNUMLINEA", numlinea++);
|
||||
ok &= insert(paf1600f); // </DatiDDT>
|
||||
}
|
||||
@ -2241,6 +2245,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
{
|
||||
// <DatiDDT>
|
||||
reset(paf1600f);
|
||||
ddt_linee.set(r);
|
||||
paf1600f.set("PF_RIFNUMLINEA", static_cast<long>(r));
|
||||
paf1600f.set("PF_NUMDDDT", a._numdoc);
|
||||
paf1600f.set("PF_DATADDT", a._datadoc);
|
||||
@ -2448,6 +2453,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
reset(paf1600f);
|
||||
paf1600f.set("PF_NUMDDDT", buono->_numdoc);
|
||||
paf1600f.set("PF_DATADDT", buono->_datadoc);
|
||||
while (ddt_linee[rifnumlinea])
|
||||
rifnumlinea++;
|
||||
ddt_linee.set(rifnumlinea);
|
||||
paf1600f.set("PF_RIFNUMLINEA", rifnumlinea++);
|
||||
paf1600f.set("PF_GESTIONE", stato_paf());
|
||||
ok &= insert(paf1600f);
|
||||
@ -2869,16 +2877,15 @@ bool TDoc_fp::doc_to_paf()
|
||||
|
||||
TRectype& TDoc_fp::key_to_doc(const TDoc_key& key)
|
||||
{
|
||||
if (_doc_rec != nullptr)
|
||||
delete _doc_rec;
|
||||
_doc_rec = new TRectype(LF_DOC);
|
||||
_doc_rec->put(DOC_PROVV, key.provv());
|
||||
_doc_rec->put(DOC_ANNO, key.anno());
|
||||
_doc_rec->put(DOC_CODNUM, key.codnum());
|
||||
_doc_rec->put(DOC_NDOC, key.ndoc());
|
||||
SAFE_DELETE(_doc_rec);
|
||||
SAFE_DELETE(_doc);
|
||||
|
||||
_doc = new TDocumentoEsteso(key);
|
||||
_doc_rec = new TRectype(*_doc);
|
||||
|
||||
return *_doc_rec;
|
||||
}
|
||||
TDoc_fp::TDoc_fp(bool provvisorio) : _doc_rec(nullptr), _log(nullptr), _cache_insert(false) , _diagn(provvisorio)
|
||||
TDoc_fp::TDoc_fp(bool provvisorio) : _doc(nullptr), _doc_rec(nullptr), _log(nullptr), _cache_insert(false) , _diagn(provvisorio)
|
||||
{
|
||||
_ditta.init(LF_NDITTE, prefix().get_codditta());
|
||||
_cofi = get_cofi_tras();
|
||||
|
Loading…
x
Reference in New Issue
Block a user