Patch level : 12.0 426

Files correlati     : db0.exe db0500a.msk db0500b.msk db1.exe db1100a.msk

Attivata la descrizione della distinta in immissione
Copiato l’articolo nel codice distinta in ricerca
Impostata l’unità di misura nella pagina disponibilità dell’esplosione
Stampate la descrizione di distinta a e di riga nell’ esplosione








git-svn-id: svn://10.65.10.50/branches/R_10_00@24001 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2017-07-26 06:57:17 +00:00
parent d9284167a3
commit 57662b88e6
6 changed files with 102 additions and 41 deletions

View File

@ -241,7 +241,7 @@ protected:
void load_memo(TMask& m, TToken_string& memo); void load_memo(TMask& m, TToken_string& memo);
void remove_desc(const TMask& m); void remove_desc(TMask& m);
public: public:
TRelation& relation() { return *_therel; } TRelation& relation() { return *_therel; }
@ -1413,9 +1413,11 @@ bool TDistinta_mask::on_field_event(TOperable_field& o, TField_event e, long jol
case 'A': case 'A':
{ {
set(F_TIPO, "A", true); set(F_TIPO, "A", true);
const TArticolo mag(code); const TArticolo mag(code);
set(F_DESCR, mag.get(ANAMAG_DESCR));
if (get(F_DESCR).blank())
set(F_DESCR, mag.get(ANAMAG_DESCR));
set(F_PREZZO, mag.get(ANAMAG_COSTSTD)); set(F_PREZZO, mag.get(ANAMAG_COSTSTD));
set(F_PESO, mag.get(ANAMAG_PESO)); set(F_PESO, mag.get(ANAMAG_PESO));
set(F_UMP, mag.get(ANAMAG_UMP)); set(F_UMP, mag.get(ANAMAG_UMP));
@ -1426,7 +1428,9 @@ bool TDistinta_mask::on_field_event(TOperable_field& o, TField_event e, long jol
set(F_TIPO, "L", true); set(F_TIPO, "L", true);
const TLavorazione lav(code); const TLavorazione lav(code);
set(F_DESCR, lav.descr());
if (get(F_DESCR).blank())
set(F_DESCR, lav.descr());
set(F_UM, lav.um()); set(F_UM, lav.um());
set(F_PREZZO, lav.prezzo()); set(F_PREZZO, lav.prezzo());
} }
@ -1859,9 +1863,14 @@ bool TDistinta_app::parms2rel(const TMask& m)
return true; return true;
} }
void TDistinta_app::remove_desc(const TMask& m) void TDistinta_app::remove_desc(TMask& m)
{ {
TSheet_field& sf = m.sfield(F_SHEET); TSheet_field& sf = m.sfield(F_SHEET);
TString descr = cache().get(LF_ANAMAG, m.get(F_CODICE), ANAMAG_DESCR);
TString distdescr = m.get(F_DESCR);
if (descr == distdescr)
m.reset(F_DESCR);
FOR_EACH_SHEET_ROW(sf, r, row) FOR_EACH_SHEET_ROW(sf, r, row)
{ {
@ -1870,7 +1879,6 @@ void TDistinta_app::remove_desc(const TMask& m)
row->add(s, sf.cid2index(F_EXPR)); row->add(s, sf.cid2index(F_EXPR));
const char type = row->get(sf.cid2index(F_TIPOCOMP))[0]; const char type = row->get(sf.cid2index(F_TIPOCOMP))[0];
const TString cod = row->get(sf.cid2index(F_CODART)); const TString cod = row->get(sf.cid2index(F_CODART));
TString descr;
switch (type) switch (type)
{ {
@ -1897,7 +1905,7 @@ void TDistinta_app::remove_desc(const TMask& m)
int TDistinta_app::write(const TMask& m) int TDistinta_app::write(const TMask& m)
{ {
parms2rel(m); parms2rel(m);
remove_desc(m); remove_desc((TMask&)m);
int err = TRelation_application::write(m); int err = TRelation_application::write(m);
if (err == NOERR && get_relation()->lfile().get_bool("VIRTUALE")) if (err == NOERR && get_relation()->lfile().get_bool("VIRTUALE"))
{ {
@ -1911,7 +1919,7 @@ int TDistinta_app::write(const TMask& m)
int TDistinta_app::rewrite(const TMask& m) int TDistinta_app::rewrite(const TMask& m)
{ {
parms2rel(m); parms2rel(m);
remove_desc(m); remove_desc((TMask&)m);
int err = TRelation_application::rewrite(m); int err = TRelation_application::rewrite(m);
if (err == NOERR && get_relation()->lfile().get_bool("VIRTUALE")) if (err == NOERR && get_relation()->lfile().get_bool("VIRTUALE"))
{ {

View File

@ -90,6 +90,7 @@ BEGIN
OUTPUT F_CODICE CODART OUTPUT F_CODICE CODART
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
ADD RUN ve2 -3 ADD RUN ve2 -3
MESSAGE COPY,F_CODICE
FLAGS "U" FLAGS "U"
DEFAULT NONE DEFAULT NONE
END END

View File

@ -44,8 +44,8 @@ STRING F_DESCR 50
BEGIN BEGIN
PROMPT 2 2 "Descrizione " PROMPT 2 2 "Descrizione "
FIELD DESCR FIELD DESCR
GROUP 1 // GROUP 1
FLAGS "D" // FLAGS "D"
END END
ZOOM F_NOTE 50 ZOOM F_NOTE 50

View File

@ -860,21 +860,42 @@ bool TExplode_distinta_form::validate(TForm_item &f, TToken_string &t)
else else
if (code == "_DES") if (code == "_DES")
{ {
switch (tipo)
{ TToken_string fa(re.path(), '~');
case 'L': TToken_string key(fa.get(0));
{ TToken_string tmp("", '~');
const TLavorazione lav(re.articolo()); TString code;
valore = lav.descr();
} TToken_string & p = (TToken_string &) re.path();
break; p.get(-2, (TString &)tmp);
case 'V': tmp.get(2, code);
valore = cache().get(LF_DIST, re.articolo(), "DESCR");
break; if (code == "0")
default: valore = cache().get(LF_DIST, key, DIST_DESCR);
valore = cache().get(LF_ANAMAG, re.articolo(), ANAMAG_DESCR); else
break; {
} key.add(code); // ??????
valore = cache().get(LF_RDIST, key, RDIST_DESCR);
}
if (valore.blank())
{
switch (tipo)
{
case 'L':
{
const TLavorazione lav(re.articolo());
valore = lav.descr();
}
break;
case 'V':
valore = cache().get(LF_DIST, re.articolo(), "DESCR");
break;
default:
valore = cache().get(LF_ANAMAG, re.articolo(), ANAMAG_DESCR);
break;
}
}
if (livelli_giacenza().enabled()) if (livelli_giacenza().enabled())
{ {
TString lv = re.giacenza(); TString lv = re.giacenza();
@ -1666,10 +1687,12 @@ void TEsplosione_distinta_app::compile_list()
c.setregion(from,to); c.setregion(from,to);
const bool null_sel = _parameters._from_num.empty() || _parameters._to_num.empty(); const bool null_sel = _parameters._from_num.empty() || _parameters._to_num.empty();
const long items = null_sel ? 0L : c.items(); const long items = null_sel ? 0L : c.items();
TSheet_field& sa = (TSheet_field&) _mask->field(F_SHEETART);
int righe = sa.items();
if (items > 0) if (items+righe > 0)
{ {
TProgind p(items,TR("Estrazione distinte da esplodere da documenti...")); TProgind p(items+righe,TR("Estrazione distinte da esplodere da documenti..."));
c.freeze(); c.freeze();
for (c = 0L; c.pos() < items; ++c) for (c = 0L; c.pos() < items; ++c)
{ {
@ -1741,8 +1764,8 @@ void TEsplosione_distinta_app::compile_list()
// Aggiunge le righe dallo spreadsheet // Aggiunge le righe dallo spreadsheet
TSheet_field& sa = _mask->sfield(F_SHEETART); // sa = _mask->sfield(F_SHEETART);
const int righe = sa.items(); // righe = sa.items();
if (righe > 0) if (righe > 0)
{ {
TProgind p(righe,TR("Estrazione distinte da esplodere...")); TProgind p(righe,TR("Estrazione distinte da esplodere..."));

View File

@ -565,11 +565,14 @@ STRING F_CODDIS 20
BEGIN BEGIN
PROMPT 2 2 "Codice " PROMPT 2 2 "Codice "
USE LF_DIST SELECT VIRTUALE!="X" USE LF_DIST SELECT VIRTUALE!="X"
JOIN LF_UMART INTO CODART==CODDIST NRIGA==1
INPUT CODDIST F_CODDIS INPUT CODDIST F_CODDIS
DISPLAY "Codice@20" CODDIST DISPLAY "Codice@20" CODDIST
DISPLAY "Desrizione@50" DESCR DISPLAY "Desrizione@50" DESCR
DISPLAY "Unità di misura" UM
OUTPUT F_CODDIS CODDIST OUTPUT F_CODDIS CODDIST
OUTPUT F_DESCR DESCR OUTPUT F_DESCR DESCR
OUTPUT F_UMEXPR UM
CHECKTYPE NORMAL CHECKTYPE NORMAL
MESSAGE EMPTY CLEAR,F_LIV1|CLEAR,F_LIV2|CLEAR,F_LIV3|CLEAR,F_LIV4 MESSAGE EMPTY CLEAR,F_LIV1|CLEAR,F_LIV2|CLEAR,F_LIV3|CLEAR,F_LIV4
MESSAGE ENABLE, F_LIV1 MESSAGE ENABLE, F_LIV1

View File

@ -13,6 +13,7 @@
#include "../mg/umart.h" #include "../mg/umart.h"
#include "../mg/rmovmag.h" #include "../mg/rmovmag.h"
#include "../include/rdoc.h" #include "../include/rdoc.h"
#include "dist.h"
#include "rdist.h" #include "rdist.h"
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -764,8 +765,17 @@ bool TDistinta_tree::describe(const TCodice_articolo& codart, TString& descr) co
father_code(code); father_code(code);
key.add(code); key.add(code);
key.add(curr_comp(code));
descr = cache().get(LF_RDIST, key, RDIST_DESCR); const int ccomp = curr_comp(code);
if (ccomp == 0)
descr = cache().get(LF_DIST, codart, DIST_DESCR);
else
{
key.add(ccomp);
descr = cache().get(LF_RDIST, key, RDIST_DESCR);
}
if (descr.not_empty()) if (descr.not_empty())
return TRUE; return TRUE;
descr = cache().get(LF_ANAMAG, codart, ANAMAG_DESCR); descr = cache().get(LF_ANAMAG, codart, ANAMAG_DESCR);
@ -1704,12 +1714,12 @@ int TDistinta_tree::raggruppa(TArray& boom, TExplosion_grouping mode) const
{ {
for (int i = 0; i < boom.items(); i++) for (int i = 0; i < boom.items(); i++)
{ {
TRiga_esplosione& qta1 = (TRiga_esplosione&)boom[i]; TRiga_esplosione& row1 = (TRiga_esplosione&)boom[i];
if (mode == RAGGR_EXP_UMBASE || mode == RAGGR_EXP_BASE) if (mode == RAGGR_EXP_UMBASE || mode == RAGGR_EXP_BASE)
qta1.convert2umbase(); else row1.convert2umbase(); else
if (mode == RAGGR_EXP_UMDIST || mode == RAGGR_EXP_DIST) if (mode == RAGGR_EXP_UMDIST || mode == RAGGR_EXP_DIST)
qta1.convert2umdist(); row1.convert2umdist();
if (mode == RAGGR_EXP_UMBASE || if (mode == RAGGR_EXP_UMBASE ||
mode == RAGGR_EXP_UMDIST || mode == RAGGR_EXP_UMDIST ||
@ -1717,18 +1727,34 @@ int TDistinta_tree::raggruppa(TArray& boom, TExplosion_grouping mode) const
{ {
for (int j = boom.items()-1; j > i; j--) for (int j = boom.items()-1; j > i; j--)
{ {
TRiga_esplosione& qta2 = (TRiga_esplosione&)boom[j]; TRiga_esplosione& row2 = (TRiga_esplosione&)boom[j];
if (qta1.articolo() != qta2.articolo()) if (row1.articolo() != row2.articolo())
continue; continue;
if (mode == RAGGR_EXP_EACHUM && qta1.um() != qta2.um()) if (mode == RAGGR_EXP_EACHUM && row1.um() != row2.um())
continue; continue;
qta1 += qta2; row1 += row2;
boom.destroy(j, TRUE); boom.destroy(j, true);
} }
} }
} }
/* if (mode == RAGGR_EXP_UMBASE ||
mode == RAGGR_EXP_UMDIST ||
mode == RAGGR_EXP_EACHUM)
{
for (int i = 0; i < boom.items(); i++)
{
TRiga_esplosione& row = (TRiga_esplosione&)boom[i];
if (row.path().find("00.73.00.0030") > 0)
int i = 1;
if (row.path().find("00.73.00.0028") > 0)
int i = 1;
if (row.curr_qta() == ZERO)
boom.destroy(i,true);
}
} */
return boom.items(); return boom.items();
} }