Merge remote-tracking branch 'origin/R_10_00' into R_10_00
This commit is contained in:
commit
4480ea870e
@ -1379,50 +1379,55 @@ bool TDoc_fp::export_info_articolo(TFPRiga_documento* rdoc, TPaf_record& paf1900
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controllo se ha il CONAI in tal caso aggiungo i dati
|
// Controllo se ha il CONAI in tal caso aggiungo i dati
|
||||||
for (int i = 0; i < FR_CMAX; i++)
|
const TTipo_documento & tipodoc = rdoc->doc().tipo();
|
||||||
{
|
|
||||||
if (rdoc->get(conai_peso_name(i)).full() && !_has_cust)
|
if (tipodoc.add_conai())
|
||||||
|
for (int i = 0; i < FR_CMAX; i++)
|
||||||
{
|
{
|
||||||
reset(paf2100f);
|
const TString scat(rdoc->get(conai_sottocat_name(i)));
|
||||||
paf2100f.set("PK_KEYNLINEA", static_cast<long>(riga_doc));
|
|
||||||
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
|
||||||
|
|
||||||
TString scat = rdoc->get(conai_sottocat_name(i));
|
if (scat.full() && cache().get("&VESCC", scat).not_empty() && !_has_cust)
|
||||||
TString msg_conai;
|
{
|
||||||
|
reset(paf2100f);
|
||||||
|
paf2100f.set("PK_KEYNLINEA", static_cast<long>(riga_doc));
|
||||||
|
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
||||||
|
|
||||||
msg_conai << "Contributo CONAI " << conai_material(conai_str2class(scat)) << " (Kg)";
|
TString msg_conai;
|
||||||
paf2100f.set("PK_TIPODATO", "CONAI");
|
|
||||||
paf2100f.set("PK_RIFDATO", msg_conai);
|
msg_conai << "Contributo CONAI " << conai_material(conai_str2class(scat)) << " (Kg)";
|
||||||
paf2100f.set("PK_RIFNUMERO", rdoc->get_real(conai_peso_name(i)).string());
|
paf2100f.set("PK_TIPODATO", "CONAI");
|
||||||
ok &= insert(paf2100f);
|
paf2100f.set("PK_RIFDATO", msg_conai);
|
||||||
|
paf2100f.set("PK_RIFNUMERO", rdoc->get_real(conai_peso_name(i)).string());
|
||||||
|
ok &= insert(paf2100f);
|
||||||
|
|
||||||
|
|
||||||
TLocalisamfile cfven(LF_CFVEN);
|
TLocalisamfile cfven(LF_CFVEN);
|
||||||
cfven.put("TIPOCF", "C");
|
cfven.put("TIPOCF", "C");
|
||||||
cfven.put("CODCF", rdoc->doc().codcf());
|
cfven.put("CODCF", rdoc->doc().codcf());
|
||||||
cfven.read();
|
cfven.read();
|
||||||
TString esen_field = conai_esenzione_name(conai_str2class(scat));
|
TString esen_field = conai_esenzione_name(conai_str2class(scat));
|
||||||
|
|
||||||
real perc_esenz = cfven.get_real(esen_field);
|
real perc_esenz = cfven.get_real(esen_field);
|
||||||
if (perc_esenz > ZERO)
|
if (perc_esenz > ZERO)
|
||||||
{
|
{
|
||||||
reset(paf2100f);
|
reset(paf2100f);
|
||||||
paf2100f.set("PK_KEYNLINEA", static_cast<long>(riga_doc));
|
paf2100f.set("PK_KEYNLINEA", static_cast<long>(riga_doc));
|
||||||
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
||||||
|
|
||||||
real qta = rdoc->calc_conai_qta(i);
|
real qta = rdoc->calc_conai_qta(i);
|
||||||
qta = qta * perc_esenz / CENTO;
|
qta = qta * perc_esenz / CENTO;
|
||||||
qta.round(2);
|
qta.round(2);
|
||||||
TString msg_esen; msg_esen << "Esenzione CONAI sul totale riga (Kg)";
|
TString msg_esen; msg_esen << "Esenzione CONAI sul totale riga (Kg)";
|
||||||
|
|
||||||
paf2100f.set("PK_TIPODATO", "ESEN CONAI");
|
paf2100f.set("PK_TIPODATO", "ESEN CONAI");
|
||||||
paf2100f.set("PK_RIFDATO", msg_esen);
|
paf2100f.set("PK_RIFDATO", msg_esen);
|
||||||
paf2100f.set("PK_RIFNUMERO", qta);
|
paf2100f.set("PK_RIFNUMERO", qta);
|
||||||
ok &= insert(paf2100f);
|
ok &= insert(paf2100f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
const TFirm& TDoc_fp::get_firm()
|
const TFirm& TDoc_fp::get_firm()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user