diff --git a/build/AgaLib.vcxproj b/build/AgaLib.vcxproj
index 9e0dde249..0742ae91d 100644
--- a/build/AgaLib.vcxproj
+++ b/build/AgaLib.vcxproj
@@ -890,6 +890,10 @@
Document
+
+
+
+
diff --git a/build/AgaLib.vcxproj.filters b/build/AgaLib.vcxproj.filters
index 8d6fd47a5..92caaf358 100644
--- a/build/AgaLib.vcxproj.filters
+++ b/build/AgaLib.vcxproj.filters
@@ -17,6 +17,9 @@
{0efb2a15-b492-4cf4-b0e1-e1b1a2362369}
+
+ {f44ac840-9c6e-4e54-a14a-5beeb8e0e5e4}
+
@@ -811,4 +814,12 @@
Recdesc
+
+
+ Alx
+
+
+ Alx
+
+
\ No newline at end of file
diff --git a/build/Cg1.vcxproj b/build/Cg1.vcxproj
index b31c6c243..9e4aa1f11 100644
--- a/build/Cg1.vcxproj
+++ b/build/Cg1.vcxproj
@@ -245,6 +245,7 @@
%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
+
%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
@@ -273,6 +274,7 @@
+
@@ -298,6 +300,7 @@
+
@@ -325,6 +328,21 @@
{7b80f974-ce2e-4bd9-855a-44ff139ff288}
+
+
+ Designer
+
+
+ Designer
+
+
+ Designer
+
+
+ Designer
+
+
+
diff --git a/build/Cg1.vcxproj.filters b/build/Cg1.vcxproj.filters
index cf22c472c..284535196 100644
--- a/build/Cg1.vcxproj.filters
+++ b/build/Cg1.vcxproj.filters
@@ -13,6 +13,9 @@
{b050e81e-2d08-4fe9-8df7-4752821eadd8}
h
+
+ {67327472-c369-45be-9456-cf35ce61e40d}
+
@@ -81,6 +84,9 @@
Sources
+
+ Sources
+
@@ -131,6 +137,9 @@
Masks
+
+ Masks
+
@@ -205,8 +214,28 @@
Header
+
+ Header
+
+
+
+ Reports
+
+
+ Reports
+
+
+ Reports
+
+
+ Reports
+
+
+ Reports
+
+
\ No newline at end of file
diff --git a/build/ce2.vcxproj b/build/ce2.vcxproj
index 1d48fa54b..a4a0d9e3f 100644
--- a/build/ce2.vcxproj
+++ b/build/ce2.vcxproj
@@ -210,6 +210,7 @@
+
diff --git a/build/ce2.vcxproj.filters b/build/ce2.vcxproj.filters
index 5aee27c77..328681648 100644
--- a/build/ce2.vcxproj.filters
+++ b/build/ce2.vcxproj.filters
@@ -56,6 +56,9 @@
Masks
+
+ Masks
+
diff --git a/src/cg/cg1500a1.rep b/src/cg/cg1500a1.rep
new file mode 100644
index 000000000..0236ff5bc
--- /dev/null
+++ b/src/cg/cg1500a1.rep
@@ -0,0 +1,248 @@
+
+
+ Stampa bilancio a sezioni contrapposte 1
+
+
+
+
+
+
+
+
+
+
+
+ "Stampa bilancio a sezioni contrapposte"
+#CODES @
+0
+C;E;
+IF
+" esercizio "
++
+#CODES @
++
+THEN
+#THIS !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!INDIR"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!CF"
+GET_FIRM_DATA
+
+
+
+ "!IVA"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #102 @
+0
+C;E;
+#103 @
+0
+=
+AND
+IF
+#THIS @
+#F1.305
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #202 @
+0
+C;E;
+#203 @
+0
+=
+AND
+IF
+#THIS @
+#F1.306
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #THIS @ 0 E;
+IF
+#THIS @
+#457 !
+"#354" HIDE
+"#454" SHOW
+ELSE
+#THIS @ 0 C;
+IF
+0
+#THIS @
+-
+#357 !
+"#354" SHOW
+"#454" HIDE
+ELSE
+#THIS @
+#357 !
+#THIS @
+#457 !
+"#354" HIDE
+"#454" HIDE
+THEN
+THEN
+
+
+
+ #THIS @
+0
+E;
+IF
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" SHOW
+ELSE
+#THIS @
+0
+C;
+IF
+0
+#THIS @
+-
+#F1.356 !
+"#353" SHOW
+"#453" HIDE
+ELSE
+#THIS @
+#F1.356 !
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" HIDE
+THEN
+THEN
+
+
+
+
+
+
+ #305 @
+#356 @
++
+#357 @
++
+#THIS !
+
+
+
+
+
+
+ #306 @
+#456 @
++
+#457 @
++
+#THIS !
+
+
+
+
\ No newline at end of file
diff --git a/src/cg/cg1500a2.rep b/src/cg/cg1500a2.rep
new file mode 100644
index 000000000..bf2d76bd0
--- /dev/null
+++ b/src/cg/cg1500a2.rep
@@ -0,0 +1,248 @@
+
+
+ Stampa bilancio a sezioni contrapposte 2
+
+
+
+
+
+
+
+
+
+
+
+ "Stampa bilancio a sezioni contrapposte"
+#CODES @
+0
+C;E;
+IF
+" esercizio "
++
+#CODES @
++
+THEN
+#THIS !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!INDIR"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!CF"
+GET_FIRM_DATA
+
+
+
+ "!IVA"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #102 @
+0
+C;E;
+#103 @
+0
+=
+AND
+IF
+#THIS @
+#F1.305
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #202 @
+0
+C;E;
+#203 @
+0
+=
+AND
+IF
+#THIS @
+#F1.306
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #THIS @ 0 E;
+IF
+#THIS @
+#457 !
+"#354" HIDE
+"#454" SHOW
+ELSE
+#THIS @ 0 C;
+IF
+0
+#THIS @
+-
+#357 !
+"#354" SHOW
+"#454" HIDE
+ELSE
+#THIS @
+#357 !
+#THIS @
+#457 !
+"#354" HIDE
+"#454" HIDE
+THEN
+THEN
+
+
+
+ #THIS @
+0
+E;
+IF
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" SHOW
+ELSE
+#THIS @
+0
+C;
+IF
+0
+#THIS @
+-
+#F1.356 !
+"#353" SHOW
+"#453" HIDE
+ELSE
+#THIS @
+#F1.356 !
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" HIDE
+THEN
+THEN
+
+
+
+
+
+
+ #305 @
+#356 @
++
+#357 @
++
+#THIS !
+
+
+
+
+
+
+ #306 @
+#456 @
++
+#457 @
++
+#THIS !
+
+
+
+
\ No newline at end of file
diff --git a/src/cg/cg1500a3.rep b/src/cg/cg1500a3.rep
new file mode 100644
index 000000000..1db70fd75
--- /dev/null
+++ b/src/cg/cg1500a3.rep
@@ -0,0 +1,242 @@
+
+
+ Stampa bilancio a sezioni contrapposte 3
+
+
+
+
+
+
+
+
+
+
+
+ "Stampa bilancio a sezioni contrapposte"
+#CODES @
+0
+C;E;
+IF
+" esercizio "
++
+#CODES @
++
+THEN
+#THIS !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!INDIR"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "!CF"
+GET_FIRM_DATA
+
+
+
+ "!IVA"
+GET_FIRM_DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #102 @
+0
+C;E;
+#103 @
+0
+=
+AND
+IF
+#THIS @
+#F1.305
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #202 @
+0
+C;E;
+#203 @
+0
+=
+AND
+IF
+#THIS @
+#F1.306
++!
+THEN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #THIS @ 0 E;
+IF
+#THIS @
+#457 !
+"#354" HIDE
+"#454" SHOW
+ELSE
+#THIS @ 0 C;
+IF
+0
+#THIS @
+-
+#357 !
+"#354" SHOW
+"#454" HIDE
+ELSE
+#THIS @
+#357 !
+#THIS @
+#457 !
+"#354" HIDE
+"#454" HIDE
+THEN
+THEN
+
+
+
+ #THIS @
+0
+E;
+IF
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" SHOW
+ELSE
+#THIS @
+0
+C;
+IF
+0
+#THIS @
+-
+#F1.356 !
+"#353" SHOW
+"#453" HIDE
+ELSE
+#THIS @
+#F1.356 !
+#THIS @
+#F1.456 !
+"#353" HIDE
+"#453" HIDE
+THEN
+THEN
+
+
+
+
+
+
+ #305 @
+#356 @
++
+#357 @
++
+#THIS !
+
+
+
+
+
+
+ #306 @
+#456 @
++
+#457 @
++
+#THIS !
+
+
+
+
\ No newline at end of file
diff --git a/src/cg/cg1501.h b/src/cg/cg1501.h
new file mode 100644
index 000000000..abd27a10a
--- /dev/null
+++ b/src/cg/cg1501.h
@@ -0,0 +1,261 @@
+#ifndef __CG1501_H
+#define __CG1501_H
+
+#include
+#include
+
+#include "cglib.h"
+
+#define SEZIONI_CONTRAPPOSTE 1
+#define BILANCIO_VERIFICA 2
+
+#define DATA_LIMITE 1
+#define ULTIMA_IMMISSIONE 2
+
+#define VERIFICA 1
+#define MASTRO 2
+#define CLIENTI_FORNITORI 3
+
+#define MOVIMENTATO 1
+#define SALDO_NOT_ZERO 2
+#define TUTTI 3
+
+#define ORD_CONTO 1
+#define ORD_RAGSOC 2
+
+#define BIL_ROW 0
+#define BIL_GRUPPO 1
+#define BIL_CONTO 2
+#define BIL_SOTTOCONTO 3
+#define BIL_DESCR 4
+#define BIL_SALDO 5
+
+#define VER_GRUPPO 0
+#define VER_CONTO 1
+#define VER_SOTTOCONTO 2
+#define VER_NUMULTMOV 3
+#define VER_DATAULMOV 4
+#define VER_DESCR 5
+#define VER_FLAGSALINI 6
+#define VER_SALDO 7
+#define VER_PDARE 8
+#define VER_PAVERE 9
+#define VER_INDBIL 10
+
+HIDDEN const char * _sezioni_bilancio[] = { "AP", "CR", "OR" };
+
+void sez2ind(int sez_bil, int & indfrom, int & indto);
+
+class TBilancio_mask : public TAutomask
+{
+ const TString & get_report_class() const;
+ void TBilancio_mask::set_report_class(const char * classname);
+
+public:
+ virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
+
+ TBilancio_mask(const char *name) : TAutomask(name) { }
+ virtual ~TBilancio_mask() { }
+};
+
+class TSezioni_contrapposte_recset : TRecordset
+{
+ TArray _righe_sez;
+ TAssoc_array _righe_sez1;
+ TAssoc_array _righe;
+ TArray _index;
+ TArray _colonne;
+ TRecnotype _curr;
+ TSaldo _last_saldo;
+ int _last_indbil;
+ TBill _last_conto;
+ long _last_row[3][2];
+ int _filled_sezs[3];
+ long _last_key[3][2];
+ TImporto _sbilancio_prec;
+
+ int _sez_bil;
+ int _esercizio;
+ int _tipo_data;
+ TDate _dataini;
+ TDate _datalim;
+ TDate _datastampa;
+ bool _compcr;
+ bool _st_saldo_zero;
+ bool _totali_gruppo;
+ int _tipi_mov;
+ TString _contsep;
+
+ virtual TRecnotype items() const { return _righe.items(); }
+ virtual bool move_to(TRecnotype pos);
+ virtual TRecnotype current_row() const { return _curr; }
+ virtual void requery();
+ virtual const TString& query_text() const { return EMPTY_STRING; }
+ virtual unsigned int columns() const { return _colonne.items(); }
+ virtual const TRecordset_column_info& column_info(unsigned int column) const { return (TRecordset_column_info&)_colonne[column]; }
+ bool exist_row(const TAssoc_array & rows, const char * key) const { return rows.is_key(key); }
+ const TArray & get_row(TRecnotype row = -1) const;
+ virtual const TVariant& get(unsigned int column) const;
+ virtual const TVariant& get(const char* column_name) const;
+
+ void calculate_saldo(const TRectype & rec);
+ void update_record(const TRectype & rec);
+ void scan_clifor(const TRectype & rec);
+ void rebuild();
+ void pack_rows(TAssoc_array & righe);
+ void filter_rows_pos(TAssoc_array & righe, int col);
+ void filter_rows();
+ void update_index();
+
+public:
+ virtual void set_filter(const TMask& msk);
+ void set_sez(int sez_bil) { _sez_bil = sez_bil; }
+ const real & sbilancio_precedente() const { return _sbilancio_prec.valore(); }
+
+ TSezioni_contrapposte_recset();
+ ~TSezioni_contrapposte_recset() {}
+};
+
+class TSezioni_contrapposte : public TProgram_report
+{
+ TBilancio_mask & _mask;
+
+ bool _st_codici_conto;
+
+ TSezioni_contrapposte_recset * _recset;
+ virtual const char * get_excel_header_section() { return "H0|H2|F1"; }
+
+public:
+ virtual TRecordset* recordset() const;
+ bool st_codici_conto() const { return _st_codici_conto; }
+ bool get_usr_val(const TString& name, TVariant& var) const;
+ void init(const char * name, int sez);
+ TSezioni_contrapposte(TBilancio_mask & msk) : _mask(msk), _recset(nullptr) { }
+ ~TSezioni_contrapposte() {}
+};
+
+class TVerifica_recset : TRecordset
+{
+ TAssoc_array _righe;
+ TArray _index;
+ TArray _colonne;
+ TRecnotype _curr;
+ TSaldo _last_saldo;
+ int _last_indbil;
+ TBill _last_conto;
+
+ int _esercizio;
+ int _tipo_data;
+ TDate _dataini;
+ TDate _datalim;
+ TDate _datastampa;
+ bool _compcr;
+ bool _st_saldo_zero;
+ int _tipi_mov;
+ bool _quad_gior;
+ TString _contsep;
+ bool _quadratura;
+
+ int _tipo_ver;
+ int _tipo_saldo_ver;
+ bool _show_clifo;
+ TString _sit_cf;
+ int _tipo_ord;
+ TBill _da_conto;
+ TString _da_descrizione;
+ TBill _a_conto;
+ TString _a_descrizione;
+
+protected:
+ int tipo_verifica() const { return _tipo_ver; }
+ bool show_clifo() const { return _show_clifo; }
+ bool verifica() const { return tipo_verifica() == VERIFICA; }
+ bool mastro() const { return tipo_verifica() == MASTRO; }
+ bool cli_for() const { return tipo_verifica() == CLIENTI_FORNITORI; }
+ const TString & tipo_sit() const { return _sit_cf; }
+ virtual TRecnotype items() const { return _righe.items(); }
+ virtual bool move_to(TRecnotype pos);
+ virtual TRecnotype current_row() const { return _curr; }
+ virtual void requery();
+ virtual const TString& query_text() const { return EMPTY_STRING; }
+ virtual unsigned int columns() const { return _colonne.items(); }
+ virtual const TRecordset_column_info& column_info(unsigned int column) const { return (TRecordset_column_info&)_colonne[column]; }
+ bool exist_row(const char * key) const { return _righe.is_key(key); }
+ const TArray & get_row(TRecnotype row = -1) const;
+ virtual const TVariant& get(unsigned int column) const;
+ virtual const TVariant& get(const char* column_name) const;
+
+ void calculate_saldo(const TRectype & rec);
+ bool select_conti(const TRectype & rec);
+ void update_record(const TRectype & rec);
+ void scan_clifor(const TRectype & rec);
+ void rebuild();
+ void filter_rows();
+ void update_index();
+
+public:
+ bool clienti() const { return tipo_sit() == "C"; }
+ bool fornitori() const { return tipo_sit() == "F"; }
+ bool entrambi() const { return tipo_sit().blank(); }
+ virtual void set_filter(const TMask& msk);
+
+ TVerifica_recset();
+ ~TVerifica_recset() {}
+};
+
+class TVerifica : public TProgram_report
+{
+ TBilancio_mask & _mask;
+ bool _hide_points;
+ int _tipo_ver;
+ TVerifica_recset * _recset;
+
+public:
+ int tipo_verifica() const { return _tipo_ver; }
+ bool mastro() const { return tipo_verifica() == MASTRO; }
+ bool cli_for() const { return tipo_verifica() == CLIENTI_FORNITORI; }
+ virtual TRecordset* recordset() const;
+ void init();
+ TVerifica(TBilancio_mask & msk) : _mask(msk), _recset(nullptr) {}
+ ~TVerifica() {}
+};
+
+class TStampa_bilanci_avanzata : public TReport_application
+{
+ TBilancio_mask * _mask;
+ TVerifica * _verifica_rep;
+ TVerifica * _verifica_clifo_rep;
+ TSezioni_contrapposte * _sezioni_contrapposte_rep;
+#ifdef CONT_SEP
+ virtual const char * extra_modules() const { return "CG"; }
+#endif
+
+public:
+ virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
+ virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
+ virtual bool user_create();
+ virtual bool user_destroy();
+ virtual TAutomask & get_mask() { return *_mask; }
+ virtual TReport & get_report(const TAutomask & m);
+
+ TStampa_bilanci_avanzata() : _mask(nullptr), _verifica_rep(nullptr), _verifica_clifo_rep(nullptr),
+ _sezioni_contrapposte_rep(nullptr) {}
+};
+
+#endif // __CG1501_H
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+