Patch level : 10.0 398
Files correlati : pe0.exe Ricompilazione Demo : [ ] Commento Aggiornamento costi sui preventivi git-svn-id: svn://10.65.10.50/trunk@19171 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ea4eb93a55
commit
be97b08941
@ -24,6 +24,7 @@
|
|||||||
#define F_ZOOM_ROW F_USERFLD+8
|
#define F_ZOOM_ROW F_USERFLD+8
|
||||||
#define F_USEK F_USERFLD+9
|
#define F_USEK F_USERFLD+9
|
||||||
#define F_REVISION F_USERFLD+10
|
#define F_REVISION F_USERFLD+10
|
||||||
|
#define F_LOAD_COSTS F_USERFLD+11
|
||||||
#define FOR_EACH_DOC_ROW_BACK(d, r, row) const TRiga_documento* row = NULL; for (int r = d.rows(); r > 0 && (row = &d[r]) != NULL; r--)
|
#define FOR_EACH_DOC_ROW_BACK(d, r, row) const TRiga_documento* row = NULL; for (int r = d.rows(); r > 0 && (row = &d[r]) != NULL; r--)
|
||||||
|
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
@ -65,7 +66,7 @@ public:
|
|||||||
static bool pe_copia_handler(TMask_field& f, KEY k);
|
static bool pe_copia_handler(TMask_field& f, KEY k);
|
||||||
static bool pe_incolla_handler(TMask_field& f, KEY k);
|
static bool pe_incolla_handler(TMask_field& f, KEY k);
|
||||||
static bool pe_new_revision_handler(TMask_field& f, KEY k);
|
static bool pe_new_revision_handler(TMask_field& f, KEY k);
|
||||||
|
static bool pe_update_costi_handler(TMask_field& f, KEY k);
|
||||||
virtual void user_set_handler( short fieldid, int index);
|
virtual void user_set_handler( short fieldid, int index);
|
||||||
virtual void user_set_row_handler(TMask& rm, short field, int index);
|
virtual void user_set_row_handler(TMask& rm, short field, int index);
|
||||||
|
|
||||||
@ -604,6 +605,46 @@ bool TGestione_preventivo_msk::pe_new_revision_handler(TMask_field& f, KEY k)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TGestione_preventivo_msk::pe_update_costi_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TGestione_preventivo_msk & mask = (TGestione_preventivo_msk &) f.mask();
|
||||||
|
TDocumento & doc = mask.doc();
|
||||||
|
TSheet_field & sf = mask.sfield(F_SHEET);
|
||||||
|
|
||||||
|
mask.mask2doc();
|
||||||
|
|
||||||
|
const int rows = doc.physical_rows();
|
||||||
|
|
||||||
|
for (int i = 1; i <= rows; i++)
|
||||||
|
{
|
||||||
|
bool ok = i == rows;
|
||||||
|
TRiga_documento & row = doc[i];
|
||||||
|
const int level = row.get_int(RDOC_LEVEL);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
ok = (level >= doc[i + 1].get_int(RDOC_LEVEL));
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
const TString& codart = row.get(RDOC_CODARTMAG);
|
||||||
|
|
||||||
|
if (codart.full())
|
||||||
|
{
|
||||||
|
const TArticolo_giacenza & art = cached_article(codart);
|
||||||
|
const real costo = art.get_real(mask._field_costo);
|
||||||
|
|
||||||
|
row.put(RDOC_COSTO, costo);
|
||||||
|
row.autoload(sf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sf.force_update();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
// HANDLER DI RIGA //
|
// HANDLER DI RIGA //
|
||||||
///////////////////////
|
///////////////////////
|
||||||
@ -622,7 +663,7 @@ bool TGestione_preventivo_msk::pe_codart_handler(TMask_field& f, KEY k)
|
|||||||
bool update = false;
|
bool update = false;
|
||||||
const int r = sh->selected();
|
const int r = sh->selected();
|
||||||
|
|
||||||
const TString& codart = row_mask.get(FR_CODART);
|
const TString& codart = row_mask.get(FR_CODARTMAG);
|
||||||
|
|
||||||
if (codart.full())
|
if (codart.full())
|
||||||
{
|
{
|
||||||
@ -1015,7 +1056,9 @@ TMask* TGestione_preventivo_app::get_mask( int mode )
|
|||||||
TSheet_field & sh = m->sfield(F_SHEET);
|
TSheet_field & sh = m->sfield(F_SHEET);
|
||||||
const int y = m->sh_y() - 1;
|
const int y = m->sh_y() - 1;
|
||||||
|
|
||||||
m->add_button(F_REVISION, sh.page(), "Rev.", 76, y - 2, 1, 1, "");
|
m->add_button(F_LOAD_COSTS, sh.page(), "Costi", 66, y - 2, 4, 1, "");
|
||||||
|
m->set_handler(F_LOAD_COSTS, TGestione_preventivo_msk::pe_update_costi_handler);
|
||||||
|
m->add_button(F_REVISION, sh.page(), "Rev.", 73, y - 2, 4, 1, "");
|
||||||
m->set_handler(F_REVISION, TGestione_preventivo_msk::pe_new_revision_handler);
|
m->set_handler(F_REVISION, TGestione_preventivo_msk::pe_new_revision_handler);
|
||||||
|
|
||||||
m->add_button(F_SHRINK_ALL, sh.page(), "--", 61, y - 1, 1, 1, "", BMP_DARROWU);
|
m->add_button(F_SHRINK_ALL, sh.page(), "--", 61, y - 1, 1, 1, "", BMP_DARROWU);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user