Corretto raddoppio dei non-assegnati sullo sheet
git-svn-id: svn://10.65.10.50/trunk@2136 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9e482a0ea7
commit
fb0eaada3a
@ -555,40 +555,42 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TRecord_array& unas = game->unassigned();
|
||||
const int lastp = unas.last_row();
|
||||
for (int pa = unas.first_row(); pa <= lastp; pa = unas.succ_row(pa))
|
||||
{
|
||||
const TRectype& pag = unas.row(pa);
|
||||
const TRiga_partite& sum = game->riga(pa);
|
||||
TImporto imp(sum.sezione(), ZERO);
|
||||
}
|
||||
|
||||
TRecord_array& unas = game->unassigned();
|
||||
const int lastp = unas.last_row();
|
||||
for (int pa = unas.first_row(); pa <= lastp; pa = unas.succ_row(pa))
|
||||
{
|
||||
const TRectype& pag = unas.row(pa);
|
||||
const TRiga_partite& sum = game->riga(pa);
|
||||
TImporto imp(sum.sezione(), ZERO);
|
||||
|
||||
TToken_string& row = scadenze.row(scadenze.add(""));
|
||||
row.add(pag.get(PAGSCA_NRIGA));
|
||||
row.add(pag.get(PAGSCA_NRATA));
|
||||
row.add("");
|
||||
row.add(sum.get(PART_DATADOC));
|
||||
row.add(sum.get(PART_DESCR));
|
||||
TImporto i(sum.sezione(), pag.get_real(PAGSCA_IMPORTO));
|
||||
TToken_string& row = scadenze.row(scadenze.add(""));
|
||||
row.add(pag.get(PAGSCA_NRIGA));
|
||||
row.add(pag.get(PAGSCA_NRATA));
|
||||
row.add("");
|
||||
row.add(sum.get(PART_DATADOC));
|
||||
row.add(sum.get(PART_DESCR));
|
||||
TImporto i(sum.sezione(), pag.get_real(PAGSCA_IMPORTO));
|
||||
i.normalize();
|
||||
add_importo(row, i);
|
||||
tot_lit += i;
|
||||
|
||||
const real& impval = pag.get_real(PAGSCA_IMPORTOVAL);
|
||||
if (!impval.is_zero())
|
||||
{
|
||||
i = TImporto(sum.sezione(), impval);
|
||||
i.normalize();
|
||||
tot_lit += i;
|
||||
add_importo(row, i);
|
||||
if (in_valuta)
|
||||
{
|
||||
i = TImporto(sum.sezione(), pag.get_real(PAGSCA_IMPORTOVAL));
|
||||
tot_val += i;
|
||||
i.normalize();
|
||||
add_importo(row, i, TRUE);
|
||||
}
|
||||
else
|
||||
row.add("");
|
||||
row.add(sum.get(PART_NREG));
|
||||
row.add(sum.get(PART_DATAREG));
|
||||
row.add(sum.get(PART_NUMDOC));
|
||||
row.add("");
|
||||
row.add(pa);
|
||||
}
|
||||
add_importo(row, i, TRUE);
|
||||
tot_val += i;
|
||||
}
|
||||
else
|
||||
row.add("");
|
||||
row.add(sum.get(PART_NREG));
|
||||
row.add(sum.get(PART_DATAREG));
|
||||
row.add(sum.get(PART_NUMDOC));
|
||||
row.add("");
|
||||
row.add(pa);
|
||||
}
|
||||
|
||||
if (lastrow > 0)
|
||||
@ -1050,20 +1052,13 @@ void TGame_mask::fill_partite(int annorif, const char* numrif)
|
||||
{
|
||||
const bool all = get(P_SHOWALL).not_empty();
|
||||
|
||||
int first_game = -1;
|
||||
|
||||
TString_array& a = partite().rows_array();
|
||||
a.destroy();
|
||||
|
||||
app().begin_wait();
|
||||
|
||||
for (TPartita* gioco = app().partite().first(); gioco != NULL; gioco = app().partite().next())
|
||||
{
|
||||
const int added = update_partita(*gioco, -1); // Memorizza posizione di inserimento
|
||||
if (first_game < 0 && gioco->anno() == annorif &&
|
||||
same_number(gioco->numero(), numrif))
|
||||
first_game = added;
|
||||
}
|
||||
update_partita(*gioco, -1); // Memorizza posizione di inserimento
|
||||
|
||||
TLocalisamfile partita(LF_PARTITE);
|
||||
partita.zero();
|
||||
@ -1087,31 +1082,31 @@ void TGame_mask::fill_partite(int annorif, const char* numrif)
|
||||
if (!app().partite().exist(conto(), anno, num))
|
||||
{
|
||||
TPartita game(conto(), anno, num);
|
||||
|
||||
int added = -1;
|
||||
if (all || !game.chiusa())
|
||||
added = update_partita(game, -1);
|
||||
|
||||
if (first_game < 0 && added >= 0 &&
|
||||
anno == annorif && same_number(num, numrif))
|
||||
first_game = added;
|
||||
if (all || !game.chiusa())
|
||||
update_partita(game, -1);
|
||||
}
|
||||
partita.put(PART_NRIGA, 9999); // Forza lettura partita successiva nella prossima read
|
||||
}
|
||||
|
||||
a.sort();
|
||||
for (int r = a.items()-1; r > 0; r--)
|
||||
{
|
||||
TToken_string& row = a.row(r);
|
||||
if (annorif == row.get_int(0) && same_number(numrif, row.get(1)))
|
||||
break;
|
||||
}
|
||||
|
||||
update_saldo_clifo();
|
||||
partite().force_update();
|
||||
aggiorna_residuo();
|
||||
|
||||
if (a.items() > 0)
|
||||
if (a.items() > 1)
|
||||
{
|
||||
if (first_game < 0) first_game = 0;
|
||||
partite_notify(partite(), first_game, K_TAB);
|
||||
partite_notify(partite(), 0, K_TAB);
|
||||
}
|
||||
else
|
||||
{
|
||||
scadenze().destroy();
|
||||
// scadenze().force_update();
|
||||
}
|
||||
app().end_wait();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user