Patch level : 10.1024
Files correlati : ci0.exe ci2.exe Ricompilazione Demo : [ ] Commento : Corretta rilevazione ore git-svn-id: svn://10.65.10.50/branches/R_10_00@22268 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e8a448f27d
commit
2c5a56cf7e
@ -186,11 +186,6 @@ void TDef_risoatt_msk::riempi_sheet()
|
|||||||
if (select.full()) select << "&&";
|
if (select.full()) select << "&&";
|
||||||
select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
|
select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
|
||||||
}
|
}
|
||||||
/* if (mese > 0)
|
|
||||||
{
|
|
||||||
if (select.full()) select << "&&";
|
|
||||||
select << "STR(" RILORE_MESE << "==" << mese << ")";
|
|
||||||
} */
|
|
||||||
if (tpora.full())
|
if (tpora.full())
|
||||||
{
|
{
|
||||||
if (select.full()) select << "&&";
|
if (select.full()) select << "&&";
|
||||||
@ -214,17 +209,29 @@ void TDef_risoatt_msk::riempi_sheet()
|
|||||||
if (select.full())
|
if (select.full())
|
||||||
query << "SELECT " << select << "\n";
|
query << "SELECT " << select << "\n";
|
||||||
|
|
||||||
TString fromto = RILORE_TIPO "=\"D\"";
|
TString from = RILORE_TIPO "=\"D\"";
|
||||||
|
TString to = from;
|
||||||
|
TDate da(botime);
|
||||||
|
TDate a(eotime);
|
||||||
|
|
||||||
if (anno > 0)
|
if (anno > 0)
|
||||||
{
|
{
|
||||||
fromto << " " << RILORE_ANNO << "=" << anno << " ";
|
da.set_day(1);
|
||||||
|
da.set_month(1);
|
||||||
|
da.set_year(anno);
|
||||||
|
a.set_year(anno);
|
||||||
if (mese > 0)
|
if (mese > 0)
|
||||||
fromto << " " << RILORE_MESE << "=" << mese << " ";
|
{
|
||||||
|
da.set_month(mese);
|
||||||
|
a.set_month(mese);
|
||||||
}
|
}
|
||||||
|
a.set_end_month();
|
||||||
|
}
|
||||||
|
from << " " << RILORE_DADATA << "=" << da.string() << " ";
|
||||||
|
to << " " << RILORE_DADATA << "=" << a.string() << " ";
|
||||||
|
|
||||||
query << "FROM " << fromto << "\n"
|
query << "FROM " << from << "\n"
|
||||||
<< "TO " << fromto;
|
<< "TO " << to;
|
||||||
|
|
||||||
TISAM_recordset def(query);
|
TISAM_recordset def(query);
|
||||||
|
|
||||||
@ -244,7 +251,7 @@ void TDef_risoatt_msk::riempi_sheet()
|
|||||||
case 'A': riga.add(cod, sheet.cid2index(S_CODATT)); break;
|
case 'A': riga.add(cod, sheet.cid2index(S_CODATT)); break;
|
||||||
default : break;
|
default : break;
|
||||||
}
|
}
|
||||||
TDate d(rilore.get_int(RILORE_GIORNO), rilore.get_int(RILORE_MESE), rilore.get_int(RILORE_ANNO));
|
TDate d(rilore.get_date(RILORE_DADATA));
|
||||||
|
|
||||||
riga.add(d.string(), sheet.cid2index(S_DATA));
|
riga.add(d.string(), sheet.cid2index(S_DATA));
|
||||||
riga.add(rilore.get(RILORE_TPORA), sheet.cid2index(S_TPORA));
|
riga.add(rilore.get(RILORE_TPORA), sheet.cid2index(S_TPORA));
|
||||||
@ -385,9 +392,8 @@ void TDef_risoatt_msk::registra()
|
|||||||
{
|
{
|
||||||
rilroa.put(RILORE_TIPO, "D");
|
rilroa.put(RILORE_TIPO, "D");
|
||||||
rilroa.put(RILORE_ID, id);
|
rilroa.put(RILORE_ID, id);
|
||||||
rilroa.put(RILORE_ANNO, anno);
|
TDate d(giorno, mese, anno);
|
||||||
rilroa.put(RILORE_MESE, mese);
|
rilroa.put(RILORE_DADATA, d);
|
||||||
rilroa.put(RILORE_GIORNO, giorno);
|
|
||||||
rilroa.put(RILORE_TIPORA, tipora);
|
rilroa.put(RILORE_TIPORA, tipora);
|
||||||
rilroa.put(RILORE_CODICE, codice);
|
rilroa.put(RILORE_CODICE, codice);
|
||||||
rilroa.put(RILORE_TPORA, tpora);
|
rilroa.put(RILORE_TPORA, tpora);
|
||||||
|
@ -14,12 +14,6 @@ BEGIN
|
|||||||
PICTURE TOOL_FINDREC
|
PICTURE TOOL_FINDREC
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_NEWREC 2 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 1 1 "Nuovo"
|
|
||||||
PICTURE TOOL_NEWREC
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_SAVEREC 2 2
|
BUTTON DLG_SAVEREC 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Salva"
|
PROMPT 1 1 "Salva"
|
||||||
|
183
ci/ci2200.cpp
183
ci/ci2200.cpp
@ -50,6 +50,7 @@ public:
|
|||||||
virtual TObject* curr_node() const;
|
virtual TObject* curr_node() const;
|
||||||
const int pos() const { return _curr_node;}
|
const int pos() const { return _curr_node;}
|
||||||
const TString &id() const { return *(TString *)curr_node(); }
|
const TString &id() const { return *(TString *)curr_node(); }
|
||||||
|
const TString &id(int pos) const { return _content.row(pos); }
|
||||||
virtual void node2id(const TObject* obj, TString& id) const;
|
virtual void node2id(const TObject* obj, TString& id) const;
|
||||||
|
|
||||||
virtual bool has_root() const;
|
virtual bool has_root() const;
|
||||||
@ -130,12 +131,13 @@ void TRil_tree::highlight(const TString & query, int mese, int anno)
|
|||||||
|
|
||||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
const int es = recset.get(RILORE_ANNO).as_int();
|
const TDate & d = recset.get(RILORE_DADATA).as_date();
|
||||||
|
const int es = esercizi().date2esc(d);
|
||||||
|
|
||||||
full_years.set(es);
|
full_years.set(es);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < _content.items(); i++)
|
for (int i = 0; i < _content.items(); i++)
|
||||||
_t[i] = full_years[atoi(id())] ? _full : _normal;
|
_t[i] = full_years[atoi(id(i))] ? _full : _normal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (_dett == "M")
|
if (_dett == "M")
|
||||||
@ -145,7 +147,8 @@ void TRil_tree::highlight(const TString & query, int mese, int anno)
|
|||||||
|
|
||||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
const int mese = recset.get(RILORE_MESE).as_int();
|
const TDate & d = recset.get(RILORE_DADATA).as_date();
|
||||||
|
const int mese = d.month();
|
||||||
|
|
||||||
full_months.set(mese);
|
full_months.set(mese);
|
||||||
}
|
}
|
||||||
@ -164,7 +167,8 @@ void TRil_tree::highlight(const TString & query, int mese, int anno)
|
|||||||
//tutte le celle che corrispondono a una data interessata da qualcosa
|
//tutte le celle che corrispondono a una data interessata da qualcosa
|
||||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
const int day = recset.get(RILORE_GIORNO).as_int();
|
const TDate & d = recset.get(RILORE_DADATA).as_date();
|
||||||
|
const int day = d.day();
|
||||||
|
|
||||||
full_days.set(day);
|
full_days.set(day);
|
||||||
}
|
}
|
||||||
@ -299,9 +303,9 @@ protected:
|
|||||||
const char * content_query();
|
const char * content_query();
|
||||||
void update_tree();
|
void update_tree();
|
||||||
void update_disp();
|
void update_disp();
|
||||||
void update_prev();
|
void update_prev(int r = -1);
|
||||||
void update_column(short sid, const bool full);
|
void update_column(short sid, const bool full);
|
||||||
void nuova_riga();
|
void riempi_nuova_riga(int r);
|
||||||
void azzera_riga(TSheet_field& sheet);
|
void azzera_riga(TSheet_field& sheet);
|
||||||
void azzera_tutto(TSheet_field& sheet);
|
void azzera_tutto(TSheet_field& sheet);
|
||||||
void registra();
|
void registra();
|
||||||
@ -591,21 +595,36 @@ void TRilevamento_cons_msk::riempi_sheet(char tipo)
|
|||||||
query << "SELECT " << select << "\n";
|
query << "SELECT " << select << "\n";
|
||||||
|
|
||||||
const TString & dett = get(F_INTERVALLO);
|
const TString & dett = get(F_INTERVALLO);
|
||||||
TString fromto = RILORE_TIPO;
|
TString from;
|
||||||
|
from << RILORE_TIPO << "=\"" << tipo << "\"";
|
||||||
|
TString to(from);
|
||||||
|
TDate da(botime);
|
||||||
|
TDate a(eotime);
|
||||||
|
|
||||||
fromto << "=\"" << tipo << "\"";
|
|
||||||
if (_anno > 0)
|
if (_anno > 0)
|
||||||
{
|
{
|
||||||
fromto << " " << RILORE_ANNO << "=" << _anno << " ";
|
da.set_day(1);
|
||||||
|
da.set_month(1);
|
||||||
|
da.set_year(_anno);
|
||||||
|
a.set_year(_anno);
|
||||||
if (dett != "A")
|
if (dett != "A")
|
||||||
{
|
{
|
||||||
fromto << RILORE_MESE << "=" << _mese << " ";
|
da.set_month(_mese);
|
||||||
|
a.set_month(_mese);
|
||||||
if (dett != "M" && tipo == 'C')
|
if (dett != "M" && tipo == 'C')
|
||||||
fromto << RILORE_GIORNO << "=" << _giorno << " ";
|
{
|
||||||
|
da.set_day(_giorno);
|
||||||
|
a.set_day(_giorno);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
a.set_end_month();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query << "FROM " << fromto << "\n"
|
from << " " << RILORE_DADATA << "=" << da.string() << " ";
|
||||||
<< "TO " << fromto;
|
to << " " << RILORE_DADATA << "=" << a.string() << " ";
|
||||||
|
|
||||||
|
query << "FROM " << from << "\n"
|
||||||
|
<< "TO " << to;
|
||||||
|
|
||||||
TISAM_recordset def(query);
|
TISAM_recordset def(query);
|
||||||
|
|
||||||
@ -637,7 +656,12 @@ void TRilevamento_cons_msk::riempi_sheet(char tipo)
|
|||||||
riga.add(rilore.get(RILORE_CIG), sheet.cid2index(S_CIG));
|
riga.add(rilore.get(RILORE_CIG), sheet.cid2index(S_CIG));
|
||||||
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);
|
const int r = sheet.items() - 1;
|
||||||
|
|
||||||
|
sheet.check_row(r);
|
||||||
|
// sheet.update_mask(r);
|
||||||
|
update_prev(r);
|
||||||
|
// sheet.update_row(r);
|
||||||
}
|
}
|
||||||
if (sheet.items() > 0)
|
if (sheet.items() > 0)
|
||||||
{
|
{
|
||||||
@ -770,16 +794,15 @@ void TRilevamento_cons_msk::update_disp()
|
|||||||
set(F_ORECONS, orecons);
|
set(F_ORECONS, orecons);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRilevamento_cons_msk::update_prev()
|
void TRilevamento_cons_msk::update_prev(int r)
|
||||||
{
|
{
|
||||||
TSheet_field & sf = sfield(F_SHEET);
|
TSheet_field & sf = sfield(F_SHEET);
|
||||||
|
|
||||||
if ( sf.items() > 0)
|
|
||||||
{
|
|
||||||
const int r = sf.selected();
|
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return;
|
r = sf.selected();
|
||||||
|
|
||||||
|
if (r >= 0 && r < sf.items())
|
||||||
|
{
|
||||||
TToken_string & row = sf.row(r);
|
TToken_string & row = sf.row(r);
|
||||||
//leggo dalla maschera i campi chiave di ricerca
|
//leggo dalla maschera i campi chiave di ricerca
|
||||||
TString4 risoatt = row.get(sf.cid2index(S_RISOATT));
|
TString4 risoatt = row.get(sf.cid2index(S_RISOATT));
|
||||||
@ -803,8 +826,6 @@ void TRilevamento_cons_msk::update_prev()
|
|||||||
TToken_string chiave;
|
TToken_string chiave;
|
||||||
|
|
||||||
chiave.add(_anno);
|
chiave.add(_anno);
|
||||||
chiave.add(_mese);
|
|
||||||
chiave.add(_giorno);
|
|
||||||
chiave.add(risoatt);
|
chiave.add(risoatt);
|
||||||
chiave.add(codice);
|
chiave.add(codice);
|
||||||
chiave.add(tpora);
|
chiave.add(tpora);
|
||||||
@ -818,34 +839,56 @@ void TRilevamento_cons_msk::update_prev()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TString query;
|
TString query;
|
||||||
query << "USE " << LF_RILORE << " KEY 5\n"
|
|
||||||
<< "FROM " << RILORE_TIPO "=\"P\" "
|
query << "USE " << LF_RILORE << " KEY 3";
|
||||||
|
query << "\nFROM " << RILORE_TIPO "=\"P\" "
|
||||||
<< RILORE_TIPORA << "=" << risoatt << " "
|
<< RILORE_TIPORA << "=" << risoatt << " "
|
||||||
<< RILORE_CODICE << "=" << codice << " "
|
<< RILORE_CODICE << "=" << codice << " "
|
||||||
<< RILORE_TPORA << "=" << tpora << " "
|
<< RILORE_TPORA << "=" << tpora << " ";
|
||||||
<< RILORE_CODCOSTO << "=" << codcosto << " "
|
query << RILORE_CODCOSTO << "=" << codcosto << " ";
|
||||||
<< RILORE_CODCMS << "=" << codcms << " "
|
query << RILORE_CODCMS << "=" << codcms << " ";
|
||||||
<< RILORE_CODFASE << "=" << codfase
|
query << RILORE_CODFASE << "=" << codfase ;
|
||||||
<< " " << RILORE_ANNO << "=" << _anno << " "
|
query << "\n";
|
||||||
<< RILORE_MESE << "=" << 1 << " "
|
|
||||||
<< RILORE_GIORNO << "=" << 1 << "\n";
|
|
||||||
|
|
||||||
query << "TO " << RILORE_TIPO "=\"P\" "
|
query << "TO " << RILORE_TIPO "=\"P\" "
|
||||||
<< RILORE_TIPORA << "=" << risoatt << " "
|
<< RILORE_TIPORA << "=" << risoatt << " "
|
||||||
<< RILORE_CODICE << "=" << codice << " "
|
<< RILORE_CODICE << "=" << codice << " "
|
||||||
<< RILORE_TPORA << "=" << tpora << " "
|
<< RILORE_TPORA << "=" << tpora << " ";
|
||||||
<< RILORE_CODCOSTO << "=" << codcosto << " "
|
query << RILORE_CODCOSTO << "=" << codcosto << " ";
|
||||||
<< RILORE_CODCMS << "=" << codcms << " "
|
query << RILORE_CODCMS << "=" << codcms << " ";
|
||||||
<< RILORE_CODFASE << "=" << codfase
|
query << RILORE_CODFASE << "=" << codfase ;
|
||||||
<< RILORE_ANNO << "=" << _anno << " "
|
query << "\n";
|
||||||
<< RILORE_MESE << "=" << 12 << " "
|
|
||||||
<< RILORE_GIORNO << "=" << 31 << "\n";
|
|
||||||
|
|
||||||
|
const TString & dett = get(F_INTERVALLO);
|
||||||
|
|
||||||
|
TDate inizio(1, 1, _anno);
|
||||||
|
TDate fine(31, 12, _anno);
|
||||||
|
if (dett == "G")
|
||||||
|
{
|
||||||
|
inizio.set_month(_mese);
|
||||||
|
fine.set_month(_mese);
|
||||||
|
fine.set_end_month();
|
||||||
|
}
|
||||||
TISAM_recordset def(query);
|
TISAM_recordset def(query);
|
||||||
real oreprev;
|
real oreprev;
|
||||||
|
|
||||||
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
for(bool ok = def.move_first(); ok; ok = def.move_next())
|
||||||
oreprev += def.cursor()->curr().get_real(RILORE_QTAORE);
|
{
|
||||||
|
TDate da(def.get(RILORE_DADATA).as_date());
|
||||||
|
TDate a(def.get(RILORE_ADATA).as_date());
|
||||||
|
|
||||||
|
if (a >= inizio && da <= fine)
|
||||||
|
{
|
||||||
|
real ore = def.get(RILORE_QTAORE).as_real();
|
||||||
|
|
||||||
|
if (da > inizio)
|
||||||
|
inizio = da;
|
||||||
|
if (a < fine)
|
||||||
|
fine = a;
|
||||||
|
ore = ore * (fine - inizio) / (a - da);
|
||||||
|
oreprev += ore;
|
||||||
|
}
|
||||||
|
}
|
||||||
row.add(oreprev.string(), sf.cid2index(S_OREPREV));
|
row.add(oreprev.string(), sf.cid2index(S_OREPREV));
|
||||||
sf.force_update(r);
|
sf.force_update(r);
|
||||||
_oreprev.add(chiave, oreprev);
|
_oreprev.add(chiave, oreprev);
|
||||||
@ -907,27 +950,39 @@ const char * TRilevamento_cons_msk::content_query()
|
|||||||
if (select.full())
|
if (select.full())
|
||||||
query << "SELECT " << select << "\n";
|
query << "SELECT " << select << "\n";
|
||||||
|
|
||||||
TString fromto = RILORE_TIPO "=\"C\"";
|
|
||||||
const TString & dett = get(F_INTERVALLO);
|
const TString & dett = get(F_INTERVALLO);
|
||||||
|
TString from = RILORE_TIPO "=\"C\"";
|
||||||
|
TString to(from);
|
||||||
|
TDate da(botime);
|
||||||
|
TDate a(eotime);
|
||||||
|
|
||||||
if (dett != "A")
|
if (dett != "A")
|
||||||
{
|
{
|
||||||
fromto << " " << RILORE_ANNO << "=" << _anno << " ";
|
da.set_day(1);
|
||||||
|
da.set_month(1);
|
||||||
|
da.set_year(_anno);
|
||||||
|
a.set_year(_anno);
|
||||||
if (dett != "M")
|
if (dett != "M")
|
||||||
fromto << RILORE_MESE << "=" << _mese << " ";
|
{
|
||||||
|
da.set_month(_mese);
|
||||||
|
a.set_month(_mese);
|
||||||
}
|
}
|
||||||
query << "FROM " << fromto << "\n"
|
a.set_end_month();
|
||||||
<< "TO " << fromto;
|
}
|
||||||
|
from << " " << RILORE_DADATA << "=" << da.string() << " ";
|
||||||
|
to << " " << RILORE_DADATA << "=" << a.string() << " ";
|
||||||
|
|
||||||
|
query << "FROM " << from << "\n"
|
||||||
|
<< "TO " << to;
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
//NUOVA_RIGA: metodo che aggiunge una riga allo sheet
|
//NUOVA_RIGA: metodo che aggiunge una riga allo sheet
|
||||||
//tenendo conto dei campi chiave compilati in testata
|
//tenendo conto dei campi chiave compilati in testata
|
||||||
void TRilevamento_cons_msk::nuova_riga()
|
void TRilevamento_cons_msk::riempi_nuova_riga(int r)
|
||||||
{
|
{
|
||||||
TSheet_field& sheet = sfield(F_SHEET);
|
TSheet_field& sheet = sfield(F_SHEET);
|
||||||
TToken_string & riga = sheet.row(-1);
|
TToken_string & riga = sheet.row(r);
|
||||||
const int r = sheet.items() - 1;
|
|
||||||
TMask& msk = sheet.sheet_mask();
|
TMask& msk = sheet.sheet_mask();
|
||||||
|
|
||||||
|
|
||||||
@ -988,6 +1043,7 @@ void TRilevamento_cons_msk::registra()
|
|||||||
TString80 codcms;
|
TString80 codcms;
|
||||||
TString16 codfase;
|
TString16 codfase;
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
|
const TString4 dett = get(F_INTERVALLO);
|
||||||
|
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, row)
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
||||||
{
|
{
|
||||||
@ -1024,9 +1080,28 @@ void TRilevamento_cons_msk::registra()
|
|||||||
{
|
{
|
||||||
rilroa.put(RILORE_TIPO, "C");
|
rilroa.put(RILORE_TIPO, "C");
|
||||||
rilroa.put(RILORE_ID, id);
|
rilroa.put(RILORE_ID, id);
|
||||||
rilroa.put(RILORE_ANNO, _curr_anno);
|
TDate da(_curr_giorno, _curr_mese, _curr_anno);
|
||||||
rilroa.put(RILORE_MESE, _curr_mese);
|
TDate a(_curr_giorno, _curr_mese, _curr_anno);
|
||||||
rilroa.put(RILORE_GIORNO, _curr_giorno);
|
|
||||||
|
if (dett == "A")
|
||||||
|
{
|
||||||
|
da.set_day(1);
|
||||||
|
a.set_month(1);
|
||||||
|
da.set_day(31);
|
||||||
|
a.set_month(12);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (dett =="M")
|
||||||
|
{
|
||||||
|
da.set_day(1);
|
||||||
|
a.set_end_month();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id == 0L || dett == "G")
|
||||||
|
{
|
||||||
|
rilroa.put(RILORE_DADATA, da);
|
||||||
|
rilroa.put(RILORE_ADATA, a);
|
||||||
|
}
|
||||||
rilroa.put(RILORE_TIPORA, tipora);
|
rilroa.put(RILORE_TIPORA, tipora);
|
||||||
rilroa.put(RILORE_CODICE, codice);
|
rilroa.put(RILORE_CODICE, codice);
|
||||||
rilroa.put(RILORE_TPORA, tpora);
|
rilroa.put(RILORE_TPORA, tpora);
|
||||||
@ -1041,8 +1116,10 @@ void TRilevamento_cons_msk::registra()
|
|||||||
|
|
||||||
if (_numcn.full() && _tipocn.full())
|
if (_numcn.full() && _tipocn.full())
|
||||||
{
|
{
|
||||||
TDoc_key oldkey(rilroa);
|
TString8 codnum = rilroa.get(RILORE_CODNUM);
|
||||||
const long ndoc = date2ndoc(TDate(_giorno, _mese, _anno));
|
TDoc_key oldkey(rilroa.get_date(RILORE_DADATA).year(), codnum, rilroa.get_long(RILORE_NDOC), rilroa.get_char(RILORE_PROVV));
|
||||||
|
|
||||||
|
const long ndoc = date2ndoc(da);
|
||||||
|
|
||||||
if (oldkey.provv() != 'D')
|
if (oldkey.provv() != 'D')
|
||||||
{
|
{
|
||||||
@ -1220,7 +1297,7 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
|
|||||||
break;
|
break;
|
||||||
case F_SHEET:
|
case F_SHEET:
|
||||||
if (e == se_notify_add)
|
if (e == se_notify_add)
|
||||||
nuova_riga();
|
riempi_nuova_riga(jolly);
|
||||||
else
|
else
|
||||||
if (e == se_enter || e == se_leave)
|
if (e == se_enter || e == se_leave)
|
||||||
{
|
{
|
||||||
|
@ -345,9 +345,9 @@ BEGIN
|
|||||||
PROMPT 45 11 "Prezzo "
|
PROMPT 45 11 "Prezzo "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER S_OREPREV 6 2
|
NUMBER S_OREPREV 7 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 60 11 "Ore Prev. "
|
PROMPT 60 11 "Ore Prev."
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
15
ci/cilib.cpp
15
ci/cilib.cpp
@ -724,7 +724,7 @@ int TRilevamento_ore::read(const char tipo, const long id, TReclock lock)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TRilevamento_ore::read(const char tipo, const int anno, const int mese, const int giorno, const char tipora, const char *codice, const char *tpora, const char* codcosto, const char* codcms, const char* codfase, TReclock lock)
|
int TRilevamento_ore::read(const char tipo, const TDate & giorno, const char tipora, const char *codice, const char *tpora, const char* codcosto, const char* codcms, const char* codfase, TReclock lock)
|
||||||
{
|
{
|
||||||
TLocalisamfile rilore(LF_RILORE);
|
TLocalisamfile rilore(LF_RILORE);
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
@ -732,11 +732,7 @@ int TRilevamento_ore::read(const char tipo, const int anno, const int mese, cons
|
|||||||
rilore.setkey(2);
|
rilore.setkey(2);
|
||||||
zero();
|
zero();
|
||||||
put(RILORE_TIPO, tipo);
|
put(RILORE_TIPO, tipo);
|
||||||
//put(RILORE_ANNO, anno);
|
put(RILORE_DADATA, giorno);
|
||||||
//put(RILORE_MESE, mese);
|
|
||||||
//put(RILORE_GIORNO, giorno);
|
|
||||||
TDate dadata(giorno, mese, anno);
|
|
||||||
put(RILORE_DADATA, dadata);
|
|
||||||
put(RILORE_TIPORA, tipora);
|
put(RILORE_TIPORA, tipora);
|
||||||
put(RILORE_CODICE, codice);
|
put(RILORE_CODICE, codice);
|
||||||
put(RILORE_TPORA, tpora);
|
put(RILORE_TPORA, tpora);
|
||||||
@ -847,10 +843,10 @@ TRilevamento_ore::TRilevamento_ore(const char tipo, const long id)
|
|||||||
read(tipo, id);
|
read(tipo, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRilevamento_ore::TRilevamento_ore(const char tipo, const int anno, const int mese, const int giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase)
|
TRilevamento_ore::TRilevamento_ore(const char tipo, const TDate & giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase)
|
||||||
: TRectype(LF_RILORE)
|
: TRectype(LF_RILORE)
|
||||||
{
|
{
|
||||||
read(tipo, anno, mese, giorno, tipora, codice, tpora, codcosto, codcms, codfase);
|
read(tipo, giorno, tipora, codice, tpora, codcosto, codcms, codfase);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRilevamento_ore::TRilevamento_ore()
|
TRilevamento_ore::TRilevamento_ore()
|
||||||
@ -862,8 +858,7 @@ TRilevamento_ore::TRilevamento_ore()
|
|||||||
|
|
||||||
const long date2ndoc(const TDate& data)
|
const long date2ndoc(const TDate& data)
|
||||||
{
|
{
|
||||||
const TDate inizio(1, 1, data.year());
|
return data.month() * 100 + data.day();
|
||||||
return data - inizio + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
@ -229,7 +229,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int read(const char tipo, const long id, TReclock lock = _nolock);
|
int read(const char tipo, const long id, TReclock lock = _nolock);
|
||||||
int read(const char tipo, const int anno, const int mese, const int giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase, TReclock lock = _nolock);
|
int read(const char tipo, const TDate & giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase, TReclock lock = _nolock);
|
||||||
int remove();
|
int remove();
|
||||||
void update_id();
|
void update_id();
|
||||||
int write_rewrite();
|
int write_rewrite();
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
TRilevamento_ore(const TRectype& rec);
|
TRilevamento_ore(const TRectype& rec);
|
||||||
TRilevamento_ore(const TRilevamento_ore& rilore);
|
TRilevamento_ore(const TRilevamento_ore& rilore);
|
||||||
TRilevamento_ore(const char tipo, const long id);
|
TRilevamento_ore(const char tipo, const long id);
|
||||||
TRilevamento_ore(const char tipo, const int anno, const int mese, const int giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase);
|
TRilevamento_ore(const char tipo, const TDate & giorno, const char tipora, const char* codice, const char* tpora, const char* codcosto, const char* codcms, const char* codfase);
|
||||||
TRilevamento_ore();
|
TRilevamento_ore();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user