Patch level : 10.1026
Files correlati : db0.exe Ricompilazione Demo : [ ] Commento : Completata la modifica per avere una descrione di riga sulla distinta base git-svn-id: svn://10.65.10.50/branches/R_10_00@22269 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2c5a56cf7e
commit
f0b53ea023
@ -1198,8 +1198,14 @@ bool TDistinta_mask::on_distsheet_event(TOperable_field& o, TField_event e, long
|
||||
const TToken_string& row = sheet.row(m);
|
||||
row.get(F_CODART-FIRST_FIELD, code1);
|
||||
if (code == code1)
|
||||
if (!yesno_box("Il codice %s e' ripetuto alla riga %d,\ncontinuare ugualmente ?", (const char *) code, n + 1))
|
||||
{
|
||||
int k = noyesall_box("Il codice %s e' ripetuto alla riga %d,\ncontinuare ugualmente ?", (const char *) code, n + 1);
|
||||
if (k == K_NO)
|
||||
return false;
|
||||
else
|
||||
if (k == K_SPACE)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1265,7 +1271,7 @@ bool TDistinta_mask::on_distsheet_event(TOperable_field& o, TField_event e, long
|
||||
if (e == fe_modify)
|
||||
{
|
||||
TAutomask& m = (TAutomask&)o.mask();
|
||||
const TString& str = o.get();
|
||||
TString str = o.get(); str.replace(',', '.');
|
||||
if (str.not_empty())
|
||||
{
|
||||
TDistinta_expr expr;
|
||||
@ -1285,7 +1291,10 @@ bool TDistinta_mask::on_distsheet_event(TOperable_field& o, TField_event e, long
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str = expr.as_string(); str.replace('.', ',');
|
||||
o.set(expr.as_string());
|
||||
}
|
||||
}
|
||||
else
|
||||
return m.error_box(FR("Errore di sintassi: %s"), expr.last_token());
|
||||
@ -1337,7 +1346,7 @@ bool TDistinta_mask::on_parmsheet_event(TOperable_field& o, TField_event e, long
|
||||
{
|
||||
TString var;
|
||||
sf.row(sf.selected()).get(1,var);
|
||||
const TString& expr = o.get();
|
||||
TString expr = o.get(); expr.replace(',', '.');
|
||||
TDistinta_expr e;
|
||||
const TTypeexp exprtype = _tree.get_var_type(var);
|
||||
if (!e.set(expr, exprtype))
|
||||
@ -1746,6 +1755,7 @@ void TDistinta_app::load_memo(TMask& m, TToken_string& memo)
|
||||
if (equal > 0)
|
||||
row[equal] = SAFE_PIPE_CHR;
|
||||
row.insert(format(" %c",SAFE_PIPE_CHR),0);
|
||||
row.replace('.', ',');
|
||||
if (_tree.is_global(row.get(1)))
|
||||
row[0]='G';
|
||||
}
|
||||
@ -1760,6 +1770,9 @@ int TDistinta_app::read(TMask& m)
|
||||
TSheet_field& sheet = m.sfield(F_SHEET);
|
||||
FOR_EACH_SHEET_ROW(sheet, nrig, row)
|
||||
{
|
||||
TString s = row->get(sheet.cid2index(F_EXPR));
|
||||
s.replace('.' , ',');
|
||||
row->add(s, sheet.cid2index(F_EXPR));
|
||||
sheet.check_row(nrig);
|
||||
row->add(nrig+1, sheet.cid2index(F_SORT0));
|
||||
if (*row->get(sheet.cid2index(F_DESCOMP)) == '\0')
|
||||
@ -1823,7 +1836,7 @@ bool TDistinta_app::parms2rel(const TMask& m)
|
||||
var = row->get();
|
||||
if (!var.blank())
|
||||
{
|
||||
expr = row->get();
|
||||
expr = row->get(); expr.replace(',', '.');
|
||||
if (typ == 'G' && !_tree.is_global(var))
|
||||
error_box(FR("La variabile %s non e' una delle variabili globali. Consultare la documentazione del modulo Distinta Base"),(const char *)var);
|
||||
memo.add(var);
|
||||
@ -1844,6 +1857,9 @@ void TDistinta_app::remove_desc(const TMask& m)
|
||||
|
||||
FOR_EACH_SHEET_ROW(sf, r, row)
|
||||
{
|
||||
TString s = row->get(sf.cid2index(F_EXPR));
|
||||
s.replace(',' , '.');
|
||||
row->add(s, sf.cid2index(F_EXPR));
|
||||
const char type = row->get(sf.cid2index(F_TIPOCOMP))[0];
|
||||
const TString cod = row->get(sf.cid2index(F_CODART));
|
||||
TString descr;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "../mg/mglib.h"
|
||||
#include "../ve/velib.h"
|
||||
|
||||
#include "rdist.h"
|
||||
#include "dblib.h"
|
||||
#include <doc.h>
|
||||
#include <rdoc.h>
|
||||
@ -867,6 +868,24 @@ bool TExplode_distinta_form::validate(TForm_item &f, TToken_string &t)
|
||||
else
|
||||
if (code == "_DES")
|
||||
{
|
||||
TToken_string fa(re.path(), '~');
|
||||
TToken_string key(fa.get(0));
|
||||
TToken_string tmp("", '~');
|
||||
TString code;
|
||||
|
||||
TToken_string & p = (TToken_string &) re.path();
|
||||
p.get(-2, (TString &)tmp);
|
||||
tmp.get(2, code);
|
||||
key.add(code);
|
||||
|
||||
valore = cache().get(LF_RDIST, key, RDIST_DESCR);
|
||||
|
||||
if (valore.full())
|
||||
{
|
||||
f.set(valore);
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (tipo)
|
||||
{
|
||||
case 'A':
|
||||
@ -894,7 +913,8 @@ bool TExplode_distinta_form::validate(TForm_item &f, TToken_string &t)
|
||||
TString lv = re.giacenza();
|
||||
for (int l = livelli_giacenza().last_level(); l > 0 ; l--)
|
||||
lv.insert(" ",livelli_giacenza().packed_length(l));
|
||||
valore.insert(lv);
|
||||
if (lv.full())
|
||||
valore.insert(lv);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -967,7 +987,7 @@ bool TExplode_distinta_form::validate(TForm_item &f, TToken_string &t)
|
||||
}
|
||||
}
|
||||
f.set(valore);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
real TExplode_distinta_form::res2produce_by_father(TRiga_esplosione& re)
|
||||
|
@ -136,6 +136,7 @@ END
|
||||
BEGIN
|
||||
KEY "Descrizione componente"
|
||||
PROMPT 3 1 ""
|
||||
FIELD RDIST->DESCR
|
||||
FIELD ALIAS_ANAMAG_RIGHE@->DESCR
|
||||
FIELD ALIAS_LAV_RIGHE@->S0
|
||||
FIELD ALIAS_VAR_RIGHE@->S0
|
||||
|
11
db/dblib.cpp
11
db/dblib.cpp
@ -670,6 +670,7 @@ char TDistinta_tree::path_type(const TToken_string & path) const
|
||||
{
|
||||
path.get(-2, (TString &)_tmp);
|
||||
char ap = ((TToken_string &) _tmp).get_char(6);
|
||||
if (ap == ' ') ap = 'G';
|
||||
return ap;
|
||||
}
|
||||
|
||||
@ -759,11 +760,13 @@ const TString& TDistinta_tree::describe(const TCodice_articolo& codart) const
|
||||
|
||||
bool TDistinta_tree::describe(const TCodice_articolo& codart, TString& descr) const
|
||||
{
|
||||
static TRecord_cache __rdist_cache(LF_RDIST, 2);
|
||||
TToken_string key = codart;
|
||||
TToken_string key;
|
||||
TCodice_articolo code = codart;
|
||||
|
||||
key.add(TToken_string(_root, '~').get(0));
|
||||
descr = __rdist_cache.get(key, RDIST_DESCR);
|
||||
father_code(code);
|
||||
key.add(code);
|
||||
key.add(curr_comp(code));
|
||||
descr = cache().get(LF_RDIST, key, RDIST_DESCR);
|
||||
if (descr.not_empty())
|
||||
return TRUE;
|
||||
descr = cache().get(LF_ANAMAG, codart, ANAMAG_DESCR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user