Migliorata esclusione partite chiuse da scaduto

git-svn-id: svn://10.65.10.50/branches/R_10_00@23062 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2015-03-31 06:22:08 +00:00
parent b3f5edc274
commit c8fafc955f

View File

@ -7,6 +7,7 @@
#include <clifo.h>
#include <nditte.h>
#include <partite.h>
#include <pconti.h>
///////////////////////////////////////////////////////////
@ -150,10 +151,10 @@ bool TStampaScaduto::fil_function(const TRelation *r)
TRectype& part = r->curr(LF_PARTITE);
TString80 key;
key.format("%03d%03d%06ld%4d",
key.format("%03d%03d%06ld%4d%s",
part.get_int(PART_GRUPPO), part.get_int(PART_CONTO),
part.get_long(PART_SOTTOCONTO), part.get_int(PART_ANNO));
key << part.get(PART_NUMPART);
part.get_long(PART_SOTTOCONTO), part.get_int(PART_ANNO),
(const char*)part.get(PART_NUMPART));
const bool rt = key != _last_game;
if (rt)
@ -206,8 +207,8 @@ void TStampaScaduto::compute_unassigned(const TPartita& p)
void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
{
// 27-01-2014 Se una partita ha l'utlimo pagamento prima della data limite, posso ignorarla
if (p.chiusa())
// 27-01-2014 Se una partita ha l'ultimo pagamento prima della data limite, posso ignorarla
if (p.chiusa(true))
{
TDate last_pag;
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
@ -224,7 +225,7 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
}
}
}
if (last_pag.ok() && last_pag <= _limop)
if (last_pag.ok() && last_pag < _limbf)
return; // Ignora partite chiuse da tempo immemorabile
}
@ -556,8 +557,8 @@ void TStampaScaduto::on_firm_change()
{
if (_m != NULL)
{
TConfig conf (CONFIG_DITTA,"cg");
_m->enable(F_VALUTA,conf.get_bool("GesVal"));
const bool valuta = ini_get_bool(CONFIG_DITTA, "cg", "GesVal");
_m->enable(F_VALUTA, valuta);
}
}
@ -579,9 +580,9 @@ bool TStampaScaduto::user_create()
for (int i = 0; i < 6; i++)
_s_date.add(new TDate);
TConfig conf (CONFIG_DITTA,"cg");
const bool valuta = ini_get_bool(CONFIG_DITTA, "cg", "GesVal");
_m = new TSelection_ext_mask("sc2300a");
_m->enable(F_VALUTA,conf.get_bool("GesVal"));
_m->enable(F_VALUTA, valuta);
enable_print_menu();
return true;
@ -606,16 +607,10 @@ bool TStampaScaduto::set_print(int)
reset_print();
if (_m->get_who() == 'P')
{
_tipost = altri;
}
else
{
if (_m->get_who() == 'C') _tipost = clienti;
else _tipost = fornitori;
}
if (_m->get_key() == 1) _ordcod = true;
else _ordcod = false;
_tipost = _m->get_who() == 'C' ? clienti : fornitori;
_ordcod = _m->get_key() == 1;
_end_printed = _pending_clifo = false;
_gcr = _m->get_int(F_GIORNI);
_stvaluta = _m->get_bool(F_VALUTA);
@ -645,10 +640,12 @@ bool TStampaScaduto::set_print(int)
{
case clienti:
case fornitori:
filter_from.put("TIPOC", _tipost == clienti ? "C" : "F");
filter_from.put(PART_TIPOCF, _tipost == clienti ? "C" : "F");
filter_to = filter_from;
if (_ordcod) // Per codice...
{
filter_from.put(PART_SOTTOCONTO, _m->get(SC_CFCODFR));
filter_to.put (PART_SOTTOCONTO, _m->get(SC_CFCODTO));
select_cursor(_cur1);
get_cursor(_cur1)->setregion(filter_from, filter_to);
}
@ -784,9 +781,9 @@ void TStampaScaduto::print_header()
reset_header ();
TString datas = _datas.string();
TString limop = _limop.string();
TString limscad = _limscad.string();
TString16 datas = _datas.string();
TString16 limop = _limop.string();
TString16 limscad = _limscad.string();
set_header (soh++, FR("Ditta : %ld %s@158gData@163g%s @190gPag. @#"),
firm, (const char *)_m->get(F_RAGSOC), (const char *)datas);