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");
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
TString query;
|
||||
|
177
src/f1/f1lib.h
177
src/f1/f1lib.h
@ -5,30 +5,30 @@
|
||||
#include "reputils.h"
|
||||
#include "tsdb.h"
|
||||
|
||||
#define FILE_CONFIG CONFIG_DITTA
|
||||
#define FILE_SECTION "f1"
|
||||
#define F1_CAUS "caus"
|
||||
#define F1_INIREGCONT "cg2CONTAB"
|
||||
#define LOG_MSG 0
|
||||
#define LOG_WARN 1
|
||||
#define LOG_ERR 2
|
||||
#define FILE_CONFIG CONFIG_DITTA
|
||||
#define FILE_SECTION "f1"
|
||||
#define F1_CAUS "caus"
|
||||
#define F1_INIREGCONT "cg2CONTAB"
|
||||
#define LOG_MSG 0
|
||||
#define LOG_WARN 1
|
||||
#define LOG_ERR 2
|
||||
|
||||
enum err_cont
|
||||
{
|
||||
no_codcaus = -1,
|
||||
no_selected = -2,
|
||||
is_already_cont = -3,
|
||||
cancel = -4,
|
||||
forn_err = -5, // Manca un codice fornitore
|
||||
is_ready = 0,
|
||||
no_err = 1
|
||||
no_codcaus = -1,
|
||||
no_selected = -2,
|
||||
is_already_cont = -3,
|
||||
cancel = -4,
|
||||
forn_err = -5, // Manca un codice fornitore
|
||||
is_ready = 0,
|
||||
no_err = 1
|
||||
};
|
||||
|
||||
typedef struct _prot_s
|
||||
{
|
||||
const char* tipo;
|
||||
const char* num;
|
||||
int anno;
|
||||
const char* tipo;
|
||||
const char* num;
|
||||
int anno;
|
||||
} prot_s;
|
||||
|
||||
|
||||
@ -39,11 +39,11 @@ typedef struct _prot_s
|
||||
*/
|
||||
class TFppro : public TObject
|
||||
{
|
||||
struct keys_s
|
||||
{
|
||||
TString prginvio;
|
||||
TString headerfatt;
|
||||
TString bodyfatt;
|
||||
struct keys_s
|
||||
{
|
||||
TString prginvio;
|
||||
TString headerfatt;
|
||||
TString bodyfatt;
|
||||
|
||||
operator const char*() const
|
||||
{
|
||||
@ -53,106 +53,107 @@ class TFppro : public TObject
|
||||
a.add(bodyfatt);
|
||||
return a;
|
||||
}
|
||||
} _keys;
|
||||
} _keys;
|
||||
|
||||
SSimple_query* _db;
|
||||
bool _keys_setted;
|
||||
bool _is_set; // Query is setted
|
||||
TString _fppro_query;
|
||||
SSimple_query* _db;
|
||||
bool _keys_setted;
|
||||
bool _is_set; // Query is setted
|
||||
TString _fppro_query;
|
||||
TString _last_error;
|
||||
|
||||
static bool sql_inj(const TString& str);
|
||||
static bool sql_inj(const keys_s& keys);
|
||||
public:
|
||||
const char* where_str() const;
|
||||
const char* where_str() const;
|
||||
|
||||
bool check_reg(TToken_string& keys, int numreg);
|
||||
// Se un mov. registrato non e' collegato all'FPPRO cerco di capire qual'e`
|
||||
bool guess_the_doc(const TLocalisamfile& mov);
|
||||
// Getters
|
||||
const char* get_keys_fppro() const;
|
||||
int get_numreg();
|
||||
int get_numreg(TToken_string& keys);
|
||||
TString get_codforn() const;
|
||||
TDate get_datareg();
|
||||
TDate get_datareg(TToken_string& keys);
|
||||
real get_ritenute() const;
|
||||
TDate get_data_first_doc() const;
|
||||
TDate get_dataorarioric() const;
|
||||
int get_numregcont() const;
|
||||
bool check_reg(TToken_string& keys, int numreg);
|
||||
// Se un mov. registrato non e' collegato all'FPPRO cerco di capire qual'e`
|
||||
bool guess_the_doc(const TLocalisamfile& mov);
|
||||
// Getters
|
||||
const char* get_keys_fppro() const;
|
||||
int get_numreg();
|
||||
int get_numreg(TToken_string& keys);
|
||||
TString get_codforn() const;
|
||||
TDate get_datareg();
|
||||
TDate get_datareg(TToken_string& keys);
|
||||
real get_ritenute() const;
|
||||
TDate get_data_first_doc() const;
|
||||
TDate get_dataorarioric() const;
|
||||
int get_numregcont() const;
|
||||
|
||||
TString get_last_error(bool clear = true);
|
||||
// Setters
|
||||
bool set_query();
|
||||
TFppro& set_keys(TToken_string& keys);
|
||||
TFppro& set_keys(const keys_s& keys);
|
||||
// Setters
|
||||
bool set_query();
|
||||
TFppro& set_keys(TToken_string& keys);
|
||||
TFppro& set_keys(const keys_s& keys);
|
||||
|
||||
bool associa_mov(int numreg) const;
|
||||
const char* get_tipoprot() const;
|
||||
const char* get_numprot() const;
|
||||
const char* get_annoprot() const;
|
||||
const char* get_dataoraric() const;
|
||||
const char* get_tipodoc() const;
|
||||
bool associa_mov(int numreg) const;
|
||||
const char* get_tipoprot() const;
|
||||
const char* get_numprot() const;
|
||||
const char* get_annoprot() const;
|
||||
const char* get_dataoraric() const;
|
||||
const char* get_tipodoc() const;
|
||||
const char* get_numdoc() const;
|
||||
|
||||
TFppro();
|
||||
TFppro();
|
||||
TFppro(TToken_string& keys) : TFppro() { set_keys(keys); }
|
||||
};
|
||||
|
||||
class TProtocollo : TObject
|
||||
{
|
||||
TString _tipoprot;
|
||||
TString _progres;
|
||||
int _year{};
|
||||
TString _tipoprot;
|
||||
TString _progres;
|
||||
int _year{};
|
||||
|
||||
public:
|
||||
TProtocollo() = default;
|
||||
TProtocollo(const int year, const char* tipoprot, const char* progres) : _tipoprot(tipoprot), _progres(progres), _year(year) { }
|
||||
TProtocollo() = default;
|
||||
TProtocollo(const int year, const char* tipoprot, const char* progres) : _tipoprot(tipoprot), _progres(progres), _year(year) { }
|
||||
|
||||
void set(const TProtocollo& prot);
|
||||
void sset(const char* prot);
|
||||
TString& get_prot() const;
|
||||
prot_s get_prot();
|
||||
void set(const TProtocollo& prot);
|
||||
void sset(const char* prot);
|
||||
TString& get_prot() const;
|
||||
prot_s get_prot();
|
||||
|
||||
int get_year() const { return _year; }
|
||||
TString& get_tipoprot() { return _tipoprot; }
|
||||
TString& get_progres() { return _progres; }
|
||||
|
||||
int get_year() const { return _year; }
|
||||
TString& get_tipoprot() { return _tipoprot; }
|
||||
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
|
||||
{
|
||||
TLog_report* _log;
|
||||
TLog_report* _log;
|
||||
public:
|
||||
TF1_log() : _log(nullptr){}
|
||||
void log(int severity, const char* msg);
|
||||
bool show_log();
|
||||
TF1_log() : _log(nullptr){}
|
||||
void log(int severity, const char* msg);
|
||||
bool show_log();
|
||||
};
|
||||
|
||||
TFppro& fppro_db();
|
||||
TFppro& fppro_db();
|
||||
|
||||
const char* get_ini_codcaus();
|
||||
const char* get_codcaus(const char * tipodoc, const char* codcf);
|
||||
bool get_endatareg();
|
||||
TString get_datainireg();
|
||||
TString get_dataendreg();
|
||||
bool get_periodprec();
|
||||
bool get_endatareg();
|
||||
TString get_datainireg();
|
||||
TString get_dataendreg();
|
||||
bool get_periodprec();
|
||||
|
||||
void set_ini_codcaus(const TString& codcaus);
|
||||
void set_endatareg(bool enable);
|
||||
void set_datainireg(const TString& date);
|
||||
void set_dataendreg(const TString& date);
|
||||
void set_periodprec(bool flag);
|
||||
void set_ini_codcaus(const TString& codcaus);
|
||||
void set_endatareg(bool enable);
|
||||
void set_datainireg(const TString& date);
|
||||
void set_dataendreg(const TString& date);
|
||||
void set_periodprec(bool flag);
|
||||
|
||||
// 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)
|
||||
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);
|
||||
void run_cont_ini(bool liq);
|
||||
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);
|
||||
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))
|
||||
{
|
||||
// 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'))
|
||||
paiv.cut(0);
|
||||
else if (paiv.full() && paiv.len() == 11 && (paiv[0] == '8' || paiv[0] == '9'))
|
||||
if (paiv.full())
|
||||
{
|
||||
codfis = paiv;
|
||||
paiv.cut(0);
|
||||
if (paiv.len() == 11 && (paiv[0] == '8' || paiv[0] == '9'))
|
||||
{
|
||||
codfis = paiv;
|
||||
paiv.cut(0);
|
||||
}
|
||||
}
|
||||
else if (codfis.full() && codfis.len() == 11 && (codfis[0] == '8' || codfis[0] == '9'))
|
||||
paiv.cut(0);
|
||||
}
|
||||
|
||||
if (paiv == "0")
|
||||
@ -641,7 +644,8 @@ const char* TEstrazione::diagnostica_mov()
|
||||
ok &= fppro_db().associa_mov(numreg);
|
||||
case correct:
|
||||
ok &= true;
|
||||
mov_i.err = false;
|
||||
mov_i.err = false;
|
||||
mov_i.numdoc = fppro_db().get_numdoc();
|
||||
break;
|
||||
|
||||
// ERRORS
|
||||
|
@ -10,7 +10,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __CG2101_H
|
||||
#include "../cg/cg2101.h"
|
||||
#include "../cg/cglib.h"
|
||||
#endif
|
||||
|
||||
class TLista_documenti : public TObject // velib04
|
||||
|
Loading…
x
Reference in New Issue
Block a user