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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;__LONGDOUBLE__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
@ -371,7 +371,7 @@ void TProtocollo::sset(const char* prot)
|
|||||||
_progres = p.get();
|
_progres = p.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString& TProtocollo::get_prot() const
|
const TString& TProtocollo::get_prot_str() const
|
||||||
{
|
{
|
||||||
return prot_in(_year, _tipoprot, _progres);
|
return prot_in(_year, _tipoprot, _progres);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
void set(const TProtocollo& prot);
|
void set(const TProtocollo& prot);
|
||||||
void sset(const char* prot);
|
void sset(const char* prot);
|
||||||
const TString& get_prot() const;
|
const TString& get_prot_str() const;
|
||||||
prot_s get_prot();
|
prot_s get_prot();
|
||||||
|
|
||||||
int get_year() const { return _year; }
|
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_CONT && forn_code == 0 && is_contab && data_range // Filtro solo contabilizzati e data
|
||||||
|| filter_elab == FILTER_ALL) // Tutte
|
|| filter_elab == FILTER_ALL) // Tutte
|
||||||
{
|
{
|
||||||
TToken_string& row = sf.row(-1);
|
|
||||||
if (denom.blank()) {
|
if (denom.blank()) {
|
||||||
denom = fp_db().sq_get("NOME");
|
denom = fp_db().sq_get("NOME");
|
||||||
denom << " " << fp_db().sq_get("COGNOME");
|
denom << " " << fp_db().sq_get("COGNOME");
|
||||||
}
|
}
|
||||||
denom.cut(50);
|
denom.cut(50);
|
||||||
|
|
||||||
row.add(fp_db().sq_get_int("ANNO"), 1);
|
const int row = sf.set_row_cell(S_ANNO, fp_db().sq_get_int("ANNO"));
|
||||||
row.add(fp_db().sq_get("TIPO_SDI"));
|
sf.set_row_cell(S_TIPODOCSDI, fp_db().sq_get("TIPO_SDI"), row);
|
||||||
row.add(fp_db().sq_get("NUM_DOC"));
|
sf.set_row_cell(S_NDOC, fp_db().sq_get("NUM_DOC"), row);
|
||||||
row.add(fp_db().sq_get_date("DATA_RIC"));
|
sf.set_row_cell(S_DATARIC, fp_db().sq_get_date("DATA_RIC"), row);
|
||||||
row.add(fp_db().sq_get_date("DATA_DOC"));
|
sf.set_row_cell(S_DATADOC, fp_db().sq_get_date("DATA_DOC"), row);
|
||||||
row.add(fp_db().sq_get("TOT_DOC"));
|
sf.set_row_cell(S_TOTDOC, fp_db().sq_get("TOT_DOC"), row);
|
||||||
row.add(fppro_db().set_keys(keys).get_ritenute());
|
sf.set_row_cell(S_TOTRIT, fppro_db().set_keys(keys).get_ritenute(), row);
|
||||||
|
|
||||||
// Decido se mettere o meno il flag
|
// Decido se mettere o meno il flag
|
||||||
if (forn_code == 0)
|
sf.set_row_cell(S_FPPRO, forn_code == 0, row);
|
||||||
row.add("X");
|
sf.set_row_cell(S_NUMREGCONT, fp_db().sq_get("NUMREGCONT"), row);
|
||||||
else
|
|
||||||
row.add("");
|
|
||||||
|
if(dataregcont > TDate("20010101"))
|
||||||
row.add(fp_db().sq_get("NUMREGCONT"));
|
sf.set_row_cell(S_DATAREGCONT, dataregcont, row);
|
||||||
if(dataregcont == TDate("20010101"))
|
|
||||||
row.add("");
|
|
||||||
else
|
|
||||||
row.add(dataregcont);
|
|
||||||
// Valorizzo le colonne rimanenti o la tabella degli errori
|
// Valorizzo le colonne rimanenti o la tabella degli errori
|
||||||
if (forn_code >= 0)
|
if (forn_code >= 0)
|
||||||
{
|
{
|
||||||
row.add(clifo.get(CLI_CODCF));
|
sf.set_row_cell(S_FORNITORE, clifo.get(CLI_CODCF), row);
|
||||||
row.add(clifo.get(CLI_RAGSOC));
|
sf.set_row_cell(S_RAGSOC, clifo.get(CLI_RAGSOC), row);
|
||||||
}
|
}
|
||||||
else if (_list_fatt_err.find(denom) == _list_fatt_err.end())
|
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);
|
add_row_err_forn(forn_code, sf_err, denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
row.add(paa_codpaese, sf.cid2index(S_STATOPAIV));
|
sf.set_row_cell(S_STATOPAIV, paa_codpaese, row);
|
||||||
row.add(paa_piva);
|
sf.set_row_cell(S_PARIVA, paa_piva, row);
|
||||||
row.add(paa_codfisc);
|
sf.set_row_cell(S_CODFISC, paa_codfisc, row);
|
||||||
row.add(fp_db().sq_get("ATTACHMENT") != "0" ? "" : "X");
|
sf.set_row_cell(S_ATTACH, fp_db().sq_get("ATTACHMENT")!="0", row);
|
||||||
row.add(denom);
|
sf.set_row_cell(S_RAGXML, denom, row);
|
||||||
row.add(TProtocollo(fp_db().sq_get_int("ANNO_PROT"), fp_db().sq_get("TIPO_PROT"), fp_db().sq_get("NUM_PROT")));
|
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);
|
||||||
row.add(keys);
|
sf.set_row_cell(S_PROKEY, keys, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -481,6 +481,7 @@ class TDoc_fp : public TObject
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
TRectype* _doc_rec;
|
TRectype* _doc_rec;
|
||||||
|
TDocumentoEsteso* _doc;
|
||||||
TCli_for _rec_clifo;
|
TCli_for _rec_clifo;
|
||||||
TAnagrafica _ditta;
|
TAnagrafica _ditta;
|
||||||
TString16 _cofi;
|
TString16 _cofi;
|
||||||
@ -528,13 +529,14 @@ private:
|
|||||||
|
|
||||||
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
std::map<TString, TRiepilogo_agg> _riepilogo_agg;
|
||||||
|
|
||||||
|
/*
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool _is_valuta_estera{ false }; // Se il documento in valuta estera
|
bool _is_valuta_estera{ false }; // Se il documento in valuta estera
|
||||||
TString4 _cod_val;
|
TString4 _cod_val;
|
||||||
real _cambio;
|
real _cambio;
|
||||||
} _doc_cambio;
|
} _doc_cambio;
|
||||||
|
*/
|
||||||
//int parse_line(const TString& line, TString& var, TString& val) const;
|
//int parse_line(const TString& line, TString& var, TString& val) const;
|
||||||
//bool create_table(TScanner& paf, const TString& table);
|
//bool create_table(TScanner& paf, const TString& table);
|
||||||
|
|
||||||
|
@ -1260,9 +1260,9 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
|||||||
// Preparo il record del cliente
|
// Preparo il record del cliente
|
||||||
_rec_clifo = doc.clifor();
|
_rec_clifo = doc.clifor();
|
||||||
// Valorizzo la gestione del cambio
|
// Valorizzo la gestione del cambio
|
||||||
_doc_cambio._cod_val = doc.valuta();
|
//_doc_cambio._cod_val = doc.valuta();
|
||||||
_doc_cambio._is_valuta_estera = doc.valuta().full() && !is_euro_value(doc.valuta());
|
//_doc_cambio._is_valuta_estera = doc.valuta().full() && !is_euro_value(doc.valuta());
|
||||||
_doc_cambio._cambio = doc.cambio();
|
//_doc_cambio._cambio = doc.cambio();
|
||||||
// Paese del documento
|
// Paese del documento
|
||||||
_paese = "IT";
|
_paese = "IT";
|
||||||
_has_bolla = false;
|
_has_bolla = false;
|
||||||
@ -1359,19 +1359,19 @@ int TDoc_fp::commit()
|
|||||||
int r = 0;
|
int r = 0;
|
||||||
if (_to_commit)
|
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())
|
if (r >= 0 && fp_db().sq_commit())
|
||||||
{
|
{
|
||||||
r += 2;
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -1493,9 +1493,11 @@ const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
|||||||
{
|
{
|
||||||
TString& ret = get_tmp_string();
|
TString& ret = get_tmp_string();
|
||||||
ret.cut(0);
|
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();
|
app.change_to_euro_val();
|
||||||
ret << app.get_num().string(0);
|
ret << app.get_num().string(0);
|
||||||
}
|
}
|
||||||
@ -1791,6 +1793,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
|
|
||||||
ok &= export_paf3200f();
|
ok &= export_paf3200f();
|
||||||
|
|
||||||
|
TBit_array ddt_linee;
|
||||||
|
|
||||||
// <CedentePrestatore>
|
// <CedentePrestatore>
|
||||||
TPaf_record& paf0200f = _paf_container.get_paf("PAF0200F");
|
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_DATADDT", dataddt);
|
||||||
paf1600f.set("PF_GESTIONE", stato_paf());
|
paf1600f.set("PF_GESTIONE", stato_paf());
|
||||||
|
ddt_linee.set(numlinea);
|
||||||
paf1600f.set("PF_RIFNUMLINEA", numlinea++);
|
paf1600f.set("PF_RIFNUMLINEA", numlinea++);
|
||||||
ok &= insert(paf1600f); // </DatiDDT>
|
ok &= insert(paf1600f); // </DatiDDT>
|
||||||
}
|
}
|
||||||
@ -2241,6 +2245,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
{
|
{
|
||||||
// <DatiDDT>
|
// <DatiDDT>
|
||||||
reset(paf1600f);
|
reset(paf1600f);
|
||||||
|
ddt_linee.set(r);
|
||||||
paf1600f.set("PF_RIFNUMLINEA", static_cast<long>(r));
|
paf1600f.set("PF_RIFNUMLINEA", static_cast<long>(r));
|
||||||
paf1600f.set("PF_NUMDDDT", a._numdoc);
|
paf1600f.set("PF_NUMDDDT", a._numdoc);
|
||||||
paf1600f.set("PF_DATADDT", a._datadoc);
|
paf1600f.set("PF_DATADDT", a._datadoc);
|
||||||
@ -2448,6 +2453,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
reset(paf1600f);
|
reset(paf1600f);
|
||||||
paf1600f.set("PF_NUMDDDT", buono->_numdoc);
|
paf1600f.set("PF_NUMDDDT", buono->_numdoc);
|
||||||
paf1600f.set("PF_DATADDT", buono->_datadoc);
|
paf1600f.set("PF_DATADDT", buono->_datadoc);
|
||||||
|
while (ddt_linee[rifnumlinea])
|
||||||
|
rifnumlinea++;
|
||||||
|
ddt_linee.set(rifnumlinea);
|
||||||
paf1600f.set("PF_RIFNUMLINEA", rifnumlinea++);
|
paf1600f.set("PF_RIFNUMLINEA", rifnumlinea++);
|
||||||
paf1600f.set("PF_GESTIONE", stato_paf());
|
paf1600f.set("PF_GESTIONE", stato_paf());
|
||||||
ok &= insert(paf1600f);
|
ok &= insert(paf1600f);
|
||||||
@ -2869,16 +2877,15 @@ bool TDoc_fp::doc_to_paf()
|
|||||||
|
|
||||||
TRectype& TDoc_fp::key_to_doc(const TDoc_key& key)
|
TRectype& TDoc_fp::key_to_doc(const TDoc_key& key)
|
||||||
{
|
{
|
||||||
if (_doc_rec != nullptr)
|
SAFE_DELETE(_doc_rec);
|
||||||
delete _doc_rec;
|
SAFE_DELETE(_doc);
|
||||||
_doc_rec = new TRectype(LF_DOC);
|
|
||||||
_doc_rec->put(DOC_PROVV, key.provv());
|
_doc = new TDocumentoEsteso(key);
|
||||||
_doc_rec->put(DOC_ANNO, key.anno());
|
_doc_rec = new TRectype(*_doc);
|
||||||
_doc_rec->put(DOC_CODNUM, key.codnum());
|
|
||||||
_doc_rec->put(DOC_NDOC, key.ndoc());
|
|
||||||
return *_doc_rec;
|
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());
|
_ditta.init(LF_NDITTE, prefix().get_codditta());
|
||||||
_cofi = get_cofi_tras();
|
_cofi = get_cofi_tras();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user