Files correlati : cg2.exe Commento : - Corrette write e rewrite spostando controlli per F1-FPPRO prima della scrittura - Corretta registrazione se collego un movimento gia registrato e il doc ext non e' valorizzato
124 lines
3.0 KiB
C++
124 lines
3.0 KiB
C++
#ifndef _F1LIBH_
|
|
#define _F1LIBH_
|
|
|
|
#include "strings.h"
|
|
#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
|
|
|
|
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
|
|
};
|
|
|
|
class TFppro : public TObject
|
|
{
|
|
struct keys_s
|
|
{
|
|
const char* prginvio;
|
|
const char* headerfatt;
|
|
const char* bodyfatt;
|
|
};
|
|
private:
|
|
SSimple_query* _db;
|
|
keys_s _keys;
|
|
bool _guess;
|
|
bool _keys_setted;
|
|
bool _is_set;
|
|
TString _fppro_query;
|
|
|
|
public:
|
|
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
|
|
void get_keys_fppro();
|
|
int get_numreg();
|
|
int get_numreg(TToken_string& keys);
|
|
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;
|
|
// Setters
|
|
bool set_query();
|
|
TFppro& set_keys(TToken_string& keys);
|
|
TFppro& set_keys(keys_s keys);
|
|
|
|
|
|
static bool set_connection(SSimple_query& s);
|
|
|
|
TFppro();
|
|
TFppro(TToken_string& keys) : TFppro() { set_keys(keys); }
|
|
};
|
|
|
|
class TProtocollo : TObject
|
|
{
|
|
int _year{};
|
|
TString _tipoprot;
|
|
TString _progres;
|
|
|
|
public:
|
|
TProtocollo() = default;
|
|
TProtocollo(const int year, const char* tipoprot, const char* progres): _year(year), _tipoprot(tipoprot), _progres(progres) { }
|
|
|
|
void set(TProtocollo prot);
|
|
void sset(const char* prot);
|
|
TString& get_prot() const;
|
|
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);
|
|
|
|
operator const char*() const { return static_cast<const char*>(get_prot()); }
|
|
|
|
};
|
|
|
|
class TF1_log : TObject
|
|
{
|
|
TLog_report* _log;
|
|
public:
|
|
TF1_log() : _log(nullptr){}
|
|
void log(int severity, const char* msg);
|
|
bool show_log();
|
|
};
|
|
|
|
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();
|
|
|
|
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);
|
|
// 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);
|
|
#endif |