Finita correzione al calcolo IVA
git-svn-id: svn://10.65.10.50/trunk@5092 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									ccc3eeabd5
								
							
						
					
					
						commit
						42a386c25d
					
				@ -1034,11 +1034,6 @@ public:
 | 
			
		||||
  int  scadenze_items() { return _scadenze_array.items(); }  // restituisce il numero di scadenze
 | 
			
		||||
  TString_array& scadenze() { return _scadenze_array; }
 | 
			
		||||
 | 
			
		||||
  // Funzioni di totalizzazione
 | 
			
		||||
//  real& tot_importi_netti();
 | 
			
		||||
//  real& tot_imposte();
 | 
			
		||||
//  real tot_spese();
 | 
			
		||||
//  real tot_documento();
 | 
			
		||||
  // restituisce tot_imponibili, tot_esenti, tot_nonsoggetti a seconda del selettore:  
 | 
			
		||||
  // 1 = regime normale
 | 
			
		||||
  // 2 = da ventilare (non usato)
 | 
			
		||||
@ -1049,9 +1044,6 @@ public:
 | 
			
		||||
  // per avere esenti + non soggetti il selettore sara' 20 e cosi' via.
 | 
			
		||||
  real tot_imponibili(byte selector);
 | 
			
		||||
  
 | 
			
		||||
  // Reperisce l'informazione <what> dal campo G1 della testata
 | 
			
		||||
/*  const char* get_head_info(const TString& what); */
 | 
			
		||||
  
 | 
			
		||||
  // Funzioni per settare i parametri
 | 
			
		||||
  void set_decimals(dec_parm & parm) { _parm = parm ; }
 | 
			
		||||
  void set_condv(TCli_for * cli); // Cambia le condizioni di vendita
 | 
			
		||||
 | 
			
		||||
@ -72,12 +72,12 @@ void TTipo_riga_documento::read_formule()
 | 
			
		||||
  _imponibile = profile.get("IMPONIBILE", "MAIN");
 | 
			
		||||
  if (_imponibile.empty())
 | 
			
		||||
    _imponibile = "IMPONIBILE";
 | 
			
		||||
  TFormula_documento * o = (TFormula_documento*)_formule_riga.objptr(_imponibile);
 | 
			
		||||
  if (o == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    o = new TFormula_documento(_riga, _imponibile, "IMPORTO(1)");
 | 
			
		||||
    _formule_riga.add(_imponibile, o);
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  TTable frr("%FRR");
 | 
			
		||||
  
 | 
			
		||||
  frr.put("CODTAB", _imponibile);     
 | 
			
		||||
  if (frr.read() != NOERR)
 | 
			
		||||
    _formule_riga.add(_imponibile, new TFormula_documento(_riga, _imponibile, "IMPORTO(1)"), TRUE);
 | 
			
		||||
  if (_formule.find(_imponibile) < 0)
 | 
			
		||||
    _formule.add(_imponibile);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -120,12 +120,12 @@ void TTipo_documento::read_formule()
 | 
			
		||||
  _totale = profile.get("TOTALE", "MAIN");
 | 
			
		||||
  if (_totale.empty())
 | 
			
		||||
    _totale = "TOTDOC";             
 | 
			
		||||
  TFormula_documento * o = (TFormula_documento*)_formule_documento.objptr(_totale);
 | 
			
		||||
  if (o == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    o = new TFormula_documento(_documento, _totale, "IMPONIBILI()+IMPOSTE()");
 | 
			
		||||
    _formule_documento.add(_totale, o);
 | 
			
		||||
  }
 | 
			
		||||
                                                   
 | 
			
		||||
  TTable frd("%FRD");                                                 
 | 
			
		||||
       
 | 
			
		||||
  frd.put("CODTAB", _totale);     
 | 
			
		||||
  if (frd.read() != NOERR)
 | 
			
		||||
    _formule_documento.add(_totale, new TFormula_documento(_documento, _totale, "IMPONIBILI()+IMPOSTE()"), TRUE);
 | 
			
		||||
  if (_formule.find(_totale) < 0)
 | 
			
		||||
    _formule.add(_totale);
 | 
			
		||||
  _totale_netto = "_";
 | 
			
		||||
@ -134,24 +134,20 @@ void TTipo_documento::read_formule()
 | 
			
		||||
  _basesconto = profile.get("BASESCONTO", "MAIN");
 | 
			
		||||
  if (_basesconto.empty())
 | 
			
		||||
    _basesconto = "BASESCONTO";
 | 
			
		||||
  o = (TFormula_documento*)_formule_documento.objptr(_basesconto);
 | 
			
		||||
  if (o == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    o = new TFormula_documento(_documento, _basesconto, "SOMMA(\"IMPONIBILE()\", \"(TIPO() != 'S') && (TIPO() != 'C')\")");
 | 
			
		||||
    _formule_documento.add(_basesconto, o);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  frd.put("CODTAB", _basesconto);     
 | 
			
		||||
  if (frd.read() != NOERR)
 | 
			
		||||
    _formule_documento.add(_basesconto, new TFormula_documento(_documento, _basesconto, "SOMMA(\"IMPONIBILE()\", \"(TIPO() != 'S') && (TIPO() != 'C')\")"), TRUE);
 | 
			
		||||
  if (_formule.find(_basesconto) < 0)
 | 
			
		||||
    _formule.add(_basesconto);
 | 
			
		||||
  
 | 
			
		||||
  _spese = profile.get("SPESE", "MAIN");
 | 
			
		||||
  if (_spese.empty())
 | 
			
		||||
    _spese = "SPESE";
 | 
			
		||||
  o = (TFormula_documento*)_formule_documento.objptr(_spese);
 | 
			
		||||
  if (o == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    o = new TFormula_documento(_documento, _spese, "SOMMA(\"IMPONIBILE()\", \"TIPO() != 'S'\")");
 | 
			
		||||
    _formule_documento.add(_spese, o);
 | 
			
		||||
  }
 | 
			
		||||
    
 | 
			
		||||
  frd.put("CODTAB", _spese);     
 | 
			
		||||
  if (frd.read() != NOERR)
 | 
			
		||||
    _formule_documento.add(_spese, new TFormula_documento(_documento, _spese, "SOMMA(\"IMPONIBILE()\", \"TIPO() == 'S'\")"), TRUE);
 | 
			
		||||
  if (_formule.find(_spese) < 0)
 | 
			
		||||
    _formule.add(_spese);
 | 
			
		||||
}
 | 
			
		||||
@ -198,7 +194,7 @@ TFormula_documento * TTipo_documento::succ_formula(bool restart)
 | 
			
		||||
/////////////////////////////////////////////////////////////
 | 
			
		||||
TRiepilogo_iva& TRiepilogo_iva::copy(const TRiepilogo_iva& a)
 | 
			
		||||
{ 
 | 
			
		||||
  _codiva = a._codiva;
 | 
			
		||||
  (TRectype &) _codiva = (TRectype &) a._codiva;
 | 
			
		||||
  _imp = a._imp;
 | 
			
		||||
  _imp_spese = a._imp_spese;
 | 
			
		||||
  _iva = a._iva;
 | 
			
		||||
 | 
			
		||||
@ -49,13 +49,11 @@ void TDocumentoEsteso::compile_summary()
 | 
			
		||||
{
 | 
			
		||||
  _sum_filter = 0;
 | 
			
		||||
  _summary_array.destroy();
 | 
			
		||||
//  _imposte = ZERO;
 | 
			
		||||
//  _importi_netti = ZERO;
 | 
			
		||||
  const int ndec = in_valuta() ? 3 : 0;     
 | 
			
		||||
  update_tabella_iva();
 | 
			
		||||
  _summary_table = tabella_iva();
 | 
			
		||||
  _summary_table.restart();
 | 
			
		||||
  for (TRiepilogo_iva * ri = (TRiepilogo_iva *) _summary_table.get(); ri != NULL;
 | 
			
		||||
       ri = (TRiepilogo_iva *) _summary_table.get());
 | 
			
		||||
       ri = (TRiepilogo_iva *) _summary_table.get())
 | 
			
		||||
  {             
 | 
			
		||||
    real imponibile(ri->imponibile());
 | 
			
		||||
    real imposta(ri->imposta());
 | 
			
		||||
@ -219,35 +217,6 @@ void TDocumentoEsteso::scadenze_reset()
 | 
			
		||||
    _scadenze_current = 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
/*
 | 
			
		||||
real& TDocumentoEsteso::tot_importi_netti()
 | 
			
		||||
{
 | 
			
		||||
  if (!summary_compiled()) compile_summary();
 | 
			
		||||
  return _importi_netti;  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& TDocumentoEsteso::tot_imposte()
 | 
			
		||||
{
 | 
			
		||||
  if (!summary_compiled()) compile_summary();
 | 
			
		||||
  return _imposte;  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real TDocumentoEsteso::tot_spese()
 | 
			
		||||
{
 | 
			
		||||
// TString16 t("TOTSP");
 | 
			
		||||
//  real number(get_head_info(t));
 | 
			
		||||
//  return number;
 | 
			
		||||
  return spese();
 | 
			
		||||
}               
 | 
			
		||||
 | 
			
		||||
real TDocumentoEsteso::tot_documento()
 | 
			
		||||
{
 | 
			
		||||
  if (!summary_compiled()) compile_summary();
 | 
			
		||||
  real number = _imposte + _importi_netti;
 | 
			
		||||
  return number;  
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
real TDocumentoEsteso::tot_imponibili(byte selector)
 | 
			
		||||
{
 | 
			
		||||
  if (!summary_compiled()) compile_summary();
 | 
			
		||||
@ -264,25 +233,6 @@ real TDocumentoEsteso::tot_imponibili(byte selector)
 | 
			
		||||
  return number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
const char* TDocumentoEsteso::get_head_info(const TString & what)
 | 
			
		||||
{
 | 
			
		||||
  TToken_string memo(head().get("G1"),'\n'); // prende il campo memo con i totalizzatori. Un totalizzatore per riga nella forma <MACRO>=<VALORE>
 | 
			
		||||
  TString rt;
 | 
			
		||||
  const int items = memo.items();
 | 
			
		||||
  for (int i = 0; i<items; i++) // scorre le righe del memo
 | 
			
		||||
  {
 | 
			
		||||
    TToken_string item(memo.get(),'=');
 | 
			
		||||
    if (what == item.get())
 | 
			
		||||
    {
 | 
			
		||||
      rt = item.get();
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return (const char*) rt;
 | 
			
		||||
} */
 | 
			
		||||
 | 
			
		||||
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec, TCond_vendita * condv)
 | 
			
		||||
 : TDocumento(rec, condv), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user