Patch level : 12.00 1416
Files correlati : ve0.exe Commento Riprostinata la commessa precedente se l'attuale e chiusa
This commit is contained in:
parent
42c2419751
commit
45b418599a
@ -1287,7 +1287,7 @@ public:
|
||||
short cms_start_sh() const { return _cms_start_sh;}
|
||||
short cms_end_sh() const { return _cms_end_sh;}
|
||||
TString& codcms() { return _codcms;}
|
||||
const TString& codcms() const { return _codcms;}
|
||||
const TString & codcms() const { return _codcms;}
|
||||
TString& codcms_sh() { return _codcms_sh;}
|
||||
const TString & codcms_sh() const { return _codcms_sh;}
|
||||
TString& codart() { return _codart; }
|
||||
|
||||
@ -993,7 +993,7 @@ bool pricerange_handler(TMask_field& f, KEY key )
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool __in_handler = false;
|
||||
@ -1108,7 +1108,7 @@ static void search_price(TEdit_field& f, KEY key )
|
||||
TSheet_field& sh = *row_mask.get_sheet();
|
||||
TDocumento_mask& mask = (TDocumento_mask &)sh.mask();
|
||||
|
||||
TPrice_sheet sheet(f);
|
||||
TPrice_sheet sheet(f);
|
||||
|
||||
TString_array & el = sheet.rows_array();
|
||||
TRelation rel(LF_DOC);
|
||||
@ -1928,10 +1928,10 @@ bool codart_handler(TMask_field& f, KEY key )
|
||||
upd_colli_peso_tara(row_mask, codart);
|
||||
}
|
||||
|
||||
condv.ricerca();
|
||||
condv.ricerca();
|
||||
|
||||
const char* rdoc_prezzo = mask.doc().tipo().calcolo_lordo() ? RDOC_PREZZOL : RDOC_PREZZO;
|
||||
mask.doc()[current_doc_row].put(rdoc_prezzo, row_mask.get(FR_PREZZO));
|
||||
mask.doc()[current_doc_row].put(rdoc_prezzo, row_mask.get(FR_PREZZO));
|
||||
|
||||
TArticolo_conai cart(codart);
|
||||
|
||||
@ -2883,10 +2883,10 @@ bool cms_mag_handler(TMask_field& f, KEY key)
|
||||
const TSheet_field& s = *m.get_sheet();
|
||||
TDocumento_mask& mask = (TDocumento_mask&)s.mask();
|
||||
const TRectype& curr = m.efield(mask.cms_end_sh()).browse()->cursor()->curr();
|
||||
const TString80 codcms = curr.get(COMMESSE_CODCMS);
|
||||
TString80 codcms = curr.get(COMMESSE_CODCMS);
|
||||
TString svcms = mask.codcms_sh();
|
||||
|
||||
|
||||
if (mask.codcms_sh() != codcms) // Cambio commessa
|
||||
if (svcms != codcms) // Cambio commessa
|
||||
{
|
||||
if ((key == K_TAB && f.focusdirty()))
|
||||
{
|
||||
@ -2896,7 +2896,27 @@ bool cms_mag_handler(TMask_field& f, KEY key)
|
||||
if (chiusa && curr.get_bool(COMMESSE_PROROGA))
|
||||
chiusa = mask.get_date(F_DATADOC) > curr.get_date(COMMESSE_DATAPROR);
|
||||
if (chiusa)
|
||||
return (t == _bloccante) ? f.error_box(FR("La commessa %s è chiusa "), (const char*)codcms) : f.yesno_box(FR("La commessa chiusa %s, vuoi utilizzarla"), (const char*)codcms);
|
||||
{
|
||||
bool ok = (t == _bloccante) ? error_box(FR("La commessa %s è chiusa "), (const char*)codcms) :
|
||||
yesno_box(FR("La commessa chiusa %s, vuoi utilizzarla ?"), (const char*)codcms);
|
||||
if (!ok)
|
||||
{
|
||||
codcms = svcms;
|
||||
for (short i = mask.cms_start(); i <= mask.cms_end(); i++)
|
||||
{
|
||||
TEdit_field & e = mask.efield(i);
|
||||
const TFieldref * f = e.field();
|
||||
|
||||
if (f != nullptr)
|
||||
{
|
||||
const int from = f->from();
|
||||
const int to = f->to();
|
||||
mask.set(i, codcms.sub(from, to), 0x2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
mask.codcms_sh() = codcms;
|
||||
|
||||
@ -2988,13 +3008,15 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
|
||||
const TRectype& curr_cms = ((TEdit_field&)f).browse()->cursor()->curr();
|
||||
const TString80 codcms = curr_cms.get(COMMESSE_CODCMS);
|
||||
TString80 codcms = curr_cms.get(COMMESSE_CODCMS);
|
||||
mask.set(F_CMSH, codcms);
|
||||
|
||||
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
||||
{
|
||||
// Controlla se c'e' la gestione dei centri di costo al secondo livello
|
||||
if (mask.codcms() != codcms)
|
||||
TString svcms = mask.codcms();
|
||||
|
||||
if (svcms != codcms)
|
||||
{
|
||||
if ((key == K_TAB && f.focusdirty()))
|
||||
{
|
||||
@ -3004,7 +3026,27 @@ bool codcms_handler(TMask_field& f, KEY key)
|
||||
if (chiusa && curr_cms.get_bool(COMMESSE_PROROGA))
|
||||
chiusa = mask.get_date(F_DATADOC) > curr_cms.get_date(COMMESSE_DATAPROR);
|
||||
if (chiusa)
|
||||
return (t == _bloccante) ? f.error_box(FR("La commessa %s è chiusa "), (const char*)codcms) : f.yesno_box(FR("La commessa chiusa %s, vuoi utilizzarla"), (const char*)codcms);
|
||||
{
|
||||
bool ok = (t == _bloccante) ? error_box(FR("La commessa %s è chiusa "), (const char*)codcms) :
|
||||
yesno_box(FR("La commessa chiusa %s, vuoi utilizzarla ?"), (const char*)codcms);
|
||||
if (!ok)
|
||||
{
|
||||
codcms = svcms;
|
||||
for (short i = mask.cms_start(); i <= mask.cms_end(); i++)
|
||||
{
|
||||
TEdit_field & e = mask.efield(i);
|
||||
const TFieldref * f = e.field();
|
||||
|
||||
if (f != nullptr)
|
||||
{
|
||||
const int from = f->from();
|
||||
const int to = f->to();
|
||||
mask.set(i, codcms.sub(from, to), 0x2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
doc.put(DOC_CODCMS, codcms);
|
||||
FOR_EACH_PHYSICAL_RDOC(doc, r, riga)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user