Patch level : 4.0 911
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 1010 git-svn-id: svn://10.65.10.50/trunk@16332 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5f5d0c6853
commit
2c18acdc65
@ -30,7 +30,6 @@
|
||||
|
||||
enum seltype { by_num, by_date };
|
||||
enum expltype { mat_base, scalare};
|
||||
enum valtype { no_val, last_cost, average_cost, pond_cost, last2cost, std_cost, LIFO_annuale, LIFO_storico, FIFO_annuale, FIFO_storico ,prezzo_listino};
|
||||
|
||||
struct _ParmStruct
|
||||
{
|
||||
@ -1025,6 +1024,9 @@ void TExplode_distinta_form::set_explosion_rows(TArray& exp_array)
|
||||
const int rows = exp_array.items();
|
||||
real r;
|
||||
TString k;
|
||||
TString noexplode_path("*****");
|
||||
const bool dettagliata = _p->_advanced_val;
|
||||
|
||||
|
||||
for (int i = 0; i < rows; i++)
|
||||
{
|
||||
@ -1044,11 +1046,27 @@ void TExplode_distinta_form::set_explosion_rows(TArray& exp_array)
|
||||
const TString& liv = is_head ? _d->liv() : re.giacenza();
|
||||
|
||||
// Il fabbisogno e': nr. componenti di questo articolo per residuo da produrre del padre
|
||||
|
||||
if (_p->_fabbisogno && _p->_explosion == scalare)
|
||||
r = re.last_qta() * res2produce_by_father(re); // In UM locale...
|
||||
else
|
||||
r = re.val() * res2produce_by_father(re); // In UM locale...
|
||||
|
||||
if (dettagliata && re.path().starts_with(noexplode_path))
|
||||
r = ZERO;
|
||||
else
|
||||
if (_p->_fabbisogno && _p->_explosion == scalare)
|
||||
r = re.last_qta() * res2produce_by_father(re); // In UM locale...
|
||||
else
|
||||
r = re.val() * res2produce_by_father(re); // In UM locale...
|
||||
|
||||
if (dettagliata && tipo == 'A')
|
||||
{
|
||||
TArticolo_giacenza & art = TExplode_distinta_form::cache_articoli().art(re.articolo());
|
||||
const valtype art_tipo = (valtype)art.get_int(ANAMAG_VALDIST);
|
||||
|
||||
if (art_tipo > no_val)
|
||||
{
|
||||
const TDate inizio_val = art.get_date(ANAMAG_DATAVDIST);
|
||||
if (_p->_obs_date >= inizio_val)
|
||||
noexplode_path = re.path();
|
||||
}
|
||||
}
|
||||
|
||||
if (r == ZERO)
|
||||
{
|
||||
|
@ -25,9 +25,11 @@ class TValorizzazione_mask : public TAutomask
|
||||
TAssoc_array _risultati;
|
||||
|
||||
TDistinta_tree _tree;
|
||||
int _tipoval;
|
||||
valtype _tipoval;
|
||||
TString4 _annoes,_catven, _codlist ;
|
||||
TString8 _codmag;
|
||||
TDate _data;
|
||||
bool _dettagliata;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
@ -44,10 +46,12 @@ public:
|
||||
real TValorizzazione_mask::valore(const TCodice_articolo& dis, const char* liv)
|
||||
{
|
||||
real total;
|
||||
|
||||
|
||||
if (dis.not_empty())
|
||||
{
|
||||
TString80 cod = dis;
|
||||
bool explode = true;
|
||||
|
||||
if (liv && *liv)
|
||||
cod << ',' << liv;
|
||||
|
||||
@ -60,16 +64,35 @@ real TValorizzazione_mask::valore(const TCodice_articolo& dis, const char* liv)
|
||||
add_magcode(codmagdep, get(F_CODMAG));
|
||||
add_depcode(codmagdep, get(F_CODDEP));
|
||||
_tree.set_global("_MAGDEP", codmagdep);
|
||||
const char tipo = _tree.get_type(dis);
|
||||
valtype tipoval = _tipoval;
|
||||
|
||||
if (_tree.set_root(dis))
|
||||
if (_dettagliata && tipo == 'A')
|
||||
{
|
||||
const TRectype & rec = cache().get(LF_ANAMAG, dis);
|
||||
|
||||
const valtype art_tipo = (valtype)rec.get_int(ANAMAG_VALDIST);
|
||||
|
||||
if (art_tipo > no_val)
|
||||
{
|
||||
const TDate inizio_val = rec.get_date(ANAMAG_DATAVDIST);
|
||||
|
||||
explode = _data < inizio_val;
|
||||
if (!explode)
|
||||
tipoval = art_tipo;
|
||||
}
|
||||
}
|
||||
|
||||
if (explode &&_tree.set_root(dis))
|
||||
{
|
||||
TArray boom;
|
||||
// Esplosione ai materiali di base
|
||||
// raggruppati alla unita' di misura di riferimento
|
||||
_tree.explode(boom, TRUE, RAGGR_EXP_BASE);
|
||||
_tree.explode(boom, false, RAGGR_EXP_BASE, 1);
|
||||
for (int r = boom.last(); r >= 0; r--)
|
||||
{
|
||||
const TRiga_esplosione& esp = (const TRiga_esplosione&)boom[r];
|
||||
|
||||
const real value = esp.val() * valore(esp.articolo(), esp.giacenza());
|
||||
total += value;
|
||||
}
|
||||
@ -78,13 +101,12 @@ real TValorizzazione_mask::valore(const TCodice_articolo& dis, const char* liv)
|
||||
}
|
||||
else
|
||||
{
|
||||
const char tipo = _tree.get_type(dis);
|
||||
switch (tipo)
|
||||
{
|
||||
case 'A':
|
||||
{
|
||||
const TArticolo_giacenza art(dis);
|
||||
switch (_tipoval)
|
||||
switch (tipoval)
|
||||
{
|
||||
case 0: total = art.ultimo_costo(_annoes); break;
|
||||
case 1: total = art.media_costi(_annoes); break;
|
||||
@ -130,9 +152,12 @@ void TValorizzazione_mask::elabora()
|
||||
rec_to.put ("CODDIST", get(F_DIST_TO));
|
||||
|
||||
_annoes = get(F_ANNOES);
|
||||
_tipoval = get_int(F_TIPO);
|
||||
_tipoval = (valtype) get_int(F_TIPO);
|
||||
_catven = get(F_CATVEN_LIST);
|
||||
_codlist = get(F_CODLIST);
|
||||
_data = get_date(F_DATA);
|
||||
_dettagliata = get_bool(F_DETTAGLIATA);
|
||||
|
||||
|
||||
TRelation rel(LF_DIST);
|
||||
TCursor cur(&rel);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define F_LINEA 110
|
||||
|
||||
#define F_PREVIEW 111
|
||||
#define F_DETTAGLIATA 112
|
||||
#define F_CATVEN_LIST 120
|
||||
#define F_CODLIST 121
|
||||
|
||||
|
@ -152,6 +152,11 @@ BEGIN
|
||||
MESSAGE HIDE,G_LISTINO@
|
||||
END
|
||||
|
||||
BOOELAN F_DETTAGLIATA
|
||||
BEGIN
|
||||
PROMPT 2 7 "Dettagliata"
|
||||
END
|
||||
|
||||
STRING F_CATVEN_LIST 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat.ven. "
|
||||
|
@ -108,7 +108,9 @@ void TQuantita::copy(const TQuantita& q)
|
||||
|
||||
void TQuantita::convert(real& val, const TCodice_um& from_um, const TCodice_um& to_um) const
|
||||
{
|
||||
CHECK(!from_um.blank() && !to_um.blank(), "Unita' di misura nulla");
|
||||
// CHECK(!from_um.blank() && !to_um.blank(), "Unita' di misura nulla");
|
||||
if (from_um.blank() || to_um.blank())
|
||||
return;
|
||||
if (from_um != to_um && !val.is_zero())
|
||||
{
|
||||
const fraction& mul = get_factor(from_um);
|
||||
@ -930,7 +932,7 @@ bool TDistinta_tree::is_cyclic(const TToken_string& path) const
|
||||
isola_codice((TToken_string &)_tmp);
|
||||
if (_tmp == mycod)
|
||||
{
|
||||
cyclic = TRUE;
|
||||
cyclic = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,8 @@
|
||||
// TCodice_articolo
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
enum valtype { no_val, last_cost, average_cost, pond_cost, last2cost, std_cost, LIFO_annuale, LIFO_storico, FIFO_annuale, FIFO_storico ,prezzo_listino};
|
||||
|
||||
// Codice articolo di magazzino (equivale ad una TString20 )
|
||||
class TCodice_articolo : public TFixed_string
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ void TPlann_sub_mask::copy_fields_from()
|
||||
TSheet_field & sfld = (TSheet_field & )fld(i);
|
||||
CHECK(_m->field(dlg).is_sheet(),"Impossibile copiare un campo non sheet su uno sheet");
|
||||
TSheet_field & srcfld = _m->sfield(dlg);
|
||||
for (int it = 0; it < srcfld.items(); it++)
|
||||
for (int it = 0; it <srcfld.items(); it++)
|
||||
{
|
||||
const TToken_string & r=srcfld.row(it);
|
||||
sfld.row(it) = r;
|
||||
@ -681,6 +681,20 @@ bool TPlanning_mask::carica_documenti()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skip)
|
||||
{
|
||||
const TRectype * doc = riga.find_original_doc();
|
||||
|
||||
if (doc != NULL)
|
||||
{
|
||||
const int stato = doc->get_int(DOC_STATO);
|
||||
|
||||
if (test_status(*doc, tn) < 0)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
line = _articles.find(cli, art, liv, imp, lin, mag, magc, da_rdoc_key, true);
|
||||
}
|
||||
|
||||
@ -770,10 +784,6 @@ bool TPlanning_mask::carica_documenti()
|
||||
}
|
||||
line->qta(buck) += q.val();
|
||||
}
|
||||
// else
|
||||
// if (art == "008BTN003013CAON")
|
||||
// int i = 1;
|
||||
|
||||
real price;
|
||||
find_price(get(F_TIPOCV),get(F_CODCONDV),get(F_CATVEN_CV),
|
||||
get(F_TIPOCF), cli, art, line->qta(buck), price);
|
||||
@ -2330,10 +2340,10 @@ int TPlanning_mask::init_bucket0(TArticolo_giacenza &art, int r)
|
||||
bool TPlanning_mask::do_test_art_row(int r, int first, int last, bool signal)
|
||||
{
|
||||
TSheet_field& sf = sfield(F_ARTICOLI);
|
||||
TMask& smask= sf.sheet_mask();
|
||||
TToken_string& curr_row = sf.row(r);
|
||||
TToken_string& constr_row = sf.row(first-1);
|
||||
TToken_string& giac_row = sf.row(first);
|
||||
TMask & smask= sf.sheet_mask();
|
||||
TToken_string & curr_row=sf.row(r);
|
||||
TToken_string & constr_row=sf.row(first-1);
|
||||
TToken_string & giac_row=sf.row(first);
|
||||
|
||||
// **********
|
||||
// setta la priorita' e la linea su tutte le righe del blocco
|
||||
|
@ -858,7 +858,7 @@ void TMSP_constraint::fill_sheet_row(TToken_string& row, const TMask & m, const
|
||||
const TString80 da_rdoc_key(da_rdoc_key());
|
||||
|
||||
if (da_rdoc_key.full())
|
||||
val << ' ' << SAFE_PIPE_CHR << ' ' << da_rdoc_key;
|
||||
val << '¦' << da_rdoc_key;
|
||||
|
||||
if ((descr == NULL || *descr == '\0') && __userflds != NULL && __userflds->full())
|
||||
{
|
||||
@ -872,12 +872,18 @@ void TMSP_constraint::fill_sheet_row(TToken_string& row, const TMask & m, const
|
||||
const TString & fldval = anamag.get(fldname);
|
||||
|
||||
if (fldval.full())
|
||||
userdesc << fldval << __sep;
|
||||
{
|
||||
if (userdesc.full())
|
||||
userdesc << __sep;
|
||||
userdesc << fldval;
|
||||
}
|
||||
}
|
||||
userdesc << " ";
|
||||
if (userdesc.full())
|
||||
userdesc << ", ";
|
||||
val.insert(userdesc);
|
||||
}
|
||||
row.add(val, F_DESCART-FIRST_FIELD);
|
||||
row.add(val, F_DESCART-FIRST_FIELD);
|
||||
row.add(codimp(),F_CODIMP-FIRST_FIELD);
|
||||
row.add(codlin(),F_CODLIN-FIRST_FIELD);
|
||||
|
||||
//TString8 str = _codmag.left(3);
|
||||
@ -1285,7 +1291,7 @@ TMSP_constraint* TMSP_constraints::find(const TToken_string& row, bool create)
|
||||
_key << str;
|
||||
_key.strip_spaces();
|
||||
row.get(F_DESCART-FIRST_FIELD, str);
|
||||
const int pos = str.find(SAFE_PIPE_CHR);
|
||||
const int pos = str.find('¦');
|
||||
|
||||
if (pos >= 0)
|
||||
_key.add(str.mid(pos +1));
|
||||
@ -1416,7 +1422,7 @@ TMSP_line* TMSP_lines::find(const TToken_string& row, bool create)
|
||||
}
|
||||
}
|
||||
row.get(F_DESCART-FIRST_FIELD, str);
|
||||
const int pos = str.find(SAFE_PIPE_CHR);
|
||||
const int pos = str.find('¦');
|
||||
|
||||
if (pos >= 0)
|
||||
_key.add(str.mid(pos +1));
|
||||
@ -1707,10 +1713,10 @@ bool TLista_docref::edit_checked()
|
||||
action.set("Action","MODIFY","Transaction");
|
||||
action.set_paragraph(format("%d",LF_DOC));
|
||||
TToken_string & rw = row(r);
|
||||
action.set(DOC_PROVV,"D");
|
||||
action.set(DOC_ANNO,rw.get(1));
|
||||
action.set(DOC_CODNUM,rw.get(2));
|
||||
action.set(DOC_NDOC,rw.get(3));
|
||||
action.set("PROVV","D");
|
||||
action.set("ANNO",rw.get(1));
|
||||
action.set("CODNUM",rw.get(2));
|
||||
action.set("NDOC",rw.get(3));
|
||||
}
|
||||
TExternal_app editdoc(format("VE0 -1 -i%s",(const char *)ininame));
|
||||
editdoc.run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user