1998-04-30 14:59:47 +00:00
|
|
|
|
#include <applicat.h>
|
2002-02-26 16:20:19 +00:00
|
|
|
|
#include <execp.h>
|
|
|
|
|
#include <mailbox.h>
|
|
|
|
|
#include <printer.h>
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
1997-07-07 11:04:00 +00:00
|
|
|
|
#include "movmag.h"
|
|
|
|
|
#include "rmovmag.h"
|
|
|
|
|
|
1997-06-09 12:27:17 +00:00
|
|
|
|
#include "mglib.h"
|
1997-05-23 15:11:42 +00:00
|
|
|
|
#include "mg3300.h"
|
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
#include "../cg/cglib01.h"
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
#define VALUE_NOT_SET "~~"
|
1997-07-07 11:04:00 +00:00
|
|
|
|
|
2002-10-23 14:14:55 +00:00
|
|
|
|
TCausale_magazzino& get_cau(const char* codcaus)
|
|
|
|
|
{
|
|
|
|
|
static TAssoc_array _c;
|
|
|
|
|
TCausale_magazzino * caus = (TCausale_magazzino*) _c.objptr(codcaus);
|
|
|
|
|
if (caus == NULL)
|
|
|
|
|
{
|
|
|
|
|
caus = new TCausale_magazzino(codcaus);
|
|
|
|
|
_c.add(codcaus, caus);
|
|
|
|
|
}
|
|
|
|
|
return *caus;
|
|
|
|
|
}
|
2003-09-24 13:37:10 +00:00
|
|
|
|
|
1997-07-07 11:04:00 +00:00
|
|
|
|
class TForm_schedemag : public TForm_stampemg
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
|
|
|
|
int _tolivgiac,_tolivart;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
TString16 _anno_prec;
|
|
|
|
|
bool _magazzino_chiuso;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
bool _sottocatmer;
|
2000-10-03 13:45:12 +00:00
|
|
|
|
bool _sudd_mag;
|
2001-05-02 13:40:49 +00:00
|
|
|
|
bool _no_valori;
|
|
|
|
|
bool _no_ff;
|
|
|
|
|
bool _sintetica;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
TDate _data_inizio, _data_fine;
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TToken_string _rmov_sortexp;
|
|
|
|
|
TString _rmov_raggcond,_rmov_joinexp;
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TTipo_saldomag _tiposcheda; // tipo scheda
|
2000-05-05 15:25:49 +00:00
|
|
|
|
int _annoes;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TString16 _user1;
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
bool ragg_exprs(int livart,int livgiac);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
public:
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TToken_string& rmov_sortexp() {return _rmov_sortexp;}
|
|
|
|
|
TString & rmov_joinexp() {return _rmov_joinexp;}
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
void set_description_field(const char* u) { _user1 = u; }
|
|
|
|
|
|
|
|
|
|
void set_tiposcheda(const char * tipo);
|
1998-04-30 14:59:47 +00:00
|
|
|
|
void set_chiusura_mag(const int val);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
void set_data_inizio(const TDate& d) { _data_inizio = d; }
|
1997-07-07 11:00:41 +00:00
|
|
|
|
bool validate(TForm_item &cf, TToken_string &s);
|
|
|
|
|
void setdett_perart(bool percatmer, bool sottocatmer,int livart,int livgiac,bool sudd_mag, bool sudd_dep);
|
|
|
|
|
void setdett_permag(bool sudd_dep, bool showdett,int livart,int livgiac);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
void set_date_limite(const int anno, const TDate& d, const TDate& e);
|
2001-05-02 13:40:49 +00:00
|
|
|
|
void set_options(bool no_valori, bool no_ff, bool sintetica);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
const char* descr_tiposcheda() const;
|
|
|
|
|
const char* nomecampo_scheda() const;
|
2002-10-23 14:14:55 +00:00
|
|
|
|
TTipo_saldomag tiposcheda() const {return _tiposcheda;} ;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TForm_schedemag(const char *name,const char *code)
|
|
|
|
|
: TForm_stampemg(name,code), _tolivgiac(0), _tolivart(0) {}
|
|
|
|
|
|
|
|
|
|
virtual ~TForm_schedemag() {}
|
1997-05-23 15:11:42 +00:00
|
|
|
|
};
|
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
const char* TForm_schedemag::descr_tiposcheda() const
|
1997-05-23 15:11:42 +00:00
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
switch (_tiposcheda)
|
|
|
|
|
{
|
|
|
|
|
case s_giac:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("Giacenza"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_acl:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("A conto lavoro"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_incl:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("In conto lavoro"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_prodc:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("In produzione componenti"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_prodf:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("In produzione finiti"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_ordc:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("Ordinato clienti"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_ordf:
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return (TR("Ordinato fornitori"));
|
2004-03-16 07:43:45 +00:00
|
|
|
|
case s_acq:
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
}
|
|
|
|
|
return "";
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
const char* TForm_schedemag::nomecampo_scheda() const
|
1997-05-29 16:31:53 +00:00
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
switch (_tiposcheda)
|
|
|
|
|
{
|
|
|
|
|
case s_giac:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_GIAC);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_acl:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_ACL);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_incl:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_INCL);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_prodc:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_PRODCOMP);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_prodf:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_PRODFIN);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_ordc:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_ORDC);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
case s_ordf:
|
1997-07-07 11:04:00 +00:00
|
|
|
|
return (MAG_ORDF);
|
2004-03-16 07:43:45 +00:00
|
|
|
|
case s_acq:
|
|
|
|
|
case s_ent:
|
|
|
|
|
case s_ven:
|
|
|
|
|
case s_usc:
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
}
|
|
|
|
|
return "";
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
|
|
|
|
{
|
|
|
|
|
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (code=="_USER")
|
|
|
|
|
{
|
|
|
|
|
const TString subcode(s.get());
|
|
|
|
|
TString valore(VALUE_NOT_SET);
|
|
|
|
|
|
|
|
|
|
if (subcode=="TIPOSCHEDA")
|
|
|
|
|
valore = descr_tiposcheda();
|
|
|
|
|
if (subcode=="GRUPPOART")
|
|
|
|
|
{
|
|
|
|
|
if (_tolivart < livelli_articolo().last_level())
|
|
|
|
|
valore = livelli_articolo().group_descr_packed(relation()->lfile(LF_ANAMAG).get("CODART"),_tolivart);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (_user1.blank())
|
|
|
|
|
valore = relation()->lfile(LF_ANAMAG).get("DESCR");
|
|
|
|
|
else
|
|
|
|
|
valore = relation()->curr(LF_ANAMAG).get(_user1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (subcode=="CODGRUPPOGIAC")
|
|
|
|
|
{
|
|
|
|
|
int livello=_tolivgiac;
|
|
|
|
|
|
|
|
|
|
valore = livelli_giacenza().name(livello);
|
|
|
|
|
add_giaclev(valore, 1, livello);
|
|
|
|
|
valore << ' ';
|
|
|
|
|
TString s = livelli_giacenza().unpack_grpcode(relation()->lfile(LF_MAG).get("LIVELLO"),livello);
|
|
|
|
|
if (s.empty())
|
|
|
|
|
s = UNKNOWN_NAME;
|
|
|
|
|
valore << s;
|
|
|
|
|
}
|
|
|
|
|
if (subcode=="CODGRUPPOART")
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = relation()->lfile(LF_ANAMAG).get("CODART");
|
|
|
|
|
if (livelli_articolo().enabled())
|
|
|
|
|
valore.cut(min(valore.len(),livelli_articolo().packed_length(_tolivart)));
|
1998-06-10 16:38:58 +00:00
|
|
|
|
}
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="GRUPPOGIAC")
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = livelli_giacenza().group_descr_packed(relation()->lfile(LF_RMOVMAG).get("LIVGIAC"),_tolivgiac);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="CODCATMER")
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = relation()->lfile(LF_ANAMAG).get("GRMERC");
|
|
|
|
|
if (!_sottocatmer && valore.full())
|
1997-07-07 11:00:41 +00:00
|
|
|
|
valore.cut(3);
|
|
|
|
|
}
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="CATMER")
|
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
if (_sottocatmer)
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = relation()->lfile(-ALIAS_SOTTOCATMER).get("S0");
|
1997-07-07 11:00:41 +00:00
|
|
|
|
else
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = relation()->lfile(-ALIAS_CATMER).get("S0");
|
1997-07-07 11:00:41 +00:00
|
|
|
|
}
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="DADATA")
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = _data_inizio.string();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="ADATA")
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = _data_fine.string();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
|
|
|
|
const TRectype& rmovmag = relation()->curr(LF_RMOVMAG);
|
|
|
|
|
const TRectype& movmag = relation()->curr(LF_MOVMAG);
|
|
|
|
|
const TString16 cau_r= rmovmag.get(RMOVMAG_CODCAUS);
|
|
|
|
|
const TString16 cau_m= movmag.get(MOVMAG_CODCAUS);
|
2002-10-23 14:14:55 +00:00
|
|
|
|
const TCausale_magazzino & cau = get_cau(cau_r.empty() ? cau_m : cau_r);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (subcode=="*SEGNOCAUS")
|
|
|
|
|
{
|
2000-05-05 15:25:49 +00:00
|
|
|
|
const char qv = s.get_char(); // Segno per Quantita'o Valore
|
|
|
|
|
int sgn = cau.sgn(_tiposcheda);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
switch(qv)
|
|
|
|
|
{
|
|
|
|
|
case 'Q': if (!cau.update_qta()) sgn = 0; break;
|
|
|
|
|
case 'V': if (!cau.update_val()) sgn = 0; break;
|
|
|
|
|
default : break;
|
|
|
|
|
}
|
|
|
|
|
if (sgn)
|
|
|
|
|
{
|
|
|
|
|
real v(cf.get());
|
|
|
|
|
v *= real(sgn);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = v.string();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = "";
|
1997-07-07 11:04:00 +00:00
|
|
|
|
}
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="CAUSALERIGA")
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = cau.codice();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="DESCRCAUSALE")
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = cau.descr();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (subcode=="CANPRINTSALDOPREC") // Determina se e' possibile stampare il saldo precedente
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
bool printsaldoprec = true;
|
2004-03-16 07:43:45 +00:00
|
|
|
|
const TDate datareg = movmag.get_date(MOVMAG_DATAREG);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
// Se il movimento corrente e' >= la data inizio stampa allora posso sempre stampare il saldo ...
|
|
|
|
|
if (datareg < _data_inizio) // ... altrimenti devo fare altri controlli
|
|
|
|
|
{
|
|
|
|
|
const bool stampa_perart = relation()->lfile().num() == LF_ANAMAG;
|
|
|
|
|
if (stampa_perart) // Stampa per articoli
|
|
|
|
|
{
|
|
|
|
|
TSortedfile& rmm = (TSortedfile&)relation()->lfile(LF_RMOVMAG);
|
|
|
|
|
const TRecnotype oldpos = rmm.recno();
|
|
|
|
|
TString80 old_art;
|
|
|
|
|
old_art << rmm.get(RMOVMAG_CODART); old_art << '|' << rmm.get(RMOVMAG_LIVGIAC);
|
|
|
|
|
const int err = rmm.next();
|
|
|
|
|
if (err == NOERR) // Se non sono sull'ultimo record ...
|
|
|
|
|
{
|
|
|
|
|
const TRectype& next_movmag = rmm.relation().curr(LF_MOVMAG);
|
2004-03-16 07:43:45 +00:00
|
|
|
|
const TDate next_datareg = next_movmag.get_date(MOVMAG_DATAREG);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
// Se il prossimo record e' dopo la data iniziale devo stampre il saldo
|
|
|
|
|
// Lo stesso dicasi se la prossima data e' inferiore alla corrente (sono su un altro articolo!)
|
2006-07-11 13:10:51 +00:00
|
|
|
|
printsaldoprec = next_datareg >= _data_inizio || next_datareg < datareg;
|
|
|
|
|
if (!printsaldoprec)
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
// Se la prossima data e' >= della corrente verifico se cambio articolo
|
|
|
|
|
TString80 new_art;
|
|
|
|
|
new_art << rmm.get(RMOVMAG_CODART); new_art << '|' << rmm.get(RMOVMAG_LIVGIAC);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
printsaldoprec = old_art != new_art;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rmm.readat(oldpos); // ripristino la posizione del file
|
|
|
|
|
}
|
|
|
|
|
else // Stampa per magazzini
|
|
|
|
|
{
|
2000-10-03 13:45:12 +00:00
|
|
|
|
TSortedfile& rmm = (TSortedfile&)relation()->lfile(LF_RMOVMAG);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
const TRecnotype oldpos = rmm.recno();
|
|
|
|
|
TString80 old_art;
|
2000-10-03 13:45:12 +00:00
|
|
|
|
old_art << rmm.get(RMOVMAG_CODART);
|
|
|
|
|
old_art << '|' << rmm.get(RMOVMAG_LIVGIAC);
|
|
|
|
|
old_art << '|' << rmm.get(RMOVMAG_CODMAG);
|
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
const int err = rmm.next();
|
|
|
|
|
if (err == NOERR) // Se non sono sull'ultimo record ...
|
|
|
|
|
{
|
|
|
|
|
const long next_num_reg = rmm.get_long(RMOVMAG_NUMREG);
|
|
|
|
|
const TRectype& next_movmag = cache().get(LF_MOVMAG, next_num_reg);
|
2004-03-16 07:43:45 +00:00
|
|
|
|
const TDate next_datareg = next_movmag.get_date(MOVMAG_DATAREG);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
// Se il prossimo record e' dopo la data iniziale devo stampre il saldo
|
|
|
|
|
// Lo stesso dicasi se la prossima data e' inferiore alla corrente (sono su un altro articolo!)
|
2006-07-11 13:10:51 +00:00
|
|
|
|
printsaldoprec = next_datareg >= _data_inizio || next_datareg < datareg;
|
|
|
|
|
if (!printsaldoprec)
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
// Se la prossima data e' >= della corrente verifico se cambio articolo
|
|
|
|
|
TString80 new_art;
|
2000-10-03 13:45:12 +00:00
|
|
|
|
new_art << rmm.get(RMOVMAG_CODART);
|
|
|
|
|
new_art << '|' << rmm.get(RMOVMAG_LIVGIAC);
|
|
|
|
|
new_art << '|' << rmm.get(RMOVMAG_CODMAG);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
printsaldoprec = old_art != new_art;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rmm.readat(oldpos); // ripristino la posizione del file
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = printsaldoprec ? "1" : "0";
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
if (subcode=="SALDOPREC")
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = "";
|
1998-04-30 14:59:47 +00:00
|
|
|
|
if (!_magazzino_chiuso) // mag precedente non chiuso, mancano i saldi di apertura
|
|
|
|
|
{
|
2000-05-05 15:25:49 +00:00
|
|
|
|
TLocalisamfile mag_annoprec(LF_MAG);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
TString codmag, codart, livello;
|
|
|
|
|
|
|
|
|
|
const bool stampa_perart = relation()->lfile().num() == LF_ANAMAG;
|
|
|
|
|
if (stampa_perart) // Stampa per articoli
|
|
|
|
|
{
|
|
|
|
|
const TRectype& rmovmag = cursor()->curr(LF_RMOVMAG); // Record collegato a LF_ANAMAG
|
|
|
|
|
codmag = rmovmag.get(RMOVMAG_CODMAG);
|
|
|
|
|
codart = rmovmag.get(RMOVMAG_CODART);
|
|
|
|
|
livello = rmovmag.get(RMOVMAG_LIVGIAC);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Nella stampa per magazzini al momento del saldo sono avanti di un passo rispetto a dove mi serve
|
|
|
|
|
if (cursor()->pos() > 0L)
|
|
|
|
|
{
|
|
|
|
|
--(*cursor());
|
|
|
|
|
const TRectype& rmovmag = cursor()->curr(LF_RMOVMAG); // Record principale
|
|
|
|
|
codmag = rmovmag.get(RMOVMAG_CODMAG);
|
|
|
|
|
codart = rmovmag.get(RMOVMAG_CODART);
|
|
|
|
|
livello = rmovmag.get(RMOVMAG_LIVGIAC);
|
|
|
|
|
++(*cursor());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
mag_annoprec.put(MAG_ANNOES, _anno_prec);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
mag_annoprec.put(MAG_CODMAG, codmag);
|
|
|
|
|
mag_annoprec.put(MAG_CODART, codart);
|
|
|
|
|
mag_annoprec.put(MAG_LIVELLO, livello);
|
|
|
|
|
if (_sudd_mag) // Se e' una stampa dettagliata per magazzino
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
2000-10-03 13:45:12 +00:00
|
|
|
|
mag_annoprec.setkey(2);
|
|
|
|
|
if (mag_annoprec.read() == NOERR) // Ho trovato un saldo precedente del magazzino in questione
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
2000-10-03 13:45:12 +00:00
|
|
|
|
const real saldoprec = mag_annoprec.get_real(nomecampo_scheda());
|
|
|
|
|
if (!saldoprec.is_zero())
|
|
|
|
|
{
|
|
|
|
|
real currsaldo = cf.get();
|
|
|
|
|
currsaldo += saldoprec; // Sommo il saldo precedente al campo corrente
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = currsaldo.string();
|
2000-10-03 13:45:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Calcolo la somma dei saldi di tutti i magazzini
|
|
|
|
|
mag_annoprec.setkey(1);
|
|
|
|
|
real currsaldo = cf.get();
|
|
|
|
|
for (int r = 1; ; r++)
|
|
|
|
|
{
|
|
|
|
|
mag_annoprec.put(MAG_NRIGA, r);
|
|
|
|
|
if (mag_annoprec.read() != NOERR)
|
|
|
|
|
break;
|
|
|
|
|
const real saldoprec = mag_annoprec.get_real(nomecampo_scheda());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
currsaldo += saldoprec; // Sommo il saldo precedente al campo corrente
|
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
valore = currsaldo.string();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
1998-04-30 14:59:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-10-22 10:00:18 +00:00
|
|
|
|
if (subcode.left(3) == "ADD")
|
2000-05-05 15:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
const TString16 cau = cf.section().find_field(FF_CAUSALE_RIGA).get();
|
2002-10-23 14:14:55 +00:00
|
|
|
|
TCausale_magazzino & ccrr = get_cau(cau);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const bool is_qta = subcode.right(3) == "QTA";
|
|
|
|
|
const bool ok = is_qta && ccrr.update_qta() || !is_qta && ccrr.update_val();
|
2006-07-11 13:10:51 +00:00
|
|
|
|
|
|
|
|
|
if (ok)
|
1999-10-22 10:00:18 +00:00
|
|
|
|
{
|
2000-05-05 15:25:49 +00:00
|
|
|
|
const short fld = s.get_int(2);
|
|
|
|
|
TForm_item& dest = cf.section().find_field(fld);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
real v1(cf.get());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
real v2(dest.get());
|
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
v2 += v1;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
dest.set(v2.string());
|
1999-10-22 10:00:18 +00:00
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
return true;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (valore != VALUE_NOT_SET)
|
|
|
|
|
{
|
|
|
|
|
cf.set(valore);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
1998-06-10 16:38:58 +00:00
|
|
|
|
return TForm_stampemg::validate(cf, s);
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
bool TForm_schedemag::ragg_exprs(int livart, int livgiac)
|
1997-05-29 16:31:53 +00:00
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TString piece,rest;
|
|
|
|
|
// ***********
|
|
|
|
|
int tolivart,tolivgiac;
|
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
tolivart =livart ? livart : livelli_articolo().last_level() ;
|
|
|
|
|
tolivgiac=livgiac ? livgiac : livelli_giacenza().last_level();
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// sezioni livello codice
|
|
|
|
|
piece="CODART";
|
1999-10-22 10:00:18 +00:00
|
|
|
|
if (livelli_articolo().enabled())
|
|
|
|
|
piece << "[1," << livelli_articolo().packed_length(tolivart) <<']';
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (_rmov_raggcond.full())
|
|
|
|
|
_rmov_raggcond << "+";
|
|
|
|
|
_rmov_raggcond << piece;
|
|
|
|
|
_rmov_sortexp.add(piece);
|
|
|
|
|
_rmov_joinexp.cut(0);
|
|
|
|
|
_rmov_joinexp << piece << "==" << piece;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
if (livart==0)
|
|
|
|
|
{
|
|
|
|
|
piece="LIVGIAC";
|
1999-10-22 10:00:18 +00:00
|
|
|
|
if (livelli_giacenza().enabled())
|
|
|
|
|
piece << "[1," << livelli_giacenza().packed_length(tolivgiac) <<']';
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_raggcond << '+' << piece;
|
|
|
|
|
_rmov_sortexp.add(piece);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
return true;
|
1997-05-23 15:11:42 +00:00
|
|
|
|
}
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
void TForm_schedemag::setdett_permag(bool sudd_dep,bool show_dett,int livart,int livgiac)
|
|
|
|
|
{
|
|
|
|
|
TForm_subsection &h_d=(TForm_subsection &)find_field('B',odd_page,"HEADER_DEP");
|
|
|
|
|
h_d.enable(sudd_dep);
|
|
|
|
|
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
|
|
|
|
h_a.enable(show_dett);
|
|
|
|
|
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
1999-10-22 10:00:18 +00:00
|
|
|
|
h_g.enable(livelli_giacenza().enabled() && (livart ==0 || livgiac !=0 ));
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_raggcond = "CODMAG[1,3]";
|
|
|
|
|
_rmov_sortexp = "CODMAG[1,3]";
|
1998-06-10 16:38:58 +00:00
|
|
|
|
if (sudd_dep)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_raggcond << "+CODMAG[4,5]";
|
|
|
|
|
_rmov_sortexp.add("CODMAG[4,5]");
|
1998-08-25 18:07:30 +00:00
|
|
|
|
}
|
|
|
|
|
if (show_dett)
|
2006-07-11 13:10:51 +00:00
|
|
|
|
ragg_exprs(livart, livgiac);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
|
|
|
|
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,"GRUPPI_RMOVMAG");
|
2006-07-11 13:10:51 +00:00
|
|
|
|
s.setcondition(_rmov_raggcond,_strexpr);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
|
|
|
|
TString cond;
|
|
|
|
|
cond << LF_MOVMAG << "->DATAREG";
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_sortexp.add(cond);
|
|
|
|
|
_rmov_sortexp.add("NUMREG");
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
_tolivart=livart ? livart :livelli_articolo().last_level() ;
|
|
|
|
|
_tolivgiac=livgiac ? livgiac :livelli_giacenza().last_level();
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_sudd_mag = true; // E' una stampa suddvisa per magazzini
|
1997-05-23 15:11:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
void TForm_schedemag::setdett_perart(bool percatmer,bool sottocatmer,int livart,int livgiac,bool sudd_mag,bool sudd_dep)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_sortexp.cut(0);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// raggruppamento MAX fino all'articolo
|
|
|
|
|
TForm_subsection &h_cm=(TForm_subsection &)find_field('B',odd_page,"HEADER_CATMER");
|
|
|
|
|
h_cm.enable(percatmer);
|
|
|
|
|
TForm_subsection &h_cm2=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIACCATMER");
|
|
|
|
|
h_cm2.enable(percatmer);
|
|
|
|
|
|
|
|
|
|
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
1998-06-10 16:38:58 +00:00
|
|
|
|
h_a.enable (livart!=0 && !sudd_mag);
|
2001-05-02 13:40:49 +00:00
|
|
|
|
h_a.set_newpage(livart!=0 && !sudd_mag && !_no_ff);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TForm_subsection &t_a=(TForm_subsection &)find_field('B',odd_page,"TOTALI_GRUPPIART");
|
1997-07-07 11:04:00 +00:00
|
|
|
|
t_a.show( livart!=0 && !sudd_mag);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
// raggruppamento MAX fino alla giacenza
|
1997-07-07 11:04:00 +00:00
|
|
|
|
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV");
|
2001-05-02 13:40:49 +00:00
|
|
|
|
h_g.enable(livart ==0 || livgiac !=0 || sudd_mag);
|
|
|
|
|
h_g.set_newpage(!_no_ff && (livart ==0 || livgiac !=0 || sudd_mag));
|
1997-07-07 11:04:00 +00:00
|
|
|
|
TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
1999-10-22 10:00:18 +00:00
|
|
|
|
h_l.enable(livelli_giacenza().enabled() && (livart ==0 || livgiac !=0 ));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TForm_subsection &h_m=(TForm_subsection &)find_field('B',odd_page,"HEADER_MAG");
|
|
|
|
|
h_m.enable(sudd_mag );
|
|
|
|
|
TForm_subsection &h_d=(TForm_subsection &)find_field('B',odd_page,"HEADER_DEP");
|
|
|
|
|
h_d.enable(sudd_dep);
|
|
|
|
|
|
|
|
|
|
TForm_subsection &t_s=(TForm_subsection &)find_field('B',odd_page,"TOTALI_GRMOV");
|
1997-07-07 11:04:00 +00:00
|
|
|
|
t_s.show(livart==0 || livgiac !=0 || sudd_mag);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
_tolivart=livart ? livart :livelli_articolo().last_level() ;
|
|
|
|
|
_tolivgiac=livgiac ? livgiac :livelli_giacenza().last_level();
|
1997-07-07 11:00:41 +00:00
|
|
|
|
_sottocatmer=sottocatmer;
|
|
|
|
|
|
|
|
|
|
// settaggio catmer/ragg codice
|
|
|
|
|
if (livart || percatmer) {
|
|
|
|
|
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,"GRUPPI_ARTICOLO");
|
2000-05-05 15:25:49 +00:00
|
|
|
|
TString cond;
|
|
|
|
|
if (percatmer)
|
|
|
|
|
cond << "GRMERC" << (sottocatmer ? "[1,3]" : "") << '+';
|
1999-10-22 10:00:18 +00:00
|
|
|
|
cond << "CODART[1," << livelli_articolo().packed_length(_tolivart) << ']';
|
1997-07-07 11:00:41 +00:00
|
|
|
|
s.setcondition(cond,_strexpr);
|
|
|
|
|
}
|
|
|
|
|
// settaggio raggruppamenti codice sulla scheda
|
2006-07-11 13:10:51 +00:00
|
|
|
|
ragg_exprs(livart, livgiac);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
|
|
|
|
_sudd_mag = sudd_mag; // E' una stampa suddvisa per magazzini?
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (sudd_mag)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_raggcond << "+CODMAG[1,3]";
|
|
|
|
|
_rmov_sortexp.add("CODMAG[1,3]");
|
1997-07-07 11:00:41 +00:00
|
|
|
|
if (sudd_dep)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_raggcond << "+CODMAG[4,5]";
|
|
|
|
|
_rmov_sortexp.add("CODMAG[4,5]");
|
1997-07-07 11:00:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,"GRUPPI_RMOVMAG");
|
2006-07-11 13:10:51 +00:00
|
|
|
|
s.setcondition(_rmov_raggcond,_strexpr);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TString cond;
|
|
|
|
|
cond << LF_MOVMAG << "->DATAREG";
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_rmov_sortexp.add(cond);
|
|
|
|
|
_rmov_sortexp.add("NUMREG");
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
void TForm_schedemag::set_tiposcheda(const char * tipo)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (tipo[0] == 'G')
|
|
|
|
|
_tiposcheda = s_giac;
|
|
|
|
|
else
|
|
|
|
|
if (tipo[0] == 'A')
|
|
|
|
|
_tiposcheda = s_acl;
|
|
|
|
|
else
|
|
|
|
|
if (tipo[0] == 'I')
|
|
|
|
|
_tiposcheda = s_incl;
|
|
|
|
|
else
|
|
|
|
|
if (*tipo=='P')
|
|
|
|
|
{
|
|
|
|
|
if (tipo[1]=='F')
|
|
|
|
|
_tiposcheda = s_prodf;
|
|
|
|
|
else
|
|
|
|
|
_tiposcheda = s_prodc;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (tipo[0] == 'O')
|
|
|
|
|
{
|
|
|
|
|
if (tipo[1]=='F')
|
|
|
|
|
_tiposcheda = s_ordf;
|
|
|
|
|
else
|
|
|
|
|
_tiposcheda = s_ordc;
|
|
|
|
|
}
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-02 13:40:49 +00:00
|
|
|
|
void TForm_schedemag::set_options(bool no_valori, bool no_ff, bool sintetica)
|
|
|
|
|
{
|
|
|
|
|
_no_valori = no_valori;
|
|
|
|
|
if (_no_valori)
|
|
|
|
|
{
|
|
|
|
|
((TForm_item &)find_field('H',odd_page, 8)).hide();
|
|
|
|
|
((TForm_item &)find_field('H',odd_page, 9)).hide();
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, 104)).hide();
|
|
|
|
|
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, 105)).hide();
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, FF_VALORE_GART)).hide();
|
|
|
|
|
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, FF_VALORE_MOV)).hide();
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, 190)).hide();
|
|
|
|
|
|
|
|
|
|
if (name().left(7) == "mg3300a")
|
|
|
|
|
((TForm_item &)find_field('B',odd_page, FF_VALORE_GRMOV)).hide();
|
|
|
|
|
}
|
|
|
|
|
_no_ff = no_ff;
|
|
|
|
|
_sintetica = sintetica;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
void TForm_schedemag::set_date_limite(const int anno, const TDate& d, const TDate& e)
|
1998-04-30 14:59:47 +00:00
|
|
|
|
{
|
|
|
|
|
TEsercizi_contabili ec;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
|
|
|
|
_annoes = anno;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
_anno_prec.format("%4d",ec.pred(anno));
|
|
|
|
|
_magazzino_chiuso = (ec.pred(anno) == 0) || !(ec.esercizio(atoi(_anno_prec)).chiusura_mag().empty());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
|
|
|
|
_data_inizio = d;
|
|
|
|
|
_data_fine = e;
|
|
|
|
|
|
|
|
|
|
const TEsercizio& es = ec[_annoes];
|
|
|
|
|
|
|
|
|
|
if (!_data_inizio.ok())
|
|
|
|
|
{
|
|
|
|
|
_data_inizio = es.inizio();
|
|
|
|
|
}
|
|
|
|
|
if (!_data_fine.ok())
|
|
|
|
|
{
|
|
|
|
|
_data_fine = es.fine();
|
|
|
|
|
}
|
1998-04-30 14:59:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
// mg3300 Stampa
|
1997-05-23 15:11:42 +00:00
|
|
|
|
// mg3300 Stampa
|
1998-04-30 14:59:47 +00:00
|
|
|
|
class TStampa_schede_mag : public TSkeleton_application
|
1997-05-23 15:11:42 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TStampemg_mask * _mask; // static so they are visible from filter function
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TForm_schedemag *_form; // to be moved into TPrint_application
|
2000-10-03 13:45:12 +00:00
|
|
|
|
TCursor * _cur;
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
int _codicees;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
bool _raggmag;
|
|
|
|
|
bool _reload;
|
2002-02-26 16:20:19 +00:00
|
|
|
|
|
1997-05-23 15:11:42 +00:00
|
|
|
|
protected:
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TStampemg_mask & mask() { return *_mask;}
|
1998-04-30 14:59:47 +00:00
|
|
|
|
virtual bool create();
|
|
|
|
|
virtual bool destroy();
|
|
|
|
|
virtual void main_loop();
|
2000-10-03 13:45:12 +00:00
|
|
|
|
static bool negatives_only(const TRelation* rel);
|
2002-10-23 14:14:55 +00:00
|
|
|
|
static bool cau_filter(const TRelation* rel);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
|
|
|
|
|
void setprint_perarticoli();
|
|
|
|
|
void setprint_permagazzini();
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
2000-05-05 15:25:49 +00:00
|
|
|
|
protected:
|
|
|
|
|
static bool handle_dadata(TMask_field& f, KEY k);
|
|
|
|
|
static bool handle_adata(TMask_field& f, KEY k);
|
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
public:
|
|
|
|
|
bool & reload() {return _reload;}
|
2002-10-23 14:14:55 +00:00
|
|
|
|
TTipo_saldomag tiposcheda() const {return _form->tiposcheda();} ;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TStampa_schede_mag() : _reload(false) {}
|
|
|
|
|
virtual ~TStampa_schede_mag() {}
|
1997-05-23 15:11:42 +00:00
|
|
|
|
};
|
|
|
|
|
|
2002-02-26 16:20:19 +00:00
|
|
|
|
TStampa_schede_mag& app() { return (TStampa_schede_mag&)main_app(); }
|
|
|
|
|
|
2000-10-03 13:45:12 +00:00
|
|
|
|
bool TStampa_schede_mag::negatives_only(const TRelation* rel)
|
|
|
|
|
{
|
|
|
|
|
const TString codart = rel->curr(LF_ANAMAG).get(ANAMAG_CODART);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
const int anno = app().mask().get_int(F_ANNOES);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
TArticolo_giacenza artgiac(codart);
|
|
|
|
|
const real giac = artgiac.giacenza_anno(NULL, NULL, anno);
|
|
|
|
|
return giac < ZERO;
|
|
|
|
|
}
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
2002-10-23 14:14:55 +00:00
|
|
|
|
bool TStampa_schede_mag::cau_filter(const TRelation* rel)
|
|
|
|
|
{
|
|
|
|
|
const TRectype& rmov = rel->curr(LF_RMOVMAG);
|
|
|
|
|
TString16 cau = rmov.get(RMOVMAG_CODCAUS);
|
|
|
|
|
if (cau.empty())
|
|
|
|
|
cau = cache().get(LF_MOVMAG, rmov.get(RMOVMAG_NUMREG), MOVMAG_CODCAUS);
|
|
|
|
|
return get_cau(cau).sgn(app().tiposcheda()) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
void TStampa_schede_mag::setprint_permagazzini()
|
1997-05-23 15:11:42 +00:00
|
|
|
|
{
|
1997-05-29 16:31:53 +00:00
|
|
|
|
TRectype darec(LF_RMOVMAG),arec(LF_RMOVMAG);
|
|
|
|
|
TString cfilter;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
const TMask & m = mask();
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
_form->set_tiposcheda(_mask->get(F_SCHEDA));
|
|
|
|
|
_cur = _form->cursor();
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering from/to MAGS
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DAMAG).not_empty())
|
|
|
|
|
cfilter << "(CODMAG[1,3]>=" <<'"' << m.get(F_DAMAG)<< "\")&&" ;
|
|
|
|
|
if (m.get(F_AMAG).not_empty())
|
|
|
|
|
cfilter << "(CODMAG[1,3]<=" <<'"' << m.get(F_AMAG)<< "\")&&" ;
|
2002-07-02 16:21:23 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DADEP).not_empty())
|
|
|
|
|
cfilter << "(CODMAG[4,]>=" <<'"' << m.get(F_DADEP)<< "\")&&" ;
|
|
|
|
|
if (m.get(F_ADEP).not_empty())
|
|
|
|
|
cfilter << "(CODMAG[4,]<=" <<'"' << m.get(F_ADEP)<< "\")&&" ;
|
2002-07-02 16:21:23 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
cfilter << "(" << LF_MOVMAG <<"->ANNOES==" <<'"' << m.get(F_ANNOES)<< "\")&&" ;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering from/to DATA
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_ADATA).full())
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TDate d1(m.get(F_ADATA));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
cfilter << "(ANSI(110->DATAREG)<=" <<'"' << d1.string(ANSI) << "\")&&" ;
|
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DADATA).full())
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TDate d1(m.get(F_DADATA));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TString cond;
|
2001-05-02 13:40:49 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
cond << "ANSI(" << LF_MOVMAG << "->DATAREG)>=\"" << d1.string(ANSI) << '"';
|
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"H_MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
cond.cut(0) << "ANSI(" << LF_MOVMAG << "->DATAREG)<\"" << d1.string(ANSI) << '"';
|
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"MOVS_PRECEDENTI")).setcondition(cond,_strexpr);
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Imposta i livelli di dettaglio della scheda
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_form->setdett_permag(m.get_bool(F_DETTAGLIOMAG), m.get_bool(F_DETTAGLIODEP),
|
|
|
|
|
m.get_int(F_TOLIVELLOART), m.get_int(F_TOLIVELLOGIAC));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
// filtering from/to ART
|
2006-07-11 13:10:51 +00:00
|
|
|
|
darec.put("CODART", m.get(F_DAART));
|
|
|
|
|
arec.put("CODART", m.get(F_AART));
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering ONLY NEGATIVES
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_FILTRO)[0]=='N')
|
|
|
|
|
_cur->set_filterfunction(negatives_only, true);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// prepare cursor to print....
|
|
|
|
|
((TSorted_cursor *)_cur)->change_order(_form->rmov_sortexp());
|
|
|
|
|
if (cfilter.not_empty())
|
2000-10-03 13:45:12 +00:00
|
|
|
|
cfilter.rtrim(2);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TLocalisamfile *mag = new TLocalisamfile(LF_MAG);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
mag->setkey(2);
|
|
|
|
|
TString mag_joinexp;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
mag_joinexp << "ANNOES==\"" << m.get(F_ANNOES) << "\"|CODMAG==CODMAG|CODART==CODART|LIVELLO==LIVGIAC";
|
2003-05-05 14:32:23 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
_cur->relation()->replace(mag,1,mag_joinexp);
|
|
|
|
|
_cur->setfilter(cfilter,TRUE);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
_cur->setregion(darec,arec,0x2);
|
1997-05-23 15:11:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
// ORDINAMENTO per articoli
|
|
|
|
|
void TStampa_schede_mag::setprint_perarticoli()
|
|
|
|
|
{
|
|
|
|
|
TRectype darec(LF_ANAMAG),arec(LF_ANAMAG);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
TRectype darecr(LF_RMOVMAG),arecr(LF_RMOVMAG);
|
1997-05-29 16:31:53 +00:00
|
|
|
|
TString cfilter,filter;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
const TMask & m = mask();
|
1997-05-29 16:31:53 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_form->set_tiposcheda(m.get(F_SCHEDA));
|
|
|
|
|
char subordine =m.get(F_SUBORDINE)[0];
|
1997-05-29 16:31:53 +00:00
|
|
|
|
_cur = _form->cursor();
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering ANNOES
|
2006-07-11 13:10:51 +00:00
|
|
|
|
filter << '(' << LF_MOVMAG << "->ANNOES==" << m.get(F_ANNOES)<< ")&&" ;
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering from/to MAGS
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DAMAG)[0])
|
|
|
|
|
filter << "(" << LF_RMOVMAG << "->CODMAG[1,3]>=" <<'"' << m.get(F_DAMAG)<< "\")&&" ;
|
|
|
|
|
if (m.get(F_AMAG)[0])
|
|
|
|
|
filter << "(" << LF_RMOVMAG << "->CODMAG[1,3]<=" <<'"' << m.get(F_AMAG)<< "\")&&" ;
|
2002-07-02 16:21:23 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DADEP).full())
|
|
|
|
|
filter << "(" << LF_RMOVMAG << "->CODMAG[4,]>=" <<'"' << m.get(F_DADEP)<< "\")&&" ;
|
|
|
|
|
if (m.get(F_ADEP).full())
|
|
|
|
|
filter << "(" << LF_RMOVMAG << "->CODMAG[4,]<=" <<'"' << m.get(F_ADEP)<< "\")&&" ;
|
2002-07-02 16:21:23 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering from/to DATA
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_DADATA).full())
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TDate d1(m.get(F_DADATA));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TString cond;
|
|
|
|
|
cond << "ANSI(" << LF_MOVMAG << "->DATAREG)>=\"" << d1.string(ANSI) << '"';
|
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"H_MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
cond.cut(0) << "ANSI(" << LF_MOVMAG << "->DATAREG)<\"" << d1.string(ANSI) << '"';
|
|
|
|
|
((TForm_subsection &)_form->find_field('B',odd_page,"MOVS_PRECEDENTI")).setcondition(cond,_strexpr);
|
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_ADATA).not_empty())
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TDate d1(m.get(F_ADATA));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
filter << "(ANSI(110->DATAREG)<=" <<'"' << d1.string(ANSI) << "\")&&" ;
|
|
|
|
|
}
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
1997-07-07 11:00:41 +00:00
|
|
|
|
// filtering ONLY NEGATIVES
|
2006-07-11 13:10:51 +00:00
|
|
|
|
if (m.get(F_FILTRO)[0]=='N')
|
2001-05-02 13:40:49 +00:00
|
|
|
|
_cur->set_filterfunction(negatives_only);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
// Imposta i livelli di dettaglio della scheda
|
2006-07-11 13:10:51 +00:00
|
|
|
|
int tolivelloart = m.get_int(F_TOLIVELLOART);
|
|
|
|
|
int tolivellogiac = m.get_int(F_TOLIVELLOGIAC);
|
|
|
|
|
TString sortexp;
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
switch (subordine)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
case 'C':
|
|
|
|
|
_cur->setkey(1); sortexp = ANAMAG_CODART;
|
|
|
|
|
darec.put("CODART", m.get(F_DAART));
|
|
|
|
|
arec.put("CODART", m.get(F_AART));
|
|
|
|
|
_form->setdett_perart(false, false, tolivelloart, tolivellogiac,
|
|
|
|
|
m.get_bool(F_SUDDIV_MAGAZZINI),
|
|
|
|
|
m.get_bool(F_SUDDIV_DEPOSITI));
|
|
|
|
|
break;
|
|
|
|
|
case 'D':
|
|
|
|
|
_cur->setkey(2); sortexp = ANAMAG_DESCR;
|
|
|
|
|
darec.put("DESCR", m.get(F_DADES));
|
|
|
|
|
arec.put("DESCR", m.get(F_ADES));
|
|
|
|
|
_form->setdett_perart(false , false, tolivelloart, tolivellogiac,
|
|
|
|
|
m.get_bool(F_SUDDIV_MAGAZZINI),
|
|
|
|
|
m.get_bool(F_SUDDIV_DEPOSITI));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
break;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
case 'M':
|
|
|
|
|
_cur->setkey(3); sortexp = ANAMAG_GRMERC;
|
|
|
|
|
darec.put("GRMERC", m.get(F_DACATMER));
|
|
|
|
|
arec.put("GRMERC", m.get(F_ACATMER));
|
|
|
|
|
if (m.get(F_AART).full())
|
|
|
|
|
cfilter << "(CODART<=" <<'"' << m.get(F_AART)<< TString(20,(char)127)<< "\")&&" ;
|
|
|
|
|
if (m.get(F_DAART).full())
|
|
|
|
|
cfilter << "(CODART>=" <<'"' << m.get(F_DAART) << "\")&&" ;
|
|
|
|
|
_form->setdett_perart(true, false, tolivelloart, tolivellogiac,
|
|
|
|
|
m.get_bool(F_SUDDIV_MAGAZZINI),
|
|
|
|
|
m.get_bool(F_SUDDIV_DEPOSITI));
|
1998-06-10 16:38:58 +00:00
|
|
|
|
break;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
case 'P':
|
|
|
|
|
_cur->setkey(1); sortexp = ANAMAG_USER1;
|
|
|
|
|
darec.put("CODART", m.get(F_DAART));
|
|
|
|
|
arec.put("CODART", m.get(F_AART));
|
|
|
|
|
_form->setdett_perart( false, false, tolivelloart, tolivellogiac,
|
|
|
|
|
m.get_bool(F_SUDDIV_MAGAZZINI),
|
|
|
|
|
m.get_bool(F_SUDDIV_DEPOSITI));
|
|
|
|
|
if (m.get(F_DAUSR).full())
|
|
|
|
|
cfilter << "(USER1>=\"" << m.get(F_DAUSR) << "\")&&";
|
|
|
|
|
if (m.get(F_AUSR).full())
|
|
|
|
|
cfilter << "(USER1<=\"" << m.get(F_AUSR) << "~\")&&";
|
1997-07-07 11:00:41 +00:00
|
|
|
|
break;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
|
|
|
|
|
_form->set_description_field(subordine == 'P' ? ANAMAG_USER1 : "");
|
|
|
|
|
|
1997-05-29 16:31:53 +00:00
|
|
|
|
// prepare cursor's relation....
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TRelation *aux=new TRelation (LF_RMOVMAG);
|
|
|
|
|
aux->add(LF_MOVMAG,"NUMREG==NUMREG");
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (filter.right(2) == "&&")
|
|
|
|
|
filter.rtrim(2);
|
|
|
|
|
TSortedfile *rmovmag= new TSortedfile(LF_RMOVMAG,aux,_form->rmov_sortexp(),filter,0x2);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
darecr.put(RMOVMAG_CODART,darec.get(ANAMAG_CODART));
|
|
|
|
|
arecr.put(RMOVMAG_CODART,arec.get(ANAMAG_CODART));
|
2000-05-05 15:25:49 +00:00
|
|
|
|
rmovmag->setregion(darecr,arecr,0x2);
|
2002-10-23 14:14:55 +00:00
|
|
|
|
if (tiposcheda() != s_giac)
|
|
|
|
|
rmovmag->cursor().set_filterfunction(cau_filter);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
_cur->relation()->replace(rmovmag,1, _form->rmov_joinexp() );
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
TLocalisamfile *mag=new TLocalisamfile(LF_MAG);
|
|
|
|
|
mag->setkey(2);
|
|
|
|
|
TString mag_joinexp;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
mag_joinexp << "ANNOES==\"" << m.get(F_ANNOES) << "\"|CODMAG==CODMAG|CODART==CODART|LIVELLO==LIVGIAC";
|
1997-07-07 11:00:41 +00:00
|
|
|
|
_cur->relation()->replace(mag,2,mag_joinexp);
|
2000-10-03 13:45:12 +00:00
|
|
|
|
|
|
|
|
|
if (cfilter.not_empty())
|
|
|
|
|
cfilter.rtrim(2);
|
1997-07-07 11:00:41 +00:00
|
|
|
|
|
|
|
|
|
_cur->setfilter(cfilter);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
_cur->setregion(darec,arec,0x2);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
((TSorted_cursor*)_cur)->change_order(sortexp);
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
void TStampa_schede_mag::main_loop()
|
2002-02-26 16:20:19 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TStampemg_mask & m = mask();
|
|
|
|
|
while (reload() || m.run() == K_ENTER)
|
2002-02-26 16:20:19 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
reload() = false;
|
|
|
|
|
if (m.magazz_ini().gestmag(TRUE))
|
1997-07-07 11:00:41 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
char dettaglio=m.get(F_ENABLER)[0];
|
|
|
|
|
if (dettaglio=='A' && m.get_int(F_TOLIVELLOART)==0)
|
|
|
|
|
m.set(F_TOLIVELLOART,livelli_articolo().last_level());
|
|
|
|
|
if (dettaglio=='G' && m.get_int(F_TOLIVELLOGIAC)==0)
|
|
|
|
|
m.set(F_TOLIVELLOGIAC,livelli_giacenza().last_level());
|
2001-05-02 13:40:49 +00:00
|
|
|
|
TString16 frmname;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
const bool per_articoli = (*m.get(F_ORDINE) == 'A');
|
|
|
|
|
const bool sintetica = m.get_bool(F_SINTETICA);
|
2001-05-02 13:40:49 +00:00
|
|
|
|
if (per_articoli)
|
|
|
|
|
frmname = "mg3300a";
|
|
|
|
|
else
|
|
|
|
|
frmname = "mg3300b";
|
|
|
|
|
if (sintetica)
|
|
|
|
|
frmname << 's';
|
|
|
|
|
_form = new TForm_schedemag(frmname, "") ;
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_form->set_options(m.get_bool(F_NO_VALORI), m.get_bool(F_NO_FF),
|
2001-05-02 13:40:49 +00:00
|
|
|
|
sintetica);
|
|
|
|
|
|
|
|
|
|
if (per_articoli)
|
1998-04-30 14:59:47 +00:00
|
|
|
|
setprint_perarticoli();
|
2001-05-02 13:40:49 +00:00
|
|
|
|
else
|
1998-04-30 14:59:47 +00:00
|
|
|
|
setprint_permagazzini();
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
2006-07-11 13:10:51 +00:00
|
|
|
|
_form->set_date_limite(m.get_int(F_ANNOES), m.get_date(F_DADATA), m.get_date(F_ADATA));
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
_form->print();
|
|
|
|
|
delete _form;
|
2001-05-02 13:40:49 +00:00
|
|
|
|
_form = NULL;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
}
|
1997-07-07 11:00:41 +00:00
|
|
|
|
} // while true
|
1998-04-30 14:59:47 +00:00
|
|
|
|
return ;
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
2000-05-05 15:25:49 +00:00
|
|
|
|
|
|
|
|
|
bool TStampa_schede_mag::handle_dadata(TMask_field& f, KEY k)
|
|
|
|
|
{
|
|
|
|
|
if (!f.empty() && f.to_check(k)) // se f deve essere controllato (cio<69> se <20> cambiato e sono uscito da lui o dalla maschera)
|
|
|
|
|
{
|
|
|
|
|
const int annoes = f.mask().get_int(F_ANNOES);
|
|
|
|
|
TEsercizi_contabili ec;
|
|
|
|
|
const TEsercizio& es = ec[annoes];
|
2004-03-16 07:43:45 +00:00
|
|
|
|
TDate data(f.get());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (data < es.inizio())
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return f.error_box (FR("La data di inizio non puo' essere anteriore al %s"), es.inizio().string());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TStampa_schede_mag::handle_adata(TMask_field& f, KEY k)
|
|
|
|
|
{
|
|
|
|
|
if (!f.empty() && f.to_check(k)) // se f deve essere controllato (cio<69> se <20> cambiato e sono uscito da lui o dalla maschera)
|
|
|
|
|
{
|
|
|
|
|
const int annoes = f.mask().get_int(F_ANNOES);
|
|
|
|
|
TEsercizi_contabili ec;
|
|
|
|
|
const TEsercizio& es = ec[annoes];
|
2004-03-16 07:43:45 +00:00
|
|
|
|
const TDate data(f.get());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
if (data > es.fine())
|
2004-05-18 10:44:57 +00:00
|
|
|
|
return f.error_box (FR("La data di fine non puo' essere successiva al %s"), es.fine().string());
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
return true;
|
2000-05-05 15:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-11-12 16:43:41 +00:00
|
|
|
|
static bool linker(int n, const char* str)
|
2002-02-26 16:20:19 +00:00
|
|
|
|
{
|
|
|
|
|
if (n == 0)
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TRectype art(LF_ANAMAG);
|
|
|
|
|
|
|
|
|
|
art.put(ANAMAG_CODART, str);
|
|
|
|
|
app().reload() = art.edit();
|
2002-02-26 16:20:19 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
TRectype mov(LF_MOVMAG);
|
|
|
|
|
|
|
|
|
|
mov.put(MOVMAG_NUMREG, str);
|
|
|
|
|
app().reload() = mov.edit();
|
2002-02-26 16:20:19 +00:00
|
|
|
|
}
|
2006-07-11 13:10:51 +00:00
|
|
|
|
return false;
|
2002-02-26 16:20:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
bool TStampa_schede_mag::create()
|
1997-05-23 15:11:42 +00:00
|
|
|
|
{
|
2006-07-11 13:10:51 +00:00
|
|
|
|
open_files(LF_TABCOM, LF_TAB, LF_RMOVMAG, LF_MOVMAG, LF_MAG, LF_ANAMAG, 0);
|
1998-04-30 14:59:47 +00:00
|
|
|
|
_mask = new TStampemg_mask("mg3300");
|
2000-05-05 15:25:49 +00:00
|
|
|
|
_mask->set_handler(F_DADATA,handle_dadata);
|
|
|
|
|
_mask->set_handler(F_ADATA,handle_adata);
|
2006-07-11 13:10:51 +00:00
|
|
|
|
|
|
|
|
|
TConfig prassid(CONFIG_DITTA, "ve"); // apre il file di configurazione della ditta corrente
|
|
|
|
|
|
|
|
|
|
if (prassid.get_bool("CHK_USER", "ve", 1))
|
|
|
|
|
{
|
|
|
|
|
const TString& user1 = prassid.get("PROMPT_USER", "ve", 1);
|
|
|
|
|
|
|
|
|
|
_mask->field(F_DAUSR).set_prompt(user1);
|
|
|
|
|
_mask->show(F_DAUSR); _mask->show(F_AUSR);
|
|
|
|
|
}
|
2002-02-26 16:20:19 +00:00
|
|
|
|
|
|
|
|
|
printer().links().add("Articolo |b|w"); // Crea il link blu alle anagrafiche
|
|
|
|
|
printer().links().add("Movimento |v|w"); // Crea il link viola ai movimenti
|
|
|
|
|
printer().setlinkhandler(linker);
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
return TSkeleton_application::create();
|
1997-05-23 15:11:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
bool TStampa_schede_mag::destroy()
|
1997-05-23 15:11:42 +00:00
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
delete _mask;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
return TSkeleton_application::destroy();
|
1997-05-29 16:31:53 +00:00
|
|
|
|
}
|
1997-05-23 15:11:42 +00:00
|
|
|
|
|
|
|
|
|
int mg3300(int argc, char* argv[])
|
|
|
|
|
{
|
1997-07-07 11:00:41 +00:00
|
|
|
|
TStampa_schede_mag a;// derivata da Application e con uso di form
|
2004-05-18 10:44:57 +00:00
|
|
|
|
a.run(argc,argv,TR("Stampa schede di magazzino"));
|
1997-07-07 11:00:41 +00:00
|
|
|
|
return 0;
|
2004-05-18 10:44:57 +00:00
|
|
|
|
}
|