Patch level : nopatch
Files correlati : Commento : Implementazione nuovo modulo FP
This commit is contained in:
		
							parent
							
								
									3d906254a0
								
							
						
					
					
						commit
						fec596bb45
					
				@ -17,7 +17,6 @@
 | 
			
		||||
#define FILTER_ALL			"A"
 | 
			
		||||
#define FILTER_CONT			"C"
 | 
			
		||||
#define PARA_FP					"fp"
 | 
			
		||||
#define F1_INIREGCONT   "regcont"
 | 
			
		||||
 | 
			
		||||
enum
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -150,7 +150,7 @@ void TPAR_mask::fill()
 | 
			
		||||
		const TCli_for & cli = cached_clifor(mov.get_char(MOV_TIPO), mov.get_long(MOV_CODCF));
 | 
			
		||||
		bool sent = false;
 | 
			
		||||
 | 
			
		||||
		if (chiave_paf_mov(mov, tipodocsdi, hfatt, bfatt))
 | 
			
		||||
		if (chiave_paf_mov(mov, hfatt, bfatt))
 | 
			
		||||
		{
 | 
			
		||||
			if (paf0100f.search(nullptr, hfatt, bfatt) && paf0100f.sq_get("P1_GESTIONE") != " " && paf0100f.sq_get("P1_ERRINT") != "*")
 | 
			
		||||
			{
 | 
			
		||||
@ -598,7 +598,7 @@ void TPAR_mask::set_err_paf()
 | 
			
		||||
			TString hfatt, bfatt;
 | 
			
		||||
			TPaf_record paf0100f("PAF0100F");
 | 
			
		||||
 | 
			
		||||
			if (chiave_paf_mov(mov, tipodocsdi, hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
 | 
			
		||||
			if (chiave_paf_mov(mov, hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
 | 
			
		||||
			{
 | 
			
		||||
				TString query;
 | 
			
		||||
				query <<
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										125
									
								
								src/fp/fplib.h
									
									
									
									
									
								
							
							
						
						
									
										125
									
								
								src/fp/fplib.h
									
									
									
									
									
								
							@ -7,6 +7,7 @@
 | 
			
		||||
 | 
			
		||||
#include "../ve/velib05.h"
 | 
			
		||||
#include "../fe/felib.h"
 | 
			
		||||
#include <reprint.h>
 | 
			
		||||
#include <reputils.h>
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include <memory>
 | 
			
		||||
@ -35,13 +36,13 @@ TString& complete_num_fp(const TCodice_numerazione& codnum, const int numdoc);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Genera la chiave per i paf
 | 
			
		||||
bool chiave_paf_mov(const TRectype& mov, const TString & tipodoc, TString& hfatt, TString& bfatt);
 | 
			
		||||
bool chiave_paf_mov(const TRectype& mov, TString& hfatt, TString& bfatt);
 | 
			
		||||
bool chiave_paf_doc(const TDocumento& doc, TString& hfatt, TString& bfatt);
 | 
			
		||||
bool chiave_paf_doc(const TRectype& doc, TString& hfatt, TString& bfatt);
 | 
			
		||||
// Ritorna cod sdi, pec o vuoto. Chiama get_coddest()
 | 
			
		||||
TString get_dest_sdi(char tipocf, long codcf, const TString& cod_ind_sped);
 | 
			
		||||
// Valorizza codice sdi e pec in base alle configurazioni del monitor
 | 
			
		||||
bool get_coddest(char tipocf, long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped);
 | 
			
		||||
bool get_coddest(char tipocf, long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped = EMPTY_STRING);
 | 
			
		||||
const TString& tipo_doc_sdi(const TDocumento& doc);
 | 
			
		||||
 | 
			
		||||
// Controlli comuni
 | 
			
		||||
@ -451,7 +452,17 @@ public:
 | 
			
		||||
	virtual ~TFP_expression() {};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Gestione PAF
 | 
			
		||||
/*
 | 
			
		||||
 /$$$$$$$$ /$$$$$$$
 | 
			
		||||
|__  $$__/| $$__  $$
 | 
			
		||||
	 | $$   | $$  \ $$  /$$$$$$   /$$$$$$$
 | 
			
		||||
	 | $$   | $$  | $$ /$$__  $$ /$$_____/
 | 
			
		||||
	 | $$   | $$  | $$| $$  \ $$| $$
 | 
			
		||||
	 | $$   | $$  | $$| $$  | $$| $$
 | 
			
		||||
	 | $$   | $$$$$$$/|  $$$$$$/|  $$$$$$$
 | 
			
		||||
	 |__/   |_______/  \______/  \_______/
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
class TDoc_fp : public TObject
 | 
			
		||||
{
 | 
			
		||||
	friend class TFP_custom;
 | 
			
		||||
@ -462,7 +473,7 @@ private:
 | 
			
		||||
	TAnagrafica				_ditta;
 | 
			
		||||
	TString16					_cofi;
 | 
			
		||||
	TFilename					_dbname;
 | 
			
		||||
	TLog_report*			_log;
 | 
			
		||||
	TLog_report 			_log;
 | 
			
		||||
	TString						_logpaf;
 | 
			
		||||
	bool							_gestioneallegati;
 | 
			
		||||
	bool							_allegafattura;
 | 
			
		||||
@ -542,7 +553,7 @@ protected:
 | 
			
		||||
	const TString&      descrizione(const TRiga_documento& rdoc);
 | 
			
		||||
	const TRectype& cco(const TRectype&                doc) const; // Contratto/Convenzione/Offerta
 | 
			
		||||
 | 
			
		||||
	void        log(int severity, const char* msg);
 | 
			
		||||
 | 
			
		||||
	const TString & natura(const char* codiva) const;
 | 
			
		||||
	static const char* get_esigibilita_iva(const TDocumentoEsteso& doc);
 | 
			
		||||
	void set_IVA(TString         codiva, TPaf_record& paf) const;
 | 
			
		||||
@ -581,4 +592,108 @@ public:
 | 
			
		||||
	TDoc_fp();
 | 
			
		||||
	~TDoc_fp();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 /$$$$$$$$ /$$$$$$$
 | 
			
		||||
|__  $$__/| $$__  $$
 | 
			
		||||
	 | $$   | $$  \ $$  /$$$$$$   /$$$$$$
 | 
			
		||||
	 | $$   | $$$$$$$/ /$$__  $$ /$$__  $$
 | 
			
		||||
	 | $$   | $$__  $$| $$$$$$$$| $$  \ $$
 | 
			
		||||
	 | $$   | $$  \ $$| $$_____/| $$  | $$
 | 
			
		||||
	 | $$   | $$  | $$|  $$$$$$$|  $$$$$$$
 | 
			
		||||
	 |__/   |__/  |__/ \_______/ \____  $$
 | 
			
		||||
															 /$$  \ $$
 | 
			
		||||
															|  $$$$$$/
 | 
			
		||||
															 \______/
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
class TReg_fp : public TObject
 | 
			
		||||
{
 | 
			
		||||
	friend class TFP_custom;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	TAnagrafica				_ditta;
 | 
			
		||||
	TString16					_cofi;
 | 
			
		||||
	TFilename					_dbname;
 | 
			
		||||
	TLog_report 			_log;
 | 
			
		||||
	TString						_logpaf;
 | 
			
		||||
	bool							_gestioneallegati;
 | 
			
		||||
	bool							_allegafattura;
 | 
			
		||||
	TString						_def_fld;
 | 
			
		||||
	TString						_def_usr_fld;
 | 
			
		||||
	bool							_to_commit;
 | 
			
		||||
	bool							_cache_insert;
 | 
			
		||||
	vector<TString>		_query;
 | 
			
		||||
	TString8					_hfatt; // Codice univoco di 6 caratteri dell'ufficio P.A. o di 7 caratteri per un privato
 | 
			
		||||
	TString						_bfatt; // Codice univoco di 20 caratteri del Regumento
 | 
			
		||||
	TString						_paese;
 | 
			
		||||
	bool							_enapec;
 | 
			
		||||
	bool							_privato;
 | 
			
		||||
	TString						_coddest;
 | 
			
		||||
	TString						_pec;
 | 
			
		||||
	bool							_is_pa;
 | 
			
		||||
	TString						_codivadefault;
 | 
			
		||||
	long							_idx_cassa_previdenziale;
 | 
			
		||||
	long							_idx_adg_reg_row; // Indice per la tabella altri dati gestionali della riga
 | 
			
		||||
	int								_num_linea;
 | 
			
		||||
	int								_counter;
 | 
			
		||||
	TPaf_container		_paf_container;
 | 
			
		||||
	int								_count_r_conai;
 | 
			
		||||
	bool							_nascondi_sconti_righe_fatt;
 | 
			
		||||
	TFP_nota_piede_f	_riga_npf;
 | 
			
		||||
	bool							_has_cust;
 | 
			
		||||
 | 
			
		||||
	bool						insert(TPaf_record& p);
 | 
			
		||||
	bool						remove(TPaf_record& p);
 | 
			
		||||
	void						reset(TPaf_record& p) const { TPaf_container::set_keys_paf(p, _hfatt, _bfatt); }
 | 
			
		||||
	bool						save_paf();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
 | 
			
		||||
	/**< Funzioni di controllo */
 | 
			
		||||
	/**< Controlli di testata, non  const per il calcolo della codizione di pagamento */
 | 
			
		||||
	bool check_initial(const TMovimento_contabile& mov);
 | 
			
		||||
	/**< Controllo di riga */
 | 
			
		||||
	bool check_row(const TMovimento_contabile& mov, int n_riga);
 | 
			
		||||
	/**< Controllo riepilogo IVA */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	bool initialize(const TMovimento_contabile& Reg);
 | 
			
		||||
	//static bool get_bnp_iban(const TString&                   abi, const TString&     cab, int       prg, TString& iban);
 | 
			
		||||
	//bool get_bank(TRegumento&                    Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
 | 
			
		||||
	//bool get_bank_presentazione(const TRegumento& Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
 | 
			
		||||
	//bool get_bank_appoggio(const TRegumento& Reg, TString& iban, TString& abi, TString& cab, TString& istituto) const;
 | 
			
		||||
	const TString&      descrizione(const TMovimento_contabile& mov, int n_riga) const {	return mov.cg()[n_riga].get((RMV_DESCR));} 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	void        save_log() { TReport_book b; b.add(_log); b.export_text(TFilename("fp_err.log"), false, 132); }
 | 
			
		||||
	const TString & natura(const char* codiva) const;
 | 
			
		||||
	static const char* get_esigibilita_iva(const TMovimento_contabile& Reg);
 | 
			
		||||
	void set_IVA(TString         codiva, TPaf_record& paf) const;
 | 
			
		||||
	void set_IVA(const TMovimento_contabile& mov, int n_row, TPaf_record&   paf) const;
 | 
			
		||||
	bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
 | 
			
		||||
	bool add_row_alleg(TFilename& file, long& nprogr, TPaf_record& paf);
 | 
			
		||||
	void set_qta_prezzo(TPaf_record& paf1800f, const TMovimento_contabile& mov, int n_row) const;
 | 
			
		||||
	void add_ritenuta(const TMovimento_contabile & mov, int n_row, TPaf_record& paf0700f) const;
 | 
			
		||||
	bool add_riepilogo_iva(const TMovimento_contabile mov, int n_riga);
 | 
			
		||||
	
 | 
			
		||||
	const TFirm& TReg_fp::get_firm(){return prefix().firm();}
 | 
			
		||||
 | 
			
		||||
	bool export_paf0100f();
 | 
			
		||||
	bool export_paf3200f();
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	bool reg_to_paf(const TMovimento_contabile& mov);
 | 
			
		||||
	bool reg_to_paf(long n_mov);
 | 
			
		||||
	// Mostra il log a fine esecuzione
 | 
			
		||||
	bool show_log();
 | 
			
		||||
	int commit();
 | 
			
		||||
	int force_commit();
 | 
			
		||||
	void set_cache_insert(const bool v) { _cache_insert = v; }
 | 
			
		||||
 | 
			
		||||
	TReg_fp();
 | 
			
		||||
	~TReg_fp();
 | 
			
		||||
};
 | 
			
		||||
#endif // __FPLIB_H
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user