Patch level : 10.1050

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

Aggiunto flag di rimborso sui consuntivi
Aggiunto campo costo totale sui consuntivi


git-svn-id: svn://10.65.10.50/branches/R_10_00@22396 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2011-07-19 12:47:24 +00:00
parent 103a0fdb0d
commit 9cb4f3dc19
3 changed files with 63 additions and 4 deletions

View File

@ -30,6 +30,7 @@ class TRilevamento_prev_msk : public TAutomask
short _sfase_sid, _sfase_lid;
TString _numpr;
TString _tipopr;
real _totcosto;
protected:
const TString & proponi_costo(const TMask& msk);
@ -492,6 +493,7 @@ void TRilevamento_prev_msk::riempi_sheet()
<< "TO " << to;
TISAM_recordset def(query);
_totcosto = ZERO;
//riempio lo sheet con i dati che soddisfano il filtro preparato prima
for(bool ok = def.move_first(); ok; ok = def.move_next())
@ -515,9 +517,14 @@ void TRilevamento_prev_msk::riempi_sheet()
riga.add(rilore.get(RILORE_QTAORE), sheet.cid2index(S_QTAORE));
riga.add(rilore.get(RILORE_CODLIST), sheet.cid2index(S_CODLIST));
riga.add(rilore.get(RILORE_COSTO), sheet.cid2index(S_COSTO));
const real valore(rilore.get_real(RILORE_QTAORE) * rilore.get_real(RILORE_COSTO));
_totcosto += valore;
riga.add(valore.stringa(), sheet.cid2index(S_COSTOTOT));
riga.add(rilore.get(RILORE_ID), sheet.cid2index(S_ID));
sheet.check_row(sheet.items() - 1);
}
set(F_COSTOTOT, _totcosto);
sheet.force_update();
}
@ -803,6 +810,43 @@ bool TRilevamento_prev_msk::on_field_event(TOperable_field& f, TField_event e, l
case F_SHEET:
if (e == se_notify_add)
riempi_nuova_riga(jolly);
else
if (e == se_enter)
{
TSheet_field& sheet = sfield(F_SHEET);
TMask & m = sheet.sheet_mask();
TToken_string & row = sheet.row(jolly);
real valore(row.get(sheet.cid2index(S_COSTO)));
valore *= real(row.get(sheet.cid2index(S_QTAORE)));
_totcosto -= valore;
}
else
if (e == se_leave)
{
TSheet_field& sheet = sfield(F_SHEET);
TMask & m = sheet.sheet_mask();
TToken_string & row = sheet.row(jolly);
real valore(row.get(sheet.cid2index(S_COSTO)));
valore *= real(row.get(sheet.cid2index(S_QTAORE)));
row.add(valore.stringa(), sheet.cid2index(S_COSTOTOT));
_totcosto += valore;
set(F_COSTOTOT, _totcosto);
sfield(F_SHEET).force_update(jolly);
}
else
if (e == se_query_del)
{
TSheet_field& sheet = sfield(F_SHEET);
TMask & m = sheet.sheet_mask();
TToken_string & row = sheet.row(jolly);
real valore(row.get(sheet.cid2index(S_COSTO)));
valore *= real(row.get(sheet.cid2index(S_QTAORE)));
_totcosto -= valore;
}
break;
case S_CODRIS:
case S_CODATT:

View File

@ -8,7 +8,8 @@
#define F_DESRIS 307
#define F_CODATT 308
#define F_DESATT 309
#define F_ANAL 310
#define F_COSTOTOT 310
#define F_ANAL 311
#define F_SHEET 330
#define DLG_RESET 400
@ -41,6 +42,7 @@
#define S_COSTO 121
#define S_DESRIS 122
#define S_DESATT 222
#define S_ID 123
#define S_COSTOTOT 123
#define S_ID 124
#define S_CMSH 350

View File

@ -57,6 +57,12 @@ BEGIN
OUTPUT F_TPORA CODTAB
END
NUMBER F_COSTOTOT 13 2
BEGIN
PROMPT 59 1 "Costo"
FLAGS "D"
END
LISTBOX F_RISOATT 1 12
BEGIN
PROMPT 2 2 "@bTipo "
@ -146,6 +152,7 @@ BEGIN
ITEM "Listino"
ITEM "Costo@10"
ITEM "Descrizione@50"
ITEM "Costo totale"
ITEM "ID@8"
END
@ -332,15 +339,21 @@ BEGIN
PROMPT 45 11 "Prezzo "
END
NUMBER S_COSTOTOT 13 2
BEGIN
PROMPT 2 12 "Costo totale"
FLAGS "D"
END
NUMBER S_ID 8
BEGIN
PROMPT 2 12 "ID "
PROMPT 2 13 "ID "
FLAGS "D"
END
BOOLEAN S_DEL
BEGIN
PROMPT 31 12 "Elimina"
PROMPT 31 13 "Elimina"
END
STRING S_CMSH 20