Patch level : 10.0 patch 808

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Rilevazione ore


git-svn-id: svn://10.65.10.50/branches/R_10_00@20889 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-09-22 06:47:04 +00:00
parent 253c8447ff
commit aace49f409
4 changed files with 21 additions and 66 deletions

View File

@ -181,16 +181,11 @@ void TDef_risoatt_msk::riempi_sheet()
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(" << RILORE_CODICE << "==\"" << codice << "\")"; select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
} }
if (anno > 0) /* if (mese > 0)
{
if (select.full()) select << "&&";
select << "STR(" << RILORE_ANNO << "==" << anno << ")";
}
if (mese > 0)
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "STR(" RILORE_MESE << "==" << mese << ")"; select << "STR(" RILORE_MESE << "==" << mese << ")";
} } */
if (tpora.full()) if (tpora.full())
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
@ -218,9 +213,9 @@ void TDef_risoatt_msk::riempi_sheet()
if (anno > 0) if (anno > 0)
{ {
fromto << " " << RILORE_ANNO << "=\"" << anno << "\" "; fromto << " " << RILORE_ANNO << "=" << anno << " ";
if (mese > 0) if (mese > 0)
fromto << " " << RILORE_MESE << "=\"" << mese << "\" "; fromto << " " << RILORE_MESE << "=" << mese << " ";
} }
query << "FROM " << fromto << "\n" query << "FROM " << fromto << "\n"

View File

@ -41,6 +41,7 @@ NUMBER F_ANNO 4
BEGIN BEGIN
PROMPT 2 1 "Anno " PROMPT 2 1 "Anno "
FLAGS "A" FLAGS "A"
CHECKTYPE REQUIRED
END END
LISTBOX F_MESE 10 LISTBOX F_MESE 10

View File

@ -350,14 +350,14 @@ void TRilevamento_prev_msk::carica_default()
void TRilevamento_prev_msk::riempi_sheet() void TRilevamento_prev_msk::riempi_sheet()
{ {
//leggo dalla maschera i campi chiave di ricerca //leggo dalla maschera i campi chiave di ricerca
const int daanno = get_date(F_DADATA).year(); const TDate da = get_date(F_DADATA);
int aanno = get_date(F_ADATA).year(); const TDate a = get_date(F_ADATA);
const int daanno = da.year();
int aanno = a.year();
if (aanno == 0) if (aanno == 0)
aanno = 2100; aanno = 2100;
const TString4 risoatt = get(F_RISOATT) == "T" ? "" : get(F_RISOATT); const TString4 risoatt = get(F_RISOATT) == "T" ? "" : get(F_RISOATT);
int damese = get_date(F_DADATA).month();
int amese = get_date(F_ADATA).month();
const TString4 tpora = get(F_TPORA); const TString4 tpora = get(F_TPORA);
TString80 codcosto; TString80 codcosto;
TString80 codcms; TString80 codcms;
@ -383,16 +383,8 @@ void TRilevamento_prev_msk::riempi_sheet()
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(" << RILORE_CODICE << "==\"" << codice << "\")"; select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
} }
if (daanno > 0)
{
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "STR(BETWEEN(" << RILORE_ANNO << "," << daanno << "," << aanno << "))"; select << "(BETWEEN(" << RILORE_DADATA << ",\"" << da << "\",\"" << a << "\"))";
}
if ( damese > 0 || amese > 0)
{
if (select.full()) select << "&&";
select << "(BETWEEN(" << RILORE_MESE << "," << damese << "," << amese << "))";
}
if (tpora.full()) if (tpora.full())
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
@ -420,8 +412,8 @@ void TRilevamento_prev_msk::riempi_sheet()
TString to = from; TString to = from;
if (daanno > 0) if (daanno > 0)
from << " " << RILORE_ANNO << "=\"" << daanno << "\" "; from << " " << RILORE_ANNO << "=" << daanno << " ";
to << " " << RILORE_ANNO << "=\"" << aanno << "\" "; to << " " << RILORE_ANNO << "=" << aanno << " ";
query << "FROM " << from << "\n" query << "FROM " << from << "\n"
<< "TO " << to; << "TO " << to;
@ -661,6 +653,8 @@ bool TRilevamento_prev_msk::on_field_event(TOperable_field& f, TField_event e, l
} }
} }
break; break;
case F_DADATA:
case F_ADATA:
case F_RISOATT: case F_RISOATT:
case F_CODRIS: case F_CODRIS:
case F_CODATT: case F_CODATT:

View File

@ -220,16 +220,6 @@ void TRilevamento_cons_msk::carica_default()
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(" << RILORE_CODICE << "==\"" << codice << "\")"; select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
} }
if (anno > 0)
{
if (select.full()) select << "&&";
select << "STR(" << RILORE_ANNO << "==" << anno << ")";
}
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 << "&&";
@ -257,9 +247,9 @@ void TRilevamento_cons_msk::carica_default()
if (anno > 0) if (anno > 0)
{ {
fromto << " " << RILORE_ANNO << "=\"" << anno << "\" "; fromto << " " << RILORE_ANNO << "=" << anno << " ";
if (mese > 0) if (mese > 0)
fromto << RILORE_MESE << "=\"" << mese << "\" "; fromto << RILORE_MESE << "=" << mese << " ";
} }
riempi_calendario(query, anno, mese); riempi_calendario(query, anno, mese);
} }
@ -343,21 +333,6 @@ void TRilevamento_cons_msk::riempi_risoatt(int giorno)
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(" << RILORE_CODICE << "==\"" << codice << "\")"; select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
} }
if (anno > 0)
{
if (select.full()) select << "&&";
select << "STR(" << RILORE_ANNO << "==" << anno << ")";
}
if (mese > 0)
{
if (select.full()) select << "&&";
select << "STR(" RILORE_MESE << "==" << mese << ")";
}
if (_edit_mode && giorno > 0)
{
if (select.full()) select << "&&";
select << "STR(" RILORE_GIORNO << "==" << giorno << ")";
}
if (tpora.full()) if (tpora.full())
{ {
if (select.full()) select << "&&"; if (select.full()) select << "&&";
@ -389,12 +364,12 @@ void TRilevamento_cons_msk::riempi_risoatt(int giorno)
fromto << "=\"D\""; fromto << "=\"D\"";
if (anno > 0) if (anno > 0)
{ {
fromto << " " << RILORE_ANNO << "=\"" << anno << "\" "; fromto << " " << RILORE_ANNO << "=" << anno << " ";
if (mese > 0) if (mese > 0)
{ {
fromto << RILORE_MESE << "=\"" << mese << "\" "; fromto << RILORE_MESE << "=" << mese << " ";
if (_edit_mode && giorno > 0) if (_edit_mode && giorno > 0)
fromto << RILORE_GIORNO << "=\"" << giorno << "\" "; fromto << RILORE_GIORNO << "=" << giorno << " ";
} }
} }
query << "FROM " << fromto << "\n" query << "FROM " << fromto << "\n"
@ -458,16 +433,6 @@ void TRilevamento_cons_msk::riempi_sheet()
if (select.full()) select << "&&"; if (select.full()) select << "&&";
select << "(" << RILORE_CODICE << "==\"" << codice << "\")"; select << "(" << RILORE_CODICE << "==\"" << codice << "\")";
} }
if (anno > 0)
{
if (select.full()) select << "&&";
select << "STR(" << RILORE_ANNO << "==" << anno << ")";
}
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 << "&&";
@ -495,9 +460,9 @@ void TRilevamento_cons_msk::riempi_sheet()
if (anno > 0) if (anno > 0)
{ {
fromto << " " << RILORE_ANNO << "=\"" << anno << "\" "; fromto << " " << RILORE_ANNO << "=" << anno << " ";
if (mese > 0) if (mese > 0)
fromto << RILORE_MESE << "=\"" << mese << "\" "; fromto << RILORE_MESE << "=" << mese << " ";
} }
query << "FROM " << fromto << "\n" query << "FROM " << fromto << "\n"
<< "TO " << fromto; << "TO " << fromto;