Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00
This commit is contained in:
		
						commit
						0ff224ec0c
					
				@ -1261,7 +1261,7 @@ int TPrimanota_application::read(TMask& m)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    TBill c; c.get(r);
 | 
					    TBill c; c.get(r);
 | 
				
			||||||
    c.add_to(riga, 4, 0x7);              // Conto 105-110
 | 
					    c.add_to(riga, 4, 0x7);              // Conto 105-110
 | 
				
			||||||
    riga.add(r.get(RMI_NAVP));  
 | 
					    riga.add(r.get(RMI_NAVP), cid2index(IVA_NOTAVARECF));
 | 
				
			||||||
  }           
 | 
					  }           
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  calcola_imp();                         // Calcola totale imponibile ed imposte
 | 
					  calcola_imp();                         // Calcola totale imponibile ed imposte
 | 
				
			||||||
 | 
				
			|||||||
@ -34,30 +34,80 @@ PAGE "Fatture Ricevute SDI" -1 -1 77 20
 | 
				
			|||||||
NUMBER F_CODCLIFORS 6
 | 
					NUMBER F_CODCLIFORS 6
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
	PROMPT 1 1 "Codice fornitore"
 | 
						PROMPT 1 1 "Codice fornitore"
 | 
				
			||||||
 | 
						FIELD CODCF
 | 
				
			||||||
 | 
					  GROUP 1
 | 
				
			||||||
 | 
					  USE LF_CLIFO
 | 
				
			||||||
 | 
					  INPUT TIPOCF "F"
 | 
				
			||||||
 | 
					  INPUT CODCF F_CODCLIFORS
 | 
				
			||||||
 | 
					  DISPLAY "Codice" CODCF
 | 
				
			||||||
 | 
					  DISPLAY "Ragione Sociale@50" RAGSOC
 | 
				
			||||||
 | 
					  DISPLAY "Sospeso@C" SOSPESO
 | 
				
			||||||
 | 
					  DISPLAY "Partita IVA@12" PAIV
 | 
				
			||||||
 | 
					  DISPLAY "Codice Fiscale@16" COFI
 | 
				
			||||||
 | 
					  OUTPUT F_CODCLIFORS CODCF
 | 
				
			||||||
 | 
					  OUTPUT F_STATOPAIVS STATOPAIV
 | 
				
			||||||
 | 
					  OUTPUT F_PIVAS PAIV
 | 
				
			||||||
 | 
						OUTPUT F_COFIS COFI
 | 
				
			||||||
 | 
						OUTPUT F_RAGSOCS RAGSOC
 | 
				
			||||||
 | 
					  CHECKTYPE REQUIRED
 | 
				
			||||||
 | 
					  ADD RUN cg0 -1
 | 
				
			||||||
	FLAGS "D"
 | 
						FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STRING F_COFIS 16
 | 
					STRING F_COFIS 16
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 35 1 "Cod. Fiscale "
 | 
					  PROMPT 35 1 "Cod. Fiscale "
 | 
				
			||||||
 | 
						GROUP 1
 | 
				
			||||||
 | 
					  USE LF_CLIFO KEY 4
 | 
				
			||||||
 | 
					  INPUT TIPOCF "F"
 | 
				
			||||||
 | 
					  INPUT COFI F_COFIS
 | 
				
			||||||
 | 
					  DISPLAY "Codice fiscale@16" COFI
 | 
				
			||||||
 | 
					  DISPLAY "Ragione Sociale@50" RAGSOC
 | 
				
			||||||
 | 
					  DISPLAY "Codice" CODCF
 | 
				
			||||||
 | 
					  DISPLAY "Sospeso@C" SOSPESO
 | 
				
			||||||
 | 
					  DISPLAY "Partita IVA@12" PAIV
 | 
				
			||||||
 | 
					  COPY OUTPUT F_CODCLIFORS
 | 
				
			||||||
 | 
					  CHECKTYPE NORMAL
 | 
				
			||||||
 | 
					  ADD RUN cg0 -1
 | 
				
			||||||
	FLAGS "D"
 | 
						FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STRING F_STATOPAIVS 2
 | 
					STRING F_STATOPAIVS 2
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
	PROMPT 1 2 "P. IVA"
 | 
						PROMPT 1 2 "P. IVA"
 | 
				
			||||||
 | 
						USE %SCE
 | 
				
			||||||
 | 
					  INPUT CODTAB F_STATOPAIVS
 | 
				
			||||||
 | 
					  DISPLAY "Codice" CODTAB
 | 
				
			||||||
 | 
					  DISPLAY "Descrizione@50" S0
 | 
				
			||||||
 | 
					  OUTPUT F_STATOPAIVS CODTAB
 | 
				
			||||||
 | 
					  CHECKTYPE NORMAL
 | 
				
			||||||
	FLAGS "D"
 | 
						FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STRING F_PIVAS 12
 | 
					STRING F_PIVAS 12
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 15 2 ""
 | 
					  PROMPT 15 2 ""
 | 
				
			||||||
 | 
						GROUP 1
 | 
				
			||||||
 | 
					  USE LF_CLIFO KEY 5
 | 
				
			||||||
 | 
					  INPUT TIPOCF "F"
 | 
				
			||||||
 | 
					  INPUT STATOPAIV F_STATOPAIVS
 | 
				
			||||||
 | 
					  INPUT PAIV F_PIVAS
 | 
				
			||||||
 | 
					  DISPLAY "Partita IVA@12" PAIV
 | 
				
			||||||
 | 
					  DISPLAY "Ragione Sociale@50" RAGSOC
 | 
				
			||||||
 | 
					  DISPLAY "Codice" CODCF
 | 
				
			||||||
 | 
					  DISPLAY "Sospeso@C" SOSPESO
 | 
				
			||||||
 | 
					  DISPLAY "Codice Fiscale@16" COFI
 | 
				
			||||||
 | 
					  COPY OUTPUT F_CODCLIFORS
 | 
				
			||||||
 | 
					  CHECKTYPE NORMAL
 | 
				
			||||||
 | 
					  ADD RUN cg0 -1
 | 
				
			||||||
	FLAGS "D"
 | 
						FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STRING F_RAGSOCS 50
 | 
					STRING F_RAGSOCS 50
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
	PROMPT 0 3 "Rag. Soc."
 | 
						PROMPT 0 3 "Rag. Soc."
 | 
				
			||||||
 | 
						INPUT TIPOCF F_CLIFO SELECT
 | 
				
			||||||
 | 
					  INPUT RAGSOC F_RAGSOCCF
 | 
				
			||||||
	FLAGS "D"
 | 
						FLAGS "D"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -3918,11 +3918,22 @@ bool TPrimanota_application::write_scad_f1(const TMask& cg_msk, const shared_ptr
 | 
				
			|||||||
void TPrimanota_application::write_clifo(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
 | 
					void TPrimanota_application::write_clifo(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	TLocalisamfile clifo(LF_CLIFO);
 | 
						TLocalisamfile clifo(LF_CLIFO);
 | 
				
			||||||
 | 
						if (msk->get_codforn().empty())
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
		clifo.setkey(5);
 | 
							clifo.setkey(5);
 | 
				
			||||||
		clifo.put(CLI_TIPOCF, "F");
 | 
							clifo.put(CLI_TIPOCF, "F");
 | 
				
			||||||
		clifo.put(CLI_PAIV, msk->get_piva());
 | 
							clifo.put(CLI_PAIV, msk->get_piva());
 | 
				
			||||||
		clifo.read();
 | 
							clifo.read();
 | 
				
			||||||
	if (clifo.get(CLI_PAIV) == msk->get_piva())
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							clifo.setkey(1);
 | 
				
			||||||
 | 
							clifo.put(CLI_TIPOCF, "F");
 | 
				
			||||||
 | 
							clifo.put(CLI_CODCF, msk->get_codforn());
 | 
				
			||||||
 | 
							clifo.read();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (clifo.get(CLI_PAIV) == msk->get_piva() && (cg_msk.get(F_CODCLIFOR).empty() || cg_msk.get(F_CODCLIFOR) != msk->get_codforn()))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		cg_msk.set(F_CODCLIFOR, clifo.get(CLI_CODCF));
 | 
							cg_msk.set(F_CODCLIFOR, clifo.get(CLI_CODCF));
 | 
				
			||||||
		cg_msk.set(F_RAGSOCCF, clifo.get(CLI_RAGSOC));
 | 
							cg_msk.set(F_RAGSOCCF, clifo.get(CLI_RAGSOC));
 | 
				
			||||||
@ -3956,7 +3967,7 @@ void TPrimanota_application::riporta_dati_f1(TMask& cg_msk, const shared_ptr<TPr
 | 
				
			|||||||
	cg_msk.set(F_NUMDOCEXT, msk->get_numdoc());
 | 
						cg_msk.set(F_NUMDOCEXT, msk->get_numdoc());
 | 
				
			||||||
	cg_msk.set(F_NUMDOC, msk->get_numdoc().right(7));
 | 
						cg_msk.set(F_NUMDOC, msk->get_numdoc().right(7));
 | 
				
			||||||
	cg_msk.set(F_DATADOC, msk->get_datadoc());
 | 
						cg_msk.set(F_DATADOC, msk->get_datadoc());
 | 
				
			||||||
	if (!cg_msk.get(F_CODCLIFOR).full() && msk->get_numdoc().full())
 | 
						if (msk->get_numdoc().full())
 | 
				
			||||||
		write_clifo(cg_msk, msk);
 | 
							write_clifo(cg_msk, msk);
 | 
				
			||||||
	write_righe_iva_f1(cg_msk, msk);
 | 
						write_righe_iva_f1(cg_msk, msk);
 | 
				
			||||||
	set_totale(cg_msk, msk);
 | 
						set_totale(cg_msk, msk);
 | 
				
			||||||
@ -4099,7 +4110,7 @@ bool TPro_msk::riporta_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
			//TProtocollo protocollo(TDate(row->get(2)).year(), row->get(9), row->get(10));
 | 
								//TProtocollo protocollo(TDate(row->get(2)).year(), row->get(9), row->get(10));
 | 
				
			||||||
			app()._pro_mask->set_doc(row->get(cid2index(F_NUMEROS)), row->get(cid2index(F_DATAS)),
 | 
								app()._pro_mask->set_doc(row->get(cid2index(F_NUMEROS)), row->get(cid2index(F_DATAS)),
 | 
				
			||||||
				row->get(cid2index(F_IMPTOTDOCS)), row->get(cid2index(F_RITENUTE)), "", row->get(cid2index(F_KEYFPPROS)),
 | 
									row->get(cid2index(F_IMPTOTDOCS)), row->get(cid2index(F_RITENUTE)), "", row->get(cid2index(F_KEYFPPROS)),
 | 
				
			||||||
				row->get(cid2index(F_FISCIVACODS)));
 | 
									msk.get(F_CODCLIFORS), row->get(cid2index(F_FISCIVACODS)));
 | 
				
			||||||
			if (f.dlg() == DLG_OK)
 | 
								if (f.dlg() == DLG_OK)
 | 
				
			||||||
				app()._pro_mask->_riporta = true;
 | 
									app()._pro_mask->_riporta = true;
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
@ -4219,7 +4230,7 @@ void TPro_msk::set_scadenze(const char* fpprokeys)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TPro_msk::set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* piva)
 | 
					void TPro_msk::set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* codforn, const char* piva)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	_numero = numero;
 | 
						_numero = numero;
 | 
				
			||||||
	_datadoc = datadoc;
 | 
						_datadoc = datadoc;
 | 
				
			||||||
@ -4227,6 +4238,7 @@ void TPro_msk::set_doc(const char* numero, const char* datadoc, const char* totd
 | 
				
			|||||||
	_ritenute = ritenute;
 | 
						_ritenute = ritenute;
 | 
				
			||||||
	_protfppro.sset(protfppro);
 | 
						_protfppro.sset(protfppro);
 | 
				
			||||||
	_fpprokeys = fpprokeys;
 | 
						_fpprokeys = fpprokeys;
 | 
				
			||||||
 | 
						_codforn = codforn;
 | 
				
			||||||
	_piva = piva;
 | 
						_piva = piva;
 | 
				
			||||||
	set_righeiva(fpprokeys);
 | 
						set_righeiva(fpprokeys);
 | 
				
			||||||
	set_scadenze(fpprokeys);
 | 
						set_scadenze(fpprokeys);
 | 
				
			||||||
@ -4336,7 +4348,7 @@ void TPro_msk::abilita_piva(TMask* msk)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TPro_msk::TPro_msk(TMask& cg_msk) : TAutomask("cg2100t"), _riporta(false)
 | 
					TPro_msk::TPro_msk(TMask& cg_msk) : TAutomask("cg2100t"), _riporta(false), _codforn("")
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	TMask::set_handler(DLG_CONFIG, fppro_handler);
 | 
						TMask::set_handler(DLG_CONFIG, fppro_handler);
 | 
				
			||||||
	TMask::set_handler(DLG_OK, riporta_handler);
 | 
						TMask::set_handler(DLG_OK, riporta_handler);
 | 
				
			||||||
 | 
				
			|||||||
@ -418,6 +418,7 @@ private:
 | 
				
			|||||||
	TProtocollo _protfppro;
 | 
						TProtocollo _protfppro;
 | 
				
			||||||
	TString _fpprokeys;
 | 
						TString _fpprokeys;
 | 
				
			||||||
	TString _piva;
 | 
						TString _piva;
 | 
				
			||||||
 | 
						TString _codforn;
 | 
				
			||||||
	vector<riga_iva_s> _righe_iva;
 | 
						vector<riga_iva_s> _righe_iva;
 | 
				
			||||||
	vector<scadenza_s> _scadenze;
 | 
						vector<scadenza_s> _scadenze;
 | 
				
			||||||
	bool _riporta;
 | 
						bool _riporta;
 | 
				
			||||||
@ -449,7 +450,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	void set_righeiva(const char* fpprokeys);
 | 
						void set_righeiva(const char* fpprokeys);
 | 
				
			||||||
	void set_scadenze(const char* fpprokeys);
 | 
						void set_scadenze(const char* fpprokeys);
 | 
				
			||||||
	void set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* piva);
 | 
						void set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* codforn, const char* piva);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TString				get_numdoc() const { return _numero; }
 | 
						TString				get_numdoc() const { return _numero; }
 | 
				
			||||||
	TDate					get_datadoc() const { return _datadoc; }
 | 
						TDate					get_datadoc() const { return _datadoc; }
 | 
				
			||||||
@ -457,6 +458,7 @@ public:
 | 
				
			|||||||
	real					get_ritenute() { return _ritenute; }
 | 
						real					get_ritenute() { return _ritenute; }
 | 
				
			||||||
	TProtocollo&	get_protocollo() { return _protfppro; }
 | 
						TProtocollo&	get_protocollo() { return _protfppro; }
 | 
				
			||||||
	TString				get_fpprokeys() const { return _fpprokeys; }
 | 
						TString				get_fpprokeys() const { return _fpprokeys; }
 | 
				
			||||||
 | 
						TString				get_codforn() const { return _codforn; }
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	TString get_piva() const { return _piva; }
 | 
						TString get_piva() const { return _piva; }
 | 
				
			||||||
	const vector<riga_iva_s>& get_righeiva() { return _righe_iva; }
 | 
						const vector<riga_iva_s>& get_righeiva() { return _righe_iva; }
 | 
				
			||||||
@ -465,6 +467,7 @@ public:
 | 
				
			|||||||
	void add_scad(const TDate& date, const real& importo);
 | 
						void add_scad(const TDate& date, const real& importo);
 | 
				
			||||||
	bool should_bring_back() const { return _riporta; }
 | 
						bool should_bring_back() const { return _riporta; }
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	static TString& query_fppro(const TString& codforn, const TString& date);
 | 
						static TString& query_fppro(const TString& codforn, const TString& date);
 | 
				
			||||||
	static TString& query_fppro(const TString& stato_piva, const TString& piva, const TString& date);
 | 
						static TString& query_fppro(const TString& stato_piva, const TString& piva, const TString& date);
 | 
				
			||||||
	static TString& query_fppro(const TString& codforn, const TString& stato_piva, const TString& piva, const TString& where_str, const TString& date, const TString& keyprginvio, const TString& keyheaderfatt, const TString& keybodyfatt, bool order = true, bool piva_research = false);
 | 
						static TString& query_fppro(const TString& codforn, const TString& stato_piva, const TString& piva, const TString& where_str, const TString& date, const TString& keyprginvio, const TString& keyheaderfatt, const TString& keybodyfatt, bool order = true, bool piva_research = false);
 | 
				
			||||||
 | 
				
			|||||||
@ -395,9 +395,9 @@ const TCausale & TCache_causale::caus(const char* key, const int anno)
 | 
				
			|||||||
  return (const TCausale &) *objptr(k);
 | 
					  return (const TCausale &) *objptr(k);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TCausale & cached_causale(const char * codcaus, int anno)
 | 
					const TCausale & cached_causale(const char * codcaus, int year)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	HIDDEN TCache_causale __cache_causale;
 | 
						HIDDEN TCache_causale __cache_causale;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return __cache_causale.caus(codcaus, anno);
 | 
						return __cache_causale.caus(codcaus, year);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -82,7 +82,7 @@ public:
 | 
				
			|||||||
  virtual ~TCausale() {}
 | 
					  virtual ~TCausale() {}
 | 
				
			||||||
};                                               
 | 
					};                                               
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TCausale & cached_causale(const char * codcaus, const int year);
 | 
					const TCausale & cached_causale(const char * codcaus, const int year = 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Fatture
 | 
					// Fatture
 | 
				
			||||||
#define RIGA_IVA_DETRAIBILE      3
 | 
					#define RIGA_IVA_DETRAIBILE      3
 | 
				
			||||||
 | 
				
			|||||||
@ -312,18 +312,18 @@ void set_periodprec(bool flag)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool check_causale(const TString& cod_caus, bool acq)
 | 
					bool check_causale(const TString& cod_caus, bool acq)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return
 | 
						return cod_caus.full() && (
 | 
				
			||||||
		check_causale(cod_caus, "FA", acq) ||
 | 
							check_causale(cod_caus, "FA", acq) ||
 | 
				
			||||||
		check_causale(cod_caus, "BD", acq) ||
 | 
							check_causale(cod_caus, "BD", acq) ||
 | 
				
			||||||
		check_causale(cod_caus, "AF", acq) ||
 | 
							check_causale(cod_caus, "AF", acq) ||
 | 
				
			||||||
		check_causale(cod_caus, "FF", acq) ||
 | 
							check_causale(cod_caus, "FF", acq) ||
 | 
				
			||||||
		check_causale(cod_caus, "NC", acq) ||
 | 
							check_causale(cod_caus, "NC", acq) ||
 | 
				
			||||||
		check_causale(cod_caus, "ND", acq);
 | 
							check_causale(cod_caus, "ND", acq));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool check_causale(const TString& cod_caus, const TString& tipo_doc, bool acq)
 | 
					bool check_causale(const TString& cod_caus, const TString& tipo_doc, bool acq)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const TCausale caus(cod_caus);
 | 
						const TCausale& caus = cached_causale(cod_caus);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(tipo_doc == "FA" || tipo_doc == "BD" || tipo_doc == "AF" || tipo_doc == "FF")
 | 
						if(tipo_doc == "FA" || tipo_doc == "BD" || tipo_doc == "AF" || tipo_doc == "FF")
 | 
				
			||||||
		return caus.tipo_doc() == tipo_doc;
 | 
							return caus.tipo_doc() == tipo_doc;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user