Patch level : 2.2 109

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Riportata la versione 2.1 308


git-svn-id: svn://10.65.10.50/trunk@13141 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2005-05-23 12:17:02 +00:00
parent 139c50b3d6
commit 7fc6f05e7f
25 changed files with 908 additions and 129 deletions

View File

@ -10,6 +10,7 @@
#include "batbreg.h" #include "batbreg.h"
#include "batbcam.h" #include "batbcam.h"
#include "batbdel.h" #include "batbdel.h"
#define F_NUM 104
#include "batbval.h" #include "batbval.h"
#include "batbver.h" #include "batbver.h"
#include "batbnoc.h" #include "batbnoc.h"
@ -60,6 +61,7 @@ protected:
static bool codgmc_handler(TMask_field& f, KEY k); static bool codgmc_handler(TMask_field& f, KEY k);
static bool codnoc_handler(TMask_field& f, KEY k); static bool codnoc_handler(TMask_field& f, KEY k);
static bool desnot_handler(TMask_field& f, KEY k); static bool desnot_handler(TMask_field& f, KEY k);
static bool numivd_handler(TMask_field& f, KEY k);
void fragment_string(); void fragment_string();
void glue_string(); void glue_string();
@ -619,6 +621,21 @@ bool TGeneric_table_app::desnot_handler(TMask_field& f, KEY k)
return true; return true;
} }
bool TGeneric_table_app::numivd_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))
{
const TString & val = f.get();
if (val.not_empty())
{
if (!isdigit(val[0]) || !isdigit(val[1]))
return error_box("i primi due caratteri devono eesere numerici");
}
}
return true;
}
bool TGeneric_table_app::user_create() bool TGeneric_table_app::user_create()
{ {
bool ok = TTable_application::user_create(); bool ok = TTable_application::user_create();
@ -668,6 +685,9 @@ bool TGeneric_table_app::user_create()
if (name == TAB_NOTECLI) if (name == TAB_NOTECLI)
mask.set_handler(F_NOT_DESC, desnot_handler); mask.set_handler(F_NOT_DESC, desnot_handler);
if (name == TAB_IVDIRETTIVA)
mask.set_handler(F_NUM, numivd_handler);
} }
return ok; return ok;

View File

@ -76,6 +76,43 @@ public:
BA3800_application(char livello) : _liv(toupper(livello)) {} BA3800_application(char livello) : _liv(toupper(livello)) {}
}; };
const char * num2str(const TString & s)
{
TString & str = get_tmp_string(20);
str = s;
str.trim();
if (str.len() > 2)
{
str = s.left(2);
const int sub = atoi(s.mid(2));
switch (sub)
{
case 0:
case 1:
break;
case 2:
str << " bis";
break;
case 3:
str << " ter";
break;
case 4:
str << " quater";
break;
case 5:
str << " quinquies";
break;
case 6:
str << " sexies";
break;
default:
break;
}
}
return (const char *) str;
}
void BA3800_application::postclose_print() void BA3800_application::postclose_print()
{ {
if (_liv == 'D') if (_liv == 'D')
@ -309,7 +346,7 @@ void BA3800_application::totale_numero_arabo()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -554,7 +591,7 @@ void BA3800_application::stampa_totali_ditta()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i, FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i, FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -592,7 +629,7 @@ void BA3800_application::stampa_totali_ditta()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i, FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i, FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -626,7 +663,7 @@ void BA3800_application::stampa_totali_ditta()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -683,7 +720,7 @@ void BA3800_application::stampa_totali_ditta()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -770,7 +807,7 @@ void BA3800_application::stampa_totali_ditta()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num .not_empty()) if (_num .not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@86g%s", (const char*) _totale); set_row (_i++,"@86g%s", (const char*) _totale);
} }
} }
@ -1217,9 +1254,9 @@ void BA3800_application::setta_righe_studio(const char * titolo)
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char*) _num_da_stamp); set_row(_i,"@13g%s)", num2str(_num_da_stamp));
const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero); const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero);
setta_righe_descr(descr,"@20g%s"); setta_righe_descr(descr,"@27g%s");
} }
} }
} }
@ -1250,9 +1287,9 @@ void BA3800_application::setta_righe_studio(const char * titolo)
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char*) _num_da_stamp); set_row(_i,"@13g%s)", num2str(_num_da_stamp));
const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero); const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
} }
} }
} }
@ -1274,9 +1311,9 @@ void BA3800_application::setta_righe_studio(const char * titolo)
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char*) _num_da_stamp); set_row(_i,"@13g%s)", num2str(_num_da_stamp));
const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero); const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
} }
} }
} }
@ -1288,9 +1325,9 @@ void BA3800_application::setta_righe_studio(const char * titolo)
{ {
if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9')) if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{ {
set_row(_i,"@13g%-4s)", (const char*) _num_da_stamp); set_row(_i,"@13g%s)", num2str(_num_da_stamp));
const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero); const TString & descr = descrizione_numero(_sez_da_stamp,_let_da_stamp,numeror,numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
_cont_gcs = 1; _cont_gcs = 1;
} }
} }
@ -1392,9 +1429,9 @@ void BA3800_application::setta_righe_ditta(const char* titolo)
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero); const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
} }
} }
} }
@ -1439,9 +1476,9 @@ void BA3800_application::setta_righe_ditta(const char* titolo)
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero); const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
} }
} }
} }
@ -1461,9 +1498,9 @@ void BA3800_application::setta_righe_ditta(const char* titolo)
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@13g%-4s)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero); const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
} }
} }
} }
@ -1477,9 +1514,9 @@ void BA3800_application::setta_righe_ditta(const char* titolo)
(_sez_da_stamp == '2') || (_sez_da_stamp == '2') ||
(_sez_da_stamp == '9')) (_sez_da_stamp == '9'))
{ {
set_row(_i,"@13g%-4s)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero); const TString & descr = descrizione_numero(sezione, lettera, atoi(numr), numero);
setta_righe_descr(descr, "@20g%s"); setta_righe_descr(descr, "@27g%s");
_cont_gcs = 1; _cont_gcs = 1;
} }
} }

View File

@ -754,6 +754,7 @@ bool TReport_properties_mask::on_field_event(TOperable_field& o, TField_event e,
void TReport_properties_mask::set_report(const TReport& r) void TReport_properties_mask::set_report(const TReport& r)
{ {
set(F_FONT_AUTO, r.use_printer_font()); set(F_FONT_AUTO, r.use_printer_font());
set(F_ORIENTATION, r.orientation());
set(F_DY, r.lpi()); set(F_DY, r.lpi());
set_font_info(r.font()); set_font_info(r.font());
set(F_INCLUDE, ((TReport&)r).get_libraries()); set(F_INCLUDE, ((TReport&)r).get_libraries());
@ -774,6 +775,7 @@ void TReport_properties_mask::get_report(TReport& r) const
if (get_font_info(f)) if (get_font_info(f))
r.set_font(f); r.set_font(f);
} }
r.set_orientation(get_int(F_ORIENTATION));
const TString& oldlib = r.get_libraries(); const TString& oldlib = r.get_libraries();
if (oldlib != get(F_INCLUDE)) if (oldlib != get(F_INCLUDE))

View File

@ -53,6 +53,7 @@
#define F_REPEAT 166 #define F_REPEAT 166
#define F_FONT_AUTO 167 #define F_FONT_AUTO 167
#define F_CAN_BREAK 168 #define F_CAN_BREAK 168
#define F_ORIENTATION 169
#define F_SQL 201 #define F_SQL 201
#define F_IMPORT_QRY 202 #define F_IMPORT_QRY 202

View File

@ -9,20 +9,28 @@ BEGIN
MESSAGE TRUE DISABLE,F_FONT_SELECT|DISABLE,F_DY MESSAGE TRUE DISABLE,F_FONT_SELECT|DISABLE,F_DY
END END
RADIO F_ORIENTATION 1 24
BEGIN
PROMPT 1 1 "@bOrientamento della carta"
ITEM "0|Impostazioni Stampante"
ITEM "1|Ritratto (Verticale)"
ITEM "2|Paesaggio (Orizzontale)"
END
NUMBER F_DY 2 NUMBER F_DY 2
BEGIN BEGIN
PROMPT 1 1 "Linee per pollice " PROMPT 26 2 "Linee per pollice "
CHEKCTYPE REQUIRED CHEKCTYPE REQUIRED
END END
BUTTON F_FONT_SELECT 10 2 BUTTON F_FONT_SELECT 5 2
BEGIN BEGIN
PROMPT 1 2 "~Font" PROMPT 26 3 "~Font"
END END
SPREADSHEET F_PARAMS 0 -3 SPREADSHEET F_PARAMS 0 -3
BEGIN BEGIN
PROMPT 1 4 "" PROMPT 1 5 ""
ITEM "Parametro@16" ITEM "Parametro@16"
ITEM "Valore@50" ITEM "Valore@50"
END END

View File

@ -7,6 +7,7 @@
#define F_DESCR 105 #define F_DESCR 105
#define F_DESCR_LETT 106 #define F_DESCR_LETT 106
#define F_DESCR_CLAS 107 #define F_DESCR_CLAS 107
#define F_SUB 108

View File

@ -75,26 +75,41 @@ BEGIN
FLAGS "D" FLAGS "D"
END END
STRING F_NUM 4 STRING F_NUM 2
BEGIN BEGIN
PROMPT 1 7 "Numero " PROMPT 1 7 "Numero "
FIELD %IVD->CODTAB[7,10] FIELD %IVD->CODTAB[7,8]
KEY 1 KEY 1
USE %IVD USE %IVD
COPY INPUT F_CLASSE COPY INPUT F_CLASSE
INPUT CODTAB[7,10] F_NUM INPUT CODTAB[7,8] F_NUM
INPUT CODTAB[9,10] F_SUB
DISPLAY "Sezione" CODTAB[1,1] DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2] DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Classe @M" CODTAB[3,6] DISPLAY "Classe @M" CODTAB[3,6]
DISPLAY "Numero" CODTAB[7,10] DISPLAY "Numero" CODTAB[7,10]
DISPLAY "Descrizione@50" S0 DISPLAY "Descrizione@50" S0
OUTPUT F_NUM CODTAB[7,10] OUTPUT F_NUM CODTAB[7,8]
OUTPUT F_SUB CODTAB[9,10]
OUTPUT F_SEZ CODTAB[1,1] OUTPUT F_SEZ CODTAB[1,1]
OUTPUT F_LETT CODTAB[2,2] OUTPUT F_LETT CODTAB[2,2]
OUTPUT F_CLASSE CODTAB[3,6] OUTPUT F_CLASSE CODTAB[3,6]
OUTPUT F_DESCR S0 MESSAGE EMPTY CLEAR,F_SUB
MESSAGE ENABLE,F_SUB
HELP "Numero (arabo) secondo la IV dir. CEE" HELP "Numero (arabo) secondo la IV dir. CEE"
// VALIDATE AUTOEXIT_FUNC 2 F_LETT F_NUM END
LIST F_SUB 9
BEGIN
PROMPT 15 7 ""
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
FIELD %IVD->CODTAB[9,10]
KEY 1
END END
TEXT DLG_NULL TEXT DLG_NULL
@ -115,6 +130,7 @@ BEGIN
DISPLAY "Classe @M" CODTAB[3,6] DISPLAY "Classe @M" CODTAB[3,6]
DISPLAY "Numero" CODTAB[7,10] DISPLAY "Numero" CODTAB[7,10]
COPY OUTPUT F_NUM COPY OUTPUT F_NUM
OUTPUT F_DESCR S0
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
WARNING "Manca la descrizione" WARNING "Manca la descrizione"
END END

View File

@ -225,11 +225,6 @@ void TPianoconti_app::init_insert_mode(TMask& m)
s4 = pconti.get(PCN_NUMIVD); s4 = pconti.get(PCN_NUMIVD);
if (s3.empty()) if (s3.empty())
s3.spaces(4); s3.spaces(4);
else
s3.right_just(4,'0');
// if (!s4.empty())
// s4.right_just(2,'0');
key.format("%1d%1s%s%s", s1, (const char*) s2,(const char*) s3, (const char*) s4); key.format("%1d%1s%s%s", s1, (const char*) s2,(const char*) s3, (const char*) s4);
s5 = cache().get("%IVD", key, "S0"); s5 = cache().get("%IVD", key, "S0");
@ -246,13 +241,15 @@ void TPianoconti_app::init_insert_mode(TMask& m)
m.show(FLD_CM1_LETTIVD, ivd_enable); m.show(FLD_CM1_LETTIVD, ivd_enable);
m.show(FLD_CM1_NUMRIVD, ivd_enable); m.show(FLD_CM1_NUMRIVD, ivd_enable);
m.show(FLD_CM1_NUMIVD, ivd_enable); m.show(FLD_CM1_NUMIVD, ivd_enable);
m.show(F_SUB, ivd_enable);
m.show(FLD_CM1_DESCIVD, ivd_enable); // m.show(FLD_CM1_DESCIVD, ivd_enable); //
if (!ivd_enable) if (!ivd_enable)
{ {
m.set(FLD_CM1_SEZIVD, s1); m.set(FLD_CM1_SEZIVD, s1);
m.set(FLD_CM1_LETTIVDH, s2); m.set(FLD_CM1_LETTIVDH, s2);
m.set(FLD_CM1_NUMRIVDH, s3); m.set(FLD_CM1_NUMRIVDH, s3);
m.set(FLD_CM1_NUMIVDH, s4); m.set(FLD_CM1_NUMIVDH, s4.left(2));
m.set(F_SUBH, s4.mid(2));
m.set(FLD_CM1_DESCIVDH, s5); // m.set(FLD_CM1_DESCIVDH, s5); //
m.enable(FLD_CM1_SEZIVDOPP); m.enable(FLD_CM1_SEZIVDOPP);
m.disable(FLD_CM1_LETTIVDH); m.disable(FLD_CM1_LETTIVDH);
@ -263,6 +260,7 @@ void TPianoconti_app::init_insert_mode(TMask& m)
m.show(FLD_CM1_LETTIVDH, !ivd_enable); m.show(FLD_CM1_LETTIVDH, !ivd_enable);
m.show(FLD_CM1_NUMRIVDH, !ivd_enable); m.show(FLD_CM1_NUMRIVDH, !ivd_enable);
m.show(FLD_CM1_NUMIVDH, !ivd_enable); m.show(FLD_CM1_NUMIVDH, !ivd_enable);
m.show(F_SUBH, !ivd_enable);
m.show(FLD_CM1_DESCIVDH, !ivd_enable); // m.show(FLD_CM1_DESCIVDH, !ivd_enable); //
if (s.empty()) if (s.empty())

View File

@ -24,6 +24,8 @@
#define FLD_CM1_NUMRIVDOPP 115 #define FLD_CM1_NUMRIVDOPP 115
#define FLD_CM1_NUMIVDOPP 116 #define FLD_CM1_NUMIVDOPP 116
#define FLD_CM1_DTIPOSPRIC 117 #define FLD_CM1_DTIPOSPRIC 117
#define F_SUB 118
#define F_SUBOPP 119
#define FLD_CM1_LETTIVDH 120 #define FLD_CM1_LETTIVDH 120
#define FLD_CM1_NUMRIVDH 121 #define FLD_CM1_NUMRIVDH 121
@ -35,6 +37,7 @@
#define FLD_CM1_DESCIVD 127 #define FLD_CM1_DESCIVD 127
#define FLD_CM1_DESCIVDOPP 128 #define FLD_CM1_DESCIVDOPP 128
#define FLD_CM1_DESCIVDH 129 #define FLD_CM1_DESCIVDH 129
#define F_SUBH 130
#define FLD_CM2_STSOTTBIL 200 #define FLD_CM2_STSOTTBIL 200
#define FLD_CM2_STSOTTAB 201 #define FLD_CM2_STSOTTAB 201

View File

@ -175,7 +175,7 @@ END
STRING FLD_CM1_LETTIVD 1 1 STRING FLD_CM1_LETTIVD 1 1
BEGIN BEGIN
PROMPT 56 7 "" PROMPT 51 7 ""
HELP "Codice del conto secondo la IV direttiva CEE" HELP "Codice del conto secondo la IV direttiva CEE"
FIELD LETTIVD FIELD LETTIVD
GROUP 1 5 GROUP 1 5
@ -184,14 +184,14 @@ END
STRING FLD_CM1_LETTIVDH 1 STRING FLD_CM1_LETTIVDH 1
BEGIN BEGIN
PROMPT 55 7 "" PROMPT 51 7 ""
FLAGS "HDU" FLAGS "HDU"
GROUP 1 5 GROUP 1 5
END END
NUMBER FLD_CM1_NUMRIVD 8 4 NUMBER FLD_CM1_NUMRIVD 8 4
BEGIN BEGIN
PROMPT 59 7 "" PROMPT 55 7 ""
HELP "Codice del conto secondo la IV direttiva CEE" HELP "Codice del conto secondo la IV direttiva CEE"
FIELD NUMRIVD FIELD NUMRIVD
GROUP 1 5 GROUP 1 5
@ -200,21 +200,22 @@ END
NUMBER FLD_CM1_NUMRIVDH 8 4 NUMBER FLD_CM1_NUMRIVDH 8 4
BEGIN BEGIN
PROMPT 59 7 "" PROMPT 55 7 ""
FLAGS "HDMZ" FLAGS "HDMZ"
GROUP 1 5 GROUP 1 5
END END
STRING FLD_CM1_NUMIVD 4 STRING FLD_CM1_NUMIVD 2
BEGIN BEGIN
PROMPT 70 7 "" PROMPT 64 7 ""
FIELD NUMIVD FIELD NUMIVD[1,2]
GROUP 1 5 GROUP 1 5
USE %IVD USE %IVD
INPUT CODTAB[1,1] FLD_CM1_SEZIVD INPUT CODTAB[1,1] FLD_CM1_SEZIVD
INPUT CODTAB[2,2] FLD_CM1_LETTIVD INPUT CODTAB[2,2] FLD_CM1_LETTIVD
INPUT CODTAB[3,6] FLD_CM1_NUMRIVD INPUT CODTAB[3,6] FLD_CM1_NUMRIVD
INPUT CODTAB[7,10] FLD_CM1_NUMIVD INPUT CODTAB[7,8] FLD_CM1_NUMIVD
INPUT CODTAB[9,10] F_SUB
DISPLAY "Sezione" CODTAB[1,1] DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2] DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Classe @M" CODTAB[3,6] DISPLAY "Classe @M" CODTAB[3,6]
@ -223,17 +224,45 @@ BEGIN
OUTPUT FLD_CM1_SEZIVD CODTAB[1,1] OUTPUT FLD_CM1_SEZIVD CODTAB[1,1]
OUTPUT FLD_CM1_LETTIVD CODTAB[2,2] OUTPUT FLD_CM1_LETTIVD CODTAB[2,2]
OUTPUT FLD_CM1_NUMRIVD CODTAB[3,6] OUTPUT FLD_CM1_NUMRIVD CODTAB[3,6]
OUTPUT FLD_CM1_NUMIVD CODTAB[7,10] OUTPUT FLD_CM1_NUMIVD CODTAB[7,8]
OUTPUT F_SUB CODTAB[9,10]
OUTPUT FLD_CM1_DESCIVD S0 OUTPUT FLD_CM1_DESCIVD S0
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Codice non presente" WARNING "Codice non presente"
END END
STRING FLD_CM1_NUMIVDH 4 LIST F_SUB 9
BEGIN BEGIN
PROMPT 70 7 "" PROMPT 69 7 ""
FLAGS "HDZ"
GROUP 1 5 GROUP 1 5
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
FIELD NUMIVD[3,4]
KEY 1
END
STRING FLD_CM1_NUMIVDH 2
BEGIN
PROMPT 64 7 ""
FLAGS "HD"
GROUP 1 5
END
LIST F_SUBH 9
BEGIN
PROMPT 69 7 ""
GROUP 1 5
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
KEY 1
END END
STRING FLD_CM1_DESCIVD 70 50 STRING FLD_CM1_DESCIVD 70 50
@ -251,6 +280,7 @@ BEGIN
GROUP 1 5 GROUP 1 5
END END
STRING FLD_CM1_DESCIVDH 70 50 STRING FLD_CM1_DESCIVDH 70 50
BEGIN BEGIN
PROMPT 24 8 "" PROMPT 24 8 ""
@ -275,7 +305,7 @@ END
STRING FLD_CM1_LETTIVDOPP 1 STRING FLD_CM1_LETTIVDOPP 1
BEGIN BEGIN
PROMPT 55 9 "" PROMPT 51 9 ""
HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE" HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE"
FIELD LETTIVDOPP FIELD LETTIVDOPP
FLAGS "U" FLAGS "U"
@ -284,34 +314,50 @@ END
NUMBER FLD_CM1_NUMRIVDOPP 8 4 NUMBER FLD_CM1_NUMRIVDOPP 8 4
BEGIN BEGIN
PROMPT 59 9 "" PROMPT 55 9 ""
HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE" HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE"
FIELD NUMRIVDOPP FIELD NUMRIVDOPP
FLAGS "MZ" FLAGS "MZ"
GROUP 1 2 4 7 GROUP 1 2 4 7
END END
STRING FLD_CM1_NUMIVDOPP 4 STRING FLD_CM1_NUMIVDOPP 2
BEGIN BEGIN
PROMPT 70 9 "" PROMPT 64 9 ""
HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE" HELP "Codice del conto di sezione opposta secondo la IV direttiva CEE"
FIELD NUMIVDOPP FIELD NUMIVDOPP[1,2]
GROUP 1 2 4 7 GROUP 1 2 4 7
COPY USE FLD_CM1_NUMIVD COPY USE FLD_CM1_NUMIVD
INPUT CODTAB[1,1] FLD_CM1_SEZIVDOPP INPUT CODTAB[1,1] FLD_CM1_SEZIVDOPP
INPUT CODTAB[2,2] FLD_CM1_LETTIVDOPP INPUT CODTAB[2,2] FLD_CM1_LETTIVDOPP
INPUT CODTAB[3,6] FLD_CM1_NUMRIVDOPP INPUT CODTAB[3,6] FLD_CM1_NUMRIVDOPP
INPUT CODTAB[7,10] FLD_CM1_NUMIVDOPP INPUT CODTAB[7,8] FLD_CM1_NUMIVDOPP
INPUT CODTAB[9,10] F_SUBOPP
COPY DISPLAY FLD_CM1_NUMIVD COPY DISPLAY FLD_CM1_NUMIVD
OUTPUT FLD_CM1_SEZIVDOPP CODTAB[1,1] OUTPUT FLD_CM1_SEZIVDOPP CODTAB[1,1]
OUTPUT FLD_CM1_LETTIVDOPP CODTAB[2,2] OUTPUT FLD_CM1_LETTIVDOPP CODTAB[2,2]
OUTPUT FLD_CM1_NUMRIVDOPP CODTAB[3,6] OUTPUT FLD_CM1_NUMRIVDOPP CODTAB[3,6]
OUTPUT FLD_CM1_NUMIVDOPP CODTAB[7,10] OUTPUT FLD_CM1_NUMIVDOPP CODTAB[7,8]
OUTPUT F_SUBOPP CODTAB[9,10]
OUTPUT FLD_CM1_DESCIVDOPP S0 OUTPUT FLD_CM1_DESCIVDOPP S0
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Codice non presente" WARNING "Codice non presente"
END END
LIST F_SUBOPP 9
BEGIN
PROMPT 69 9 ""
GROUP 1 2 4 7
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
FIELD NUMIVDOPP[3,4]
KEY 1
END
STRING FLD_CM1_DESCIVDOPP 70 50 STRING FLD_CM1_DESCIVDOPP 70 50
BEGIN BEGIN
PROMPT 24 10 "" PROMPT 24 10 ""

View File

@ -56,8 +56,8 @@ class CG1100_application : public TPrintapp
int _old_gruppo; int _old_gruppo;
int _i; int _i;
int _cur_std, _cur_sorted, _cur_senza_ana; int _cur_std, _cur_sorted, _cur_senza_ana;
TString _clivd, _clivdo; TString _clivd, _clivdo, _num_dec;
TParagraph_string _d1, _d2, _d3; TParagraph_string _d1, _d2, _d3, _d4;
char _sez_da_stamp,_sez_stamp,_let_da_stamp,_let_stamp; char _sez_da_stamp,_sez_stamp,_let_da_stamp,_let_stamp;
TString _numr_da_stamp,_numr_stamp, _num_stamp, _num_da_stamp; TString _numr_da_stamp,_numr_stamp, _num_stamp, _num_da_stamp;
int _gruppo,_conto, _g_prec,_c_prec; int _gruppo,_conto, _g_prec,_c_prec;
@ -101,9 +101,46 @@ public:
virtual bool process_link(int id, const char* txt); virtual bool process_link(int id, const char* txt);
CG1100_application() : _clivd(8), _clivdo(8), _d1("", 30), _d2("", 40), _d3("", 40) {} CG1100_application() : _clivd(8), _clivdo(8), _d1("", 30), _d2("", 32), _d3("", 40), _d4("",32) {}
}; };
const char * num2str(const TString & s)
{
TString & str = get_tmp_string(20);
str = s;
str.trim();
if (str.len() > 2)
{
str = s.left(2);
const int sub = atoi(s.mid(2));
switch (sub)
{
case 0:
case 1:
break;
case 2:
str << " bis";
break;
case 3:
str << " ter";
break;
case 4:
str << " quater";
break;
case 5:
str << " quinquies";
break;
case 6:
str << " sexies";
break;
default:
break;
}
}
return (const char *) str;
}
bool CG1100_application::process_link(int id, const char* txt) bool CG1100_application::process_link(int id, const char* txt)
{ {
TToken_string str(txt); TToken_string str(txt);
@ -577,10 +614,10 @@ void CG1100_application::set_con_IV()
if (_numr_da_stamp != "") if (_numr_da_stamp != "")
set_row(_i,"@2g%8s", (const char*) numrom); set_row(_i,"@2g%8s", (const char*) numrom);
set_row(_i,"@11g%-4s", (const char *)_num_da_stamp); set_row(_i,"@11g%s", num2str(_num_da_stamp));
_d2 = descrizione; _d2 = descrizione;
set_row(_i,"@16g#a", &_d2); set_row(_i,"@23g#a", &_d2);
} }
} }
} }
@ -588,20 +625,21 @@ void CG1100_application::set_con_IV()
set_row (_i,"@62g$[b]%3d$[n]", _conto); set_row (_i,"@62g$[b]%3d$[n]", _conto);
if (_sottoc != 0) if (_sottoc != 0)
set_row (_i,"@66g$[b]%6ld$[n]", _sottoc); set_row (_i,"@66g$[b]%6ld$[n]", _sottoc);
set_row (_i,"@73g%.40s", (const char*) descr); _d4 = descr;
set_row (_i,"@73g#a", &_d4);
if (sez_opp != '0') if (sez_opp != '0')
{ {
set_row (_i,"@116g%c", sez_opp); set_row (_i,"@109g%c", sez_opp);
if (let_opp != '\0') if (let_opp != '\0')
set_row (_i,"@118g%c", let_opp); set_row (_i,"@111g%c", let_opp);
if (numr_opp != 0) if (numr_opp != 0)
set_row (_i,"@120g%8s", (const char*) numrom_opp); set_row (_i,"@113g%8s", (const char*) numrom_opp);
if (num_opp.not_empty()) if (num_opp.not_empty())
set_row (_i++,"@129g%-4s", (const char *) num_opp); set_row (_i++,"@122g%s", num2str(num_opp));
} }
else else
_i++; _i++;
@ -759,7 +797,8 @@ void CG1100_application::set_completa()
set_row (i, "@58g@1s", FLD(LF_PCON, PCN_SEZIVD) ); set_row (i, "@58g@1s", FLD(LF_PCON, PCN_SEZIVD) );
set_row (i, "@60g@1s", FLD(LF_PCON, PCN_LETTIVD) ); set_row (i, "@60g@1s", FLD(LF_PCON, PCN_LETTIVD) );
set_row (i, "@62g#-8t", &_clivd ); set_row (i, "@62g#-8t", &_clivd );
set_row (i, "@71g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") ); // set_row (i, "@71g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") );
set_row (i, "@71g#t", &_num_dec);
} }
else else
if (_tipo_stampa == completa_bil) if (_tipo_stampa == completa_bil)
@ -979,6 +1018,7 @@ bool CG1100_application::preprocess_page(int file,int counter)
_clivd = itor(c3); _clivd = itor(c3);
_clivdo = itor(o3); _clivdo = itor(o3);
_num_dec = num2str(_rec->get(PCN_NUMIVD));
return true; return true;
} }
@ -1084,8 +1124,8 @@ void CG1100_application::intesta (stampe tipo)
set_header (soh++, FR("@20gStampa conti riclassificati per IV direttiva")); set_header (soh++, FR("@20gStampa conti riclassificati per IV direttiva"));
s.fill('-'); s.fill('-');
set_header (soh++, (const char *) s); set_header (soh++, (const char *) s);
set_header (soh++, FR("@58gCodici Piano@116gSez. e Classe")); set_header (soh++, FR("@58gCodici Piano@109gSez. e Classe"));
set_header (soh++, FR("Classe@16gDescrizione@58gdei Conti @73gDescrizione@116gdi segno opposto")); set_header (soh++, FR("Classe@23gDescrizione@58gdei Conti @73gDescrizione@109gdi segno opposto"));
break; break;

View File

@ -22,6 +22,8 @@
#include "cglib01.h" #include "cglib01.h"
#include "cglib02.h" #include "cglib02.h"
extern const char * num2str(const TString & s);
class TRiga_sez_opp : public TObject class TRiga_sez_opp : public TObject
{ {
TToken_string* _str; TToken_string* _str;
@ -2199,7 +2201,7 @@ void TStampa_IVdirettiva::stampa_totali()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2219,7 +2221,7 @@ void TStampa_IVdirettiva::stampa_totali()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2254,7 +2256,7 @@ void TStampa_IVdirettiva::stampa_totali()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2312,7 +2314,7 @@ void TStampa_IVdirettiva::stampa_totali()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2412,7 +2414,7 @@ void TStampa_IVdirettiva::stampa_totali()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2613,7 +2615,7 @@ void TStampa_IVdirettiva::stampa_totali_con_raffronto()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale %-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale %s)"), num2str(_num));
set_row (_i,"@81g%r", &_totale_numero); set_row (_i,"@81g%r", &_totale_numero);
set_row (_i++,"@111g%r", &_totale_num_raf); set_row (_i++,"@111g%r", &_totale_num_raf);
} }
@ -2635,7 +2637,7 @@ void TStampa_IVdirettiva::stampa_totali_con_raffronto()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale %-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale %s)"), num2str(_num));
set_row (_i,"@81g%r", &_totale_numero); set_row (_i,"@81g%r", &_totale_numero);
set_row (_i++,"@111g%r", &_totale_num_raf); set_row (_i++,"@111g%r", &_totale_num_raf);
} }
@ -2675,7 +2677,7 @@ void TStampa_IVdirettiva::stampa_totali_con_raffronto()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale %-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale %s)"), num2str(_num));
set_row (_i++,"@81g%r", &_totale_numero); set_row (_i++,"@81g%r", &_totale_numero);
} }
} }
@ -2741,7 +2743,7 @@ void TStampa_IVdirettiva::stampa_totali_con_raffronto()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale@25g%-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale@25g%s)"), num2str(_num));
set_row (_i,"@81g%r", &_totale_numero); set_row (_i,"@81g%r", &_totale_numero);
set_row (_i++,"@111g%r", &_totale_num_raf); set_row (_i++,"@111g%r", &_totale_num_raf);
} }
@ -2859,7 +2861,7 @@ void TStampa_IVdirettiva::stampa_totali_con_raffronto()
//Fai il totale del numero arabo e stampalo //Fai il totale del numero arabo e stampalo
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@18gTotale %-4s)"), (const char *) _num); set_row (_i,FR("@18gTotale %s)"), num2str(_num));
set_row (_i,"@81g%r", &_totale_numero); set_row (_i,"@81g%r", &_totale_numero);
set_row (_i++,"@111g%r", &_totale_num_raf); set_row (_i++,"@111g%r", &_totale_num_raf);
} }
@ -3093,7 +3095,7 @@ void TStampa_IVdirettiva::stampa_totali_verifica()
{ {
if (_num.not_empty()) if (_num.not_empty())
{ {
set_row (_i,FR("@8gTotale@15g%-4s)"), (const char *) _num); set_row (_i,FR("@8gTotale@15g%s)"), num2str(_num));
total_printed = true; total_printed = true;
} }
} }
@ -3163,7 +3165,7 @@ void TStampa_IVdirettiva::stampa_totali_verifica()
if (_num.not_empty()) if (_num.not_empty())
{ {
if (total_printed) _i++; if (total_printed) _i++;
set_row (_i,FR("@8gTotale@15g%-4s)"), (const char *) _num); set_row (_i,FR("@8gTotale@15g%s)"), num2str(_num));
total_printed = true; total_printed = true;
} }
} }
@ -3235,7 +3237,7 @@ void TStampa_IVdirettiva::stampa_totali_verifica()
if (_num.not_empty()) if (_num.not_empty())
{ {
if (total_printed) _i++; if (total_printed) _i++;
set_row (_i,FR("@8gTotale@15g%-4s)"), (const char *) _num); set_row (_i,FR("@8gTotale@15g%s)"), num2str(_num));
total_printed = true; total_printed = true;
} }
} }
@ -4077,10 +4079,10 @@ void TStampa_IVdirettiva::setta_righe(const char * titolo)
if (devo_stampare_risultato_prima_delle_imposte()) if (devo_stampare_risultato_prima_delle_imposte())
stampa_risultato_prima_delle_imposte(); stampa_risultato_prima_delle_imposte();
set_row(_i,"@13g%s@17g)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 32);
setta_righe_descr(s, "@20g%s"); setta_righe_descr(s, "@27g%s");
} }
} }
} }
@ -4129,10 +4131,10 @@ void TStampa_IVdirettiva::setta_righe(const char * titolo)
{ {
if (devo_stampare_risultato_prima_delle_imposte()) if (devo_stampare_risultato_prima_delle_imposte())
stampa_risultato_prima_delle_imposte(); stampa_risultato_prima_delle_imposte();
set_row(_i,"@13g%s@17g)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 32);
setta_righe_descr(s, "@20g%s"); setta_righe_descr(s, "@27g%s");
} }
} }
} }
@ -4155,9 +4157,9 @@ void TStampa_IVdirettiva::setta_righe(const char * titolo)
{ {
if (devo_stampare_risultato_prima_delle_imposte()) if (devo_stampare_risultato_prima_delle_imposte())
stampa_risultato_prima_delle_imposte(); stampa_risultato_prima_delle_imposte();
set_row(_i,"@13g%s", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 32);
setta_righe_descr(s,"@20g%s"); setta_righe_descr(s,"@27g%s");
} }
} }
} }
@ -4168,10 +4170,10 @@ void TStampa_IVdirettiva::setta_righe(const char * titolo)
{ {
if (devo_stampare_risultato_prima_delle_imposte()) if (devo_stampare_risultato_prima_delle_imposte())
stampa_risultato_prima_delle_imposte(); stampa_risultato_prima_delle_imposte();
set_row(_i,"@13g%s@17g)", (const char *) numero); set_row(_i,"@13g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror, numero), 32);
setta_righe_descr(s, "@20g%s"); setta_righe_descr(s, "@27g%s");
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
{ {
_cont_gcs = 0; _cont_gcs = 0;
@ -4271,9 +4273,9 @@ void TStampa_IVdirettiva::setta_righe_verifica()
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@0g%s)", (const char *) numero); set_row(_i,"@0g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 32);
setta_righe_descr_verifica(s, "@6g%s"); setta_righe_descr_verifica(s, "@13g%s");
} }
} }
} }
@ -4306,9 +4308,9 @@ void TStampa_IVdirettiva::setta_righe_verifica()
} }
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@0g%s)", (const char *)numero); set_row(_i,"@0g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 32);
setta_righe_descr_verifica(s, "@6g%s"); setta_righe_descr_verifica(s, "@13g%s");
} }
} }
} }
@ -4334,9 +4336,9 @@ void TStampa_IVdirettiva::setta_righe_verifica()
if (numero.not_empty()) if (numero.not_empty())
{ {
set_row(_i,"@0g%s)", (const char *) numero); set_row(_i,"@0g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 32);
setta_righe_descr_verifica(s, "@6g%s"); setta_righe_descr_verifica(s, "@13g%s");
} }
} }
} }
@ -4351,9 +4353,9 @@ void TStampa_IVdirettiva::setta_righe_verifica()
{ {
if (_let_da_stamp != 'Z') if (_let_da_stamp != 'Z')
{ {
set_row(_i,"@0g%s)", (const char *) numero); set_row(_i,"@0g%s)", num2str(numero));
TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 40); TParagraph_string s(descrizione_ivd(sezione,lettera,numeror,numero), 32);
setta_righe_descr_verifica(s, "@6g%s"); setta_righe_descr_verifica(s, "@13g%s");
_cont_num += 1; _cont_num += 1;
_cont_gcs = 0; _cont_gcs = 0;
} }

View File

@ -33,6 +33,43 @@ public:
virtual ~TMastrini_record() { } virtual ~TMastrini_record() { }
}; };
const char * num2str(const TString & s)
{
TString & str = get_tmp_string(20);
str = s;
str.trim();
if (str.len() > 2)
{
str = s.left(2);
const int sub = atoi(s.mid(2));
switch (sub)
{
case 0:
case 1:
break;
case 2:
str << " bis";
break;
case 3:
str << " ter";
break;
case 4:
str << " quater";
break;
case 5:
str << " quinquies";
break;
case 6:
str << " sexies";
break;
default:
break;
}
}
return (const char *) str;
}
const TString& TMastrini_record::get_str(const char* fieldname) const const TString& TMastrini_record::get_str(const char* fieldname) const
{ {
if (strcmp(fieldname, RMV_DESCR) == 0) if (strcmp(fieldname, RMV_DESCR) == 0)
@ -3411,14 +3448,14 @@ void TMastrini_application::ricerca_clifo()
set_header (4, "%s@8g%c", TR("Classe") , _lettivd); set_header (4, "%s@8g%c", TR("Classe") , _lettivd);
set_header (4, "@10g%-8s", (const char*) _numrivd); set_header (4, "@10g%-8s", (const char*) _numrivd);
if (_numivd.not_empty()) if (_numivd.not_empty())
set_header (4, "@19g%-4s", (const char *) _numivd); set_header (4, "@19g%s", num2str(_numivd));
if (descriz2 != "") if (descriz2 != "")
{ {
set_header (4,"@23g%-50s",(const char*) descriz2); set_header (4,"@30g%-50s",(const char*) descriz2);
set_header (4,"@80g%-50s",(const char*) descriz); set_header (4,"@82g%-50s",(const char*) descriz);
} }
else else
set_header (4,"@23g%-50s",(const char*) descriz); set_header (4,"@30g%-50s",(const char*) descriz);
dataini = _data_ini.string(); dataini = _data_ini.string();
datafine = _data_fine.string(); datafine = _data_fine.string();
@ -3541,14 +3578,14 @@ int TMastrini_application::ricerca_clifo(int start)
set_row(r, "%s@8g%c", TR("Classe"), _lettivd); set_row(r, "%s@8g%c", TR("Classe"), _lettivd);
set_row(r, "@10g%-8s", (const char*) _numrivd); set_row(r, "@10g%-8s", (const char*) _numrivd);
if (_numivd.not_empty()) if (_numivd.not_empty())
set_row(r, "@19g%-4s", (const char *) _numivd); set_row(r, "@19g%s", num2str(_numivd));
if (descriz2.not_empty()) if (descriz2.not_empty())
{ {
set_row(r,"@23g%-50s",(const char*) descriz2); set_row(r,"@30g%-50s",(const char*) descriz2);
set_row(r++,"@80g%-50s",(const char*) descriz); set_row(r++,"@82g%-50s",(const char*) descriz);
} }
else else
set_row(r++,"@23g%-50s",(const char*) descriz); set_row(r++,"@30g%-50s",(const char*) descriz);
dataini = _data_ini.string(); dataini = _data_ini.string();
datafine = _data_fine.string(); datafine = _data_fine.string();
@ -3651,14 +3688,14 @@ void TMastrini_application::ricerca_gruppo()
set_header (4, "@0g%s@12g%c", TR("Classe"), _lettivd); set_header (4, "@0g%s@12g%c", TR("Classe"), _lettivd);
set_header (4, "@14g%-8s",(const char*) _numrivd); set_header (4, "@14g%-8s",(const char*) _numrivd);
if (_numivd.not_empty()) if (_numivd.not_empty())
set_header (4, "@23g%-4s", (const char *) _numivd); set_header (4, "@23g%s", num2str(_numivd));
if (descriz2.not_empty()) if (descriz2.not_empty())
{ {
set_header (4,"@27g%-50s",(const char*) descriz2); set_header (4,"@34g%-48s",(const char*) descriz2);
set_header (4,"@80g%-50s",(const char*) descriz); set_header (4,"@82g%-50s",(const char*) descriz);
} }
else else
set_header (4,"@27g%-50s",(const char*) descriz); set_header (4,"@34g%-50s",(const char*) descriz);
dataini = _data_ini.string(); dataini = _data_ini.string();
datafine = _data_fine.string(); datafine = _data_fine.string();
@ -3726,14 +3763,14 @@ int TMastrini_application::ricerca_gruppo(int start)
set_row(r, "@0g%s@12g%c", TR("Classe"), _lettivd); set_row(r, "@0g%s@12g%c", TR("Classe"), _lettivd);
set_row(r, "@14g%-8s",(const char*) _numrivd); set_row(r, "@14g%-8s",(const char*) _numrivd);
if (_numivd.not_empty()) if (_numivd.not_empty())
set_row(r, "@23g%-4s", (const char *) _numivd); set_row(r, "@23g%-4s", num2str(_numivd));
if (descriz2 != "") if (descriz2 != "")
{ {
set_row(r,"@27g%-50s",(const char*) descriz2); set_row(r,"@34g%-48s",(const char*) descriz2);
set_row(r++,"@80g%-50s",(const char*) descriz); set_row(r++,"@82g%-50s",(const char*) descriz);
} }
else else
set_row(r++,"@27g%-50s",(const char*) descriz); set_row(r++,"@34g%-50s",(const char*) descriz);
dataini = _data_ini.string(); dataini = _data_ini.string();
datafine = _data_fine.string(); datafine = _data_fine.string();

View File

@ -2072,6 +2072,7 @@ bool TReport::load(const char* fname)
_lpi = xml.GetIntAttr("lpi", 6); _lpi = xml.GetIntAttr("lpi", 6);
_font.load(xml); _font.load(xml);
_use_printer_font = xml.GetBoolAttr("use_printer_font"); _use_printer_font = xml.GetBoolAttr("use_printer_font");
_orientation = xml.GetIntAttr("orientation");
const TXmlItem* desc = xml.FindFirstChild("description"); const TXmlItem* desc = xml.FindFirstChild("description");
if (desc != NULL) if (desc != NULL)
@ -2131,6 +2132,7 @@ bool TReport::save(const char* fname) const
xml.SetAttr("libraries", _include); xml.SetAttr("libraries", _include);
_font.save(xml); _font.save(xml);
xml.SetAttr("use_printer_font", use_printer_font() ? 1 : 0); xml.SetAttr("use_printer_font", use_printer_font() ? 1 : 0);
xml.SetAttr("orientation", orientation());
const char* sectype = "HBF"; const char* sectype = "HBF";
for (int j = 0; j < 3; j++) for (int j = 0; j < 3; j++)
@ -2949,7 +2951,7 @@ void TReport::include_libraries(bool reload)
TReport::TReport() TReport::TReport()
: _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL), : _lpi(6), _include(15, ','), _recordset(NULL), _curr_field(NULL),
_use_printer_font(false) _use_printer_font(false), _orientation(0)
{ {
_expressions.set_report(this); _expressions.set_report(this);
_prescript.set_description("PRESCRIPT"); _prescript.set_description("PRESCRIPT");

View File

@ -447,6 +447,7 @@ class TReport : public TAlex_virtual_machine
TReport_expr_cache _expressions; TReport_expr_cache _expressions;
word _rep_page, _book_page; word _rep_page, _book_page;
bool _use_printer_font; bool _use_printer_font;
int _orientation;
TReport_field* _curr_field; TReport_field* _curr_field;
protected: protected:
@ -489,6 +490,8 @@ public:
const TReport_font& print_font() const; const TReport_font& print_font() const;
void set_use_printer_font(bool on) { _use_printer_font = on; } void set_use_printer_font(bool on) { _use_printer_font = on; }
bool use_printer_font() const { return _use_printer_font; } bool use_printer_font() const { return _use_printer_font; }
void set_orientation(int orion) { _orientation = orion; }
int orientation() const { return _orientation; }
void set_font(const TReport_font& f) { _font = f; } void set_font(const TReport_font& f) { _font = f; }
void unmap_font(); void unmap_font();

View File

@ -1552,7 +1552,7 @@ bool TReport_book::close_page()
void TReport_book::reprint_group_headers(const TReport_section& rs) void TReport_book::reprint_group_headers(const TReport_section& rs)
{ {
const int max_group = _report->find_max_level('H'); const int max_group = _report->find_max_level('H');
for (int level = max_group; level >= 2; level--) for (int level = 2; level <= max_group; level++)
{ {
TReport_section& rs = _report->section('H', level); TReport_section& rs = _report->section('H', level);
if (rs.repeat_on_page()) if (rs.repeat_on_page())
@ -1665,6 +1665,19 @@ bool TReport_book::init(TReport& rep)
if (!TBook::init()) if (!TBook::init())
return false; return false;
const int report_orientation = rep.orientation();
if (report_orientation > 0)
{
const int priter_orientation = _ph > _pw ? 1 : 2;
if (report_orientation != priter_orientation)
{
// Scambia orientamento della carta
xvt_app_escape(XVT_ESC_SET_PRINTER_INFO, _rcd, &_pw, &_ph, NULL, NULL);
// Rilegge parametri cambiati
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _rcd, &_ph, &_pw, &_pvr, &_phr);
}
}
_report = &rep; _report = &rep;
if (_report->use_printer_font()) if (_report->use_printer_font())
_report->load_printer_font(); _report->load_printer_font();

View File

@ -78,7 +78,8 @@ FASCMS|1|10|0|Fase Commessa
CODCOSTO|1|20|0|Centro di costo CODCOSTO|1|20|0|Centro di costo
NUMREG|3|7|0|Numero movimento contabilizzato NUMREG|3|7|0|Numero movimento contabilizzato
NUMANT|3|7|0|Numero movimento anticipo contabilizzato NUMANT|3|7|0|Numero movimento anticipo contabilizzato
3 4
PROVV+ANNO+CODNUM+NDOC| PROVV+ANNO+CODNUM+NDOC|
TIPOCF+CODCF+PROVV+ANNO+DATADOC+CODNUM+NDOC|X TIPOCF+CODCF+PROVV+ANNO+DATADOC+CODNUM+NDOC|X
DATADOC+PROVV+ANNO+CODNUM+NDOC|X DATADOC+PROVV+ANNO+CODNUM+NDOC|X
TIPOCF+CODCF+PROVV+ANNO+CODNUM+NDOC|X

7
ve/ve0100c.h Executable file
View File

@ -0,0 +1,7 @@
#define F_DACODNUM 101
#define F_DAANNO 102
#define F_DAPROVV 103
#define F_DANDOC 104
#define F_DANRIGA 105
#define F_DESCRNUM 106

95
ve/ve0100c.uml Executable file
View File

@ -0,0 +1,95 @@
#include "ve0100c.h"
PAGE "Documento collegato " -1 -1 78 6
STRING F_DACODNUM 4
BEGIN
PROMPT 2 1 "Numerazione "
USE %NUM
INPUT CODTAB F_DACODNUM
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_DACODNUM CODTAB
OUTPUT F_DESCRNUM S0
CHECKTYPE NORMAL
FLAGS "U"
GROUP 1
END
STRING F_DESCRNUM 50
BEGIN
PROMPT 24 1 ""
USE %NUM KEY 2
INPUT S0 F_DESCRNUM
DISPLAY "Descrizione@50" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT F_DACODNUM
GROUP 1
END
NUMBER F_DAANNO 4
BEGIN
PROMPT 2 3 "Anno "
FLAGS "U"
GROUP 1
END
LISTBOX F_DAPROVV 11
BEGIN
PROMPT 24 3 ""
ITEM "D|Definitivo "
ITEM "P|Provvisorio"
FIELD PROVV
GROUP 1
END
NUMBER F_DANDOC 7
BEGIN
PROMPT 43 3 "Numero "
USE LF_RIGHEDOC
INPUT PROVV F_DAPROVV SELECT
INPUT ANNO F_DAANNO SELECT
INPUT CODNUM F_DACODNUM SELECT
INPUT NDOC F_DANDOC
INPUT NRIGA F_DANRIGA
DISPLAY "N.Doc.@7" NDOC
DISPLAY "Riga" NRIGA
DISPLAY "Descrizione@50" DESCR
DISPLAY "Articolo@20" CODARTMAG
OUTPUT F_DANDOC NDOC
OUTPUT F_DANRIGA NRIGA
CHECKTYPE SEARCH
GROUP 1
END
NUMBER F_DANRIGA 3
BEGIN
PROMPT 66 3 "Riga "
USE LF_RIGHEDOC
INPUT PROVV F_DAPROVV SELECT
INPUT ANNO F_DAANNO SELECT
INPUT CODNUM F_DACODNUM SELECT
INPUT NDOC F_DANDOC SELECT
INPUT NRIGA F_DANRIGA
DISPLAY "N.Doc.@7" NDOC
DISPLAY "Riga" NRIGA
DISPLAY "Descrizione@50" DESCR
DISPLAY "Articolo@20" CODARTMAG
OUTPUT F_DANRIGA NRIGA
CHECKTYPE NORMAL
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -9,6 +9,7 @@ int main(int argc, char **argv)
{ {
case 1 : ve1200(argc, argv); break; case 1 : ve1200(argc, argv); break;
case 2 : ve1300(argc, argv); break; case 2 : ve1300(argc, argv); break;
case 3 : ve1400(argc, argv); break;
default: ve1100(argc, argv); break; default: ve1100(argc, argv); break;
} }
return 0; return 0;

View File

@ -4,6 +4,7 @@
int ve1100(int argc, char* argv[]); int ve1100(int argc, char* argv[]);
int ve1200(int argc, char* argv[]); int ve1200(int argc, char* argv[]);
int ve1300(int argc, char* argv[]); int ve1300(int argc, char* argv[]);
int ve1400(int argc, char* argv[]);
#endif // __VE1_H #endif // __VE1_H

355
ve/ve1400.cpp Executable file
View File

@ -0,0 +1,355 @@
#include <applicat.h>
#include <automask.h>
#include <defmask.h>
#include <execp.h>
#include <reprint.h>
#include <utility.h>
#include "velib.h"
#include "../ba/ba8400.h"
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
bool cod2app(const char* tok, TString& app)
{
if (isalpha(tok[0]) && isalpha(tok[1]) && atoi(tok+2) > 1000)
{
app.strncpy(tok, 3);
app << " -" << char(tok[3]-1);
return true;
}
return false;
}
bool get_xml_attr(const TString& line, const char* attr, TString& value)
{
TString str; str << ' ' << attr << "=\"";
const int pos = line.find(str);
if (pos >= 0)
{
const int apicia = line.find('"', pos)+1;
const int apicic = line.find('"', apicia);
if (apicic > apicia)
{
value = line.sub(apicia, apicic);
return true;
}
}
return false;
}
bool get_xml_child(const TString& line, const char* tag, TString& value)
{
TString str; str << '<' << tag << '>';
const int pos = line.find(str);
if (pos >= 0)
{
const int apicia = line.find('>', pos)+1;
const int apicic = line.find('<', apicia);
if (apicic > apicia)
{
value = line.sub(apicia, apicic);
return true;
}
}
return false;
}
bool rep2app(const char* name, TString& app, TString& desc)
{
app = desc = "";
TFilename report_name(name);
report_name.ext("rep");
if (!report_name.custom_path())
return false;
TToken_string libraries(50, ',');
TString stringona;
TScanner scan(report_name);
for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe
stringona << scan.line();
get_xml_attr(stringona, "libraries", libraries);
get_xml_child(stringona, "description", desc);
FOR_EACH_TOKEN(libraries, tok) if (strlen(tok) == 6)
{
if (cod2app(tok, app))
return true;
}
cod2app(report_name.name(), app);
return true;
}
///////////////////////////////////////////////////////////
// TDocument_cache
///////////////////////////////////////////////////////////
class TDocument_cache : TCache
{
protected:
virtual TObject* key2obj(const char* key);
public:
TDocumento& doc(const TRectype& rec);
TDocument_cache() : TCache(23) { }
virtual ~TDocument_cache() { }
};
TObject* TDocument_cache::key2obj(const char* key)
{
TToken_string k(key);
const char provv = *k.get(0);
const int anno = k.get_int();
const TString4 codnum= k.get();
const long ndoc = k.get_long();
return new TDocumento(provv, anno, codnum, ndoc);
}
TDocumento& TDocument_cache::doc(const TRectype& rec)
{
TToken_string key;
key = rec.get(DOC_PROVV);
key.add(rec.get(DOC_ANNO));
key.add(rec.get(DOC_CODNUM));
key.add(rec.get(DOC_NDOC));
TDocumento& d = *(TDocumento*)objptr(key);
return d;
}
///////////////////////////////////////////////////////////
// TDocument_recordset
///////////////////////////////////////////////////////////
class TDocument_recordset : public TISAM_recordset
{
TDocument_cache _cache;
protected:
virtual const TVariant& get(int logic, const char* field) const;
public:
TDocument_recordset(const char* use) : TISAM_recordset(use) { }
virtual ~TDocument_recordset() { }
};
const TVariant& TDocument_recordset::get(int logic, const char* field) const
{
const int idx = relation()->log2ind(logic);
if (idx < 0)
return NULL_VARIANT;
const TRectype& rec = relation()->file(idx).curr();
logic = rec.num();
if ((logic == LF_DOC || logic == LF_RIGHEDOC) && rec.type(field) == _nullfld)
{
TDocumento& doc = ((TDocument_cache&)_cache).doc(rec);
TVariant& var = get_tmp_var();
if (logic == LF_DOC)
{
var = doc.get(field);
}
else
{
const int nriga = rec.get_int(RDOC_NRIGA);
const TRiga_documento& rdoc = doc[nriga];
var = rdoc.get(field);
}
return var;
}
return TISAM_recordset::get(logic, field);
}
///////////////////////////////////////////////////////////
// TDocument_report
///////////////////////////////////////////////////////////
class TDocument_report : public TReport
{
protected:
virtual bool set_recordset(const TString& query);
public:
bool load(const char* name);
};
bool TDocument_report::set_recordset(const TString& query)
{
return TReport::set_recordset(new TDocument_recordset(query));
}
bool TDocument_report::load(const char* name)
{
const bool ok = TReport::load(name);
if (ok)
{
// Purtroppo il recordset delle sottosezioni deve essere reimpostato a mano
for (int i = 11; i <= 999; i++)
{
TReport_section* sec = find_section('B', i);
if (sec != NULL)
{
TRecordset* recset = sec->recordset();
if (recset != NULL)
{
const TString use = recset->query_text();
recset = new TDocument_recordset(use);
sec->set_recordset(recset);
}
}
}
}
return ok;
}
///////////////////////////////////////////////////////////
// TKlarkKent_mask
///////////////////////////////////////////////////////////
class TKlarkKent_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TKlarkKent_mask() : TAutomask("ba8500a") { }
};
bool TKlarkKent_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case F_REPORT:
if (e == fe_button)
{
TArray_sheet a(-1, -1, 75, 20, "Report", "Nome@16|Progr.|Descrizione@50");
TString_array& arr = a.rows_array();
list_files("*.rep", arr);
TFilename dir = firm2dir(-1); dir.add("custom"); dir.add("*.rep");
list_files(dir, arr);
TString app, desc;
FOR_EACH_ARRAY_ROW(arr, i, row)
{
rep2app(*row, app, desc);
TFilename n = *row; n = n.name(); n.ext("");
*row = n;
row->add(app);
row->add(desc);
}
if (a.run() == K_ENTER)
{
o.set(a.row(-1).get(0));
e = fe_modify;
}
}
if (e == fe_init || e == fe_modify)
{
TFilename name = o.get();
TString app, desc;
const bool ok = rep2app(name, app, desc);
set(F_FORM, desc);
set(F_DOC, app);
enable(DLG_PRINT, ok);
}
break;
case DLG_EDIT:
if (e == fe_button && !field(F_REPORT).empty())
{
TString str;
str << "ba8 -2 " << get(F_REPORT);
TExternal_app app(str);
app.run(true);
}
break;
default:
break;
}
return true;
}
///////////////////////////////////////////////////////////
// TKlarkKent_app
///////////////////////////////////////////////////////////
class TKlarkKent_app : public TSkeleton_application
{
protected:
virtual void main_loop();
};
void TKlarkKent_app::main_loop()
{
TString_array arr;
for (int i = 2; i < argc(); i++)
arr.add(argv(i));
if (arr.items() == 0)
arr.add(EMPTY_STRING);
bool can_repeat = false;
do
{
TReport_book book;
FOR_EACH_ARRAY_ROW(arr, r, row)
{
TFilename report_name = *row;
report_name.ext("rep");
if (row->blank() || !report_name.custom_path())
{
TKlarkKent_mask m;
m.set(F_REPORT, report_name);
if (m.run() == K_ENTER)
{
report_name = m.get(F_REPORT);
report_name.ext("rep");
report_name.custom_path();
*row = report_name;
}
}
TString appname, desc;
rep2app(report_name, appname, desc);
if (appname.not_empty())
{
appname << ' ' << report_name;
TExternal_app app(appname);
app.run(true);
}
else
{
TDocument_report rep;
if (rep.load(report_name))
{
const bool ok = book.add(rep);
if (ok && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa
{
TFilename msk = report_name;
msk.ext("msk");
can_repeat = msk.exist(); // Posso ripetere se ho una maschera collegata
}
else
can_repeat = false;
}
}
}
if (book.pages() > 0)
book.print_or_preview();
} while (can_repeat);
}
int ve1400(int argc, char* argv[])
{
TKlarkKent_app app;
app.run(argc, argv, TR("Stampa Report Vendite"));
return 0;
}

View File

@ -14,6 +14,7 @@
#include "ve0100.h" #include "ve0100.h"
#include "ve0100b1.h" #include "ve0100b1.h"
#include "ve0100C.h"
#include "ve0100o.h" #include "ve0100o.h"
#include "veuml.h" #include "veuml.h"
#include "veuml1.h" #include "veuml1.h"
@ -21,6 +22,34 @@
#include "sconti.h" #include "sconti.h"
#include "doc.h"
#include "rdoc.h"
class TOriginal_row_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
virtual bool on_key(KEY key);
public:
TOriginal_row_mask() : TAutomask("ve0100c") { }
};
bool TOriginal_row_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
return true;
}
bool TOriginal_row_mask::on_key(KEY key)
{
if (key == K_SHIFT + K_F12)
enable(-1);
return TAutomask::on_key(key);
}
TDocumento_mask::TDocumento_mask(const char* td) TDocumento_mask::TDocumento_mask(const char* td)
: TVariable_mask(), _progs_page(-1), : TVariable_mask(), _progs_page(-1),
_condv(NULL), _smartcard(NULL) _condv(NULL), _smartcard(NULL)
@ -576,6 +605,42 @@ bool TDocumento_mask::on_key(KEY key)
(const char*)user()); (const char*)user());
return TRUE; return TRUE;
} }
else
if (key == K_F7)
{
const TSheet_field & sf = sfield(F_SHEET);
TDocumento & d = doc();
TRiga_documento & riga = d[sf.selected() + 1];
TOriginal_row_mask sm;
const TRectype * or_row = riga.find_original_rdoc();
if (or_row != NULL)
{
sm.set(F_DACODNUM, or_row->get(RDOC_CODNUM));
sm.set(F_DAANNO, or_row->get(RDOC_ANNO));
sm.set(F_DAPROVV, or_row->get(RDOC_PROVV));
sm.set(F_DANDOC, or_row->get(RDOC_NDOC));
sm.set(F_DANRIGA, or_row->get(RDOC_NRIGA));
sm.disable(-1);
}
if (sm.run() == K_ENTER && sm.field(F_DACODNUM).enabled())
{
TToken_string key(sm.get(F_DACODNUM));
key.add(sm.get(F_DAANNO));
key.add(sm.get(F_DAPROVV));
key.add(sm.get(F_DANDOC));
key.add(sm.get(F_DANRIGA));
const TRectype & or_row_mod = cache().get(LF_RIGHEDOC, key);
if (or_row_mod.empty())
riga.reset_original_rdoc_key();
else
riga.set_original_rdoc_key(or_row_mod);
}
return true;
}
return TVariable_mask::on_key(key); return TVariable_mask::on_key(key);
} }
@ -1259,6 +1324,7 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
ss.sheet_mask().enable(DLG_USER, on); ss.sheet_mask().enable(DLG_USER, on);
} }
return TRUE; return TRUE;
} }
@ -2756,4 +2822,3 @@ bool TDocumento_mask::codval_handler( TMask_field& f, KEY key )
} }
return TRUE; return TRUE;
} }

View File

@ -51,6 +51,7 @@ typedef void* XVT_PALETTE;
typedef unsigned long XVT_PALETTE_ATTR; typedef unsigned long XVT_PALETTE_ATTR;
#define XVT_ESC_GET_PRINTER_INFO 883 #define XVT_ESC_GET_PRINTER_INFO 883
#define XVT_ESC_SET_PRINTER_INFO 884
typedef enum e_display_type { typedef enum e_display_type {
XVT_DISPLAY_MONO, /* monochromatic display */ XVT_DISPLAY_MONO, /* monochromatic display */

View File

@ -127,7 +127,6 @@ void TPRINT_RCD::SetData(wxPrintData & data)
{ {
m_size = 0; m_size = 0;
SetBoolElement(data.GetCollate(), &m_size); SetBoolElement(data.GetCollate(), &m_size);
SetBoolElement(data.GetColour(), &m_size); SetBoolElement(data.GetColour(), &m_size);
SetUnsignedElement(data.GetDuplex(), &m_size); SetUnsignedElement(data.GetDuplex(), &m_size);
@ -431,10 +430,10 @@ TPrintDC::~TPrintDC()
BOOLEAN xvt_app_escape(int esc_code, PRINT_RCD* rcd, long* ph, long* pw, long* pvr, long* phr) BOOLEAN xvt_app_escape(int esc_code, PRINT_RCD* rcd, long* ph, long* pw, long* pvr, long* phr)
{ {
*ph = *pw = *pvr = *phr = 0;
switch (esc_code) switch (esc_code)
{ {
case XVT_ESC_GET_PRINTER_INFO: case XVT_ESC_GET_PRINTER_INFO:
*ph = *pw = *pvr = *phr = 0;
if (rcd == NULL || xvt_print_is_valid(rcd)) if (rcd == NULL || xvt_print_is_valid(rcd))
{ {
int w, h; int w, h;
@ -457,6 +456,31 @@ BOOLEAN xvt_app_escape(int esc_code, PRINT_RCD* rcd, long* ph, long* pw, long* p
return TRUE; return TRUE;
} }
break; break;
case XVT_ESC_SET_PRINTER_INFO:
if (rcd != NULL && xvt_print_is_valid(rcd) && ph != NULL && pw != NULL)
{
wxPrintData data;
#ifdef WIN32
TPRINT_RCD* prcd = (TPRINT_RCD*)rcd;
data.SetNativeData(OsWin32_ConvertToNativePrinterInfo(prcd->m_data, prcd->m_size));
#endif
data.ConvertFromNative();
data.SetOrientation(*ph > *pw ? 1 : 2);
data.ConvertToNative();
#ifdef WIN32
void* pHandle = data.GetNativeData();
unsigned int nSize = 0;
void* ptr = OsWin32_ConvertFromNativePrinterInfo(pHandle, nSize);
prcd->SetData(ptr, nSize);
delete ptr;
#endif
return TRUE;
}
break;
default: default:
break; break;
} }