Patch level : 10.948
Files correlati : ri0.exe ri1.exe Ricompilazione Demo : [ ] Commento : Aggiunto il flag per avere o no i progressivi nella riclassificazione saldi. Nella esportazione testo i codici di campo sono zerofilled ora git-svn-id: svn://10.65.10.50/branches/R_10_00@21743 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6815325599
commit
25c451a60b
@ -138,16 +138,19 @@ void TRicl_saldi::main_loop()
|
|||||||
const TDate dal(c.get("Dal"));
|
const TDate dal(c.get("Dal"));
|
||||||
const bool provv = c.get_bool("Provvisori");
|
const bool provv = c.get_bool("Provvisori");
|
||||||
const bool all = c.get_bool("Struttura");
|
const bool all = c.get_bool("Struttura");
|
||||||
|
const bool progr = c.get_bool("Prograssivi");
|
||||||
|
|
||||||
output_file = c.get("Output");
|
output_file = c.get("Output");
|
||||||
if (codricl.full())
|
if (codricl.full())
|
||||||
{
|
{
|
||||||
TSaldi_ricl_recordset recset(codricl, codper, nper, dal, provv, all);
|
TSaldi_ricl_recordset recset(codricl, codper, nper, dal, provv, all, progr);
|
||||||
|
|
||||||
recset.save_as(output_file);
|
recset.save_as(output_file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TSaldi_conti_recordset recset(codper, nper, dal, provv, all);
|
TSaldi_conti_recordset recset(codper, nper, dal, provv, all, progr);
|
||||||
|
|
||||||
recset.save_as(output_file);
|
recset.save_as(output_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,5 @@
|
|||||||
#define F_PROVV 111
|
#define F_PROVV 111
|
||||||
#define F_OUTPUT 112
|
#define F_OUTPUT 112
|
||||||
#define F_TIPOCOL 113
|
#define F_TIPOCOL 113
|
||||||
|
#define F_PROG 114
|
||||||
|
|
||||||
|
@ -132,9 +132,15 @@ BEGIN
|
|||||||
FIELD PROVV
|
FIELD PROVV
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_PROG
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 9 "Progessivi"
|
||||||
|
FIELD PROG
|
||||||
|
END
|
||||||
|
|
||||||
LIST F_TIPOCOL 2 14
|
LIST F_TIPOCOL 2 14
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 9 "Esporta "
|
PROMPT 2 10 "Esporta "
|
||||||
ITEM "0|Saldi"
|
ITEM "0|Saldi"
|
||||||
ITEM "1|Tutti i valori"
|
ITEM "1|Tutti i valori"
|
||||||
FIELD COLTYPE
|
FIELD COLTYPE
|
||||||
@ -142,7 +148,7 @@ END
|
|||||||
|
|
||||||
STRING F_OUTPUT 50 30
|
STRING F_OUTPUT 50 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 10 "Output "
|
PROMPT 2 12 "Output "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
FSELECT ""
|
FSELECT ""
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <diction.h>
|
#include <diction.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
@ -168,7 +169,7 @@ public:
|
|||||||
const TVariant & pdare(int nper) const { return (TVariant &) _prog_dare[nper]; }
|
const TVariant & pdare(int nper) const { return (TVariant &) _prog_dare[nper]; }
|
||||||
const TVariant & saldo(int nper) const { return (TVariant &) _saldo[nper]; }
|
const TVariant & saldo(int nper) const { return (TVariant &) _saldo[nper]; }
|
||||||
const int nper() const { return _saldo.items(); }
|
const int nper() const { return _saldo.items(); }
|
||||||
void update(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to);
|
void update(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to, bool prog);
|
||||||
|
|
||||||
bool is_zero() const;
|
bool is_zero() const;
|
||||||
bool movimentato() const { return _movimentato;}
|
bool movimentato() const { return _movimentato;}
|
||||||
@ -176,11 +177,11 @@ public:
|
|||||||
const TSaldo_periodo & operator -=(const TSaldo_periodo & sp);
|
const TSaldo_periodo & operator -=(const TSaldo_periodo & sp);
|
||||||
|
|
||||||
TSaldo_periodo(int items);
|
TSaldo_periodo(int items);
|
||||||
TSaldo_periodo(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to);
|
TSaldo_periodo(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to, bool prog);
|
||||||
virtual ~TSaldo_periodo() {}
|
virtual ~TSaldo_periodo() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
void TSaldo_periodo::update(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to)
|
void TSaldo_periodo::update(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to, bool prog)
|
||||||
{
|
{
|
||||||
TSaldo_ricl sal;
|
TSaldo_ricl sal;
|
||||||
const int nper = from.items();
|
const int nper = from.items();
|
||||||
@ -224,11 +225,13 @@ void TSaldo_periodo::update(char tcf, int gruppo, int conto, long sottoconto, bo
|
|||||||
_movimentato |= sal.movimentato();
|
_movimentato |= sal.movimentato();
|
||||||
for (int i = 0; i < nper; i++)
|
for (int i = 0; i < nper; i++)
|
||||||
{
|
{
|
||||||
saldoini(i) += sld;
|
saldoini(i) = sld;
|
||||||
pavere(i) += sal.progavere(i);
|
pavere(i) += sal.progavere(i);
|
||||||
pdare(i) += sal.progdare(i);
|
pdare(i) += sal.progdare(i);
|
||||||
|
if (!prog)
|
||||||
|
sld = ZERO;
|
||||||
sld += sal.progdare(i) - sal.progavere(i);
|
sld += sal.progdare(i) - sal.progavere(i);
|
||||||
saldo(i) += sld;
|
saldo(i) = sld;
|
||||||
}
|
}
|
||||||
p.addstatus(1L);
|
p.addstatus(1L);
|
||||||
}
|
}
|
||||||
@ -244,6 +247,8 @@ void TSaldo_periodo::update(char tcf, int gruppo, int conto, long sottoconto, bo
|
|||||||
for (int i = 0; i < nper; i++)
|
for (int i = 0; i < nper; i++)
|
||||||
{
|
{
|
||||||
saldoini(i) = sld;
|
saldoini(i) = sld;
|
||||||
|
if (!prog)
|
||||||
|
sld = ZERO;
|
||||||
pavere(i) = sal.progavere(i);
|
pavere(i) = sal.progavere(i);
|
||||||
pdare(i) = sal.progdare(i);
|
pdare(i) = sal.progdare(i);
|
||||||
sld += sal.progdare(i) - sal.progavere(i);
|
sld += sal.progdare(i) - sal.progavere(i);
|
||||||
@ -313,9 +318,9 @@ TSaldo_periodo::TSaldo_periodo(int items)
|
|||||||
_movimentato = false;
|
_movimentato = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSaldo_periodo::TSaldo_periodo(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to)
|
TSaldo_periodo::TSaldo_periodo(char tcf, int gruppo, int conto, long sottoconto, bool provv, const TArray & from, const TArray & to, bool prog)
|
||||||
{
|
{
|
||||||
update(tcf, gruppo, conto, sottoconto, provv, from, to);
|
update(tcf, gruppo, conto, sottoconto, provv, from, to, prog);
|
||||||
_movimentato = false;
|
_movimentato = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,6 +331,7 @@ class TSaldi_recordset_data :public TObject
|
|||||||
TArray _from;
|
TArray _from;
|
||||||
TArray _to;
|
TArray _to;
|
||||||
bool _provv;
|
bool _provv;
|
||||||
|
bool _prog;
|
||||||
TString16 _codricl;
|
TString16 _codricl;
|
||||||
TString8 _table;
|
TString8 _table;
|
||||||
|
|
||||||
@ -335,6 +341,7 @@ public:
|
|||||||
TArray & from() { return _from; }
|
TArray & from() { return _from; }
|
||||||
TArray & to() { return _to; }
|
TArray & to() { return _to; }
|
||||||
bool & provv() { return _provv; }
|
bool & provv() { return _provv; }
|
||||||
|
bool & prog() { return _prog; }
|
||||||
TString & codricl() { return _codricl; }
|
TString & codricl() { return _codricl; }
|
||||||
TString & table() { return _table; }
|
TString & table() { return _table; }
|
||||||
TSaldi_recordset_data() : _nper(0), _provv(0) { }
|
TSaldi_recordset_data() : _nper(0), _provv(0) { }
|
||||||
@ -359,7 +366,7 @@ const TSaldo_periodo & saldo_periodo_conto(char tcf, int gruppo, int conto, long
|
|||||||
if (values == NULL)
|
if (values == NULL)
|
||||||
{
|
{
|
||||||
if (sottoconto > 0L || tcf > ' ')
|
if (sottoconto > 0L || tcf > ' ')
|
||||||
values = new TSaldo_periodo(tcf, gruppo, conto, sottoconto, data.provv(), data.from(), data.to());
|
values = new TSaldo_periodo(tcf, gruppo, conto, sottoconto, data.provv(), data.from(), data.to(), data.prog());
|
||||||
else
|
else
|
||||||
values = new TSaldo_periodo(data.from().items());
|
values = new TSaldo_periodo(data.from().items());
|
||||||
data.saldi().add(key, values);
|
data.saldi().add(key, values);
|
||||||
@ -413,7 +420,7 @@ const TSaldo_periodo & saldo_periodo_ricl(const char * codricl, const char *cod)
|
|||||||
const long sottocontoc = conti.get(PCN_SOTTOCONTO).as_int();
|
const long sottocontoc = conti.get(PCN_SOTTOCONTO).as_int();
|
||||||
const char tcf = conti.get(PCN_TMCF).as_string()[0];
|
const char tcf = conti.get(PCN_TMCF).as_string()[0];
|
||||||
|
|
||||||
TSaldo_periodo s(tcf, gruppoc, contoc, sottocontoc, data.provv(), data.from(), data.to());
|
TSaldo_periodo s(tcf, gruppoc, contoc, sottocontoc, data.provv(), data.from(), data.to(), data.prog());
|
||||||
*values += s;
|
*values += s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -541,6 +548,16 @@ const TVariant& TSaldi_conti_recordset::get_field(int logic, const char* field)
|
|||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fname == PCN_GRUPPO || fname ==PCN_CONTO || fname ==PCN_SOTTOCONTO)
|
||||||
|
{
|
||||||
|
TVariant & val = (TVariant &) TISAM_recordset::get_field(logic, field);
|
||||||
|
const int len = cursor()->relation()->lfile().curr().length(fname);
|
||||||
|
TString v(val.as_string());
|
||||||
|
|
||||||
|
v.lpad(len, '0');
|
||||||
|
val = v;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
return TISAM_recordset::get_field(logic, field);
|
return TISAM_recordset::get_field(logic, field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +591,7 @@ void TSaldi_conti_recordset::set_fromto()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TSaldi_conti_recordset::TSaldi_conti_recordset(const char * codper, int nper, const TDate & dal, int sel_columns, bool provv, bool all,
|
TSaldi_conti_recordset::TSaldi_conti_recordset(const char * codper, int nper, const TDate & dal, int sel_columns, bool provv, bool all, bool prog,
|
||||||
const TString& sql)
|
const TString& sql)
|
||||||
: TISAM_recordset(sql), _codper(codper), _sel_columns(sel_columns), _all(all)
|
: TISAM_recordset(sql), _codper(codper), _sel_columns(sel_columns), _all(all)
|
||||||
{
|
{
|
||||||
@ -584,6 +601,7 @@ TSaldi_conti_recordset::TSaldi_conti_recordset(const char * codper, int nper, co
|
|||||||
|
|
||||||
data.nper() = nper;
|
data.nper() = nper;
|
||||||
data.provv() = provv;
|
data.provv() = provv;
|
||||||
|
data.prog() = prog;
|
||||||
data.from().destroy();
|
data.from().destroy();
|
||||||
data.to().destroy();
|
data.to().destroy();
|
||||||
data.from().add(dal);
|
data.from().add(dal);
|
||||||
@ -647,6 +665,9 @@ TSaldi_conti_recordset::TSaldi_conti_recordset(const TMask& m, const TString& sq
|
|||||||
else
|
else
|
||||||
if (fldname.starts_with("COLTYPE"))
|
if (fldname.starts_with("COLTYPE"))
|
||||||
_sel_columns = atoi(f.get());
|
_sel_columns = atoi(f.get());
|
||||||
|
else
|
||||||
|
if (fldname.starts_with("PROG"))
|
||||||
|
data.prog() = f.get().full();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_fromto();
|
set_fromto();
|
||||||
@ -815,7 +836,7 @@ void TSaldi_ricl_recordset::set_fromto()
|
|||||||
}
|
}
|
||||||
|
|
||||||
TSaldi_ricl_recordset::TSaldi_ricl_recordset(const char * codricl, const char * codper, int nper, const TDate & dal, int sel_columns, bool provv,
|
TSaldi_ricl_recordset::TSaldi_ricl_recordset(const char * codricl, const char * codper, int nper, const TDate & dal, int sel_columns, bool provv,
|
||||||
bool all, const TString& sql) : TISAM_recordset(sql), _codricl(codricl), _all(all), _sel_columns(sel_columns)
|
bool all, bool prog, const TString& sql) : TISAM_recordset(sql), _codricl(codricl), _all(all), _prog(prog), _sel_columns(sel_columns)
|
||||||
{
|
{
|
||||||
_id = __shuttle.add(new TSaldi_recordset_data);
|
_id = __shuttle.add(new TSaldi_recordset_data);
|
||||||
|
|
||||||
@ -834,6 +855,7 @@ TSaldi_ricl_recordset::TSaldi_ricl_recordset(const char * codricl, const char *
|
|||||||
table << "&TCZCO";
|
table << "&TCZCO";
|
||||||
data.codricl() = _codricl;
|
data.codricl() = _codricl;
|
||||||
data.table() = table;
|
data.table() = table;
|
||||||
|
data.prog() = _prog;
|
||||||
set_fromto();
|
set_fromto();
|
||||||
if (sql.blank())
|
if (sql.blank())
|
||||||
{
|
{
|
||||||
@ -900,6 +922,9 @@ TSaldi_ricl_recordset::TSaldi_ricl_recordset(const TMask& m, const TString& sql)
|
|||||||
else
|
else
|
||||||
if (fldname.starts_with("COLTYPE"))
|
if (fldname.starts_with("COLTYPE"))
|
||||||
_sel_columns = atoi(f.get());
|
_sel_columns = atoi(f.get());
|
||||||
|
else
|
||||||
|
if (fldname.starts_with("PROG"))
|
||||||
|
_prog = f.get().full();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -915,6 +940,7 @@ TSaldi_ricl_recordset::TSaldi_ricl_recordset(const TMask& m, const TString& sql)
|
|||||||
table << "&TCZCO";
|
table << "&TCZCO";
|
||||||
data.codricl() = _codricl;
|
data.codricl() = _codricl;
|
||||||
data.table() = table;
|
data.table() = table;
|
||||||
|
data.prog() = _prog;
|
||||||
set_fromto();
|
set_fromto();
|
||||||
if (sql.blank())
|
if (sql.blank())
|
||||||
{
|
{
|
||||||
@ -991,6 +1017,9 @@ KEY TRicl_report::run_form(TMask& m)
|
|||||||
else
|
else
|
||||||
if (fldname.starts_with("COLTYPE"))
|
if (fldname.starts_with("COLTYPE"))
|
||||||
_sel_columns = atoi(f.get());
|
_sel_columns = atoi(f.get());
|
||||||
|
else
|
||||||
|
if (fldname.starts_with("PROG"))
|
||||||
|
_prog = f.get().full();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1002,9 +1031,9 @@ bool TRicl_report::set_recordset(const TString& query)
|
|||||||
if (query.find("RICLCG") > 0)
|
if (query.find("RICLCG") > 0)
|
||||||
{
|
{
|
||||||
if (_codricl.full())
|
if (_codricl.full())
|
||||||
return TReport::set_recordset(new TSaldi_ricl_recordset(_codricl, _codper, _nper, _dal, _sel_columns, _provv, _all, query));
|
return TReport::set_recordset(new TSaldi_ricl_recordset(_codricl, _codper, _nper, _dal, _sel_columns, _provv, _all, _prog, query));
|
||||||
else
|
else
|
||||||
return TReport::set_recordset(new TSaldi_conti_recordset(_codper, _nper, _dal, _sel_columns, _provv, _all, query));
|
return TReport::set_recordset(new TSaldi_conti_recordset(_codper, _nper, _dal, _sel_columns, _provv, _all, _prog, query));
|
||||||
}
|
}
|
||||||
return TReport::set_recordset(query);
|
return TReport::set_recordset(query);
|
||||||
}
|
}
|
||||||
@ -1028,9 +1057,9 @@ bool TRicl_report::load(const char* name)
|
|||||||
if (use.find("RICLCG") > 0)
|
if (use.find("RICLCG") > 0)
|
||||||
{
|
{
|
||||||
if (_codricl.full())
|
if (_codricl.full())
|
||||||
return TReport::set_recordset(new TSaldi_ricl_recordset(_codricl, _codper, _nper, _dal, _sel_columns, _provv, _all, use));
|
return TReport::set_recordset(new TSaldi_ricl_recordset(_codricl, _codper, _nper, _dal, _sel_columns, _provv, _all, _prog, use));
|
||||||
else
|
else
|
||||||
return TReport::set_recordset(new TSaldi_conti_recordset(_codper, _nper, _dal, _sel_columns, _provv, _all, use));
|
return TReport::set_recordset(new TSaldi_conti_recordset(_codper, _nper, _dal, _sel_columns, _provv, _all, _prog, use));
|
||||||
sec->set_recordset(recset);
|
sec->set_recordset(recset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1060,6 +1089,7 @@ bool TRicl_report::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
|
|||||||
opcode -= _first_msg;
|
opcode -= _first_msg;
|
||||||
switch (opcode)
|
switch (opcode)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
const TDate & from(int n) const;
|
const TDate & from(int n) const;
|
||||||
const TDate & to(int n) const;
|
const TDate & to(int n) const;
|
||||||
virtual void requery();
|
virtual void requery();
|
||||||
TSaldi_conti_recordset(const char * codper, int nper, const TDate & dal, int sel_columns = 0,bool provv = false, bool all = true, const TString& sql = "");
|
TSaldi_conti_recordset(const char * codper, int nper, const TDate & dal, int sel_columns = 0,bool provv = false, bool all = true, bool prog = true, const TString& sql = "");
|
||||||
TSaldi_conti_recordset(const TMask& m, const TString& sql = "");
|
TSaldi_conti_recordset(const TMask& m, const TString& sql = "");
|
||||||
virtual ~TSaldi_conti_recordset();
|
virtual ~TSaldi_conti_recordset();
|
||||||
};
|
};
|
||||||
@ -50,6 +50,7 @@ class TSaldi_ricl_recordset : public TISAM_recordset
|
|||||||
TString16 _codricl;
|
TString16 _codricl;
|
||||||
int _id;
|
int _id;
|
||||||
bool _all;
|
bool _all;
|
||||||
|
bool _prog;
|
||||||
TString4 _codper;
|
TString4 _codper;
|
||||||
int _sel_columns;
|
int _sel_columns;
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ public:
|
|||||||
virtual void requery();
|
virtual void requery();
|
||||||
void set_fromto();
|
void set_fromto();
|
||||||
|
|
||||||
TSaldi_ricl_recordset(const char * codricl, const char * codper, int nper, const TDate & dal, int sel_columns = 0, bool provv = false, bool all = true, const TString& sql = "");
|
TSaldi_ricl_recordset(const char * codricl, const char * codper, int nper, const TDate & dal, int sel_columns = 0, bool provv = false, bool all = true, bool progr = true, const TString& sql = "");
|
||||||
TSaldi_ricl_recordset(const TMask & m, const TString& sql = "");
|
TSaldi_ricl_recordset(const TMask & m, const TString& sql = "");
|
||||||
virtual ~TSaldi_ricl_recordset();
|
virtual ~TSaldi_ricl_recordset();
|
||||||
};
|
};
|
||||||
@ -83,6 +84,7 @@ class TRicl_report : public TReport
|
|||||||
TDate _dal;
|
TDate _dal;
|
||||||
bool _provv;
|
bool _provv;
|
||||||
bool _all;
|
bool _all;
|
||||||
|
bool _prog;
|
||||||
int _sel_columns;
|
int _sel_columns;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user