Patch level : 10.0 214
Files correlati : lv3.exe Ricompilazione Demo : [ ] Commento : Rivisto il meccanismo di calcolo delle dotazioni git-svn-id: svn://10.65.10.50/trunk@18103 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
be32b4ceba
commit
9b10ce1dc0
@ -124,19 +124,25 @@ bool TGiac_per_cli::load_row(const TRiga_documento& rdoc)
|
|||||||
if (cau.get_bool("B0"))
|
if (cau.get_bool("B0"))
|
||||||
{
|
{
|
||||||
const TCausale_magazzino & rit = cached_causale_magazzino(cau.get("S1"));
|
const TCausale_magazzino & rit = cached_causale_magazzino(cau.get("S1"));
|
||||||
|
const real & ritirato = rdoc.get_real(RDOC_QTAGG1);
|
||||||
|
int st = rit.sgn(s_dottm);
|
||||||
|
int so = rit.sgn(s_dotod);
|
||||||
|
|
||||||
vartmp += rit.sgn(s_dottm) * rdoc.get_int(RDOC_QTAGG1);
|
vartmp += real(st) * ritirato;
|
||||||
vardot += rit.sgn(s_dotod) * rdoc.get_int(RDOC_QTAGG1);
|
vardot += real(so) * ritirato;
|
||||||
}
|
}
|
||||||
if (cau.get_bool("B1"))
|
if (cau.get_bool("B1"))
|
||||||
{
|
{
|
||||||
const TCausale_magazzino & con = cached_causale_magazzino(cau.get("S2"));
|
const TCausale_magazzino & con = cached_causale_magazzino(cau.get("S2"));
|
||||||
|
const real & consegnato = rdoc.get_real(RDOC_QTA);
|
||||||
|
int st = con.sgn(s_dottm);
|
||||||
|
int so = con.sgn(s_dotod);
|
||||||
|
|
||||||
vartmp += con.sgn(s_dottm) * rdoc.get_int(RDOC_QTA);
|
vartmp += real(st) * consegnato;
|
||||||
vardot += con.sgn(s_dotod) * rdoc.get_int(RDOC_QTA);
|
vardot += real(so) * consegnato;
|
||||||
}
|
}
|
||||||
dotmp += vartmp;
|
dotmp -= vartmp;
|
||||||
dotazione += vardot;
|
dotazione -= vardot;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,14 +164,16 @@ real TGiac_per_cli::giac_att(TRiga_documento& rdoc, bool odierna)
|
|||||||
if (cau.get_bool("B0"))
|
if (cau.get_bool("B0"))
|
||||||
{
|
{
|
||||||
const TCausale_magazzino & rit = cached_causale_magazzino(cau.get("S1"));
|
const TCausale_magazzino & rit = cached_causale_magazzino(cau.get("S1"));
|
||||||
|
const int s = rit.sgn(odierna ? s_dotod : s_dottm);
|
||||||
|
|
||||||
saldo += rit.sgn(odierna ? s_dotod : s_dottm) * rdoc.get_int(RDOC_QTAGG1);
|
saldo += real(s) * rdoc.get_real(RDOC_QTAGG1);
|
||||||
}
|
}
|
||||||
if (cau.get_bool("B1"))
|
if (cau.get_bool("B1"))
|
||||||
{
|
{
|
||||||
const TCausale_magazzino & con = cached_causale_magazzino(cau.get("S2"));
|
const TCausale_magazzino & con = cached_causale_magazzino(cau.get("S2"));
|
||||||
|
const int s = con.sgn(odierna ? s_dotod : s_dottm);
|
||||||
|
|
||||||
saldo += con.sgn(odierna ? s_dotod : s_dottm) * rdoc.get_int(RDOC_QTA);
|
saldo += real(s) * rdoc.get_real(RDOC_QTA);
|
||||||
}
|
}
|
||||||
giac += saldo;
|
giac += saldo;
|
||||||
|
|
||||||
@ -409,17 +417,21 @@ bool TGestione_bolle_msk::lv_ritirato_handler(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
TMask& msk = f.mask();
|
TMask& msk = f.mask();
|
||||||
real ritirato = f.get();
|
real ritirato = f.get();
|
||||||
if (msk.field(FR_QTA).enabled() && msk.field(FR_QTA).empty())
|
|
||||||
{
|
|
||||||
arrotonda(msk,ritirato);
|
|
||||||
msk.set(FR_QTA,ritirato);
|
|
||||||
}
|
|
||||||
|
|
||||||
//gestione campi dotazione odierna e dotazione temporanea
|
|
||||||
TSheet_field* sheet = msk.get_sheet();
|
TSheet_field* sheet = msk.get_sheet();
|
||||||
TDocumento_mask& dmask = (TDocumento_mask&)sheet->mask();
|
TDocumento_mask& dmask = (TDocumento_mask&)sheet->mask();
|
||||||
TRiga_documento& rdoc = dmask.doc()[sheet->selected()+1];
|
TRiga_documento& rdoc = dmask.doc()[sheet->selected()+1];
|
||||||
|
|
||||||
rdoc.put(RDOC_QTAGG1,ritirato);
|
rdoc.put(RDOC_QTAGG1,ritirato);
|
||||||
|
if (msk.field(FR_QTA).enabled() && msk.field(FR_QTA).empty())
|
||||||
|
{
|
||||||
|
real consegnato = ritirato;
|
||||||
|
arrotonda(msk, consegnato);
|
||||||
|
msk.set(FR_QTA, consegnato, 0x3);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//gestione campi dotazione odierna e dotazione temporanea
|
||||||
|
|
||||||
|
|
||||||
TGiac_per_cli& giac = gbapp().giacenza();
|
TGiac_per_cli& giac = gbapp().giacenza();
|
||||||
real dotod = giac.giac_att(rdoc, true);
|
real dotod = giac.giac_att(rdoc, true);
|
||||||
@ -450,7 +462,7 @@ bool TGestione_bolle_msk::lv_consegnato_handler(TMask_field& f, KEY k)
|
|||||||
TSheet_field* sheet = msk.get_sheet();
|
TSheet_field* sheet = msk.get_sheet();
|
||||||
TDocumento_mask& dmask = (TDocumento_mask&)sheet->mask();
|
TDocumento_mask& dmask = (TDocumento_mask&)sheet->mask();
|
||||||
TRiga_documento& rdoc = dmask.doc()[sheet->selected()+1];
|
TRiga_documento& rdoc = dmask.doc()[sheet->selected()+1];
|
||||||
rdoc.put(RDOC_QTAGG1,consegnato);
|
rdoc.put(RDOC_QTA, consegnato);
|
||||||
|
|
||||||
TGiac_per_cli& giac = gbapp().giacenza();
|
TGiac_per_cli& giac = gbapp().giacenza();
|
||||||
real dotod = giac.giac_att(rdoc, true);
|
real dotod = giac.giac_att(rdoc, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user