Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00
This commit is contained in:
commit
9fbe73153a
@ -1,10 +1,14 @@
|
||||
#include <experimental/filesystem>
|
||||
|
||||
#include "f90.h"
|
||||
#include "f90100.h"
|
||||
|
||||
#include "lffiles.h"
|
||||
#include "isam.h"
|
||||
#include "../f1/f1lib.h"
|
||||
#include "../fp/fplib.h"
|
||||
#include "urldefid.h"
|
||||
#include "progind.h"
|
||||
#include "f90100.h"
|
||||
#include "f901tab.h"
|
||||
#include "f90100b.h"
|
||||
#include "f90100d.h"
|
||||
@ -197,6 +201,7 @@ int TEstrai_mask::estrai()
|
||||
delete progr;
|
||||
|
||||
_stats = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
// Effettiva estrazione. Faccio partire diagnostica e scrittura db.
|
||||
const result_estr result = _estrazione->estrai();
|
||||
#ifdef DBG
|
||||
TString msg;
|
||||
@ -392,8 +397,15 @@ void TMonitor_mask::controllo_errori() const
|
||||
warning_box("Selezionare un'estrazione.");
|
||||
}
|
||||
|
||||
void TMonitor_mask::delete_estr_fld(const TString& idestr)
|
||||
{
|
||||
static const TFilename dir = TString() << F9CONF.get_addr_doc() << SLASH << F9CONF.get_ambiente() << SLASH << idestr << SLASH;
|
||||
unsigned long long i = experimental::filesystem::remove_all((const char*)dir);
|
||||
}
|
||||
|
||||
void TMonitor_mask::delete_pack(const bool all) const
|
||||
{
|
||||
// Se nello sheet non c'e' selezionata alcuna riga viene richiamata col flag all = true
|
||||
bool flag = false;
|
||||
TSheet_field& sf = sfield(S_ELAB);
|
||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||
@ -409,7 +421,7 @@ void TMonitor_mask::delete_pack(const bool all) const
|
||||
" SELECT @stato = " DRD_STATO "\n"
|
||||
" FROM " F9_DRD "\n"
|
||||
" WHERE " DRD_ID_EST " = '" << id_estr << "';\n\n"
|
||||
" IF(@stato = '" D_GEST_ERR "') BEGIN\n"
|
||||
" IF(@stato = '" D_GEST_ERR "' OR @stato = '" IN_DIAGN "') BEGIN\n"
|
||||
" DELETE FROM " F9_ERR " WHERE " ERR_CODSOC " = '" << codsoc << "' AND " ERR_IDESTR " = '" << id_estr << "';\n"
|
||||
" END\n"
|
||||
" ELSE BEGIN\n"
|
||||
@ -423,7 +435,7 @@ void TMonitor_mask::delete_pack(const bool all) const
|
||||
" SELECT @flag_prov = " DRD_FLAG_PD ", @stato = " DRD_STATO "\n"
|
||||
" FROM " F9_DRD "\n"
|
||||
" WHERE " DRD_ID_EST " = '" << id_estr << "';\n\n"
|
||||
" IF (@flag_prov = 'P' OR @stato = '" D_GEST_ERR "') BEGIN\n"
|
||||
" IF (@flag_prov = 'P' OR @stato = '" D_GEST_ERR "' OR @stato = '" IN_DIAGN "') BEGIN\n"
|
||||
" DELETE FROM " F9_DRD " WHERE " DRD_CODSOC " = '" << codsoc << "' AND " DRD_ID_EST " = '" << id_estr << "';\n"
|
||||
" DELETE FROM " F9_IVA " WHERE " IVA_CODSOC " = '" << codsoc << "' AND " IVA_IDLAN " = '" << id_estr << "';\n"
|
||||
" DELETE FROM " F9_MOVESTR " WHERE " MES_CODSOC " = '" << codsoc << "' AND " MES_IDESTR " = '" << id_estr << "';\n"
|
||||
@ -437,6 +449,7 @@ void TMonitor_mask::delete_pack(const bool all) const
|
||||
return;
|
||||
}
|
||||
fp_db().sq_commit();
|
||||
delete_estr_fld(id_estr);
|
||||
if (!all)
|
||||
break;
|
||||
}
|
||||
@ -452,7 +465,7 @@ void TMonitor_mask::delete_pack(const bool all) const
|
||||
void TMonitor_mask::fill() const
|
||||
{
|
||||
TString query;
|
||||
query << "SELECT * FROM F9DRD00K ORDER BY " << DRD_TIME << " DESC;";
|
||||
query << "SELECT * FROM F9DRD00K WHERE " DRD_CODSOC " = '" << F9CONF.get_ambiente() << "' ORDER BY " << DRD_TIME << " DESC;";
|
||||
fp_db().sq_set_exec(query, false);
|
||||
|
||||
TSheet_field& sf = sfield(S_ELAB);
|
||||
|
@ -147,6 +147,7 @@ class TMonitor_mask : public TAutomask
|
||||
|
||||
// Controllo estr. mask
|
||||
void controllo_errori() const;
|
||||
static void delete_estr_fld(const TString& idestr);
|
||||
void delete_pack(bool all = false) const;
|
||||
|
||||
// Riempie sheet per visualizzare le estrazioni
|
||||
|
@ -222,9 +222,9 @@ void TF9_categorie_doc_msk::new_annesso(const TString& catdoc_padre)
|
||||
TCategorie_doc::annesso ann;
|
||||
if (!_categorie_doc.get_ann(catann, ann))
|
||||
{
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
correct_spell_catdoc(catann);
|
||||
_categorie_doc.add_annesso(catdoc_padre, catann, descr, tipo, obblig);
|
||||
fill_annessi(catdoc_padre);
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
|
||||
#include "annessif9.h"
|
||||
#include "applicat.h"
|
||||
#include "automask.h"
|
||||
@ -120,7 +119,15 @@ bool TImport_msk::catdocann_handler(TMask_field& field, KEY key)
|
||||
if (annessi && annessi->items() > 0)
|
||||
{
|
||||
if (annessi->run() == K_ENTER)
|
||||
msk.set(F_CATDOCANN, annessi->row(annessi->selected()).get(0));
|
||||
{
|
||||
const char* s = annessi->row(annessi->selected()).get(0);
|
||||
TCategorie_doc::annesso annesso;
|
||||
categorie_doc().get_ann(s, annesso);
|
||||
if (annesso.opcee != "RC")
|
||||
msk.set(F_CATDOCANN, annesso.catdoc);
|
||||
else
|
||||
warning_box("Impossibile importare un annesso cartaceo per un prospetto integrativo per Reverse Charge.");
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box(msg_notexist);
|
||||
@ -211,6 +218,7 @@ class TGestione_doc_cartacei_f9_msk : public TAutomask
|
||||
TString user;
|
||||
};
|
||||
const TString& _addr_cart; // Indirizzo cartella doc. cartacei F9
|
||||
std::unique_ptr<TMask> _config_msk;
|
||||
std::unique_ptr<std::set<TString>> _extensions; // todo: controllare che con TString funzioni l'ordinamento, quindi la find
|
||||
std::unique_ptr<TImport_msk> _import_msk;
|
||||
std::map<TString, doc_cart_t> _list_file;
|
||||
@ -218,7 +226,7 @@ class TGestione_doc_cartacei_f9_msk : public TAutomask
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
|
||||
void check_addr_cart() const;
|
||||
void check_addr_cart();
|
||||
static void check_deleted();
|
||||
bool check_file_exist(const TString& file) const;
|
||||
void delete_file();
|
||||
@ -229,8 +237,8 @@ class TGestione_doc_cartacei_f9_msk : public TAutomask
|
||||
void fill_docs();
|
||||
static TToken_string& get_valid_extensions();
|
||||
void load_extensions();
|
||||
bool load_file(const TFilename& file, const TString& numreg, bool is_annesso, const TString& catannpadre, const TString& catdocann);
|
||||
void open_config_win() const;
|
||||
static bool load_file(const TFilename& file, const TString& numreg, bool is_annesso, const TString& catannpadre, const TString& catdocann);
|
||||
void open_config_win();
|
||||
void open_import_win();
|
||||
static void remove_file_from_f9cart(const std::set<TString>& files);
|
||||
bool verify_extension(const TFilename& file);
|
||||
@ -261,7 +269,7 @@ bool TGestione_doc_cartacei_f9_msk::on_field_event(TOperable_field& o, TField_ev
|
||||
case DLG_USER:
|
||||
if (e == fe_button)
|
||||
{
|
||||
int page = curr_page();
|
||||
const int page = curr_page();
|
||||
if (!page)
|
||||
edit_file();
|
||||
else
|
||||
@ -272,7 +280,7 @@ bool TGestione_doc_cartacei_f9_msk::on_field_event(TOperable_field& o, TField_ev
|
||||
return true;
|
||||
}
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::check_addr_cart() const
|
||||
void TGestione_doc_cartacei_f9_msk::check_addr_cart()
|
||||
{
|
||||
const TFilename f(_addr_cart);
|
||||
if (f.full() && !f.exist())
|
||||
@ -503,7 +511,7 @@ void TGestione_doc_cartacei_f9_msk::fill_annessi()
|
||||
}
|
||||
msg << "\n" << *it << " [Num. Reg.: " << _list_ann.find(*it)->second.numreg << "]";
|
||||
}
|
||||
const bool del = warning_box(msg);
|
||||
warning_box(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -646,6 +654,22 @@ bool TGestione_doc_cartacei_f9_msk::load_file(const TFilename& file, const TStri
|
||||
}
|
||||
else
|
||||
{
|
||||
// Controllo che non sto gia' utilizzando questa categoria di annesso per questa registrazione
|
||||
// Prendo la lista degli annessi per questa registrazione e li controllo in cerca della categoria
|
||||
TF9_doccart doccart;
|
||||
vector<annesso_t> list_annessi;
|
||||
doccart.mov2listann_vect(numreg, list_annessi);
|
||||
bool exist = false;
|
||||
for(auto it = list_annessi.begin(); it != list_annessi.end(); ++it)
|
||||
{
|
||||
if(it->catdocann == catdocann)
|
||||
exist = true;
|
||||
}
|
||||
if(exist)
|
||||
{
|
||||
message_box("Attenzione: la registrazione num. %s ha gia' un annesso associato con questo tipo di annesso.", (const char*)numreg);
|
||||
return false;
|
||||
}
|
||||
f9annessi.zero();
|
||||
f9annessi.put(F9A_NUMREG, numreg);
|
||||
f9annessi.put(F9A_FILENAME, file.name());
|
||||
@ -680,47 +704,46 @@ bool TGestione_doc_cartacei_f9_msk::load_file(const TFilename& file, const TStri
|
||||
return true;
|
||||
}
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::open_config_win() const
|
||||
void TGestione_doc_cartacei_f9_msk::open_config_win()
|
||||
{
|
||||
static std::unique_ptr<TMask> msk;
|
||||
if(msk == nullptr)
|
||||
if(_config_msk == nullptr)
|
||||
{
|
||||
msk = std::make_unique<TMask>("Configurazione", 1, 78, 14);
|
||||
msk->add_button_tool(DLG_OK, "Conferma", TOOL_OK);
|
||||
msk->add_button_tool(DLG_NULL, "", 0);
|
||||
msk->add_button_tool(DLG_QUIT, "Esci", TOOL_QUIT);
|
||||
_config_msk = std::make_unique<TMask>("Configurazione", 1, 78, 14);
|
||||
_config_msk->add_button_tool(DLG_OK, "Conferma", TOOL_OK);
|
||||
_config_msk->add_button_tool(DLG_NULL, "", 0);
|
||||
_config_msk->add_button_tool(DLG_QUIT, "Esci", TOOL_QUIT);
|
||||
|
||||
msk->add_groupbox(DLG_NULL, 0, "", 1, 0, 76, 4, "");
|
||||
msk->add_static (DLG_NULL, 0, "@BInserire estensioni file riconosciute, separate da virgola.", 2, 1);
|
||||
msk->add_string (101, 0, "Estensioni:", 2, 2, 255, "", 60);
|
||||
msk->add_groupbox(DLG_NULL, 0, "@BCartella documenti cartacei", 1, 4, 76, 4);
|
||||
msk->add_static (DLG_NULL, 0, "@BInserire nome cartella, all'interno della area dati della ditta", 2, 5);
|
||||
msk->add_string (102, 0, "", 2, 6, 64, "", 30);
|
||||
_config_msk->add_groupbox(DLG_NULL, 0, "", 1, 0, 76, 4, "");
|
||||
_config_msk->add_static (DLG_NULL, 0, "@BInserire estensioni file riconosciute, separate da virgola.", 2, 1);
|
||||
_config_msk->add_string (101, 0, "Estensioni:", 2, 2, 255, "", 60);
|
||||
_config_msk->add_groupbox(DLG_NULL, 0, "@BCartella documenti cartacei", 1, 4, 76, 4);
|
||||
_config_msk->add_static (DLG_NULL, 0, "@BInserire nome cartella, all'interno della area dati della ditta", 2, 5);
|
||||
_config_msk->add_string (102, 0, "", 2, 6, 64, "", 30);
|
||||
|
||||
msk->set(101, F9CONF.get_estensioni());
|
||||
_config_msk->set(101, F9CONF.get_estensioni());
|
||||
TString s = F9CONF.get_addr_cart();
|
||||
s.rtrim(1);
|
||||
s.ltrim(s.rfind('\\') + 1);
|
||||
msk->set(102, s);
|
||||
_config_msk->set(102, s);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (msk->run() != K_ENTER)
|
||||
if (_config_msk->run() != K_ENTER)
|
||||
{
|
||||
if (msk->get(102).empty())
|
||||
if (_config_msk->get(102).empty())
|
||||
{
|
||||
warning_box("Si prega di inserire il nome della cartella per i documenti cartacei.");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
F9CONF.set_estensioni(msk->get(101));
|
||||
TString dir = msk->get(102);
|
||||
F9CONF.set_estensioni(_config_msk->get(101));
|
||||
TString dir = _config_msk->get(102);
|
||||
if (dir.empty())
|
||||
{
|
||||
if(yesno_box("Nome cartella vuoto.\nCreare cartella con nome 'Cartacei_F9'?"))
|
||||
msk->set(102, dir = "Cartacei_F9");
|
||||
_config_msk->set(102, dir = "Cartacei_F9");
|
||||
else continue;
|
||||
}
|
||||
|
||||
@ -765,7 +788,10 @@ void TGestione_doc_cartacei_f9_msk::open_import_win()
|
||||
if (!is_annesso || catannpadre.full() && catdocann.full())
|
||||
{
|
||||
if (load_file(f, numreg, is_annesso, catannpadre, catdocann))
|
||||
{
|
||||
message_box("File caricato.");
|
||||
fill();
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box("Se il documento e' un annesso, si prega di inserire le\ninformazioni per la categoria documentale dell'annesso.");
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <Windows.h>
|
||||
|
||||
#include "f9lib01.h"
|
||||
|
||||
#include "f1lib.h"
|
||||
@ -97,6 +99,14 @@ bool TEstrazione::check_annessi_oblig(const TString& catdoc, const TString& numr
|
||||
return ok_ann;
|
||||
}
|
||||
|
||||
bool TEstrazione::check_cartaceo_acq(const movimento_t& movimento)
|
||||
{
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << movimento.numreg;
|
||||
return filecart.mov2doc(reg, file) && file.exist();
|
||||
}
|
||||
|
||||
bool TEstrazione::check_documento_vendita(const TLocalisamfile& mov, _Out_ bool& exist_doc)
|
||||
{
|
||||
if (!mov.get(MOV_DPROVV).empty() && !mov.get(MOV_DANNO).empty() && !mov.get(MOV_DCODNUM).empty() && !mov.get(MOV_DNDOC).empty())
|
||||
@ -163,7 +173,37 @@ bool TEstrazione::check_periodo_def() const
|
||||
|
||||
void TEstrazione::copy_file_to_webapp_fld(const movimento_t& movimento) const
|
||||
{
|
||||
// todo:
|
||||
// f9pwa + ambiente + idlancio(ID drd) + categoria_documento(drt) + nome_documento
|
||||
static const TFilename base = TString() << _head.addr_cart << SLASH << _head.cod_soc << SLASH << _head.id_estr << SLASH;
|
||||
TToken_string categorie;
|
||||
TToken_string files;
|
||||
|
||||
if(movimento.cartaceo && movimento.catdoc != nullptr)
|
||||
{
|
||||
categorie.add(movimento.catdoc->catdoc, 0);
|
||||
files.add(movimento.nomefilecart, 0);
|
||||
}
|
||||
if(!movimento.annessi.empty())
|
||||
{
|
||||
for (auto it = movimento.annessi.begin(); it != movimento.annessi.end(); ++it)
|
||||
{
|
||||
categorie.add(it->catdocann);
|
||||
files.add(TF9_doccart::get_full_path_file_cartaceo(it->filename));
|
||||
}
|
||||
}
|
||||
#ifdef DBG
|
||||
CHECK(files.items() == categorie.items(), "copy_file_to_webapp_fld: Numero di file diverso dal numero di categorie");
|
||||
#endif
|
||||
|
||||
for(int i = 0; i < files.items(); ++i)
|
||||
{
|
||||
TFilename file = files.get(i);
|
||||
TFilename dest; dest << base << categorie.get(i) << SLASH << file.name();
|
||||
make_dir(dest.path());
|
||||
const bool f = CopyFile(file, dest, false);
|
||||
if (!f)
|
||||
error_box("Errore nel copiare il file nella cartella di destinazione: %s", (const char*)dest);
|
||||
}
|
||||
}
|
||||
|
||||
void TEstrazione::fill_id(TLocalisamfile& clifo, TString& statopaiv, TString& idfisc, TString& paiv, TString& codfis)
|
||||
@ -416,10 +456,7 @@ const char* TEstrazione::diagnostica_mov()
|
||||
const int numreg = mov_i.numreg;
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
#ifdef DBG
|
||||
if (mov.read() != NOERR)
|
||||
warning_box("OOOOOOOOOHH! E DICE SIII!!");
|
||||
#endif
|
||||
|
||||
mov_i.cartaceo = !is_doc_xml(mov);
|
||||
const state_fppro res = check_fppro(numreg);
|
||||
switch (res)
|
||||
@ -430,7 +467,6 @@ const char* TEstrazione::diagnostica_mov()
|
||||
case correct:
|
||||
ok &= true;
|
||||
mov_i.err = false;
|
||||
mov_i.state = res;
|
||||
break;
|
||||
|
||||
// ERRORS
|
||||
@ -440,7 +476,6 @@ const char* TEstrazione::diagnostica_mov()
|
||||
mov_i.err = false;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_estr = movimento_t::no_fa;
|
||||
mov_i.state = res;
|
||||
++_stats.fa_skip;
|
||||
break;
|
||||
|
||||
@ -450,48 +485,63 @@ const char* TEstrazione::diagnostica_mov()
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Errore controllo movimento: associazione movimento con fattura elettronica passiva sbagliato.";
|
||||
mov_i.state = res;
|
||||
break;
|
||||
case err_read_db:
|
||||
ok &= false;
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Errore controllo movimento: errore lettura db.";
|
||||
mov_i.state = res;
|
||||
break;
|
||||
case no_guessed:
|
||||
ok &= false;
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non associato a fattura elettr. abbinamento automatico non riuscito. Abbinare manualmente, o escludere";
|
||||
mov_i.state = res;
|
||||
// Controllo se esiste il cartaceo es. forfettari
|
||||
if(check_cartaceo_acq(mov_i))
|
||||
{
|
||||
ok &= true;
|
||||
mov_i.err = false;
|
||||
mov_i.cartaceo = true;
|
||||
mov_i.estratto = true;
|
||||
mov_i.descr_err = "";
|
||||
mov_i.state = correct;
|
||||
}
|
||||
else
|
||||
{
|
||||
ok &= false;
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non associato a fattura elettr. abbinamento automatico non riuscito. Abbinare manualmente, o escludere";
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
if (mov_i.err)
|
||||
++_stats.fa_err;
|
||||
if(mov_i.state == null_state)
|
||||
mov_i.state = res;
|
||||
|
||||
if (mov_i.err) ++_stats.fa_err;
|
||||
|
||||
/* Per quelli che hanno passato il primo controllo errori controllo che debba essere estratto
|
||||
* secondo le categorie documentali. */
|
||||
if (!mov_i.err && mov_i.estratto)
|
||||
{
|
||||
std::shared_ptr<TCategorie_doc::classe_doc> cd = categorie_doc().mov2cat(mov_i.numreg);
|
||||
mov_i.estratto = cd.get();
|
||||
mov_i.descr_estr = cd ? movimento_t::no_err : movimento_t::no_catdoc;
|
||||
mov_i.catdoc = cd;
|
||||
|
||||
if (mov_i.catdoc)
|
||||
check_annessi(mov_i, numreg);
|
||||
}
|
||||
if (mov_i.estratto)
|
||||
{
|
||||
if (!mov_i.err)
|
||||
{
|
||||
// Cerco la categoria documentale
|
||||
std::shared_ptr<TCategorie_doc::classe_doc> cd = categorie_doc().mov2cat(mov_i.numreg);
|
||||
mov_i.estratto = cd.get();
|
||||
mov_i.descr_estr = cd ? movimento_t::no_err : movimento_t::no_catdoc;
|
||||
mov_i.catdoc = cd;
|
||||
|
||||
if (mov_i.catdoc)
|
||||
check_annessi(mov_i, numreg);
|
||||
}
|
||||
|
||||
// Se cartaceo preparo il file.
|
||||
if (mov_i.cartaceo)
|
||||
{
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -501,9 +551,10 @@ const char* TEstrazione::diagnostica_mov()
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
}
|
||||
}
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
}
|
||||
ok &= mov_i.err;
|
||||
ok &= !mov_i.err;
|
||||
}
|
||||
}
|
||||
else if (tipo == iva_vendite)
|
||||
@ -524,18 +575,7 @@ const char* TEstrazione::diagnostica_mov()
|
||||
TString numreg; numreg << mov_i.numreg;
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
#ifdef DBG
|
||||
if(mov.read() != NOERR)
|
||||
warning_box("OOOOOOOOOHH! E DICE SIII!!");
|
||||
if (it->numreg == 96956)
|
||||
bool simo = true; // Rev charge
|
||||
if (it->numreg == 95752)
|
||||
bool simo = true; // Cartaceo
|
||||
if (it->numreg == 95740)
|
||||
bool simo = true; // Annessi
|
||||
if (it->numreg == 95222)
|
||||
bool simo = true; // Annessi
|
||||
#endif
|
||||
|
||||
/* Controlli per vendite cambiati:
|
||||
* Elettroniche solo quelle agli italiani, tutti gli altri sono cartacei
|
||||
*/
|
||||
@ -588,23 +628,26 @@ const char* TEstrazione::diagnostica_mov()
|
||||
++_stats.fv_estr;
|
||||
}
|
||||
|
||||
if (mov_i.estratto && mov_i.cartaceo)
|
||||
if (mov_i.estratto)
|
||||
{
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
if(mov_i.cartaceo)
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
else
|
||||
{
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non e' stato possibile reperire il file del documento cartaceo per questo movimento.";
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
TF9_doccart filecart;
|
||||
TFilename file;
|
||||
TString reg; reg << it->numreg;
|
||||
if (filecart.mov2doc(reg, file) && file.exist())
|
||||
{
|
||||
mov_i.nomefilecart << file;
|
||||
}
|
||||
else
|
||||
{
|
||||
mov_i.err = true;
|
||||
mov_i.estratto = false;
|
||||
mov_i.descr_err = "Non e' stato possibile reperire il file del documento cartaceo per questo movimento.";
|
||||
mov_i.descr_estr = movimento_t::no_filecart;
|
||||
}
|
||||
}
|
||||
copy_file_to_webapp_fld(mov_i);
|
||||
}
|
||||
}
|
||||
ok &= !mov_i.err;
|
||||
@ -673,7 +716,7 @@ result_estr TEstrazione::estrai()
|
||||
|
||||
if (_head.stato_estr == D_GEST_ERR)
|
||||
{
|
||||
warning_box("Attenzione l'estrazione ha prodotto degli errori.\n" \
|
||||
warning_box("Attenzione l'estrazione ha prodotto degli errori.\n"
|
||||
"Controllare e correggere eventuali problemi\ndal Controllo Estrazione.");
|
||||
// Se in errore, esporto lista errori sul db
|
||||
if (!export_error_list())
|
||||
@ -703,14 +746,6 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
||||
{
|
||||
if (!bar.add_status())
|
||||
break;
|
||||
#ifdef DBG
|
||||
if (it->numreg == 95752) // Cartaceo
|
||||
bool simo = true;
|
||||
if (it->numreg == 95747) // idfisc errato Arredamenti Riva
|
||||
bool simo = true;
|
||||
if (it->numreg == 95740) // Annessi
|
||||
bool simo = true;
|
||||
#endif
|
||||
|
||||
if (!it->estratto)
|
||||
continue;
|
||||
@ -827,7 +862,7 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
||||
iva_query.add(IVA_USERELA, user());
|
||||
iva_query.add_getdate(IVA_TIMEELA);
|
||||
|
||||
if (_head.tipo_doc == 'A')
|
||||
if (_head.tipo_doc == 'A' && !it->cartaceo)
|
||||
{
|
||||
TToken_string keys(mov.get(MOV_KEYFPPRO), ';');
|
||||
fppro_db().set_keys(keys);
|
||||
@ -1192,8 +1227,8 @@ std::map<TString, TCategorie_doc::annesso>::iterator TCategorie_doc::find_anness
|
||||
void TCategorie_doc::add_annesso(const TString& catdoc_padre, const TString& catdoc_ann, const TString& descr,
|
||||
const TString& class_ann, const bool obblig)
|
||||
{
|
||||
CHECK(catdoc_padre && *catdoc_padre && catdoc_ann && *catdoc_ann && class_ann && *class_ann,
|
||||
"add_annesso failed: some parameters are NULL or keys are empty");
|
||||
if(!(catdoc_padre && *catdoc_padre && catdoc_ann && *catdoc_ann && class_ann && *class_ann))
|
||||
fatal_box("add_annesso failed: some parameters are NULL or keys are empty");
|
||||
annesso ann{ catdoc_padre, catdoc_ann, descr, class_ann, obblig };
|
||||
_rows_annessi.insert({ catdoc_padre, ann });
|
||||
|
||||
@ -1203,10 +1238,8 @@ void TCategorie_doc::add_annesso(const TString& catdoc_padre, const TString& cat
|
||||
void TCategorie_doc::add_categoria(const TString& catdoc, const TString& descr, const TString& class_sost, const TString& caus_sost,
|
||||
const TString& causcont, const TString& tipocaus)
|
||||
{
|
||||
#ifdef DBG
|
||||
CHECK(catdoc && *catdoc && class_sost && *class_sost && caus_sost && *caus_sost,
|
||||
"add_categoria failed: some parameters are NULL or keys are empty");
|
||||
#endif
|
||||
if(!(catdoc && *catdoc && class_sost && *class_sost && caus_sost && *caus_sost))
|
||||
fatal_box("add_categoria failed: some parameters are NULL or keys are empty");
|
||||
classe_doc cd = { catdoc, descr, class_sost, caus_sost, causcont, tipocaus };
|
||||
_rows.emplace_back(std::make_shared<classe_doc>(cd));
|
||||
save_cat();
|
||||
@ -1383,6 +1416,9 @@ TCategorie_doc::TCategorie_doc() : _mode_sheet(MODE_SHEETS)
|
||||
load_all();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TRecord_categorie
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -343,8 +343,9 @@ class TEstrazione : public TObject
|
||||
bool update_drd_stato_estr() const;
|
||||
static const char* categoria_doc();
|
||||
static const char* caus_sos(const TLocalisamfile& mov, TipoIVA iva);
|
||||
static void check_annessi(movimento_t& mov_i, const TString& numreg);
|
||||
static void check_annessi(movimento_t& mov_i, const TString& numreg); // Controllo se ci sono tutti gli annessi obbligatori.
|
||||
static bool check_annessi_oblig(const TString& catdoc, const TString& numreg, TToken_string& ann_nexist);
|
||||
static bool check_cartaceo_acq(const movimento_t& movimento);
|
||||
static bool check_documento_vendita(const TLocalisamfile& mov, _Out_ bool& exist_doc);
|
||||
/** CHECK RIFERIMENTO FPPRO
|
||||
* Per le fatture di acquisto controllo se ho il riferimento nell'FPPRO.
|
||||
|
Loading…
x
Reference in New Issue
Block a user