Patch level : 12.0 554

Files correlati     : sc2.exe

l'esportazione in excel degli estratti conto dava risultati diversi rispetto alla versione 11.

git-svn-id: svn://10.65.10.50/branches/R_10_00@24441 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2018-03-26 14:47:31 +00:00
parent 033f1aa4aa
commit 753f92834c

View File

@ -25,13 +25,24 @@
class TEC_recordset : public TAS400_recordset class TEC_recordset : public TAS400_recordset
{ {
char _who; char _who;
TString _agente;
TString _pagam;
public: public:
char get_who() const { return _who; } char get_who() const { return _who; }
TString & set_agente(const char * agente) { _agente = agente; return _agente; }
TString & set_pagam(const char * pagam) { _pagam = pagam; return _pagam; }
void add_fields();
TEC_recordset(const char who); TEC_recordset(const char who);
}; };
TEC_recordset::TEC_recordset(char who) : TAS400_recordset("AS400(255,0,0)"), _who(who) void TEC_recordset::add_fields()
{
set("Pagamento", _pagam);
set("Agente", _agente);
}
TEC_recordset::TEC_recordset(char who) : TAS400_recordset("AS400(512,0,0)"), _who(who)
{ {
if (who >= 'C') if (who >= 'C')
{ {
@ -60,6 +71,8 @@ TEC_recordset::TEC_recordset(char who) : TAS400_recordset("AS400(255,0,0)"), _wh
create_field("Esposto", -1, 15, _realfld); create_field("Esposto", -1, 15, _realfld);
create_field("SBF", -1, 1); create_field("SBF", -1, 1);
create_field("TotDoc", -1, 15, _realfld); create_field("TotDoc", -1, 15, _realfld);
create_field("Pagamento", -1, 60);
create_field("Agente", -1, 60);
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -89,6 +102,7 @@ class TEC_form : public TForm
bool _stampa_saldo; // Stampa il saldo di ogni partita bool _stampa_saldo; // Stampa il saldo di ogni partita
bool _note_scadenti; // Considera scadute le note di credito non assegnate bool _note_scadenti; // Considera scadute le note di credito non assegnate
protected: protected:
void init_header(const TMask& m); void init_header(const TMask& m);
word ordina_totali_per_valuta(THash_object* tot[MAXTOT]); word ordina_totali_per_valuta(THash_object* tot[MAXTOT]);
@ -110,6 +124,7 @@ public:
virtual TRelation* relation() const { return _cursore->relation(); } virtual TRelation* relation() const { return _cursore->relation(); }
virtual TCursor* cursor() { return _cursore; } virtual TCursor* cursor() { return _cursore; }
virtual TEC_recordset* recordset() { return _recordset; }
const TDate& data_limite_operazione() const { return _dlo; } const TDate& data_limite_operazione() const { return _dlo; }
const TDate& data_limite_scaduto() const { return _dls; } const TDate& data_limite_scaduto() const { return _dls; }
@ -440,6 +455,7 @@ void TEC_row::export_to(TEC_recordset& r)
r.set("Esposto", TVariant(_esposto)); r.set("Esposto", TVariant(_esposto));
r.set("SBF", TVariant(_salvo_buon_fine ? "*" : " ")); r.set("SBF", TVariant(_salvo_buon_fine ? "*" : " "));
r.set("TotDoc", TVariant(_totale)); r.set("TotDoc", TVariant(_totale));
r.add_fields();
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -1381,11 +1397,7 @@ void TEC_form::set_pagam(const TString& codpag)
if (printing()) if (printing())
pagam.set(pag); pagam.set(pag);
else else
{ recordset()->set_pagam(pag);
_recordset->new_rec();
_recordset->set("Descrizione", pag);
_recordset->new_rec();
}
} }
} }
@ -1403,15 +1415,9 @@ void TEC_form::set_agente(const TString& codag)
ag << codag << ' ' << cache().get(LF_AGENTI, codag, AGE_RAGSOC); ag << codag << ' ' << cache().get(LF_AGENTI, codag, AGE_RAGSOC);
if (printing()) if (printing())
{
agente.set(ag); agente.set(ag);
}
else else
{ recordset()->set_agente(ag);
_recordset->new_rec();
_recordset->set("Descrizione", ag);
_recordset->new_rec();
}
} }
} }
@ -1507,8 +1513,10 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval, bool excel)
_maxtot = max; _maxtot = max;
} }
else else
{
_recordset = new TEC_recordset(m.get_who()); _recordset = new TEC_recordset(m.get_who());
} }
}
TEC_form::~TEC_form() TEC_form::~TEC_form()
{ {
@ -2216,7 +2224,7 @@ void TStampaEC_application::main_loop()
if (excel) if (excel)
{ {
TFilename xls; xls.tempdir(); xls.add("ec.xls"); TFilename xls; xls.tempdir(); xls.add("ec.xls");
_form->recordset().save_as(xls, fmt_html); _form->recordset()->save_as(xls, fmt_html);
xvt_sys_goto_url(xls, "open"); xvt_sys_goto_url(xls, "open");
} }