Patch level : 10.0 852

Files correlati     : ci2.exe
Ricompilazione Demo : [ ]
Commento            :

Rlevazione ore


git-svn-id: svn://10.65.10.50/branches/R_10_00@21237 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-12-05 10:28:20 +00:00
parent d42a8b3e12
commit 71ba6a6498
3 changed files with 72 additions and 33 deletions

View File

@ -30,7 +30,6 @@ class TRilevamento_cons_msk : public TAutomask
short _scms_sid, _scms_lid;
short _sfase_sid, _sfase_lid;
TDate _datasel;
TString _dett;
int _anno;
int _mese;
int _giorno;
@ -264,9 +263,11 @@ void TRilevamento_cons_msk::carica_default()
void TRilevamento_cons_msk::riempi_calendario(const TString & query)
{
TSheet_field& calendario = sfield(F_CALENDARIO);
const TString4 dett = get(F_INTERVALLO);
update_day();
if (_dett == "A")
calendario.destroy(-1, false);
if (dett == "A")
{
TBit_array full_years;
TISAM_recordset recset(query);
@ -280,16 +281,20 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
for (int i = 0; i < _n_ex; i++)
{
TToken_string & row = calendario.row(i);
COLOR back = NORMAL_BACK_COLOR;
COLOR fore = NORMAL_COLOR;
if (full_years[_es_array[i]])
{
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i, 0); // coloro di blu le date con registrazioni
back = COLOR_DKBLUE; // coloro di blu le date con registrazioni
fore = COLOR_WHITE; // coloro di blu le date con registrazioni
}
calendario.set_back_and_fore_color(back, fore, i - 1, 0);
row.add(_es_array[i]);
}
}
else
if (_dett == "M")
if (dett == "M")
{
TBit_array full_months;
TISAM_recordset recset(query);
@ -304,16 +309,20 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
for (int i = 1; i <= 12; i++)
{
TToken_string & row = calendario.row(i - 1);
COLOR back = NORMAL_BACK_COLOR;
COLOR fore = NORMAL_COLOR;
if (full_months[i])
{
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i - 1, 0); // coloro di blu le date con registrazioni
back = COLOR_DKBLUE; // coloro di blu le date con registrazioni
fore = COLOR_WHITE; // coloro di blu le date con registrazioni
}
calendario.set_back_and_fore_color(back, fore, i - 1, 0);
row.add(itom(i));
}
}
else
if (_dett == "G")
if (dett == "G")
{
TDate d(1, _mese, _anno); d.set_end_month();
const int end_month = d.day();
@ -600,22 +609,23 @@ void TRilevamento_cons_msk::registra()
void TRilevamento_cons_msk::update_day()
{
const int row = sfield(F_CALENDARIO).selected();
const TString4 dett = get(F_INTERVALLO);
if (_dett == "G")
if (dett == "G")
{
_anno = get_int(F_ANNO);
_mese = get_int(F_MESE);
_giorno = row +1;
}
else
if (_dett == "M")
if (dett == "M")
{
_anno = get_int(F_ANNO);
_mese = row + 1;
_giorno = 1;
}
else
if (_dett == "A")
if (dett == "A")
{
_anno = _es_array[row];
_mese = 1;
@ -654,6 +664,28 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
if (e == se_enter)
riempi_risoatt();
break;
case F_INTERVALLO:
if (e == fe_modify)
{
const TString4 dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS");
if (dett == "A")
{
reset(F_ANNO);
disable(F_ANNO);
reset(F_MESE);
disable(F_MESE);
}
else
{
if (dett == "M")
{
reset(F_MESE);
disable(F_MESE);
}
}
riempi_sheet();
}
break;
case S_RISOATT:
case S_CODRIS:
case S_CODATT:
@ -679,7 +711,7 @@ TRilevamento_cons_msk::TRilevamento_cons_msk()
TConfig& ini = ca_config();
TSheet_field & s = sfield(F_SHEET);
TMask & sm = s.sheet_mask();
int y = 3;
int y = 4;
int sy = 8;
short dlg = F_ANAL; // id del primo campo da generare
short sdlg = S_CDC1 + 100; // id del primo campo da generare
@ -799,28 +831,25 @@ TRilevamento_cons_msk::TRilevamento_cons_msk()
s.delete_column(id);
}
_qtaore = 0;
_dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS");
const TString4 dett = ini_get_string(CONFIG_DITTA, "ci", "DETTCONS");
TSheet_field & sc = sfield(F_CALENDARIO);
_n_ex = 0;
for (int codes = _es.first(); codes != 0; codes = _es.next(codes))
_es_array[_n_ex++] = codes;
if (_dett == "A")
{
reset(F_ANNO);
disable(F_ANNO);
reset(F_MESE);
disable(F_MESE);
}
if (dett == "A")
disable(F_INTERVALLO);
else
{
if (_dett == "M")
if (dett == "M")
{
reset(F_MESE);
disable(F_MESE);
TList_field & f = lfield(F_INTERVALLO);
f.delete_item("G");
}
set(F_ANNO, TDate(TODAY).year());
}
set(F_INTERVALLO, dett);
}
////////////////////////////////////////////

View File

@ -14,6 +14,7 @@
#define F_CALENDARIO 313
#define F_ANAL 314
#define F_SHEET 330
#define F_INTERVALLO 331
#define DLG_RESET 900
#define DLG_CERCA 901

View File

@ -32,26 +32,35 @@ ENDPAGE
PAGE "Rilevazione consuntivi" 0 2 0 0
GROUPBOX DLG_NULL 78 7
GROUPBOX DLG_NULL 78 78
BEGIN
PROMPT 1 0 "@bSelezione"
END
LISTBOX F_INTERVALLO 1 6
BEGIN
PROMPT 2 1 "@bIntervallo "
ITEM "A|Anno"
ITEM "M|Mese"
ITEM "G|Giorno"
FLAGS "Z"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 1 "Anno "
PROMPT 2 2 "Anno "
CHECKTYPE REQUIRED
END
LISTBOX F_MESE 10
BEGIN
PROMPT 24 1 "Mese "
PROMPT 24 2 "Mese "
FLAGS "M"
END
STRING F_TPORA 2
BEGIN
PROMPT 44 1 "Tipo ora "
PROMPT 44 2 "Tipo ora "
USE &ORE
INPUT CODTAB F_TPORA
DISPLAY "Codice@16" CODTAB
@ -61,7 +70,7 @@ END
LISTBOX F_RISOATT 1 12
BEGIN
PROMPT 2 2 "@bTipo "
PROMPT 2 3 "@bTipo "
ITEM "T|Tutti"
MESSAGE SHOW,1@|HIDE,2@|HIDE,3@
ITEM "R|Risorsa"
@ -73,7 +82,7 @@ END
STRING F_CODRIS 16
BEGIN
PROMPT 23 2 "Codice "
PROMPT 23 3 "Codice "
USE RSS
INPUT CODTAB F_CODRIS
DISPLAY "Codice@16" CODTAB
@ -86,14 +95,14 @@ END
STRING F_DESRIS 50 27
BEGIN
PROMPT 50 2 ""
PROMPT 50 3 ""
FLAGS "D"
GROUP 2
END
STRING F_CODATT 16
BEGIN
PROMPT 23 2 "Codice "
PROMPT 23 3 "Codice "
USE ATR
INPUT CODTAB F_CODATT
DISPLAY "Codice@16" CODTAB
@ -106,20 +115,20 @@ END
STRING F_DESATT 50 27
BEGIN
PROMPT 50 27 ""
PROMPT 50 3 ""
FLAGS "D"
GROUP 3
END
SPREADSHEET F_CALENDARIO 10 0
BEGIN
PROMPT 1 7 ""
PROMPT 1 8 ""
ITEM "@4"
END
SPREADSHEET F_SHEET 65 0
BEGIN
PROMPT 15 7 ""
PROMPT 15 8 ""
ITEM "Tipo"
ITEM "Codice@16"
ITEM "Tipo\nOra@5"