Patch level : 12.0
Files correlati : cg2100.cpp cg2102.cpp cglib01.cpp Commento: Sistemati errori in prima nota. nei documenti automatici delle integrazioni non veniva riportato il numero di documento
This commit is contained in:
		
							parent
							
								
									2c5008ac22
								
							
						
					
					
						commit
						0fe88a6973
					
				@ -1567,7 +1567,7 @@ void TPrimanota_application::set_movcoll(const long movcoll, const long numreg)
 | 
			
		||||
}
 | 
			
		||||
int TPrimanota_application::controlli_f1(const TMask& m)
 | 
			
		||||
{
 | 
			
		||||
		if (iva_mask(m) && m.get(F_PROKEY).full() && has_f1_db(m) && fp_db().sq_is_connect() && check_causale(m.get(F_CODCAUS)))
 | 
			
		||||
		if (iva_mask(m) && m.get(F_PROKEY).full() && has_f1_db(m) && fp_db().sq_is_connect() && check_causale(m.get(F_CODCAUS), m.get_date(F_DATAREG).year()))
 | 
			
		||||
		{
 | 
			
		||||
			TToken_string keys(m.get(F_PROKEY), ';');
 | 
			
		||||
			const TDate dataoraric = fppro_db().set_keys(keys).get_dataorarioric();
 | 
			
		||||
@ -1901,18 +1901,19 @@ void TPrimanota_application::genera_automatico(int tipo, const char* causimm)
 | 
			
		||||
      {
 | 
			
		||||
				TSheet_field & iva = app().ivas();
 | 
			
		||||
				const int items = iva.items();
 | 
			
		||||
				const TCausale & causreg = cached_causale(causimm);
 | 
			
		||||
				const TDate datareg = m.get_date(F_DATAREG);
 | 
			
		||||
				const TCausale & causreg = cached_causale(causimm, datareg.year());
 | 
			
		||||
				const TString8 tipo_doc_sdi = causreg.tipodocsdi();
 | 
			
		||||
				const int tipo_doc = atoi(tipo_doc_sdi.mid(2));
 | 
			
		||||
 | 
			
		||||
				if (tipo_doc_sdi.starts_with("TD") && (tipo_doc > 15 && tipo_doc < 20))
 | 
			
		||||
				{
 | 
			
		||||
					_automatico->_datadoc = m.get(F_DATAREG);
 | 
			
		||||
					_automatico->_numdoc.cut(0);
 | 
			
		||||
					_automatico->_numdoc = m.get(F_NUMDOC);
 | 
			
		||||
					_automatico->_datadoc = datareg;
 | 
			
		||||
 | 
			
		||||
					TRegistro & cr = (TRegistro &) cached_registro(causreg.codice_registro());
 | 
			
		||||
	//				cr.reread();
 | 
			
		||||
					_automatico->_numdoc << cr.protocol() + 1;
 | 
			
		||||
					//TRegistro & cr = (TRegistro &) cached_registro(causreg.codice_registro());
 | 
			
		||||
					//cr.reread();
 | 
			
		||||
					//_automatico->_numdoc << cr.protocol() + 1;
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
@ -2007,7 +2008,7 @@ void TPrimanota_application::genera_automatico(int tipo, const char* causimm)
 | 
			
		||||
      break;
 | 
			
		||||
    case 2:  // Regolarizzazione IVA
 | 
			
		||||
      { 
 | 
			
		||||
				TCausale caus_reg(_automatico->_causale);
 | 
			
		||||
				TCausale caus_reg(_automatico->_causale, _automatico->_datadoc.year());
 | 
			
		||||
				TBill contocf; caus_reg.bill(1, contocf);
 | 
			
		||||
				char tcf_reg = contocf.tipo();
 | 
			
		||||
 | 
			
		||||
@ -2741,12 +2742,13 @@ int TPrimanota_application::save_fppro()
 | 
			
		||||
    else return pro_notsaved;  // In altre modalita' esco senza fare nulla sul db
 | 
			
		||||
  }
 | 
			
		||||
    
 | 
			
		||||
  // Controllo che sto registrando un documento d'acquisto
 | 
			
		||||
  if (!check_causale(msk.get(F_CODCAUS)))
 | 
			
		||||
    return pro_notsaved;
 | 
			
		||||
  
 | 
			
		||||
  const TDate     data_operazione(msk.get(F_DATAREG));
 | 
			
		||||
  const TDate     data_documento(msk.get(F_DATADOC));
 | 
			
		||||
 | 
			
		||||
	// Controllo che sto registrando un documento d'acquisto
 | 
			
		||||
	if (!check_causale(msk.get(F_CODCAUS), data_operazione.year()))
 | 
			
		||||
		return pro_notsaved;
 | 
			
		||||
 | 
			
		||||
  const TString&  numero_docext = msk.get(F_NUMDOCEXT);
 | 
			
		||||
  real            tot_doc       = msk.get_real(F_TOTALE);
 | 
			
		||||
  const real      ritfis        = msk.get_real(F_RITFIS);
 | 
			
		||||
 | 
			
		||||
@ -2260,7 +2260,7 @@ void TPrimanota_application::check_fppro_fields(TMask& m)
 | 
			
		||||
{
 | 
			
		||||
	const bool after_data = m.get_date(F_DATAREG) >= get_data_start_fatt();
 | 
			
		||||
	
 | 
			
		||||
	if (!check_causale(m.get(F_CODCAUS)) || !app().has_module(FPAUT) || !after_data)
 | 
			
		||||
	if (!check_causale(m.get(F_CODCAUS), m.get_date(F_DATAREG).year()) || !app().has_module(FPAUT) || !after_data)
 | 
			
		||||
	{
 | 
			
		||||
		if(m.find_by_id(DLG_LINK) != nullptr)
 | 
			
		||||
			m.disable(DLG_LINK);
 | 
			
		||||
@ -4140,8 +4140,9 @@ void TPrimanota_application::insert_part_scad(TConfig& ini) // che cazzo signifi
 | 
			
		||||
bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
 | 
			
		||||
{
 | 
			
		||||
	TMask& cg_msk = f.mask();
 | 
			
		||||
	const int year = cg_msk.get_date(F_DATAREG).year();
 | 
			
		||||
 | 
			
		||||
	if (!app().has_module(FPAUT) || key != K_SPACE && key != K_TAB || !check_causale(cg_msk.get(F_CODCAUS)))
 | 
			
		||||
	if (!app().has_module(FPAUT) || key != K_SPACE && key != K_TAB || !check_causale(cg_msk.get(F_CODCAUS), year))
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
  TPro_msk * msk = app()._pro_mask;
 | 
			
		||||
@ -4186,7 +4187,7 @@ bool TPrimanota_application::scollega_handler(TMask_field& f, KEY key)
 | 
			
		||||
	{
 | 
			
		||||
	TMask& cg_msk = f.mask();
 | 
			
		||||
 | 
			
		||||
		if (check_causale(cg_msk.get(F_CODCAUS)) && cg_msk.get_bool(F_COLFPPRO))
 | 
			
		||||
		if (check_causale(cg_msk.get(F_CODCAUS), cg_msk.get_date(F_DATAREG).year()) && cg_msk.get_bool(F_COLFPPRO))
 | 
			
		||||
	{
 | 
			
		||||
		scollega(true);
 | 
			
		||||
		app().clean_fppro();
 | 
			
		||||
 | 
			
		||||
@ -65,6 +65,9 @@ bool TCausale::read(const char* cod, int year)
 | 
			
		||||
	_corrisp = false;
 | 
			
		||||
  _year = year;
 | 
			
		||||
 | 
			
		||||
	if (_year <= 0)
 | 
			
		||||
		_year = today.year();
 | 
			
		||||
 | 
			
		||||
	if (cod && *cod > ' ')
 | 
			
		||||
	{
 | 
			
		||||
		_rec = cache().get(LF_CAUSALI, cod);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user