#ifndef _F1LIBH_ #define _F1LIBH_ #include "strings.h" #include "config.h" #define FILE_CONFIG CONFIG_DITTA #define FILE_SECTION "f1" #define F1_CAUSFA "causfa" #define F1_CAUSNC "causnc" #define F1_INIREGCONT "cg2CONTAB" enum err_cont { no_codcaus = -1, no_selected = -2, is_already_cont = -3, is_ready = 0 }; 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(get_prot()); } }; void set_ini_codcaus(const TString& codcaus, bool nc = false); const char* get_ini_codcaus(bool nc = false); const char* get_codcaus(const char * tipodoc, const char* codcf); bool get_endatareg(); TString get_datainireg(); TString get_dataendreg(); void set_endatareg(bool enable); void set_datainireg(const TString& date); void set_dataendreg(const TString& date); // Controlla se il "cod_caus" e' per Fatture d'acquisto o Note Credito d'Acquisto bool check_causale(const TString& cod_caus); // 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); void run_cont_ini(); #endif