- Uso del metodo giacenza_corretta di TArticolo_giacenza

- corretto calcolo valore totale
- disabilitazione campi livello art e giac se non in TConfig


git-svn-id: svn://10.65.10.50/trunk@4978 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
augusto 1997-07-30 13:26:28 +00:00
parent be6cc40d5a
commit d2222582c0

View File

@ -45,15 +45,7 @@ bool TForm_inventario::validate(TForm_item &cf, TToken_string &s)
TString16 annoes(magrec.get(MAG_ANNOES)); TString16 annoes(magrec.get(MAG_ANNOES));
subcode=s.get(); subcode=s.get();
if (subcode=="GIAC") { if (subcode=="GIAC") {
real v=magrec.get_real(MAG_GIAC); real v=curr_art().giacenza_corretta(magrec,_giaceff,_valcomp);
if (!_giaceff) {
v +=magrec.get_real(MAG_ACL);
v -=magrec.get_real(MAG_INCL);
if (_valcomp)
v -=magrec.get_real(MAG_PRODCOMP);
else
v +=magrec.get_real(MAG_PRODFIN);
}
cf.set(v.string()); cf.set(v.string());
} }
if (subcode=="VAL1") { if (subcode=="VAL1") {
@ -155,43 +147,45 @@ bool TForm_inventario::valorizzazione(TForm_item &cf, TTipo_valorizz t)
{ {
TRectype & magrec=relation()->lfile(LF_MAG).curr(); TRectype & magrec=relation()->lfile(LF_MAG).curr();
TString annoes(magrec.get(MAG_ANNOES)); TString annoes(magrec.get(MAG_ANNOES));
real v;
if (t==valorizz_ultcos) { if (t==valorizz_ultcos) {
cf.set(curr_art().ultimo_costo(annoes).string()); v=curr_art().ultimo_costo(annoes).string();
} }
if (t==valorizz_mediacos) { if (t==valorizz_mediacos) {
cf.set(curr_art().media_costi(annoes).string()); v=curr_art().media_costi(annoes).string();
} }
if (t==valorizz_przlist) { if (t==valorizz_przlist) {
cf.set(curr_art().prezzo_listino(annoes,_codlist,_catven).string()); v=curr_art().prezzo_listino(annoes,_codlist,_catven).string();
} }
if (t==valorizz_coststd) { if (t==valorizz_coststd) {
cf.set(curr_art().costo_standard(annoes).string()); v=curr_art().costo_standard(annoes).string();
} }
if (t==valorizz_costmedio) { if (t==valorizz_costmedio) {
const TString codmag(magrec.get(MAG_CODMAG)); const TString codmag(magrec.get(MAG_CODMAG));
const TString livello(magrec.get(MAG_LIVELLO)); const TString livello(magrec.get(MAG_LIVELLO));
cf.set(curr_art().costo_medio(annoes,codmag,livello).string()); v=curr_art().costo_medio(annoes,codmag,livello).string();
} }
if (t==valorizz_LIFO) { if (t==valorizz_LIFO) {
const TString codmag(magrec.get(MAG_CODMAG)); const TString codmag(magrec.get(MAG_CODMAG));
const TString livello(magrec.get(MAG_LIVELLO)); const TString livello(magrec.get(MAG_LIVELLO));
cf.set(curr_art().LIFO(annoes,codmag,livello, _giaceff,_valcomp).string()); v=curr_art().LIFO(annoes,codmag,livello, _giaceff,_valcomp).string();
} }
if (t==valorizz_FIFO) { if (t==valorizz_FIFO) {
const TString codmag(magrec.get(MAG_CODMAG)); const TString codmag(magrec.get(MAG_CODMAG));
const TString livello(magrec.get(MAG_LIVELLO)); const TString livello(magrec.get(MAG_LIVELLO));
cf.set(curr_art().FIFO(annoes,codmag,livello, _giaceff,_valcomp).string()); v=curr_art().FIFO(annoes,codmag,livello, _giaceff,_valcomp).string();
} }
if (t==valorizz_LIFOa) { if (t==valorizz_LIFOa) {
const TString codmag(magrec.get(MAG_CODMAG)); const TString codmag(magrec.get(MAG_CODMAG));
const TString livello(magrec.get(MAG_LIVELLO)); const TString livello(magrec.get(MAG_LIVELLO));
cf.set(curr_art().LIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp).string()); v=curr_art().LIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp).string();
} }
if (t==valorizz_FIFOa) { if (t==valorizz_FIFOa) {
const TString codmag(magrec.get(MAG_CODMAG)); const TString codmag(magrec.get(MAG_CODMAG));
const TString livello(magrec.get(MAG_LIVELLO)); const TString livello(magrec.get(MAG_LIVELLO));
cf.set(curr_art().FIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp).string()); v=curr_art().FIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp).string();
} }
cf.set((v*curr_art().giacenza_corretta(magrec,_giaceff,_valcomp)).string());
return TRUE; return TRUE;
} }
@ -249,10 +243,14 @@ TStampainv_mask::TStampainv_mask():
if (!artlev.enabled()) { if (!artlev.enabled()) {
TMask_field &f1=field(F_RAGGCODICE); TMask_field &f1=field(F_RAGGCODICE);
f1.reset(); f1.check();f1.hide(); f1.reset(); f1.check();f1.hide();
field(F_FROMLIVELLOART).hide();
field(F_TOLIVELLOART).hide();
} }
if (!giaclev.enabled()) { if (!giaclev.enabled()) {
TMask_field &f2=field(F_RAGGLIVGIAC); TMask_field &f2=field(F_RAGGLIVGIAC);
f2.reset(); f2.check();f2.hide(); f2.reset(); f2.check();f2.hide();
field(F_FROMLIVELLOGIAC).hide();
field(F_TOLIVELLOGIAC).hide();
} }
} }
@ -489,7 +487,7 @@ bool TStampa_inventario::set_print(int i)
_form->add_colval(_mask->get_int(F_VAL6)); _form->add_colval(_mask->get_int(F_VAL6));
_form->set_parametri(_mask->get(F_CATVENLISTINO), _form->set_parametri(_mask->get(F_CATVENLISTINO),
_mask->get(F_CODLISTINO), _mask->get(F_CODLISTINO),
*_mask->get(F_REALE_GIAC)=='G', *_mask->get(F_REALE_GIAC)=='R',
*_mask->get(F_FIN_COMP)=='C' *_mask->get(F_FIN_COMP)=='C'
); );