Patch level : 12.0 860

Files correlati     : cg2.exe
Commento            :
- Corretta importazione scadenze con f1
- Aggiunto riporto tipo pag/ulteriore classif.
This commit is contained in:
Simone Palacino 2019-07-29 17:41:50 +02:00
parent a478d38aee
commit 8f3304c0aa

View File

@ -2431,12 +2431,43 @@ void TPrimanota_application::set_scad_f1(TMask& m)
m.set(FS_NRATE, rate);
// Correggo le percentuali
TPagamento& pag = app().pagamento();
const real totale = real(m.get(F_TOTALE)) + real(m.get(F_RITFIS));
for (int i = 0; i < rate; i++)
ps.row(i).add(real(ps.row(i).get(1)) * CENTO / totale, 3);
{
const real new_perc = real(ps.row(i).get(1)) * CENTO / totale;
ps.row(i).add(new_perc, 3);
pag.set_percrata(i, new_perc);
}
set_totale_pagamento(true); // Aggiorno pagamento
set_banche(m);
pag.set_sheet(ps);
_pag_rows = ps.rows_array(); // copia sheet
if(rate != TPagamento(m.get(F_CODPAG)).n_rate())
warning_box("Attenzione il numero delle rate del codice pagamento in testata non corrisponde al\nnumero di scadenze presenti nella fattura elettronica. Modificare il codice pagamento.");
else
{
// Metto a posto il tipo e ulteriore classficazione
TTable riga_pag("%RPG");
TTable cod_pag("%CPG");
for (int i = 0; i < rate; i++)
{
TString rp; rp << m.get(F_CODPAG) << " " << i;
riga_pag.put("CODTAB", rp);
rp = m.get(F_CODPAG);
cod_pag.put("CODTAB", rp);
if (riga_pag.read() == NOERR)
{
const int tipo_r = riga_pag.get_int("I1");
const char ult_c = cod_pag.read() == NOERR ? cod_pag.get("S5")[0] : ' ';
TToken_string& row = ps.row(i);
row.add(tipo_r, 4); // 4 - Tipo rata
row.add(ult_c, 5); // 5 - Ulteriore classificazione
row.add(pag.desc_tipo(tipo_r, ult_c), 6); // 6 - Descrizione tipo rata
}
}
}
}
bool TPrimanota_application::save(bool check_dirty)