From 753f92834cb8e583a37eae9cee22f2ab46fcf45a Mon Sep 17 00:00:00 2001 From: bonazzi Date: Mon, 26 Mar 2018 14:47:31 +0000 Subject: [PATCH] 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 --- src/sc/sc2100.cpp | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/sc/sc2100.cpp b/src/sc/sc2100.cpp index 856040514..77333d1b8 100755 --- a/src/sc/sc2100.cpp +++ b/src/sc/sc2100.cpp @@ -25,13 +25,24 @@ class TEC_recordset : public TAS400_recordset { char _who; + TString _agente; + TString _pagam; public: char get_who() const { return _who; } - TEC_recordset(const char 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::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') { @@ -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("SBF", -1, 1); 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 _note_scadenti; // Considera scadute le note di credito non assegnate + protected: void init_header(const TMask& m); word ordina_totali_per_valuta(THash_object* tot[MAXTOT]); @@ -110,6 +124,7 @@ public: virtual TRelation* relation() const { return _cursore->relation(); } virtual TCursor* cursor() { return _cursore; } + virtual TEC_recordset* recordset() { return _recordset; } const TDate& data_limite_operazione() const { return _dlo; } 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("SBF", TVariant(_salvo_buon_fine ? "*" : " ")); r.set("TotDoc", TVariant(_totale)); + r.add_fields(); } /////////////////////////////////////////////////////////// @@ -1381,11 +1397,7 @@ void TEC_form::set_pagam(const TString& codpag) if (printing()) pagam.set(pag); else - { - _recordset->new_rec(); - _recordset->set("Descrizione", pag); - _recordset->new_rec(); - } + recordset()->set_pagam(pag); } } @@ -1403,15 +1415,9 @@ void TEC_form::set_agente(const TString& codag) ag << codag << ' ' << cache().get(LF_AGENTI, codag, AGE_RAGSOC); if (printing()) - { agente.set(ag); - } else - { - _recordset->new_rec(); - _recordset->set("Descrizione", ag); - _recordset->new_rec(); - } + recordset()->set_agente(ag); } } @@ -1506,8 +1512,10 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval, bool excel) if (_maxtot <= 0 || _maxtot > max) _maxtot = max; } - else - _recordset = new TEC_recordset(m.get_who()); + else + { + _recordset = new TEC_recordset(m.get_who()); + } } TEC_form::~TEC_form() @@ -2216,7 +2224,7 @@ void TStampaEC_application::main_loop() if (excel) { 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"); }