Patch level :4.0 740

Files correlati     :ca3 & co.
Ricompilazione Demo : [ ]
Commento            :stabella ripartizioni:aggiunta procedura automatica per ripartizione di una commessa sulle sue fasi


git-svn-id: svn://10.65.10.50/trunk@15469 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-07-03 13:50:45 +00:00
parent fc694bc745
commit d6b3adde5f
3 changed files with 51 additions and 1 deletions

View File

@ -1,10 +1,12 @@
#include <automask.h>
#include <recarray.h>
#include <recset.h>
#include <relapp.h>
#include "ca0800a.h"
#include "calib01.h"
#include "fasi.h"
#include "rrip.h"
///////////////////////////////////////////////////////////
@ -16,12 +18,40 @@ class TRiparti_msk : public TAutomask
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
int create_sheet_fields(int lf, int& y, short& dlg);
void genera_righe_fasi();
void create_sheet();
public:
TRiparti_msk();
};
void TRiparti_msk::genera_righe_fasi()
{
//data una commessa in ingresso, la si vuole ripartire sulle sue fasi
TString80 commessa;
for (short id = F_CODCMS_1; id2pos(id) > 0; id++)
commessa << get(id);
if (commessa.full())
{
//sheet della maschera da riempire
TSheet_field& sheet = sfield(F_SHEET);
sheet.destroy();
//quali sono le fasi legate a 'sto cavolo di commessa?
TISAM_recordset fasi("USE FASI\nFROM CODCMSFAS=#COMMESSA\nTO CODCMSFAS=#COMMESSA");
fasi.set_var("#COMMESSA", TVariant(commessa));
TToken_string wts;
for (bool ok = fasi.move_first(); ok; ok = fasi.move_next())
{
wts = " ";
wts.add(commessa);
wts.add(fasi.get(FASI_CODFASE).as_string());
sheet.row(-1) = wts;
}
sheet.force_update(); //scrive le righe effettivamente
} //if(commessa.full()...
}
bool TRiparti_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
@ -67,6 +97,20 @@ bool TRiparti_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
}
}
break;
case F_GENFASI:
if (e == fe_init)
{
bool accendimi = insert_mode();
if (accendimi)
{
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
accendimi = fasinfo.parent() == LF_COMMESSE;
}
o.show(accendimi);
}
if (e == fe_button)
genera_righe_fasi();
break;
default:
break;
}

View File

@ -33,3 +33,4 @@
#define F_DESCMS_4 139
#define F_SHEET 151
#define F_GENFASI 152

View File

@ -193,7 +193,7 @@ BEGIN
FIELD TIPORIP
END
SPREADSHEET F_SHEET
SPREADSHEET F_SHEET 80 -3
BEGIN
PROMPT 0 3 ""
ITEM "Ripartiz.@9F"
@ -215,6 +215,11 @@ BEGIN
ITEM "Con4"
END
BUTTON F_GENFASI 40 2
BEGIN
PROMPT 0 -1 "Ripartisci la commessa di origine tra le sue fasi"
END
ENDPAGE
ENDMASK