1997-06-06 16:36:35 +00:00
|
|
|
|
#include "form.h"
|
|
|
|
|
#include "mglib.h"
|
1998-06-10 16:38:58 +00:00
|
|
|
|
#include "mg3frm.h"
|
|
|
|
|
#include "mg3msk.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
void TForm_stampemg::add_giaclev(TString &levname, int from, int to)
|
1997-06-06 16:36:35 +00:00
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
to=(to==0 ? (_tolivgiac ? _tolivgiac:livelli_giacenza().last_level()) : to);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
int lv=(from==0 ? 1: from );
|
|
|
|
|
for (; lv <to ; lv++) {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const TString & piece = livelli_giacenza().unpack_grpcode(relation()->lfile(LF_MAG).get("LIVELLO"),lv);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (piece.not_empty())
|
1997-07-07 10:18:20 +00:00
|
|
|
|
levname << '/' << piece ;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TForm_stampemg::gruppogiac(TForm_item &cf, TToken_string &s)
|
|
|
|
|
{
|
|
|
|
|
TString valore,levname;
|
|
|
|
|
int livello=atoi(s.get());
|
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (_fromlivgiac && livello == _fromlivgiac)
|
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
levname << livelli_giacenza().name(livello) << ' ' ;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore=livelli_giacenza().group_descr_packed(relation()->lfile(LF_MAG).get("LIVELLO"),livello);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
if (valore.empty())
|
1998-06-10 16:38:58 +00:00
|
|
|
|
valore = UNKNOWN_NAME;
|
|
|
|
|
cf.set(levname << valore);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TForm_stampemg::gruppoart(TForm_item &cf, TToken_string &s)
|
|
|
|
|
{
|
1997-07-07 10:18:20 +00:00
|
|
|
|
int lv=atoi(s.get());
|
1999-04-06 15:34:39 +00:00
|
|
|
|
TToken_string valore;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore=livelli_articolo().group_descr_packed(relation()->lfile(LF_ANAMAG).get("CODART"),lv);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (valore.empty())
|
|
|
|
|
{
|
|
|
|
|
valore.separator(',');
|
|
|
|
|
valore << "_USER,CODGRUPPOART," << lv;
|
|
|
|
|
validate(cf,valore);
|
|
|
|
|
valore.cut(0);
|
|
|
|
|
valore << '"' << cf.get() << '"';
|
|
|
|
|
}
|
|
|
|
|
cf.set(valore);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TForm_stampemg::codgruppogiac(TForm_item &cf, TToken_string &s)
|
|
|
|
|
{
|
|
|
|
|
TString valore,levname;
|
|
|
|
|
int livello=atoi(s.get());
|
|
|
|
|
if (_fromlivgiac && livello == _fromlivgiac)
|
|
|
|
|
{
|
|
|
|
|
levname=relation()->lfile(LF_MAG).get("CODART");
|
|
|
|
|
add_giaclev(levname,1,_fromlivgiac);
|
|
|
|
|
levname << ' ';
|
|
|
|
|
} else {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
levname << livelli_giacenza().name(livello) << ' ' ;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore=livelli_giacenza().unpack_grpcode(relation()->lfile(LF_MAG).get("LIVELLO"),livello);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (valore.empty())
|
|
|
|
|
valore = UNKNOWN_NAME;
|
|
|
|
|
cf.set(levname << valore);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TForm_stampemg::validate(TForm_item &cf, TToken_string &s)
|
|
|
|
|
{
|
1999-04-06 15:34:39 +00:00
|
|
|
|
static TString *last_um=NULL;
|
1999-04-26 15:58:05 +00:00
|
|
|
|
const TFixed_string code = s.get(0); // prende il primo parametro, il codice del messaggio
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1999-04-26 15:58:05 +00:00
|
|
|
|
if (code=="_USER")
|
|
|
|
|
{
|
|
|
|
|
const TFixed_string subcode = s.get();
|
|
|
|
|
TString valore,levname;
|
1997-07-07 10:18:20 +00:00
|
|
|
|
|
|
|
|
|
if (subcode=="GRUPPOGIAC") {
|
|
|
|
|
gruppogiac(cf,s);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
} else if (subcode=="GRUPPOART") {
|
1997-07-07 10:18:20 +00:00
|
|
|
|
gruppoart(cf,s);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
} else if (subcode=="CODGRUPPOGIAC") {
|
|
|
|
|
codgruppogiac(cf,s);
|
|
|
|
|
} else if (subcode=="CODGRUPPOART") {
|
1997-07-07 10:18:20 +00:00
|
|
|
|
int lv=atoi(s.get());
|
|
|
|
|
do {
|
|
|
|
|
valore=relation()->lfile(LF_ANAMAG).get("CODART");
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore.rpad(25).cut(livelli_articolo().packed_length(lv));
|
1997-07-07 10:18:20 +00:00
|
|
|
|
} while (--lv>0 && valore=="");
|
|
|
|
|
cf.set(valore);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
} else if (subcode=="CATMER") {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore=relation()->lfile(_ordering == mg_ragg_fisc ? -600 : (_ordering == mg_scat_merc ? -401 : -400)).get("S0");
|
1997-07-07 10:18:20 +00:00
|
|
|
|
cf.set(valore);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
} else if (subcode=="CODCATMER") {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore=relation()->lfile(LF_ANAMAG).get(_ordering == mg_ragg_fisc ? "RAGGFIS" : "GRMERC");
|
|
|
|
|
if (_ordering != mg_ragg_fisc)
|
1999-04-26 15:58:05 +00:00
|
|
|
|
{
|
|
|
|
|
valore.rpad(5);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
valore.cut(_ordering == mg_scat_merc ? 5 : 3);
|
1999-04-26 15:58:05 +00:00
|
|
|
|
}
|
1997-07-07 10:18:20 +00:00
|
|
|
|
cf.set(valore);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
} else if (subcode=="LIVELLIGIAC") {
|
1997-07-07 10:18:20 +00:00
|
|
|
|
int lv=_tolivgiac;
|
|
|
|
|
valore="";
|
|
|
|
|
do {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const TString & piece = livelli_giacenza().unpack_grpcode(relation()->lfile(LF_MAG).get("LIVELLO"),lv+1);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
if (piece.not_empty()) {
|
|
|
|
|
if (valore.not_empty())
|
|
|
|
|
valore << '/';
|
|
|
|
|
valore << piece ;
|
|
|
|
|
}
|
1999-10-22 10:00:18 +00:00
|
|
|
|
} while (lv++<livelli_giacenza().last_level());
|
1997-07-07 10:18:20 +00:00
|
|
|
|
if (valore!="")
|
1999-10-22 10:00:18 +00:00
|
|
|
|
levname=livelli_giacenza().name(_tolivgiac+1);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
else
|
|
|
|
|
levname="Giacenza";
|
|
|
|
|
cf.set(levname << ' ' << valore);
|
1998-05-27 13:41:48 +00:00
|
|
|
|
} else if (subcode=="VALIDATE_UM") {
|
|
|
|
|
/*CHECK(last_um,"Unit<69> di misura non definita");
|
|
|
|
|
if (last_um->blank())
|
|
|
|
|
cf.set("");
|
|
|
|
|
delete last_um;
|
|
|
|
|
last_um = NULL;*/
|
|
|
|
|
TForm_string &um_field=(TForm_string &)cf.form().find_field('B',odd_page,atoi(s.get()) );
|
|
|
|
|
if (*um_field.get()<=' ') // blank : not a valid UM!
|
|
|
|
|
cf.set("0");
|
|
|
|
|
} else if (subcode=="SAVE_UM") {
|
|
|
|
|
CHECK(FALSE,"SAVE_UM no more available");
|
|
|
|
|
} else if (subcode=="RESET_UM") {
|
|
|
|
|
TForm_string &dest=(TForm_string &)cf.form().find_field('B',odd_page,atoi(s.get()) );
|
|
|
|
|
dest.set("");
|
|
|
|
|
} else if (subcode=="COPY_UM") {
|
|
|
|
|
/*if (last_um==NULL)
|
|
|
|
|
last_um = new TString16(cf.get());
|
|
|
|
|
if (*last_um != cf.get())
|
|
|
|
|
{
|
|
|
|
|
// impossibile sommare le quantit<69> degli articoli per UM diverse
|
|
|
|
|
last_um->cut(0);
|
|
|
|
|
dest.set("");
|
|
|
|
|
cf.form().find_field('B',odd_page,FF_FLAGTOTQTA).set("0");
|
|
|
|
|
}*/
|
|
|
|
|
TForm_string &dest=(TForm_string &)cf.form().find_field('B',odd_page,atoi(s.get()) );
|
|
|
|
|
if (*dest.get() && strcmp(dest.get(),cf.get()) != 0)
|
|
|
|
|
{
|
|
|
|
|
// impossibile sommare le quantit<69> degli articoli per UM diverse
|
|
|
|
|
dest.set(" ");
|
|
|
|
|
//cf.form().find_field('B',odd_page,FF_FLAGTOTQTA).set("0");
|
|
|
|
|
} else {
|
|
|
|
|
// prima sommare le quantit<69> degli articoli per UM diverse
|
|
|
|
|
dest.set( cf.get() );
|
|
|
|
|
//cf.form().find_field('B',odd_page,FF_FLAGTOTQTA).set("0");
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-07-07 10:18:20 +00:00
|
|
|
|
return TRUE;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
} else
|
1997-07-07 10:18:20 +00:00
|
|
|
|
return TForm::validate(cf, s);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
void TForm_stampemg::set_ordering(const TTipo_ordinamento_mg t)
|
1997-06-06 16:36:35 +00:00
|
|
|
|
{
|
1999-04-06 15:34:39 +00:00
|
|
|
|
_ordering = t;
|
1997-07-07 10:18:20 +00:00
|
|
|
|
TForm_subsection &s=((TForm_subsection &)find_field('B',odd_page,"GRUPPI_CATMER"));
|
1999-04-06 15:34:39 +00:00
|
|
|
|
TString cond;
|
|
|
|
|
switch (_ordering)
|
|
|
|
|
{
|
|
|
|
|
default:
|
1999-10-22 10:00:18 +00:00
|
|
|
|
case mg_normale:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
cond = "CODART";
|
|
|
|
|
break;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
case mg_ragg_fisc:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
cond = "RAGGFIS";
|
|
|
|
|
break;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
case mg_cat_merc:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
cond = "GRMERC[1,3]";
|
|
|
|
|
break;
|
|
|
|
|
}
|
1997-07-07 10:18:20 +00:00
|
|
|
|
s.setcondition(cond,_strexpr);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
}
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
bool TForm_stampemg::setdett_perart(bool totaliart,int fromlivart,int livart,bool totaligiac,int fromlivgiac,int livgiac,bool showmag, bool showdep)
|
1997-06-06 16:36:35 +00:00
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const int last_artlev=livelli_articolo().last_level() ? livelli_articolo().last_level() : 1;
|
|
|
|
|
const int last_giaclev=livelli_giacenza().last_level();
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
|
|
|
|
if (totaliart) // voglio i totali di articolo
|
1998-06-10 16:38:58 +00:00
|
|
|
|
{
|
1999-04-06 15:34:39 +00:00
|
|
|
|
if (livart==0 && fromlivgiac==0)
|
|
|
|
|
livart=last_artlev; //
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (fromlivgiac==0)
|
|
|
|
|
fromlivart=last_artlev;
|
|
|
|
|
}
|
|
|
|
|
if (totaligiac) // voglio i totali di giacenza
|
|
|
|
|
{
|
|
|
|
|
if (livgiac==0 && livart==0)
|
|
|
|
|
livgiac=last_giaclev; //
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (fromlivart>livart)
|
|
|
|
|
livart=fromlivart;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
|
|
|
|
find_field('B',odd_page,"H_MAGAZZINO").enable(showmag && showdep);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
find_field('B',odd_page,"TOT_MAGAZZINO").show(showmag);
|
|
|
|
|
find_field('B',odd_page,"H_DEPOSITO").show(FALSE);
|
|
|
|
|
find_field('B',odd_page,"TOT_DEPOSITO").show(showdep);
|
|
|
|
|
return setdettaglio(TRUE,fromlivart,livart,fromlivgiac,livgiac,showmag||showdep);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
bool TForm_stampemg::setdett_permag(bool totaliart,int fromlivart,int livart,bool totaligiac,int fromlivgiac,int livgiac,bool showmag, bool showdep,bool showdett)
|
1997-06-06 16:36:35 +00:00
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const int last_artlev=livelli_articolo().last_level() ? livelli_articolo().last_level() : 1;
|
|
|
|
|
const int last_giaclev=livelli_giacenza().last_level();
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
|
|
|
|
if (totaliart) // voglio i totali di articolo
|
1998-06-10 16:38:58 +00:00
|
|
|
|
{
|
1999-04-06 15:34:39 +00:00
|
|
|
|
if (livart==0 && fromlivgiac==0)
|
|
|
|
|
livart=last_artlev; //
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (fromlivgiac==0)
|
|
|
|
|
fromlivart=last_artlev;
|
|
|
|
|
}
|
|
|
|
|
if (totaligiac) // voglio i totali di giacenza
|
|
|
|
|
{
|
|
|
|
|
if (livgiac==0 && livart==0)
|
|
|
|
|
livgiac=last_giaclev; //
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (fromlivart>livart)
|
|
|
|
|
livart=fromlivart;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-08-25 18:07:30 +00:00
|
|
|
|
find_field('B',odd_page,"H_MAGAZZINO").show(showmag && (showdep || showdett) );
|
1997-07-07 10:18:20 +00:00
|
|
|
|
find_field('B',odd_page,"TOT_MAGAZZINO").show(showmag);
|
1998-08-25 18:07:30 +00:00
|
|
|
|
|
|
|
|
|
find_field('B',odd_page,FF_DIVDEPOSITI).enable(showdep);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
find_field('B',odd_page,"H_DEPOSITO").show(showdep && showdett);
|
|
|
|
|
find_field('B',odd_page,"TOT_DEPOSITO").show(showdep);
|
|
|
|
|
return setdettaglio(showdett,fromlivart,livart,fromlivgiac,livgiac,FALSE);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
bool TForm_stampemg::setdettaglio(bool show, int fromlivart,int livart,int fromlivgiac,int livgiac,bool dettgiac)
|
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const int last_artlev=livelli_articolo().last_level() ? livelli_articolo().last_level() : 1;
|
|
|
|
|
const int last_giaclev=livelli_giacenza().last_level();
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
const int tolivart =min(( livart ? livart :last_artlev) ,last_artlev-1);
|
|
|
|
|
const int tolivgiac=min((livgiac ? livgiac :last_giaclev),last_giaclev );
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
1997-07-07 10:18:20 +00:00
|
|
|
|
_fromlivart=fromlivart;
|
|
|
|
|
_fromlivgiac=fromlivgiac;
|
|
|
|
|
_tolivart=livart;
|
|
|
|
|
_tolivgiac=livgiac;
|
|
|
|
|
// ***********
|
|
|
|
|
// abilita le sezioni dei livelli di codice
|
|
|
|
|
TForm_subsection &s1=(TForm_subsection &)find_field('B',odd_page,"H_ARTICOLO");
|
|
|
|
|
TForm_subsection &s2=(TForm_subsection &)find_field('B',odd_page,"TOT_ARTICOLO");
|
1998-04-30 14:59:47 +00:00
|
|
|
|
if (fromlivgiac==0 // non raggruppo a partire dai livelli di giacenza
|
1999-04-06 15:34:39 +00:00
|
|
|
|
&& (livart==0 || livart==last_artlev)) {
|
1998-06-10 16:38:58 +00:00
|
|
|
|
s1.show(show && (dettgiac || livgiac!=0) );
|
1997-07-07 10:18:20 +00:00
|
|
|
|
s2.show(show);
|
|
|
|
|
} else {
|
|
|
|
|
s1.hide();
|
|
|
|
|
s2.hide();
|
|
|
|
|
}
|
1998-04-30 14:59:47 +00:00
|
|
|
|
int i;
|
1997-07-07 10:18:20 +00:00
|
|
|
|
for (i=1; i<=FORM_MAXARTLEV; i++)
|
|
|
|
|
{
|
|
|
|
|
TString sname("TOT_GART");
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s1=(TForm_subsection &)find_field('B',odd_page,sname);
|
|
|
|
|
s1.show(show && i>=fromlivart && i<=tolivart && fromlivgiac==0);
|
|
|
|
|
sname="H_GCODART";
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s2=(TForm_subsection &)find_field('B',odd_page,sname);
|
|
|
|
|
s2.show(show && i>=fromlivart &&
|
1999-04-06 15:34:39 +00:00
|
|
|
|
(i<tolivart || (i==tolivart && (livart==0 || livart>tolivart || livgiac || dettgiac))) && fromlivgiac==0);
|
1997-07-07 10:18:20 +00:00
|
|
|
|
}
|
|
|
|
|
// abilita le sezioni del codice livelli giacenza
|
|
|
|
|
for (i=1; i<=FORM_MAXGIACLEV; i++)
|
|
|
|
|
{
|
|
|
|
|
TString sname("TOT_GLIVGIAC");
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s1=(TForm_subsection &)find_field('B',odd_page,sname);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
s1.show(show && i>=fromlivgiac && (i<=tolivgiac) && (livart==0));
|
1997-07-07 10:18:20 +00:00
|
|
|
|
sname="H_GLIVGIAC";
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s2=(TForm_subsection &)find_field('B',odd_page,sname);
|
|
|
|
|
s2.show(show && i>=fromlivgiac && (i<tolivgiac ||(i==tolivgiac && dettgiac)) && livart==0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***********
|
|
|
|
|
fromlivart = fromlivart ? fromlivart :1;
|
|
|
|
|
fromlivgiac=fromlivgiac ? fromlivgiac :1;
|
|
|
|
|
// codice livello giacenza
|
|
|
|
|
for (i=fromlivgiac;i<=tolivgiac ; i++) {
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (livart==0)
|
|
|
|
|
{
|
|
|
|
|
TString sname=("GRUPPI_LIVGIAC");
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,sname);
|
|
|
|
|
TString cond(s.condition());
|
1999-10-22 10:00:18 +00:00
|
|
|
|
cond << "+LIVELLO[" << livelli_giacenza().packed_length(i-1)+1 << "," << livelli_giacenza().packed_length(i) <<']';
|
1998-06-10 16:38:58 +00:00
|
|
|
|
s.setcondition(cond,_strexpr);
|
|
|
|
|
}
|
1997-07-07 10:18:20 +00:00
|
|
|
|
}
|
|
|
|
|
// sezioni livello codice
|
1998-06-10 16:38:58 +00:00
|
|
|
|
// for (i=fromlivart;i<=tolivart ; i++) {
|
|
|
|
|
for (i=1;i<=tolivart ; i++) {
|
1997-07-07 10:18:20 +00:00
|
|
|
|
TString sname("GRUPPI_CODART");
|
|
|
|
|
sname << i;
|
|
|
|
|
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,sname);
|
|
|
|
|
TString cond(s.condition());
|
1999-10-22 10:00:18 +00:00
|
|
|
|
cond << '[' << (i==1 ? 1:livelli_articolo().packed_length(i-1))<<',' << livelli_articolo().packed_length(i) <<']';
|
1997-07-07 10:18:20 +00:00
|
|
|
|
s.setcondition(cond,_strexpr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TForm_stampemg::TForm_stampemg(const char *name,const char *code)
|
1997-07-07 10:18:20 +00:00
|
|
|
|
: TForm(name,code)
|
1997-06-06 16:36:35 +00:00
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
// _giaclev= new TCodgiac_livelli();
|
|
|
|
|
// _artlev= new TCodart_livelli();
|
1997-07-07 10:18:20 +00:00
|
|
|
|
_fromlivgiac=_tolivgiac=0;
|
|
|
|
|
_fromlivart=_tolivart=0;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
_ordering = mg_normale;
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
TForm_stampemg::~TForm_stampemg()
|
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
// delete _giaclev;
|
|
|
|
|
// delete _artlev;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
}
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
|
|
|
|
// maschera delle stampe magazzino
|
|
|
|
|
|
|
|
|
|
void TStampemg_mask::enable_livellicodice()
|
|
|
|
|
{
|
|
|
|
|
int pos = id2pos(F_RAGGCODICE);
|
|
|
|
|
if (pos >= 0)
|
|
|
|
|
{
|
|
|
|
|
TMask_field &f_ragg=field(F_RAGGCODICE);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
if (!livelli_articolo().enabled())
|
1998-06-10 16:38:58 +00:00
|
|
|
|
{
|
|
|
|
|
// nasconde i campi di livello articolo
|
|
|
|
|
f_ragg.reset(); f_ragg.check(); f_ragg.hide();
|
|
|
|
|
field(F_FROMLIVELLOART).hide();
|
|
|
|
|
field(F_TOLIVELLOART).hide();
|
|
|
|
|
} else {
|
|
|
|
|
f_ragg.set("");
|
|
|
|
|
f_ragg.show();
|
|
|
|
|
f_ragg.check();
|
|
|
|
|
field(F_FROMLIVELLOART).show();
|
|
|
|
|
field(F_TOLIVELLOART).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int pos_g = id2pos(F_RAGGLIVGIAC);
|
|
|
|
|
if (pos_g >= 0)
|
|
|
|
|
{
|
|
|
|
|
TMask_field &f_ragg=field(F_RAGGLIVGIAC);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
if (!livelli_giacenza().enabled())
|
1998-06-10 16:38:58 +00:00
|
|
|
|
{
|
|
|
|
|
// nasconde i campi di livello giacenza
|
|
|
|
|
f_ragg.reset(); f_ragg.check();f_ragg.hide();
|
|
|
|
|
field(F_FROMLIVELLOGIAC).hide();
|
|
|
|
|
field(F_TOLIVELLOGIAC).hide();
|
|
|
|
|
} else {
|
|
|
|
|
f_ragg.set("");
|
|
|
|
|
f_ragg.show();
|
|
|
|
|
f_ragg.check();
|
|
|
|
|
field(F_FROMLIVELLOGIAC).show();
|
|
|
|
|
field(F_TOLIVELLOGIAC).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TStampemg_mask::set_livellicodice()
|
|
|
|
|
{
|
|
|
|
|
if (!get_bool(F_RAGGCODICE) && get_int(F_FROMLIVELLOGIAC)==0)
|
|
|
|
|
{
|
1999-10-22 10:00:18 +00:00
|
|
|
|
set(F_FROMLIVELLOART,livelli_articolo().last_level());
|
1998-06-10 16:38:58 +00:00
|
|
|
|
//set(F_TOLIVELLOART,);
|
|
|
|
|
}
|
|
|
|
|
if (!get_bool(F_RAGGLIVGIAC))
|
|
|
|
|
{
|
|
|
|
|
if (get_int(F_TOLIVELLOART)==0)
|
1999-10-22 10:00:18 +00:00
|
|
|
|
set(F_TOLIVELLOART,livelli_articolo().last_level()); //
|
1998-06-10 16:38:58 +00:00
|
|
|
|
} else {
|
|
|
|
|
if (get_int(F_TOLIVELLOGIAC)==0)
|
1999-10-22 10:00:18 +00:00
|
|
|
|
set(F_TOLIVELLOGIAC,livelli_giacenza().last_level()); //
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|