Patch level : 10.0 592

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

Corretto valore convenzionale per articolo


git-svn-id: svn://10.65.10.50/trunk@20031 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-01-31 13:20:35 +00:00
parent 9507373884
commit 516de017a4
4 changed files with 41 additions and 13 deletions

View File

@ -693,15 +693,15 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
if (arts.objptr(codart) == NULL)
{
const TString4 tipodot = rcont.get(LVRCONDV_NOLCIC);
TArticolo_lavanderie& artlav = cached_article_laundry(codart, 'C', clifo, use_indsp ? indsped : 0);
TArticolo_lavanderie& art = cached_article_laundry(codart, 'C', clifo, use_indsp ? indsped : 0);
//estraggo il record corrispondente su LF_CLIFOGIAC
const TRecmag_lavanderie& reclav = artlav.find_rec(annoes);
const TRecmag_lavanderie& rec = art.find_rec(annoes);
//se lo trovo e se il tipo dotazione è iniziale 'I', allora leggo la dotazione iniziale
//dalle giacenze articolo per cliente, altrimenti leggo la dotazione odierna
if (tipodot == "I")
dot = reclav.get_real("DOTIN");
dot = rec.get_real("DOTIN");
else
dot = reclav.get_real("DOTOD");
dot = rec.get_real("DOTOD");
const real impconv = dot * rcont.get_real(LVRCONDV_VALCONV) * rcont.get_real(LVRCONDV_FORFPERCL) / CENTO;
impconvtot += impconv;
arts.add(codart, codart);
@ -729,6 +729,7 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
}
else
{
rout.put(RDOC_DESCR, "Valore convenzionale");
rout.put(RDOC_QTA, UNO);
rout.put(RDOC_PREZZO, impconvtot);
for (int k = doc.physical_rows(); k > i; k--)

View File

@ -562,6 +562,33 @@ const TString & TArticolo_lavanderie::get_str(const char* fieldname) const
return EMPTY_STRING;
}
void TArticolo_lavanderie::set_tipocf(char tipocf)
{
if (_tipocf != tipocf)
{
_tipocf = tipocf;
remove_body(LF_CLIFOGIAC);
}
}
void TArticolo_lavanderie::set_codcf(long codcf)
{
if (_codcf != codcf)
{
_codcf = codcf;
remove_body(LF_CLIFOGIAC);
}
}
void TArticolo_lavanderie::set_indsped(int indsped)
{
if (_indsped != indsped)
{
_indsped = indsped;
remove_body(LF_CLIFOGIAC);
}
}
void TArticolo_lavanderie::set_body_key(TRectype & rowrec)
{
const int logicnum = rowrec.num();
@ -716,6 +743,7 @@ TArticolo_lavanderie & cached_article_laundry(const char * codart, const char ti
{
HIDDEN TCache_articoli_lavanderie __cache_articoli_lavanderie;
TArticolo_lavanderie & art = __cache_articoli_lavanderie.lav(codart);
art.set_tipocf(tipocf);

View File

@ -129,9 +129,9 @@ public:
TRecord_array & clifomag(int annoes) const;
TRecord_array & clifomag(const char * annoes) const { return clifomag(atoi(annoes));}
void set_tipocf(char tipocf) { _tipocf = tipocf;}
void set_codcf(long codcf) { _codcf = codcf;}
void set_indsped(int indsped) { _indsped = indsped;}
void set_tipocf(char tipocf);
void set_codcf(long codcf);
void set_indsped(int indsped);
const TRecmag_lavanderie & find_rec(int annoes) const;
const TRecmag_lavanderie & find_rec(const char * annoes) const { return find_rec(atoi(annoes)); }

View File

@ -1265,15 +1265,14 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
const TRectype & caulav = cache().get("&LVCAU", codcauslav);
if (!caulav.empty())
{
if (!qta.is_zero())
if (!qta.is_zero() && (j > 1))
{
const TString & causcons = caulav.get("S2");
CHECK(j > 1, "Wrong row number");
if (causcons.full())
mov[LF_RMOVMAG][j - 1].put(RMOVMAG_CODCAUS, causcons);
else
mov.destroy_row(--j, true);
if (causcons.full())
mov[LF_RMOVMAG][j - 1].put(RMOVMAG_CODCAUS, causcons);
else
mov.destroy_row(--j, true);
}
const real qtarit = r.get(RDOC_QTAGG1);