Patch level :2.2 nopatch per ora

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :modificata gestione maschere della stampa del pagato;adesso la maschera e' unica con piu' pagine (da riportare nel programma di trasferimento a proforma)


git-svn-id: svn://10.65.10.50/trunk@13528 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-11-24 16:07:10 +00:00
parent c886d4183e
commit 7195f56cb2
5 changed files with 298 additions and 422 deletions

View File

@ -20,149 +20,14 @@
#include "ca3.h"
#include "ca3600.h"
#include "ca3601.h"
#include "calib01.h"
#include "calib02.h"
#include "camask.h"
//===============================================================================================
////////////////////////////////////////////////////////
// MASCHERA DI CONFIGURAZIONE
////////////////////////////////////////////////////////
class TPag_per_cms_configmask: public TAnal_report_mask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
void config_loader(TSheet_field& sf, const char* paragrafo);
void config_setter(TSheet_field& sf, const char* paragrafo);
public:
TPag_per_cms_configmask();
virtual ~TPag_per_cms_configmask() {}
};
//costruttore
TPag_per_cms_configmask::TPag_per_cms_configmask()
:TAnal_report_mask("ca3601")
{
//Controllo sul tipo di piano dei conti da utilizzare (Analitico/Contabile) e su eventuali
//prefissi (esigenza CRPA)
TConfig& cfg = ca_config();
const bool use_pdcc = cfg.get_bool("UsePdcc");
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
const int pconana_levels = pconana_info.levels();
int pconana_prefix = cfg.get_int("PdcPrefix");
if (pconana_prefix >= pconana_levels)
pconana_prefix = pconana_levels-1;
disable(F_PIANO);
set(F_PIANO, use_pdcc ? "C" : "A");
//***Parte relativa al prefisso del conto analitico, per ora disabilitata perche' non richiesta
// Controllo se voglio (e posso) usare il conto analitico come prefisso di quello contabile
/* const int pref = cfg.get_int("PdcPrefix");
if (use_pdcc && pref > 0)
{
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
const int levels = info.levels();
if (levels >= 2 && pref < levels && esistono_riclassificazioni())
{
enable(F_PIANO);
ca_create_fields(*this, 0, LF_PCONANA, 2, 2, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO);
// Nascondi i campi che non fanno parte del prefisso
for (int i = 0; i < levels; i++)
{
if (i < pref)
{
field(F_PRE1 + i).check_type(CHECK_REQUIRED);
field(F_PRE1 + i).set_group(6);
field(F_PREDES1 + i).set_group(6);
}
else
{
field(F_PRE1 + i).hide();
field(F_PREDES1 + i).hide();
}
}
}
}*/
// creazione dei campi della pagina della maschera con lo sheet dei conti
if (use_pdcc) //usa conti contabili
config_loader(sfield(F_PDCC), "Pdcc");
else //usa conti analitici
{
short dlg = S_CDC2 + 100; // id del primo campo da generare (maschera di riga dello sheet)
int y = 2;
const int nfields = create_sheet_fields(F_PDCA, LF_PCONANA, y, dlg);
sfield(F_PDCA).sheet_mask().hide(-1);
config_loader(sfield(F_PDCA), "Pdca");
}
set_handlers();
}
bool TPag_per_cms_configmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case DLG_SAVEREC:
if (e == fe_button)
{
config_setter(sfield(F_PDCC), "Pdcc");
config_setter(sfield(F_PDCA), "Pdca");
}
break;
default:
break;
}
return true;
}
void TPag_per_cms_configmask::config_loader(TSheet_field& sf, const char* paragrafo)
{
TFilename configname = "ca3600.ini"; //carica file configurazione conti
configname.custom_path();
TConfig configfile(configname, paragrafo);
TString_array conti;
int n = configfile.list_variables(conti, false, paragrafo, true);
FOR_EACH_ARRAY_ROW(conti, i, row)
{
sf.row(-1) = configfile.get(*row); //carica la riga del .ini senza il contatore
sf.check_row(i);
}
}
void TPag_per_cms_configmask::config_setter(TSheet_field& sf, const char* paragrafo)
{
TFilename configname = "ca3600.ini"; //carica file configurazione conti
configname.custom_path();
TConfig configfile(configname, paragrafo);
configfile.remove_all(); //svuota il paragrafo sul .ini prima di ricompilarlo (se non si facesse
//non si riuscirebbero ad ammazzare le righe sul .ini
FOR_EACH_SHEET_ROW (sf, i, row)
{
TToken_string conto("");
conto.add(row->get(0));
conto.add(row->get(1));
conto.add(row->get(2));
conto.add(row->get(3)); //*****nel caso di pdca deve tener conto dei livelli variabili
configfile.set("conto", conto, NULL, true, i);
}
}
//===============================================================================================
////////////////////////////////////////////////////////
// MASCHERA PRINCIPALE
// MASCHERA
////////////////////////////////////////////////////////
class TPag_per_cms_mask: public TAnal_report_mask
@ -172,6 +37,10 @@ protected:
const TString& get_report_class() const;
bool test_compatible_report();
//pagina di configurazione
void config_loader(TSheet_field& sf, const char* paragrafo);
void config_setter(TSheet_field& sf, const char* paragrafo);
public:
TPag_per_cms_mask();
virtual ~TPag_per_cms_mask() {}
@ -214,13 +83,6 @@ bool TPag_per_cms_mask::on_field_event(TOperable_field& o, TField_event e, long
{
switch (o.dlg())
{
case DLG_CONFIG:
if (e == fe_button)
{
TPag_per_cms_configmask configmask; //lancia la maschera di configurazione
configmask.run();
}
break;
case F_REPORT:
if (e == fe_button)
{
@ -239,6 +101,13 @@ bool TPag_per_cms_mask::on_field_event(TOperable_field& o, TField_event e, long
return error_box(TR("Impossibile trovare un report compatibile"));
}
break;
case DLG_SAVEREC:
if (e == fe_button)
{
config_setter(sfield(F_PDCC), "Pdcc");
config_setter(sfield(F_PDCA), "Pdca");
}
break;
default:
break;
}
@ -248,14 +117,76 @@ bool TPag_per_cms_mask::on_field_event(TOperable_field& o, TField_event e, long
TPag_per_cms_mask::TPag_per_cms_mask()
:TAnal_report_mask("ca3600")
{
//Prima pagina
// creazione dei campi della pagina della maschera con lo sheet di cdc/cms/fasi
create_sheet(F_RIGHE);
//Seconda pagina (sheets dei conti)
//Controllo sul tipo di piano dei conti da utilizzare (Analitico/Contabile)
TConfig& cfg = ca_config();
const bool use_pdcc = cfg.get_bool("UsePdcc");
set(F_PIANO, use_pdcc ? "Contabile" : "Analitico");
// creazione dei campi della pagina della maschera con lo sheet dei conti
if (use_pdcc) //usa conti contabili
{
hide(-6); //nasconde i campi analitici e mostra quelli contabili
show(-5);
config_loader(sfield(F_PDCC), "Pdcc");
}
else //usa conti analitici
{
hide(-5);
show(-6);
short dlg = S_CDC2 + 100; // id del primo campo da generare (maschera di riga dello sheet)
int y = 2;
const int nfields = create_sheet_fields(F_PDCA, LF_PCONANA, y, dlg);
sfield(F_PDCA).sheet_mask().hide(-1);
config_loader(sfield(F_PDCA), "Pdca");
}
// setta gli handlers a tutti i campi generati della maschera;senza questa chiamata la on_field_event
// non puo' funzionare sui campi generati!!!
set_handlers();
}
void TPag_per_cms_mask::config_loader(TSheet_field& sf, const char* paragrafo)
{
TFilename configname = "ca3600.ini"; //carica file configurazione conti
configname.custom_path();
TConfig configfile(configname, paragrafo);
TString_array conti;
int n = configfile.list_variables(conti, false, paragrafo, true);
FOR_EACH_ARRAY_ROW(conti, i, row)
{
sf.row(-1) = configfile.get(*row); //carica la riga del .ini senza il contatore
sf.check_row(i);
}
}
void TPag_per_cms_mask::config_setter(TSheet_field& sf, const char* paragrafo)
{
TFilename configname = "ca3600.ini"; //carica file configurazione conti
configname.custom_path();
TConfig configfile(configname, paragrafo);
configfile.remove_all(); //svuota il paragrafo sul .ini prima di ricompilarlo (se non si facesse
//non si riuscirebbero ad ammazzare le righe sul .ini
FOR_EACH_SHEET_ROW (sf, i, row)
{
TToken_string conto("");
conto.add(row->get(0));
conto.add(row->get(1));
conto.add(row->get(2));
conto.add(row->get(3)); //*****nel caso di pdca deve tener conto dei livelli variabili
configfile.set("conto", conto, NULL, true, i);
}
}
///////////////////////////////////////////////////////////////
// RECORDSET

View File

@ -12,7 +12,15 @@
#define F_ORDINAMENTO 207
#define F_REPORT 208
//sheet e righe relative
//sheet commesse e righe relative
#define F_RIGHE 260
//sheets conti e righe relative
#define F_PDCC 301
#define F_PDCA 302
#define F_PIANO 319
#define S_TIPO 101
#define S_DESCRIZIONE 105
#endif // __CA3600_H

View File

@ -11,19 +11,13 @@ END
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -13 -1 "~Stampa"
PROMPT -12 -1 "~Stampa"
MESSAGE EXIT,K_ENTER
END
BUTTON DLG_CONFIG 10 2
BEGIN
PROMPT -23 -1 "~Configura"
PICTURE BMP_CONFIG
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -33 -1 ""
PROMPT -22 -1 ""
END
ENDPAGE
@ -147,8 +141,65 @@ END
ENDPAGE
//-------------- pagina con configurazione conti ---------------------
PAGE "Configurazione conti" -1 -1 78 20
STRING F_PIANO 9
BEGIN
PROMPT 1 1 "Piano dei conti "
FLAGS "D"
END
TEXT -1
BEGIN
PROMPT 1 5 "@bPiano dei conti contabile"
GROUP 5
END
SPREADSHEET F_PDCC 78 -3
BEGIN
PROMPT 1 3 "Pdcc"
ITEM "Tipo"
ITEM "Gruppo"
ITEM "Conto"
ITEM "Sottoconto"
ITEM "Descrizione@50"
GROUP 5
END
TEXT -1
BEGIN
PROMPT 1 5 "@bPiano dei conti analitico"
GROUP 6
END
SPREADSHEET F_PDCA 78 -3
BEGIN
PROMPT 1 3 "Pdca"
ITEM "Tipo"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cdc5"
GROUP 6
END
BUTTON DLG_SAVEREC 12 2
BEGIN
PROMPT -11 19 ""
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
END
ENDPAGE
ENDMASK
//----------------------------------------------------------------------------------------
// Righe degli sheet
//----------------------------------------------------------------------------------------
PAGE "Riga Analitica" -1 -1 78 19
STRING S_CDC1 20
@ -265,3 +316,158 @@ END
ENDPAGE
ENDMASK
//----------------------Piano dei conti contabile------------------------------//
//-----------Pagina di riga dello sheet PDCC----------------------//
PAGE "Riga Piano dei conti contabile" -1 -1 78 8
LIST S_TIPO 1 18
BEGIN
PROMPT 1 1 "Tipo "
ITEM "C|Costo"
ITEM "P|Pagamento"
ITEM "F|Ritenute fiscali"
ITEM "S|Ritenute sociali"
END
NUMBER S_CDC2 3
BEGIN
PROMPT 1 2 "Gruppo "
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO S_CDC2
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC2 GRUPPO
CHECKTYPE REQUIRED
END
NUMBER S_CDC3 3
BEGIN
PROMPT 1 3 "Conto "
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT S_CDC2
INPUT CONTO S_CDC3
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC2 GRUPPO
OUTPUT S_CDC3 CONTO
CHECKTYPE NORMAL
VALIDATE REQIF_FUNC 1 S_CDC4
END
NUMBER S_CDC4 6
BEGIN
PROMPT 1 4 "Sottoconto "
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT S_CDC3
INPUT SOTTOCONTO S_CDC4
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC4 SOTTOCONTO
OUTPUT S_CDC3 CONTO
OUTPUT S_CDC2 GRUPPO
OUTPUT S_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
STRING S_DESCRIZIONE 50
BEGIN
PROMPT 1 5 "Descrizione "
KEY 2
USE LF_PCON KEY 2
INPUT DESCR S_DESCRIZIONE
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT S_CDC4
CHECKTYPE REQUIRED
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK
//----------------------Piano dei conti analitico------------------------------//
//-----------Pagina di riga dello sheet PDCA----------------------//
PAGE "Riga Piano dei conti analitico" -1 -1 78 8
LIST S_TIPO 1 18
BEGIN
PROMPT 1 1 "Tipo "
ITEM "C|Costo"
ITEM "P|Pagamento"
ITEM "F|Ritenute fiscali"
ITEM "S|Ritenute sociali"
END
STRING S_CDC2 20
BEGIN
PROMPT 1 2 "Cdc2"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 20
BEGIN
PROMPT 1 3 "Cdc3"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 20
BEGIN
PROMPT 1 4 "Cdc4"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC5 20
BEGIN
PROMPT 1 5 "Cdc5"
FLAGS "BG"
CHECKTYPE NORMAL
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -1,40 +0,0 @@
// campi per la maschera ca3601
#define F_PDCC 301
#define F_PDCA 302
#define S_TIPO 101
#define S_DESCRIZIONE 105
//campi generati dai piani dei conti
#define F_PIANO 319
#define F_PRE0 320
#define F_PRE1 321
#define F_PRE2 322
#define F_PRE3 323
#define F_PREDES1 325
#define F_PREDES2 326
#define F_PREDES3 327
#define F_PDC0_INI 330
#define F_PDC1_INI 331
#define F_PDC4_INI 334
#define F_PDCDES1_INI 335
#define F_PDCDES4_INI 338
#define F_PDC0_FIN 340
#define F_PDC1_FIN 341
#define F_PDC4_FIN 344
#define F_PDCDES1_FIN 345
#define F_PDCDES4_FIN 348
#define F_PAN0_INI 350
#define F_PAN1_INI 351
#define F_PAN4_INI 354
#define F_PANDES1_INI 355
#define F_PANDES4_INI 358
#define F_PAN0_FIN 360
#define F_PAN1_FIN 361
#define F_PAN4_FIN 364
#define F_PANDES1_FIN 365
#define F_PANDES4_FIN 368

View File

@ -1,229 +0,0 @@
#include "ca3601.h"
#include "camask.h"
TOOLBAR "" 0 -2 0 2
BUTTON DLG_SAVEREC 10 2
BEGIN
PROMPT -12 -1 ""
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Configurazione conti" -1 -1 78 20
LIST F_PIANO 1 12
BEGIN
PROMPT 1 1 "Piano dei conti "
ITEM "A|Analitico"
MESSAGE HIDE,5@|SHOW,6@
ITEM "C|Contabile"
MESSAGE HIDE,6@|SHOW,5@
FLAGS "G"
END
/*GROUPBOX F_PRE0 76 4
BEGIN
PROMPT 1 1 "@bPrefisso del piano dei conti analitico:"
GROUP 6
END*/
TEXT -1
BEGIN
PROMPT 1 5 "@bPiano dei conti contabile"
GROUP 5
END
SPREADSHEET F_PDCC 78 -1
BEGIN
PROMPT 1 3 "Pdcc"
ITEM "Tipo"
ITEM "Gruppo"
ITEM "Conto"
ITEM "Sottoconto"
ITEM "Descrizione@50"
GROUP 5
END
TEXT -1
BEGIN
PROMPT 1 5 "@bPiano dei conti analitico"
GROUP 6
END
SPREADSHEET F_PDCA 78 -1
BEGIN
PROMPT 1 3 "Pdca"
ITEM "Tipo"
ITEM "Cdc2"
ITEM "Cdc3"
ITEM "Cdc4"
ITEM "Cdc5"
GROUP 6
END
ENDPAGE
ENDMASK
//----------------------Piano dei conti contabile------------------------------//
//-----------Pagina di riga dello sheet PDCC----------------------//
PAGE "Riga Piano dei conti contabile" -1 -1 78 8
LIST S_TIPO 1 18
BEGIN
PROMPT 1 1 "Tipo "
ITEM "C|Costo"
ITEM "P|Pagamento"
ITEM "F|Ritenute fiscali"
ITEM "S|Ritenute sociali"
END
NUMBER S_CDC2 3
BEGIN
PROMPT 1 2 "Gruppo "
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO S_CDC2
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC2 GRUPPO
CHECKTYPE REQUIRED
END
NUMBER S_CDC3 3
BEGIN
PROMPT 1 3 "Conto "
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT S_CDC2
INPUT CONTO S_CDC3
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC2 GRUPPO
OUTPUT S_CDC3 CONTO
CHECKTYPE NORMAL
VALIDATE REQIF_FUNC 1 S_CDC4
END
NUMBER S_CDC4 6
BEGIN
PROMPT 1 4 "Sottoconto "
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT S_CDC3
INPUT SOTTOCONTO S_CDC4
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_CDC4 SOTTOCONTO
OUTPUT S_CDC3 CONTO
OUTPUT S_CDC2 GRUPPO
OUTPUT S_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
STRING S_DESCRIZIONE 50
BEGIN
PROMPT 1 5 "Descrizione "
KEY 2
USE LF_PCON KEY 2
INPUT DESCR S_DESCRIZIONE
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT S_CDC4
CHECKTYPE REQUIRED
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK
//----------------------Piano dei conti analitico------------------------------//
//-----------Pagina di riga dello sheet PDCA----------------------//
PAGE "Riga Piano dei conti analitico" -1 -1 78 8
LIST S_TIPO 1 18
BEGIN
PROMPT 1 1 "Tipo "
ITEM "C|Costo"
ITEM "P|Pagamento"
ITEM "F|Ritenute fiscali"
ITEM "S|Ritenute sociali"
END
STRING S_CDC2 20
BEGIN
PROMPT 1 2 "Cdc2"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC3 20
BEGIN
PROMPT 1 3 "Cdc3"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC4 20
BEGIN
PROMPT 1 4 "Cdc4"
FLAGS "B"
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CDC5 20
BEGIN
PROMPT 1 5 "Cdc5"
FLAGS "BG"
CHECKTYPE NORMAL
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK