Patch level : 10.0 902
Files correlati : ci0.exe ci2.exe Ricompilazione Demo : [ ] Commento : Aggiunta matricola e Qualifica alla tabella risorse git-svn-id: svn://10.65.10.50/branches/R_10_00@21550 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
33aeede24e
commit
74d842b112
190
ci/ci2200.cpp
190
ci/ci2200.cpp
@ -43,6 +43,8 @@ class TRilevamento_cons_msk : public TAutomask
|
|||||||
TString _numcn;
|
TString _numcn;
|
||||||
TString _tipocn;
|
TString _tipocn;
|
||||||
TToken_string _last_key;
|
TToken_string _last_key;
|
||||||
|
TAssoc_array _oredisp;
|
||||||
|
TAssoc_array _oreprev;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const real proponi_costo(TToken_string& riga);
|
const real proponi_costo(TToken_string& riga);
|
||||||
@ -52,6 +54,7 @@ protected:
|
|||||||
void carica_default();
|
void carica_default();
|
||||||
void update_day();
|
void update_day();
|
||||||
void update_disp();
|
void update_disp();
|
||||||
|
void update_prev();
|
||||||
void riempi_sheet();
|
void riempi_sheet();
|
||||||
void riempi_calendario(const TString & query);
|
void riempi_calendario(const TString & query);
|
||||||
void update_column(short sid, const bool full, int len = -1);
|
void update_column(short sid, const bool full, int len = -1);
|
||||||
@ -368,6 +371,7 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
|
|||||||
}
|
}
|
||||||
calendario.force_update();
|
calendario.force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRilevamento_cons_msk::update_column(short sid, bool full, int len)
|
void TRilevamento_cons_msk::update_column(short sid, bool full, int len)
|
||||||
{
|
{
|
||||||
TSheet_field& sf = sfield(F_SHEET);
|
TSheet_field& sf = sfield(F_SHEET);
|
||||||
@ -516,14 +520,16 @@ void TRilevamento_cons_msk::riempi_risoatt(char tipo)
|
|||||||
riga.add(tipo == 'D' ? 0 : rilore.get(RILORE_ID), sheet.cid2index(S_ID));
|
riga.add(tipo == 'D' ? 0 : rilore.get(RILORE_ID), sheet.cid2index(S_ID));
|
||||||
|
|
||||||
sheet.check_row(sheet.items() - 1);
|
sheet.check_row(sheet.items() - 1);
|
||||||
|
sheet.select(sheet.items() - 1);
|
||||||
|
update_prev();
|
||||||
}
|
}
|
||||||
sheet.force_update();
|
sheet.force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
//RIEMPI_SHEET: metodo che riempie lo sheet in base ai campi chiave
|
|
||||||
//compilati sulla maschera
|
|
||||||
void TRilevamento_cons_msk::update_disp()
|
void TRilevamento_cons_msk::update_disp()
|
||||||
{
|
{
|
||||||
|
TSheet_field & sf = sfield(F_SHEET);
|
||||||
|
|
||||||
//leggo dalla maschera i campi chiave di ricerca
|
//leggo dalla maschera i campi chiave di ricerca
|
||||||
TString4 risoatt = get(F_RISOATT) == "T" ? "" : get(F_RISOATT);
|
TString4 risoatt = get(F_RISOATT) == "T" ? "" : get(F_RISOATT);
|
||||||
TString4 tpora = get(F_TPORA);
|
TString4 tpora = get(F_TPORA);
|
||||||
@ -536,7 +542,6 @@ void TRilevamento_cons_msk::update_disp()
|
|||||||
codice = get(F_CODATT);
|
codice = get(F_CODATT);
|
||||||
|
|
||||||
const bool head_resource = codice.full();
|
const bool head_resource = codice.full();
|
||||||
TSheet_field & sf = sfield(F_SHEET);
|
|
||||||
|
|
||||||
if (!head_resource && sf.items() > 0)
|
if (!head_resource && sf.items() > 0)
|
||||||
{
|
{
|
||||||
@ -545,6 +550,7 @@ void TRilevamento_cons_msk::update_disp()
|
|||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
{
|
{
|
||||||
TToken_string & row = sf.row(r);
|
TToken_string & row = sf.row(r);
|
||||||
|
|
||||||
risoatt = row.get(sf.cid2index(S_RISOATT));
|
risoatt = row.get(sf.cid2index(S_RISOATT));
|
||||||
tpora = row.get(sf.cid2index(S_TPORA));
|
tpora = row.get(sf.cid2index(S_TPORA));
|
||||||
if (risoatt == "R")
|
if (risoatt == "R")
|
||||||
@ -555,55 +561,152 @@ void TRilevamento_cons_msk::update_disp()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken_string key(risoatt);
|
|
||||||
|
|
||||||
key.add(codice);
|
|
||||||
key.add(tpora);
|
|
||||||
key.add(_giorno);
|
|
||||||
key.add(_mese);
|
|
||||||
key.add(_anno);
|
|
||||||
if (key == _last_key)
|
|
||||||
return;
|
|
||||||
_last_key = key;
|
|
||||||
int oredisp = 0;
|
|
||||||
if (codice.full())
|
if (codice.full())
|
||||||
{
|
{
|
||||||
TString query;
|
TString chiave(risoatt);
|
||||||
query << "USE " << LF_RILORE << " KEY 2\n"
|
TDate day(_giorno, _mese, _anno);
|
||||||
<< "SELECT (" << RILORE_TIPORA << "==\"" << risoatt
|
|
||||||
<< "\")&&(" << RILORE_CODICE << "==\"" << codice
|
chiave << codice.lpad(field(F_CODRIS).size()) << day.string(ANSI) << tpora;
|
||||||
<< "\")&&(" << RILORE_TPORA << "==\"" << tpora << "\")\n"
|
real * val = (real *)_oredisp.objptr(chiave);
|
||||||
<< "FROM " << RILORE_TIPO "=\"D\""
|
|
||||||
<< " " << RILORE_ANNO << "=" << _anno << " "
|
if (val != NULL)
|
||||||
<< RILORE_MESE << "=" << _mese << " "
|
set(F_OREDIS, *val);
|
||||||
<< RILORE_GIORNO << "=" << _giorno << "\n";
|
else
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
|
||||||
|
query << "USE &DRA SELECT MID(CODTAB,30,2)==\"" << tpora << "\"\n"
|
||||||
|
<< "FROM CODTAB=\"" << chiave << "\"\n" ;
|
||||||
|
TString tochiave = chiave.left(21);
|
||||||
|
|
||||||
TDate to_day(_giorno, _mese, _anno);
|
|
||||||
const TString4 intervallo = get(F_INTERVALLO);
|
const TString4 intervallo = get(F_INTERVALLO);
|
||||||
|
|
||||||
if (intervallo == "M")
|
if (intervallo == "M")
|
||||||
{
|
{
|
||||||
to_day.addmonth();
|
day.addmonth();
|
||||||
--to_day;
|
--day;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (intervallo == "A")
|
if (intervallo == "A")
|
||||||
{
|
{
|
||||||
to_day.addyear();
|
day.addyear();
|
||||||
--to_day;
|
--day;
|
||||||
}
|
}
|
||||||
|
|
||||||
query << "TO " << RILORE_TIPO "=\"D\""
|
tochiave << day.string(ANSI) << tpora;
|
||||||
<< " " << RILORE_ANNO << "=" << to_day.year() << " "
|
|
||||||
<< RILORE_MESE << "=" << to_day.month() << " "
|
query << "TO CODTAB=\"" << tochiave << "\"\n";
|
||||||
<< RILORE_GIORNO << "=" << to_day.day();
|
|
||||||
|
|
||||||
TISAM_recordset def(query);
|
TISAM_recordset def(query);
|
||||||
|
real oredisp;
|
||||||
|
|
||||||
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
||||||
oredisp += def.cursor()->curr().get_int(RILORE_QTAORE);
|
oredisp += def.cursor()->curr().get_real(RILORE_QTAORE);
|
||||||
}
|
|
||||||
set(F_OREDIS, oredisp);
|
set(F_OREDIS, oredisp);
|
||||||
|
_oredisp.add(chiave, oredisp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRilevamento_cons_msk::update_prev()
|
||||||
|
{
|
||||||
|
TSheet_field & sf = sfield(F_SHEET);
|
||||||
|
|
||||||
|
if ( sf.items() > 0)
|
||||||
|
{
|
||||||
|
const int r = sf.selected();
|
||||||
|
|
||||||
|
if (r < 0)
|
||||||
|
return;
|
||||||
|
TToken_string & row = sf.row(r);
|
||||||
|
//leggo dalla maschera i campi chiave di ricerca
|
||||||
|
TString4 risoatt = row.get(sf.cid2index(S_RISOATT));
|
||||||
|
TString16 codice;
|
||||||
|
|
||||||
|
if (risoatt == "T")
|
||||||
|
risoatt = "";
|
||||||
|
else
|
||||||
|
if (risoatt == "R")
|
||||||
|
codice = row.get(sf.cid2index(S_CODRIS));
|
||||||
|
else
|
||||||
|
if (risoatt == "A")
|
||||||
|
codice = row.get(sf.cid2index(S_CODATT));
|
||||||
|
|
||||||
|
if (codice.full())
|
||||||
|
{
|
||||||
|
TString4 tpora = row.get(sf.cid2index(S_TPORA));
|
||||||
|
TString codcosto;
|
||||||
|
TString codcms;
|
||||||
|
TString codfase;
|
||||||
|
TToken_string chiave;
|
||||||
|
|
||||||
|
get_anal_fields(codcosto, codcms, codfase);
|
||||||
|
chiave.add(_anno);
|
||||||
|
chiave.add(_mese);
|
||||||
|
chiave.add(_giorno);
|
||||||
|
chiave.add(risoatt);
|
||||||
|
chiave.add(codice);
|
||||||
|
chiave.add(tpora);
|
||||||
|
chiave.add(codcosto);
|
||||||
|
chiave.add(codcms);
|
||||||
|
chiave.add(codfase);
|
||||||
|
real * val = (real *)_oreprev.objptr(chiave);
|
||||||
|
|
||||||
|
if (val != NULL)
|
||||||
|
row.add(val->string(), sf.cid2index(S_OREPREV));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
query << "USE " << LF_RILORE << " KEY 5\n"
|
||||||
|
<< "FROM " << RILORE_TIPO "=\"P\""
|
||||||
|
<< " " << RILORE_ANNO << "=" << _anno << " "
|
||||||
|
<< RILORE_MESE << "=" << _mese << " "
|
||||||
|
<< RILORE_GIORNO << "=" << _giorno << " "
|
||||||
|
<< RILORE_TIPORA << "=" << risoatt << " "
|
||||||
|
<< RILORE_CODICE << "=" << codice << " "
|
||||||
|
<< RILORE_TPORA << "=" << tpora << " "
|
||||||
|
<< RILORE_CODCOSTO << "=" << codcosto << " "
|
||||||
|
<< RILORE_CODCMS << "=" << codcms << " "
|
||||||
|
<< RILORE_CODFASE << "=" << codfase << "\n";
|
||||||
|
|
||||||
|
TDate day(_giorno, _mese, _anno);
|
||||||
|
const TString4 intervallo = get(F_INTERVALLO);
|
||||||
|
|
||||||
|
if (intervallo == "M")
|
||||||
|
{
|
||||||
|
day.addmonth();
|
||||||
|
--day;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (intervallo == "A")
|
||||||
|
{
|
||||||
|
day.addyear();
|
||||||
|
--day;
|
||||||
|
}
|
||||||
|
|
||||||
|
query << "TO " << RILORE_TIPO "=\"P\""
|
||||||
|
<< " " << RILORE_ANNO << "=" << day.year() << " "
|
||||||
|
<< RILORE_MESE << "=" << day.month() << " "
|
||||||
|
<< RILORE_GIORNO << "=" << day.day() << " "
|
||||||
|
<< RILORE_GIORNO << "=" << _giorno << " "
|
||||||
|
<< RILORE_TIPORA << "=" << risoatt << " "
|
||||||
|
<< RILORE_CODICE << "=" << codice << " "
|
||||||
|
<< RILORE_TPORA << "=" << tpora << " "
|
||||||
|
<< RILORE_CODCOSTO << "=" << codcosto << " "
|
||||||
|
<< RILORE_CODCMS << "=" << codcms << " "
|
||||||
|
<< RILORE_CODFASE << "=" << codfase << "\n";
|
||||||
|
|
||||||
|
TISAM_recordset def(query);
|
||||||
|
real oreprev;
|
||||||
|
|
||||||
|
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
||||||
|
oreprev += def.cursor()->curr().get_int(RILORE_QTAORE);
|
||||||
|
row.add(oreprev.string(), sf.cid2index(S_OREPREV));
|
||||||
|
sf.force_update(r);
|
||||||
|
_oreprev.add(chiave, oreprev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//RIEMPI_SHEET: metodo che riempie lo sheet in base ai campi chiave
|
//RIEMPI_SHEET: metodo che riempie lo sheet in base ai campi chiave
|
||||||
@ -696,22 +799,6 @@ void TRilevamento_cons_msk::nuova_riga()
|
|||||||
TString codcms;
|
TString codcms;
|
||||||
TString codfase;
|
TString codfase;
|
||||||
|
|
||||||
/* msk.enable(S_RISOATT, tutti);
|
|
||||||
if (tutti || tipo == "R")
|
|
||||||
msk.enable(S_CODRIS);
|
|
||||||
if (tutti || tipo == "A")
|
|
||||||
msk.enable(S_CODATT);
|
|
||||||
msk.enable(S_TPORA, tpora.empty());
|
|
||||||
if (_scdc_sid >= 0)
|
|
||||||
for ( short id = _scdc_sid; id <= _scdc_lid; id++)
|
|
||||||
msk.enable(id, codcosto.blank());
|
|
||||||
if (_scms_sid >= 0)
|
|
||||||
for ( short id = _scms_sid; id <= _scms_lid; id++)
|
|
||||||
msk.enable(id, codcms.blank());
|
|
||||||
if (_sfase_sid >= 0)
|
|
||||||
for ( short id = _sfase_sid; id <= _sfase_lid; id++)
|
|
||||||
msk.enable(id, codfase.blank()); */
|
|
||||||
|
|
||||||
riga.add(tipo, sheet.cid2index(S_RISOATT));
|
riga.add(tipo, sheet.cid2index(S_RISOATT));
|
||||||
if (!tutti)
|
if (!tutti)
|
||||||
{
|
{
|
||||||
@ -989,7 +1076,10 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
|
|||||||
nuova_riga();
|
nuova_riga();
|
||||||
else
|
else
|
||||||
if (e == se_enter)
|
if (e == se_enter)
|
||||||
|
{
|
||||||
|
update_prev();
|
||||||
update_disp();
|
update_disp();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case F_INTERVALLO:
|
case F_INTERVALLO:
|
||||||
if (e == fe_modify)
|
if (e == fe_modify)
|
||||||
|
11
ci/ci2200a.h
11
ci/ci2200a.h
@ -43,11 +43,12 @@
|
|||||||
#define S_QTAORE 117
|
#define S_QTAORE 117
|
||||||
#define S_CODLIST 118
|
#define S_CODLIST 118
|
||||||
#define S_COSTO 119
|
#define S_COSTO 119
|
||||||
#define S_CUP 120
|
#define S_OREPREV 120
|
||||||
#define S_CIG 121
|
#define S_CUP 121
|
||||||
#define S_DESRIS 122
|
#define S_CIG 122
|
||||||
#define S_DESATT 222
|
#define S_DESRIS 123
|
||||||
#define S_ID 123
|
#define S_DESATT 223
|
||||||
|
#define S_ID 124
|
||||||
|
|
||||||
#define S_CMSH 350
|
#define S_CMSH 350
|
||||||
#define S_DCUP 351
|
#define S_DCUP 351
|
||||||
|
@ -154,6 +154,7 @@ BEGIN
|
|||||||
ITEM "Ore@5"
|
ITEM "Ore@5"
|
||||||
ITEM "Listino"
|
ITEM "Listino"
|
||||||
ITEM "Costo@6"
|
ITEM "Costo@6"
|
||||||
|
ITEM "Ore Prev."
|
||||||
ITEM "CUP@15"
|
ITEM "CUP@15"
|
||||||
ITEM "CIG@10"
|
ITEM "CIG@10"
|
||||||
ITEM "Descrizione@50"
|
ITEM "Descrizione@50"
|
||||||
@ -347,6 +348,12 @@ BEGIN
|
|||||||
PROMPT 45 11 "Prezzo "
|
PROMPT 45 11 "Prezzo "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER S_OREPREV 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 60 11 "Ore Prev. "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
STRING S_CMSH 20
|
STRING S_CMSH 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 50 16 ""
|
PROMPT 50 16 ""
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
125
|
125
|
||||||
0
|
0
|
||||||
$rilore|11|16|168|0|Rilevamento Ore|||
|
$rilore|||168|0|Rilevamento Ore|||
|
||||||
|
@ -23,8 +23,9 @@ NDOC|3|7|0|Chiave doc - NDOC
|
|||||||
IDRIGA|3|6|0|Chiave doc -IDRIGA
|
IDRIGA|3|6|0|Chiave doc -IDRIGA
|
||||||
CUP|1|15|0|Codice Unico di Progetto
|
CUP|1|15|0|Codice Unico di Progetto
|
||||||
CIG|1|10|0|Codice Identificativo di Gara
|
CIG|1|10|0|Codice Identificativo di Gara
|
||||||
4
|
5
|
||||||
TIPO+ID|
|
TIPO+ID|
|
||||||
TIPO+ANNO+MESE+GIORNO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+ANNO+MESE+GIORNO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
||||||
TIPO+TIPORA+CODICE+ANNO+MESE+GIORNO+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+TIPORA+CODICE+ANNO+MESE+GIORNO+TPORA+CODCOSTO+CODCMS+CODFASE|X
|
||||||
TIPO+CODCOSTO+CODCMS+CODFASE|X
|
TIPO+CODCOSTO+CODCMS+CODFASE|X
|
||||||
|
TIPO+TIPORA+CODICE+TPORA+CODCOSTO+CODCMS+CODFASE+ANNO+MESE+GIORNO|X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user