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:
luca 2010-01-14 11:57:43 +00:00
parent 85a84d3103
commit d8f8dd5e3e

View File

@ -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 // 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; real qta;
if (conai_configured_class(cc))
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
{ {
FOR_EACH_PHYSICAL_RDOC(*this, i, r) if (r->is_merce() || r->is_omaggio()) FOR_EACH_PHYSICAL_RDOC(*this, i, r) if (r->is_merce() || r->is_omaggio())
{ {
const real row_qta = r->calc_conai_qta(type); const real rowqty = r->calc_conai_qta(cc);
if (!row_qta.is_zero()) qta += rowqty;
qta += row_qta;
} }
qta.round(5); // Arrotondamento al centigrammo
} }
return qta; return qta;
} }
@ -2863,16 +2848,8 @@ void TDocumento::update_conai()
real qta = qta_lorda; real qta = qta_lorda;
if (!cli_esente && !qta_lorda.is_zero() && !perc_esenz.is_zero()) if (!cli_esente && !qta_lorda.is_zero() && !perc_esenz.is_zero())
{ {
qta = qta_lorda * (CENTO - perc_esenz) / CENTO; // More precise qta = qta_lorda * (CENTO - perc_esenz) / CENTO;
qta.round(3); qta.round(5);
}
if (ct == CONAI_CAR)
{
ofstream conaicaz("conai.txt", ios::app);
conaicaz << "Lordo=" << qta_lorda << endl
<< "Esenzione=" << perc_esenz << endl
<< "Netto=" << qta << endl;
} }
if (qta > ZERO) if (qta > ZERO)