Patch level : 12.0 668
Files correlati : fp Commento : - Aggiunta gestione F8: con il flag attivo viene data la possibilità di segnare gli XML in uscita in errore - Aggiunto flag F8 in impostazione - Aggiunta funzione set_err_paf() che segnala il paf come errato - Corretta lettura causale 770
This commit is contained in:
parent
c2d8521a92
commit
c58fcc0660
@ -43,6 +43,7 @@ void TParametri_mask::save_all() const
|
||||
fp_settings().set_cofi_tras(get(F_COFI));
|
||||
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
||||
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
|
||||
fp_settings().set_f8(get_bool(F_F8));
|
||||
}
|
||||
|
||||
void TParametri_mask::load_all()
|
||||
@ -56,6 +57,7 @@ void TParametri_mask::load_all()
|
||||
set(F_COFI, fp_settings().get_cofi_tras());
|
||||
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
|
||||
set(F_ESPORTADOC, fp_settings().get_allega_fat());
|
||||
set(F_F8, fp_settings().is_f8());
|
||||
}
|
||||
|
||||
void TParametri_mask::tipi_import() const
|
||||
|
@ -7,6 +7,7 @@
|
||||
#define F_COFI 107
|
||||
#define F_ESPORTAALLEG 108
|
||||
#define F_ESPORTADOC 109
|
||||
#define F_F8 110
|
||||
|
||||
#define F_SETPATCH 201
|
||||
#define F_ENPTYTABLE 202
|
||||
|
@ -52,6 +52,11 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BOOLEAN F_F8
|
||||
BEGIN
|
||||
PROMPT 50 8 "Gestione F8"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 10 "@BConfigurazione Allegati"
|
||||
|
@ -35,6 +35,7 @@ protected:
|
||||
bool check_not_empty();
|
||||
bool check_full_fields() const;
|
||||
bool check_doc_filter(const TDocumentoEsteso& td) const;
|
||||
void set_err_paf();
|
||||
void fill();
|
||||
void init();
|
||||
bool is_fattura(const TRectype& doc) const;
|
||||
@ -167,8 +168,10 @@ void TPA_mask::fill()
|
||||
|
||||
#ifdef DBG
|
||||
enable(DLG_OK);
|
||||
enable(DLG_SAVEREC);
|
||||
#else
|
||||
enable(DLG_OK, filter_selected != "X");
|
||||
enable(DLG_SAVEREC, fp_settings().is_f8() && filter_selected == "X");
|
||||
#endif
|
||||
|
||||
// Record di controllo per eventuali elaborazioni precedenti
|
||||
@ -341,6 +344,12 @@ bool TPA_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLG_SAVEREC:
|
||||
{
|
||||
if (e == fe_button)
|
||||
set_err_paf();
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
if((e == fe_modify || e >= se_enter) && jolly == 0)
|
||||
@ -416,6 +425,65 @@ bool TPA_mask::check_doc_filter(const TDocumentoEsteso& d) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void TPA_mask::set_err_paf()
|
||||
{
|
||||
// Vado a riportare sui paf l'errore
|
||||
TSheet_field& sfld = sfield(F_DOCS);
|
||||
TString_array& sht = sfld.rows_array();
|
||||
TLocalisamfile fdoc(LF_DOC);
|
||||
TRectype doc(LF_DOC);
|
||||
if (!sht.empty())
|
||||
{
|
||||
TProgress_monitor pi(sht.items(), "Cambio stato fatture");
|
||||
FOR_EACH_ARRAY_ROW(sht, r, riga)
|
||||
{
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
|
||||
if (riga->starts_with("X"))
|
||||
{
|
||||
const int anno = riga->get_int(sfield(F_DOCS).cid2index(S_ANNO));
|
||||
const long ndoc = riga->get_long(sfield(F_DOCS).cid2index(S_NDOC));
|
||||
const TFixed_string codnum(riga->get(sfield(F_DOCS).cid2index(S_CODNUM))); // lascio sapientemente per ultima la get di una stringa
|
||||
const TDoc_key key(anno, codnum, ndoc);
|
||||
|
||||
// Verifico che il codice sdi nello sheet sia lo stesso sulla testata del documento in caso contrario lo aggiorno
|
||||
doc.zero();
|
||||
doc.put(DOC_PROVV, key.provv());
|
||||
doc.put(DOC_ANNO, key.anno());
|
||||
doc.put(DOC_CODNUM, key.codnum());
|
||||
doc.put(DOC_NDOC, key.ndoc());
|
||||
|
||||
TString hfatt, bfatt;
|
||||
TPaf_record paf0100f("PAF0100F");
|
||||
if (doc.read(fdoc) == NOERR && chiave_paf(doc, hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
|
||||
{
|
||||
TString query = "UPDATE PAF0100F SET P1_GESTIONE = 'E' WHERE P1_KEYHEADERFATT = '"; query << hfatt << "' AND P1_KEYBODYFATT = '" << bfatt << "';";
|
||||
if(!fp_db().sq_set_exec(query))
|
||||
{
|
||||
TString err = "Impossibile salvare la fattura "; err << anno << " " << codnum << " " << ndoc << "\nVerrà saltata.";
|
||||
error_box(err);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
TString err = "Impossibile trovare la fattura "; err << anno << " " << codnum << " " << ndoc << "\nVerrà saltata.";
|
||||
error_box(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
fp_db().sq_commit();
|
||||
}
|
||||
|
||||
// Mi sposto nella prima pagina, setto il flag di dirty sul filtro e mi risposto
|
||||
// Lo faccio perchè eliminando la riga direttamente e chiamando la force_update() si crea un bug che cliccando sulla prima riga viene mostrata quella che c'era prima della eliminazione
|
||||
TAutomask::next_page(0);
|
||||
set_focus_field(F_DATAINI);
|
||||
_filter_changed = true;
|
||||
next_page(1);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// TDoc2Paf
|
||||
|
@ -2,7 +2,28 @@
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
#include <allbar.h>
|
||||
BUTTON DLG_ALL 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "~Tutti"
|
||||
PICTURE TOOL_MULTISEL
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "Elabora"
|
||||
PICTURE TOOL_ELABORA
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON DLG_SAVEREC 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "Elimina"
|
||||
PICTURE TOOL_WARNING
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
#include <helpbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Fatturazione Elettronica" 0 2 0 0
|
||||
|
@ -165,7 +165,7 @@ public:
|
||||
const bool get_esp_pri_empty() const;
|
||||
const bool get_esp_est() const;
|
||||
const TString& get_esp_est_cod() const;
|
||||
|
||||
const bool is_f8() const;
|
||||
|
||||
// Setters
|
||||
void set_db_indirizzo(const TString& ind) const;
|
||||
@ -180,6 +180,7 @@ public:
|
||||
void set_esp_pri_empty(bool esp_pri) const;
|
||||
void set_esp_est(bool esp_est) const;
|
||||
void set_esp_est_cod(const TString& esp_est_cod) const;
|
||||
void set_f8(bool f8) const;
|
||||
};
|
||||
|
||||
inline TFP_settings& fp_settings()
|
||||
|
@ -1509,7 +1509,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf0700f.set("P7_IMPORTORIT", converti_prezzo(doc.imponibile() * sp.perc() / CENTO));
|
||||
paf0700f.set("P7_ALIQUOTARIT", TCodiceIVA(sp.cod_iva()).percentuale());
|
||||
static TString caus770; caus770.cut(0); caus770.format("%02d", sp.caus_770());
|
||||
paf0700f.set("P7_CAUSPAGAM", cache().get("CA7", caus770, "S2"));
|
||||
paf0700f.set("P7_CAUSPAGAM", cache().get("%CA7", caus770, "S2"));
|
||||
}
|
||||
// </DatiRitenuta>
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define FP_ESP_PRI "esppri"
|
||||
#define FP_ESP_EST "espest"
|
||||
#define FP_ESP_EST_COD "espestcod"
|
||||
#define FP_F8 "f8"
|
||||
|
||||
|
||||
const TString& TFP_settings::get_db_indirizzo() const
|
||||
@ -82,6 +83,11 @@ const TString& TFP_settings::get_esp_est_cod() const
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_ESP_EST_COD, "XXXXXXX");
|
||||
}
|
||||
|
||||
const bool TFP_settings::is_f8() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
|
||||
}
|
||||
|
||||
void TFP_settings::set_db_indirizzo(const TString& ind) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
|
||||
@ -142,3 +148,8 @@ void TFP_settings::set_esp_est_cod(const TString& esp_est_cod) const
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_ESP_EST_COD, esp_est_cod);
|
||||
}
|
||||
|
||||
void TFP_settings::set_f8(const bool f8) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user