Patch level : 12.0 982
Files correlati : f90.exe Commento : - Esportato numdoc scritto sull'fppro a prescindere. - Corretto nuovamente codice fiscale che inizia con 8 o 9. Controllo prima la partita iva.
This commit is contained in:
parent
a3087d6668
commit
52f04fa794
@ -244,6 +244,15 @@ const char* TFppro::get_tipodoc() const
|
|||||||
return tipodoc.cut(0) << _db->sq_get("TIPODOC");
|
return tipodoc.cut(0) << _db->sq_get("TIPODOC");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* TFppro::get_numdoc() const
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
static TString numdoc;
|
||||||
|
query << "SELECT PZ_NUMERO AS NUMDOC FROM FPPRO00F\r\n" << where_str();
|
||||||
|
_db->sq_set_exec(query);
|
||||||
|
return numdoc.cut(0) << _db->sq_get("NUMDOC");
|
||||||
|
}
|
||||||
|
|
||||||
TDate TFppro::get_data_first_doc() const
|
TDate TFppro::get_data_first_doc() const
|
||||||
{
|
{
|
||||||
TString query;
|
TString query;
|
||||||
|
177
src/f1/f1lib.h
177
src/f1/f1lib.h
@ -5,30 +5,30 @@
|
|||||||
#include "reputils.h"
|
#include "reputils.h"
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
|
||||||
#define FILE_CONFIG CONFIG_DITTA
|
#define FILE_CONFIG CONFIG_DITTA
|
||||||
#define FILE_SECTION "f1"
|
#define FILE_SECTION "f1"
|
||||||
#define F1_CAUS "caus"
|
#define F1_CAUS "caus"
|
||||||
#define F1_INIREGCONT "cg2CONTAB"
|
#define F1_INIREGCONT "cg2CONTAB"
|
||||||
#define LOG_MSG 0
|
#define LOG_MSG 0
|
||||||
#define LOG_WARN 1
|
#define LOG_WARN 1
|
||||||
#define LOG_ERR 2
|
#define LOG_ERR 2
|
||||||
|
|
||||||
enum err_cont
|
enum err_cont
|
||||||
{
|
{
|
||||||
no_codcaus = -1,
|
no_codcaus = -1,
|
||||||
no_selected = -2,
|
no_selected = -2,
|
||||||
is_already_cont = -3,
|
is_already_cont = -3,
|
||||||
cancel = -4,
|
cancel = -4,
|
||||||
forn_err = -5, // Manca un codice fornitore
|
forn_err = -5, // Manca un codice fornitore
|
||||||
is_ready = 0,
|
is_ready = 0,
|
||||||
no_err = 1
|
no_err = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _prot_s
|
typedef struct _prot_s
|
||||||
{
|
{
|
||||||
const char* tipo;
|
const char* tipo;
|
||||||
const char* num;
|
const char* num;
|
||||||
int anno;
|
int anno;
|
||||||
} prot_s;
|
} prot_s;
|
||||||
|
|
||||||
|
|
||||||
@ -39,11 +39,11 @@ typedef struct _prot_s
|
|||||||
*/
|
*/
|
||||||
class TFppro : public TObject
|
class TFppro : public TObject
|
||||||
{
|
{
|
||||||
struct keys_s
|
struct keys_s
|
||||||
{
|
{
|
||||||
TString prginvio;
|
TString prginvio;
|
||||||
TString headerfatt;
|
TString headerfatt;
|
||||||
TString bodyfatt;
|
TString bodyfatt;
|
||||||
|
|
||||||
operator const char*() const
|
operator const char*() const
|
||||||
{
|
{
|
||||||
@ -53,106 +53,107 @@ class TFppro : public TObject
|
|||||||
a.add(bodyfatt);
|
a.add(bodyfatt);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
} _keys;
|
} _keys;
|
||||||
|
|
||||||
SSimple_query* _db;
|
SSimple_query* _db;
|
||||||
bool _keys_setted;
|
bool _keys_setted;
|
||||||
bool _is_set; // Query is setted
|
bool _is_set; // Query is setted
|
||||||
TString _fppro_query;
|
TString _fppro_query;
|
||||||
TString _last_error;
|
TString _last_error;
|
||||||
|
|
||||||
static bool sql_inj(const TString& str);
|
static bool sql_inj(const TString& str);
|
||||||
static bool sql_inj(const keys_s& keys);
|
static bool sql_inj(const keys_s& keys);
|
||||||
public:
|
public:
|
||||||
const char* where_str() const;
|
const char* where_str() const;
|
||||||
|
|
||||||
bool check_reg(TToken_string& keys, int numreg);
|
bool check_reg(TToken_string& keys, int numreg);
|
||||||
// Se un mov. registrato non e' collegato all'FPPRO cerco di capire qual'e`
|
// Se un mov. registrato non e' collegato all'FPPRO cerco di capire qual'e`
|
||||||
bool guess_the_doc(const TLocalisamfile& mov);
|
bool guess_the_doc(const TLocalisamfile& mov);
|
||||||
// Getters
|
// Getters
|
||||||
const char* get_keys_fppro() const;
|
const char* get_keys_fppro() const;
|
||||||
int get_numreg();
|
int get_numreg();
|
||||||
int get_numreg(TToken_string& keys);
|
int get_numreg(TToken_string& keys);
|
||||||
TString get_codforn() const;
|
TString get_codforn() const;
|
||||||
TDate get_datareg();
|
TDate get_datareg();
|
||||||
TDate get_datareg(TToken_string& keys);
|
TDate get_datareg(TToken_string& keys);
|
||||||
real get_ritenute() const;
|
real get_ritenute() const;
|
||||||
TDate get_data_first_doc() const;
|
TDate get_data_first_doc() const;
|
||||||
TDate get_dataorarioric() const;
|
TDate get_dataorarioric() const;
|
||||||
int get_numregcont() const;
|
int get_numregcont() const;
|
||||||
|
|
||||||
TString get_last_error(bool clear = true);
|
TString get_last_error(bool clear = true);
|
||||||
// Setters
|
// Setters
|
||||||
bool set_query();
|
bool set_query();
|
||||||
TFppro& set_keys(TToken_string& keys);
|
TFppro& set_keys(TToken_string& keys);
|
||||||
TFppro& set_keys(const keys_s& keys);
|
TFppro& set_keys(const keys_s& keys);
|
||||||
|
|
||||||
bool associa_mov(int numreg) const;
|
bool associa_mov(int numreg) const;
|
||||||
const char* get_tipoprot() const;
|
const char* get_tipoprot() const;
|
||||||
const char* get_numprot() const;
|
const char* get_numprot() const;
|
||||||
const char* get_annoprot() const;
|
const char* get_annoprot() const;
|
||||||
const char* get_dataoraric() const;
|
const char* get_dataoraric() const;
|
||||||
const char* get_tipodoc() const;
|
const char* get_tipodoc() const;
|
||||||
|
const char* get_numdoc() const;
|
||||||
|
|
||||||
TFppro();
|
TFppro();
|
||||||
TFppro(TToken_string& keys) : TFppro() { set_keys(keys); }
|
TFppro(TToken_string& keys) : TFppro() { set_keys(keys); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class TProtocollo : TObject
|
class TProtocollo : TObject
|
||||||
{
|
{
|
||||||
TString _tipoprot;
|
TString _tipoprot;
|
||||||
TString _progres;
|
TString _progres;
|
||||||
int _year{};
|
int _year{};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TProtocollo() = default;
|
TProtocollo() = default;
|
||||||
TProtocollo(const int year, const char* tipoprot, const char* progres) : _tipoprot(tipoprot), _progres(progres), _year(year) { }
|
TProtocollo(const int year, const char* tipoprot, const char* progres) : _tipoprot(tipoprot), _progres(progres), _year(year) { }
|
||||||
|
|
||||||
void set(const TProtocollo& prot);
|
void set(const TProtocollo& prot);
|
||||||
void sset(const char* prot);
|
void sset(const char* prot);
|
||||||
TString& get_prot() const;
|
TString& get_prot() const;
|
||||||
prot_s get_prot();
|
prot_s get_prot();
|
||||||
|
|
||||||
int get_year() const { return _year; }
|
int get_year() const { return _year; }
|
||||||
TString& get_tipoprot() { return _tipoprot; }
|
TString& get_tipoprot() { return _tipoprot; }
|
||||||
TString& get_progres() { return _progres; }
|
TString& get_progres() { return _progres; }
|
||||||
|
|
||||||
|
|
||||||
static TString& prot_in(int year, const char* tipoprot, const char* progres);
|
static TString& prot_in(int year, const char* tipoprot, const char* progres);
|
||||||
|
|
||||||
operator const char*() const { return static_cast<const char*>(get_prot()); }
|
operator const char*() const { return static_cast<const char*>(get_prot()); }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TF1_log : TObject
|
class TF1_log : TObject
|
||||||
{
|
{
|
||||||
TLog_report* _log;
|
TLog_report* _log;
|
||||||
public:
|
public:
|
||||||
TF1_log() : _log(nullptr){}
|
TF1_log() : _log(nullptr){}
|
||||||
void log(int severity, const char* msg);
|
void log(int severity, const char* msg);
|
||||||
bool show_log();
|
bool show_log();
|
||||||
};
|
};
|
||||||
|
|
||||||
TFppro& fppro_db();
|
TFppro& fppro_db();
|
||||||
|
|
||||||
const char* get_ini_codcaus();
|
const char* get_ini_codcaus();
|
||||||
const char* get_codcaus(const char * tipodoc, const char* codcf);
|
const char* get_codcaus(const char * tipodoc, const char* codcf);
|
||||||
bool get_endatareg();
|
bool get_endatareg();
|
||||||
TString get_datainireg();
|
TString get_datainireg();
|
||||||
TString get_dataendreg();
|
TString get_dataendreg();
|
||||||
bool get_periodprec();
|
bool get_periodprec();
|
||||||
|
|
||||||
void set_ini_codcaus(const TString& codcaus);
|
void set_ini_codcaus(const TString& codcaus);
|
||||||
void set_endatareg(bool enable);
|
void set_endatareg(bool enable);
|
||||||
void set_datainireg(const TString& date);
|
void set_datainireg(const TString& date);
|
||||||
void set_dataendreg(const TString& date);
|
void set_dataendreg(const TString& date);
|
||||||
void set_periodprec(bool flag);
|
void set_periodprec(bool flag);
|
||||||
|
|
||||||
// Controlla se il "cod_caus" e' per Fatture d'acquisto o Note Credito d'Acquisto
|
// Controlla se il "cod_caus" e' per Fatture d'acquisto o Note Credito d'Acquisto
|
||||||
bool check_causale(const TString& cod_caus, bool acq = true);
|
bool check_causale(const TString& cod_caus, bool acq = true);
|
||||||
// Controlla se il "cod_caus" ha come "tipo_doc" FA o NC (di acquisto)
|
// Controlla se il "cod_caus" ha come "tipo_doc" FA o NC (di acquisto)
|
||||||
bool check_causale(const TString& cod_caus, const TString& tipo_doc, bool acq = true);
|
bool check_causale(const TString& cod_caus, const TString& tipo_doc, bool acq = true);
|
||||||
bool check_caus_has_rit(const TString& cod_caus, bool rit);
|
bool check_caus_has_rit(const TString& cod_caus, bool rit);
|
||||||
void run_cont_ini(bool liq);
|
void run_cont_ini(bool liq);
|
||||||
|
|
||||||
#endif // _F1LIB_H_
|
#endif // _F1LIB_H_
|
||||||
|
@ -219,13 +219,16 @@ void TEstrazione::fill_id(TLocalisamfile& clifo, TString& statopaiv, TString& id
|
|||||||
if (IS_ITALIANO(statopaiv))
|
if (IS_ITALIANO(statopaiv))
|
||||||
{
|
{
|
||||||
// Se ho un codice fiscale che inizia per 8 o 9 e' come un privato e devo considerarlo solo come codice fiscale senza partita IVA.
|
// Se ho un codice fiscale che inizia per 8 o 9 e' come un privato e devo considerarlo solo come codice fiscale senza partita IVA.
|
||||||
if (codfis.full() && codfis.len() == 11 && (codfis[0] == '8' || codfis[0] == '9'))
|
if (paiv.full())
|
||||||
paiv.cut(0);
|
|
||||||
else if (paiv.full() && paiv.len() == 11 && (paiv[0] == '8' || paiv[0] == '9'))
|
|
||||||
{
|
{
|
||||||
codfis = paiv;
|
if (paiv.len() == 11 && (paiv[0] == '8' || paiv[0] == '9'))
|
||||||
paiv.cut(0);
|
{
|
||||||
|
codfis = paiv;
|
||||||
|
paiv.cut(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (codfis.full() && codfis.len() == 11 && (codfis[0] == '8' || codfis[0] == '9'))
|
||||||
|
paiv.cut(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paiv == "0")
|
if (paiv == "0")
|
||||||
@ -641,7 +644,8 @@ const char* TEstrazione::diagnostica_mov()
|
|||||||
ok &= fppro_db().associa_mov(numreg);
|
ok &= fppro_db().associa_mov(numreg);
|
||||||
case correct:
|
case correct:
|
||||||
ok &= true;
|
ok &= true;
|
||||||
mov_i.err = false;
|
mov_i.err = false;
|
||||||
|
mov_i.numdoc = fppro_db().get_numdoc();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ERRORS
|
// ERRORS
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CG2101_H
|
#ifndef __CG2101_H
|
||||||
#include "../cg/cg2101.h"
|
#include "../cg/cglib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TLista_documenti : public TObject // velib04
|
class TLista_documenti : public TObject // velib04
|
||||||
|
Loading…
x
Reference in New Issue
Block a user