Patch level : 10.0 1024

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :
Coretta abilitazione ricerca su unità di misura in base alla presenza o meno di un articolo valido su di una riga documento


git-svn-id: svn://10.65.10.50/branches/R_10_00@22252 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-06-09 16:13:13 +00:00
parent cb3c8e2080
commit c82c1f28e0

View File

@ -1619,7 +1619,7 @@ bool codart_handler(TMask_field& f, KEY key )
row_mask.set(FR_CODARTMAG, codart, true);
umcorr = codalt.get(CODCORR_UM);
const TString & liv1 = codalt.get(CODCORR_LIV1);
const TString& liv1 = codalt.get(CODCORR_LIV1);
if (liv1.full())
row_mask.set(FR_LIV1, liv1);
@ -1678,8 +1678,6 @@ bool codart_handler(TMask_field& f, KEY key )
if (lingua.not_empty())
{
TLocalisamfile deslin(LF_DESLIN);
deslin.setkey(2);
deslin.put(DESLIN_CODART, codart);
deslin.put(DESLIN_CODLIN, lingua);
@ -1727,10 +1725,9 @@ bool codart_handler(TMask_field& f, KEY key )
}
condv.ricerca();
if (mask.doc().tipo().calcolo_lordo())
mask.doc()[current_doc_row].put(RDOC_PREZZOL, row_mask.get(FR_PREZZO));
else
mask.doc()[current_doc_row].put(RDOC_PREZZO, row_mask.get(FR_PREZZO));
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));
FOR_EACH_CONFIGURED_CONAI_CLASS(type)
{
@ -1868,10 +1865,11 @@ bool codart_handler(TMask_field& f, KEY key )
return true;
}
bool codartmag_handler( TMask_field& f, KEY key )
{
TMask & m = f.mask();
/* Modo vecchio con funzionamento dubbiamente legato a !mask.is_running
TSheet_field& s = *m.get_sheet();
TDocumento_mask& mask= (TDocumento_mask&)s.mask();
@ -1881,16 +1879,29 @@ bool codartmag_handler( TMask_field& f, KEY key )
if (to_check)
{
const int r = s.selected();
const bool merce = TRiga_documento::tipo(m.get(FR_TIPORIGA)).is_merce();
const bool artmag = merce && f.get().full();
m.show(FR_UMQTA, artmag);
m.show(FR_UMQTA2, !artmag);
mask.update_giacenza();
const bool artmag = !f.empty() && TRiga_documento::tipo(m.get(FR_TIPORIGA)).is_merce();
m.show(FR_UMQTA, artmag);
m.show(FR_UMQTA2, !artmag);
mask.update_giacenza();
}
return true;
*/
if (key == K_TAB)
{
const bool artmag = !f.empty() && TRiga_documento::tipo(m.get(FR_TIPORIGA)).is_merce();
m.show(FR_UMQTA, artmag);
m.show(FR_UMQTA2, !artmag);
if (f.focusdirty())
{
TSheet_field& s = *m.get_sheet();
TDocumento_mask& mask= (TDocumento_mask&)s.mask();
if (mask.is_running())
mask.update_giacenza();
}
}
return true;
}
bool liv_handler( TMask_field& f, KEY key )
@ -1948,7 +1959,7 @@ bool umart_handler( TMask_field& f, KEY key )
condv.set_riga(&row_mask);
const TString& um = f.get();
real fc(1.0);
real fc = UNO;
if (um.not_empty() && curr_um.not_empty() && um != curr_um)
{
@ -1967,7 +1978,7 @@ bool umart_handler( TMask_field& f, KEY key )
if (umart.read() == NOERR)
curr_fc = umart.get_real(UMART_FC);
else
curr_fc = 1.0;
curr_fc = UNO;
}
qta *= curr_fc;
qta /= fc;
@ -1983,13 +1994,11 @@ bool umart_handler( TMask_field& f, KEY key )
curr_um = um;
curr_fc = fc;
condv.ricerca(true);
if (mask.doc().tipo().calcolo_lordo())
mask.doc()[current_doc_row].put(RDOC_PREZZOL, row_mask.get(FR_PREZZO));
else
mask.doc()[current_doc_row].put(RDOC_PREZZO, row_mask.get(FR_PREZZO));
const char* const prezzo = mask.doc().tipo().calcolo_lordo() ? RDOC_PREZZOL : RDOC_PREZZO;
mask.doc()[current_doc_row].put(prezzo, row_mask.get(FR_PREZZO));
const int pos = row_mask.id2pos(FR_CODIVA);
if (pos >= 0)
iva_handler(row_mask.fld(pos), 0);
}