Patch level : 12.0 302
Files correlati : cg4.exe Commento : Ora i cespiti ammortizzabili non vengono più esclusi dalla liquidazione IVA. Aggiunta di nuovo la funzione che estraeva un record di pagamento per l'F24 dalla liquidazione. git-svn-id: svn://10.65.10.50/branches/R_10_00@23401 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									d536ae654a
								
							
						
					
					
						commit
						407aac8833
					
				@ -654,12 +654,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  int  previous_month (int m) const;
 | 
					  int  previous_month (int m) const;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  /* Funzioni accessorie: estrazione deleghe
 | 
					  void extract_f24(int m);
 | 
				
			||||||
  bool set_deleghe();
 | 
					 | 
				
			||||||
  bool extract_deleghe();
 | 
					 | 
				
			||||||
  bool extract_delega(int m, TArray& desc);
 | 
					 | 
				
			||||||
  bool video_conferma(const real&, const real&, const real&, bool to_del = false);
 | 
					 | 
				
			||||||
  */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // stampa
 | 
					  // stampa
 | 
				
			||||||
  void set_deltab(_DescrItem& d, bool iscred);
 | 
					  void set_deltab(_DescrItem& d, bool iscred);
 | 
				
			||||||
 | 
				
			|||||||
@ -145,15 +145,16 @@ bool TLiquidazione_app::recalc_all()
 | 
				
			|||||||
					break; 
 | 
										break; 
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
      } 
 | 
					      } 
 | 
				
			||||||
        
 | 
					    	extract_f24(_month); 
 | 
				
			||||||
      _month = save_month;      
 | 
					      _month = save_month;      
 | 
				
			||||||
    }  
 | 
					    }  
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
	const bool good = _prind->addstatus(1);
 | 
						const bool good = _prind->addstatus(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TApplication::set_firm(__firm);
 | 
					  TApplication::set_firm(__firm);
 | 
				
			||||||
  delete _prind;  _prind = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						delete _prind;  _prind = NULL;
 | 
				
			||||||
  return good;
 | 
					  return good;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1126,7 +1127,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
 | 
				
			|||||||
#ifdef DBG
 | 
					#ifdef DBG
 | 
				
			||||||
		const long nr = _mov->get_long(MOV_NUMREG);
 | 
							const long nr = _mov->get_long(MOV_NUMREG);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (nr == 23121 || nr == 23112)
 | 
							if (nr == 24894)
 | 
				
			||||||
			int i = 1 ;
 | 
								int i = 1 ;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2567,11 +2568,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
 | 
				
			|||||||
      // E quelli che non hanno la % prorata settata in tabella
 | 
					      // E quelli che non hanno la % prorata settata in tabella
 | 
				
			||||||
      real aaa = acquisti_iva;
 | 
					      real aaa = acquisti_iva;
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      // E'una questione molto dibattuta il fatti di escludere i beni ammortizzabili o no:
 | 
					 | 
				
			||||||
      // Nella versione precedente (10.0) non venivano esclusi, poi dal 4-9-2014 sono stati esclusi ed infine nuovamente ignorati dal 17-2-2015
 | 
					 | 
				
			||||||
      // Arriviamo al 17-09-2015 (data epica per altri motivi) e torniamo a tenerne conto per Pragma
 | 
					 | 
				
			||||||
      aaa -= ammort_det_iva; // Scarta gli acquisti di beni ammortizzabili
 | 
					 | 
				
			||||||
      
 | 
					 | 
				
			||||||
      if (percentuale1 != INVALID_PRORATA && percentuale1 != INVALID_PRORATA_ASSERT)
 | 
					      if (percentuale1 != INVALID_PRORATA && percentuale1 != INVALID_PRORATA_ASSERT)
 | 
				
			||||||
        aaa  -= rr1 ? *rr1 : ZERO;
 | 
					        aaa  -= rr1 ? *rr1 : ZERO;
 | 
				
			||||||
      if (percentuale2 != INVALID_PRORATA && percentuale2 != INVALID_PRORATA_ASSERT)
 | 
					      if (percentuale2 != INVALID_PRORATA && percentuale2 != INVALID_PRORATA_ASSERT)
 | 
				
			||||||
 | 
				
			|||||||
@ -1356,6 +1356,7 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
 | 
				
			|||||||
  //prospettino acconto
 | 
					  //prospettino acconto
 | 
				
			||||||
  if ( (month == 12 && (_freqviva == "M" || (_isbenzinaro && _gest4)))
 | 
					  if ( (month == 12 && (_freqviva == "M" || (_isbenzinaro && _gest4)))
 | 
				
			||||||
      || (month == 13 && _freqviva == "T" && !(_isbenzinaro && _gest4)) )
 | 
					      || (month == 13 && _freqviva == "T" && !(_isbenzinaro && _gest4)) )
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
    if (look_del(12,7)) //sia che sia a debito che a credito
 | 
					    if (look_del(12,7)) //sia che sia a debito che a credito
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      d->_s4 = "ACC";  
 | 
					      d->_s4 = "ACC";  
 | 
				
			||||||
@ -1372,7 +1373,7 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
 | 
				
			|||||||
      } 
 | 
					      } 
 | 
				
			||||||
      d->_s5 = t;
 | 
					      d->_s5 = t;
 | 
				
			||||||
    }            
 | 
					    }            
 | 
				
			||||||
    
 | 
						}
 | 
				
			||||||
  return d;  
 | 
					  return d;  
 | 
				
			||||||
}                                   
 | 
					}                                   
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,100 @@
 | 
				
			|||||||
#include "cg4800b.h"                           
 | 
					#include "cg4800b.h"                           
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void TLiquidazione_app::extract_f24(int month)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (main_app().has_module(GVAUT))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							bool versare = false;
 | 
				
			||||||
 | 
							const TRectype & lim = get_lim(month);
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
							if (lim.full())
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								real topay = result_liq(month); // TBC non si puo' fa' accussi'!!!!! pena il casino!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (month == 12)   
 | 
				
			||||||
 | 
									versare = topay > _ver->get(I_ANNUALE);
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									versare = topay > _ver->get(I_PERIODICO);
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
								real intr  = lim.get_real("R14");
 | 
				
			||||||
 | 
								topay     += intr;   // lo vogliono registrato con interessi
 | 
				
			||||||
 | 
								real nrnd  = topay;
 | 
				
			||||||
 | 
								round_imposta(topay);     // importo totale del versamento arrotondato
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
								TLocalisamfile f24(LF_RIGHEF24);
 | 
				
			||||||
 | 
								TTable trib("%TRB");
 | 
				
			||||||
 | 
								long progr = 0L;
 | 
				
			||||||
 | 
								const bool mensile = _freqviva == "M"; 
 | 
				
			||||||
 | 
								const int codtrib = mensile ? 6000 + month : 6031 + (month / 3);
 | 
				
			||||||
 | 
								TString descr("IVA ANNUALE");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								TDate scad(16, (mensile ? month : ((month + 2) / 3) * 3), atoi(_year));
 | 
				
			||||||
 | 
								const long codditta = _nditte->lfile().get_long("CODDITTA");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (month < 13)
 | 
				
			||||||
 | 
									scad.addmonth(mensile ? 1 : 2);
 | 
				
			||||||
 | 
								while (scad.wday() > 5)
 | 
				
			||||||
 | 
									++scad;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (month < 13)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									if (mensile)
 | 
				
			||||||
 | 
										descr.format("IVA mese di %s %s", itom(month), (const char *)_year);
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										descr.format("IVA %s Trimestre %s", itor(month / 3 + 1), (const char *)_year);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								trib.put("CODTAB", codtrib);
 | 
				
			||||||
 | 
								if (trib.read() == NOERR)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									f24.setkey(4);
 | 
				
			||||||
 | 
									f24.put(F24_TIPOINTEST, "D");
 | 
				
			||||||
 | 
									f24.put(F24_INTEST, codditta);
 | 
				
			||||||
 | 
									f24.put(F24_ANNO, _year);
 | 
				
			||||||
 | 
									f24.put(F24_TRIBUTO, codtrib);
 | 
				
			||||||
 | 
									if (f24.read() == NOERR)
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										if (f24.get(F24_DATAVERS).blank())
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											f24.put(F24_IMPORTODEB, topay);
 | 
				
			||||||
 | 
											f24.put(F24_INTIVATRIM, intr);
 | 
				
			||||||
 | 
											f24.put(F24_DATASCAD, scad);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											const int err = f24.rewrite();
 | 
				
			||||||
 | 
											
 | 
				
			||||||
 | 
											if (err != NOERR)
 | 
				
			||||||
 | 
												error_box(FR("Ditta %ld\n%s\nerrore %d"), codditta, (const char *) descr, err);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										f24.setkey(1);
 | 
				
			||||||
 | 
										if (f24.last() == NOERR)
 | 
				
			||||||
 | 
											progr = f24.get_long(F24_PROGR);
 | 
				
			||||||
 | 
										progr++;
 | 
				
			||||||
 | 
										f24.zero();
 | 
				
			||||||
 | 
										f24.put(F24_PROGR, progr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										f24.put(F24_TRIBUTO, codtrib);
 | 
				
			||||||
 | 
										f24.put(F24_TIPOINTEST, "D");
 | 
				
			||||||
 | 
										f24.put(F24_INTEST, codditta);
 | 
				
			||||||
 | 
										f24.put(F24_DESCR, descr);
 | 
				
			||||||
 | 
										f24.put(F24_DATASCAD, scad);
 | 
				
			||||||
 | 
										f24.put(F24_ANNO, _year);
 | 
				
			||||||
 | 
										f24.put(F24_IMPORTODEB, topay);
 | 
				
			||||||
 | 
										f24.put(F24_INTIVATRIM, intr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										const int err = f24.write();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										if (err != NOERR)
 | 
				
			||||||
 | 
											error_box(FR("Ditta %ld\n%s\nerrore %d"), codditta, (const char *) descr, err);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// -------------------------------------------- calcolo acconto dicembre
 | 
					// -------------------------------------------- calcolo acconto dicembre
 | 
				
			||||||
bool TLiquidazione_app::set_acconto(real& inf, real& ina)
 | 
					bool TLiquidazione_app::set_acconto(real& inf, real& ina)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -121,6 +215,7 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
 | 
				
			|||||||
      recalc_acconto(inf, ina);
 | 
					      recalc_acconto(inf, ina);
 | 
				
			||||||
      onemade = TRUE;
 | 
					      onemade = TRUE;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
							extract_f24(_month);
 | 
				
			||||||
    _prind->addstatus(1);
 | 
					    _prind->addstatus(1);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user