Patch level : 10.0

Files correlati     : ba0.exe
Ricompilazione Demo : [ ]
Commento            :

contratti


git-svn-id: svn://10.65.10.50/trunk@18950 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-05-27 14:55:51 +00:00
parent cb421225d2
commit f43031f1a1
2 changed files with 27 additions and 46 deletions

View File

@ -96,37 +96,37 @@ bool TContratti_msk::on_art_select()
rowmask.field(S_DOTTMP).disable();
}
if (rowmask.get(S_UM).blank() && artrec.um().rows() > 0)
{
const TString& um = artrec.um()[1].get(UMART_UM);
rowmask.set(S_UM, um);
}
//se esiste il record su LF_CLIFOGIAC, recupero l'unità di misura dalla riga dello sheet selezionata
//e setto i campi delle dotazioni e dei consegnati ai valori corretti riportati alla giusta unità di misura
if (!reclav.empty())
{
const TString4 umcont(row.get(ss.cid2index(S_UM))); //unità di misura
if (rowmask.get(S_DOTIN).blank())
{
//calcolo dotazione iniziale, scritta sia sulla maschera che sullo sheet
const real dotin = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTIN), umcont);
const real dotin = reclav.get_real(CLIFOGIAC_DOTIN);
rowmask.set(S_DOTIN, dotin);
row.add(dotin.stringa(), ss.cid2index(S_DOTIN));
//calcolo dotazione odierna, scritta sia sulla maschera che sullo sheet
const real dotod = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTOD),umcont);
const real dotod = reclav.get_real(CLIFOGIAC_DOTOD);
rowmask.set(S_DOTOD, dotod);
row.add(dotod.stringa(), ss.cid2index(S_DOTOD));
//calcolo dotazione temporanea, scritta sia sulla maschera che sullo sheet
const real dottmp = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTTM),umcont);
const real dottmp = reclav.get_real(CLIFOGIAC_DOTTM);
rowmask.set(S_DOTTMP, dottmp);
row.add(dottmp.stringa(), ss.cid2index(S_DOTTMP));
}
//calcolo consegnato anno, scritto sia sulla maschera che sullo sheet
const real consyear = artrec.convert_to_um(reclav.get_real("CONSANNO"),umcont);
const real consyear = reclav.get_real("CONSANNO");
rowmask.set(S_CONSANNO, consyear);
row.add(consyear.stringa(), ss.cid2index(S_CONSANNO));
//calcolo consegnato mese, scritto sia sulla maschera che sullo sheet
const real consmonth = artrec.convert_to_um(reclav.get_real("CONSMESE"),umcont);
const real consmonth = reclav.get_real("CONSMESE");
rowmask.set(S_CONSMESE, consmonth);
row.add(consmonth.stringa(), ss.cid2index(S_CONSMESE));
}
//instanzio una cache sull'anagrafica di magazzino
//per leggere il valore di PPCONF corretto e sempre aggiornato
const TRectype& anamag = cache().get(LF_ANAMAG, codart);
@ -252,16 +252,7 @@ bool TContratti_msk::on_field_event(TOperable_field& o,TField_event e,long jolly
//se all'articolo è associata un'unità di misura, la propongo
//in automatico e richiamo il metodo ON_ART_SELECT(); altrimenti lo richiamo
//solo se è arrivato un fe_init al campo
TArticolo art(codart);
if (art.um().rows() > 0)
{
const TString& um = art.um()[1].get(UMART_UM);
m.set(S_UM,um);
TToken_string& row = ss.row(ss.selected());
row.add(o.get(),ss.cid2index(S_CODART));
row.add(um,S_UM);
on_art_select();
}
on_art_select();
}
else
if (e == fe_init)
@ -490,19 +481,19 @@ void TContratti_app::save_rows(const TMask& m)
if(!reclav.empty())
{
//riscrivo la dotazione iniziale convertita nell'unità di misura principale
const real dotin = artrec.convert_to_um(row->get(righe.cid2index(S_DOTIN)), NULL);
const real dotin = row->get(righe.cid2index(S_DOTIN));
reclav.put(CLIFOGIAC_DOTIN, dotin);
//riscrivo la dotazione odierna convertita nell'unità di misura principale
const real dotod = artrec.convert_to_um(row->get(righe.cid2index(S_DOTOD)), NULL);
const real dotod = row->get(righe.cid2index(S_DOTOD));
reclav.put(CLIFOGIAC_DOTOD, dotod);
//riscrivo la dotazione temporanea convertita nell'unità di misura principale
const real dottm = artrec.convert_to_um(row->get(righe.cid2index(S_DOTTMP)), NULL);
const real dottm = row->get(righe.cid2index(S_DOTTMP));
reclav.put(CLIFOGIAC_DOTTM, dottm);
//riscrivo il consegnato anno convertito nell'unità di misura principale
const real conan = artrec.convert_to_um(row->get(righe.cid2index(S_CONSANNO)), NULL);
const real conan = row->get(righe.cid2index(S_CONSANNO));
reclav.put(CLIFOGIAC_CONSANNO, conan);
reclav.rewrite_write(magcli);
@ -635,23 +626,21 @@ int TContratti_app::read(TMask& m)
//e setto i campi delle dotazioni e dei consegnati ai valori corretti riportati alla giusta unità di misura
if (!reclav.empty())
{
const TString4 umcont(row.get(righe.cid2index(S_UM))); //unità di misura
if (msk.get(S_DOTIN).blank())
{
//calcolo dotazione iniziale, scritta sia sulla maschera che sullo sheet
const real dotin = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTIN), umcont);
//rowmask.set(S_DOTIN, dotin);
row.add(dotin.stringa(), righe.cid2index(S_DOTIN));
const real dotin = reclav.get_real(CLIFOGIAC_DOTIN);
row.add(dotin.stringa(), righe.cid2index(S_DOTIN));
}
//calcolo dotazione odierna, scritta sia sulla maschera che sullo sheet
const real dotod = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTOD),umcont);
//rowmask.set(S_DOTOD, dotod);
row.add(dotod.stringa(), righe.cid2index(S_DOTOD));
const real dotod = reclav.get_real(CLIFOGIAC_DOTOD);
row.add(dotod.stringa(), righe.cid2index(S_DOTOD));
//calcolo dotazione temporanea, scritta sia sulla maschera che sullo sheet
const real dottmp = artrec.convert_to_um(reclav.get_real(CLIFOGIAC_DOTTM),umcont);
//rowmask.set(S_DOTTMP, dottmp);
row.add(dottmp.stringa(), righe.cid2index(S_DOTTMP));
const real dottmp = reclav.get_real(CLIFOGIAC_DOTTM);
row.add(dottmp.stringa(), righe.cid2index(S_DOTTMP));
}
//forzo una check_row
righe.check_row(righe.items()-1, 3);

View File

@ -640,15 +640,7 @@ END
STRING S_UM 2
BEGIN
PROMPT 25 3 "U.M."
USE LF_UMART KEY 2
JOIN UMS INTO CODTAB=UM
INPUT CODART S_CODART SELECT
INPUT UM S_UM
DISPLAY "U.M." UM
DISPLAY "Descrione@50" LF_TAB->S0
OUTPUT S_UM UM
FIELD UM
CHECKTYPE REQUIRED
FLAGS "D"
END
STRING S_DESCR 50 40