Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : roba per calcolo conai git-svn-id: svn://10.65.10.50/trunk@19922 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									85a84d3103
								
							
						
					
					
						commit
						d8f8dd5e3e
					
				@ -2758,33 +2758,18 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Calcola il peso in Kg degli imballaggi di una data categoria CONAI
 | 
			
		||||
real TDocumento::calc_conai_qta(TCONAI_class type)
 | 
			
		||||
real TDocumento::calc_conai_qta(TCONAI_class cc)
 | 
			
		||||
{             
 | 
			
		||||
	real qta;
 | 
			
		||||
 | 
			
		||||
  if (type == CONAI_CAR)
 | 
			
		||||
  {
 | 
			
		||||
    ofstream conaicaz("conai.txt");
 | 
			
		||||
    FOR_EACH_PHYSICAL_RDOC(*this, i, r) if (r->is_merce() || r->is_omaggio())
 | 
			
		||||
  	{
 | 
			
		||||
    	const real row_qta = r->calc_conai_qta(type);
 | 
			
		||||
      if (!row_qta.is_zero())
 | 
			
		||||
      {
 | 
			
		||||
        conaicaz << "Riga(" << i << ")=" << row_qta << endl;
 | 
			
		||||
  		  qta += row_qta;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
  if (conai_configured_class(cc))
 | 
			
		||||
  {
 | 
			
		||||
    FOR_EACH_PHYSICAL_RDOC(*this, i, r) if (r->is_merce() || r->is_omaggio())
 | 
			
		||||
  	{
 | 
			
		||||
    	const real row_qta = r->calc_conai_qta(type);
 | 
			
		||||
      if (!row_qta.is_zero())
 | 
			
		||||
  		  qta += row_qta;
 | 
			
		||||
    {
 | 
			
		||||
      const real rowqty = r->calc_conai_qta(cc);
 | 
			
		||||
	    qta += rowqty;
 | 
			
		||||
    }
 | 
			
		||||
    qta.round(5); // Arrotondamento al centigrammo
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return qta;
 | 
			
		||||
}               
 | 
			
		||||
 | 
			
		||||
@ -2863,16 +2848,8 @@ void TDocumento::update_conai()
 | 
			
		||||
        real qta = qta_lorda;
 | 
			
		||||
        if (!cli_esente && !qta_lorda.is_zero() && !perc_esenz.is_zero())
 | 
			
		||||
        {
 | 
			
		||||
					qta = qta_lorda * (CENTO - perc_esenz) / CENTO;  // More precise
 | 
			
		||||
          qta.round(3);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ct == CONAI_CAR)
 | 
			
		||||
        {
 | 
			
		||||
          ofstream conaicaz("conai.txt", ios::app);
 | 
			
		||||
          conaicaz << "Lordo=" << qta_lorda << endl
 | 
			
		||||
                   << "Esenzione=" << perc_esenz << endl
 | 
			
		||||
                   << "Netto=" << qta << endl;
 | 
			
		||||
          qta = qta_lorda * (CENTO - perc_esenz) / CENTO;
 | 
			
		||||
          qta.round(5);
 | 
			
		||||
        }
 | 
			
		||||
				
 | 
			
		||||
        if (qta > ZERO)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user