Macro con nomi di archivio
Derivazione del form da quello generico delle stampe mag Gestione Causale sulle righe git-svn-id: svn://10.65.10.50/trunk@4835 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
857ef34dbb
commit
65d87bb2c1
103
mg/mg3300.cpp
103
mg/mg3300.cpp
@ -1,28 +1,24 @@
|
||||
#include <applicat.h>
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <printer.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "movmag.h"
|
||||
#include "rmovmag.h"
|
||||
|
||||
#include "mglib.h"
|
||||
#include "mg3300.h"
|
||||
|
||||
class TForm_schedemag : public TForm
|
||||
|
||||
class TForm_schedemag : public TForm_stampemg
|
||||
{
|
||||
TRecord_cache * _causali_mag;
|
||||
int _tolivgiac,_tolivart;
|
||||
bool _sottocatmer;
|
||||
|
||||
TToken_string *_rmov_sortexp;
|
||||
TString *_rmov_raggcond,*_rmov_joinexp;
|
||||
|
||||
TCausale_magazzino * _cau; // causale di magazzino del movimento corrente
|
||||
TMag_livelli * _giaclev,*_artlev; // gestori dei gruppi articolo/giacenza
|
||||
TDecoder *_giacgrp,*_artgrp; // decodifiche dei gruppi articolo/giacenza
|
||||
//TMag_livelli * _giaclev,*_artlev; // gestori dei gruppi articolo/giacenza
|
||||
//TDecoder *_giacgrp,*_artgrp; // decodifiche dei gruppi articolo/giacenza
|
||||
TTipo_saldomag _tiposcheda; // tipo scheda
|
||||
|
||||
bool ragg_exprs(int livart,int livgiac);
|
||||
@ -69,19 +65,19 @@ TString TForm_schedemag::nomecampo_tiposcheda()
|
||||
switch (_tiposcheda)
|
||||
{
|
||||
case s_giac:
|
||||
return ("GIAC");
|
||||
return (MAG_GIAC);
|
||||
case s_acl:
|
||||
return ("ACL");
|
||||
return (MAG_ACL);
|
||||
case s_incl:
|
||||
return ("INCL");
|
||||
return (MAG_INCL);
|
||||
case s_prodc:
|
||||
return ("PRODCOMP");
|
||||
return (MAG_PRODCOMP);
|
||||
case s_prodf:
|
||||
return ("PRODFIN");
|
||||
return (MAG_PRODFIN);
|
||||
case s_ordc:
|
||||
return ("ORDC");
|
||||
return (MAG_ORDC);
|
||||
case s_ordf:
|
||||
return ("ORDF");
|
||||
return (MAG_ORDF);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -93,12 +89,6 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
||||
|
||||
if (code=="_USER") {
|
||||
subcode=s.get();
|
||||
if (subcode=="*SEGNOCAUS") {
|
||||
real v(cf.get());
|
||||
v=v*_cau->sgn(_tiposcheda);
|
||||
cf.set(v.string());
|
||||
return TRUE;
|
||||
}
|
||||
if (subcode=="TIPOSCHEDA") {
|
||||
cf.set(descr_tiposcheda());
|
||||
return TRUE;
|
||||
@ -113,7 +103,7 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
||||
if (_tolivart==_artlev->last_level())
|
||||
valore=relation()->lfile(LF_ANAMAG).get("DESCR");
|
||||
else
|
||||
valore=(_artgrp->decode(_artlev->build_tabcode(relation()->lfile(LF_ANAMAG).get("CODART"),_tolivart)));
|
||||
valore=_artlev->group_descr(relation()->lfile(LF_ANAMAG).get("CODART"),_tolivart);
|
||||
cf.set(valore);
|
||||
return TRUE;
|
||||
}
|
||||
@ -133,15 +123,10 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
||||
}
|
||||
if (subcode=="GRUPPOGIAC") {
|
||||
TString valore;
|
||||
valore=_giacgrp->decode(_giaclev->build_tabcode(relation()->lfile(LF_RMOVMAG).get("LIVGIAC"),_tolivgiac));
|
||||
valore=_giaclev->group_descr(relation()->lfile(LF_RMOVMAG).get("LIVGIAC"),_tolivgiac);
|
||||
cf.set(valore);
|
||||
return TRUE;
|
||||
}
|
||||
if (subcode=="SETCAUSALE") {
|
||||
if (_cau) delete _cau;
|
||||
_cau = new TCausale_magazzino(cf.get());
|
||||
return TRUE;
|
||||
}
|
||||
if (subcode=="CODCATMER") {
|
||||
TString valore(relation()->lfile(LF_ANAMAG).get("GRMERC"));
|
||||
if (!_sottocatmer)
|
||||
@ -158,6 +143,23 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
||||
cf.set(valore);
|
||||
return TRUE;
|
||||
}
|
||||
TCausale_magazzino &cau_r=(TCausale_magazzino &)_causali_mag->get(relation()->lfile(LF_RMOVMAG).get(RMOVMAG_CODCAUS));
|
||||
TCausale_magazzino &cau_m=(TCausale_magazzino &)_causali_mag->get(relation()->lfile(LF_MOVMAG).get(MOVMAG_CODCAUS));
|
||||
TCausale_magazzino &cau=(cau_r.codice().blank() ? cau_m : cau_r);
|
||||
if (subcode=="*SEGNOCAUS") {
|
||||
real v(cf.get());
|
||||
v=v*cau.sgn(_tiposcheda) ;
|
||||
cf.set(v.string());
|
||||
return TRUE;
|
||||
}
|
||||
if (subcode=="CAUSALERIGA") {
|
||||
cf.set(cau.codice());
|
||||
return TRUE;
|
||||
}
|
||||
if (subcode=="DESCRCAUSALE") {
|
||||
cf.set(cau.descr());
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return TForm::validate(cf, s);
|
||||
}
|
||||
@ -195,8 +197,10 @@ void TForm_schedemag::setdett_percatmer(bool sottocat,int livart,int livgiac,boo
|
||||
h_c.enable();
|
||||
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
||||
h_a.enable();
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_g.enable((livart ==0 || livgiac !=0 ));
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV");
|
||||
h_g.enable((livart ==0 || livgiac !=0 || sudd_mag));
|
||||
TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_l.enable(livgiac !=0 );
|
||||
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");
|
||||
@ -275,20 +279,22 @@ void TForm_schedemag::setdett_perart(bool percatmer,bool sottocatmer,int livart,
|
||||
h_cm2.enable(percatmer);
|
||||
|
||||
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
||||
h_a.enable(livart!=0);
|
||||
h_a.enable(livart!=0 && !sudd_mag);
|
||||
TForm_subsection &t_a=(TForm_subsection &)find_field('B',odd_page,"TOTALI_GRUPPIART");
|
||||
t_a.show(livart!=0);
|
||||
t_a.show( livart!=0 && !sudd_mag);
|
||||
|
||||
// raggruppamento MAX fino alla giacenza
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_g.enable((livart ==0 || livgiac !=0 ));
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV");
|
||||
h_g.enable((livart ==0 || livgiac !=0 || sudd_mag));
|
||||
TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_l.enable(livart ==0 || livgiac !=0 );
|
||||
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");
|
||||
t_s.show(livart==0);
|
||||
t_s.show(livart==0 || livgiac !=0 || sudd_mag);
|
||||
|
||||
_tolivart=livart ? livart :_artlev->last_level() ;
|
||||
_tolivgiac=livgiac ? livgiac :_giaclev->last_level();
|
||||
@ -349,13 +355,9 @@ void TForm_schedemag::set_tiposcheda(const char * tipo)
|
||||
}
|
||||
|
||||
TForm_schedemag::TForm_schedemag(const char *name,const char *code) :
|
||||
TForm(name,code)
|
||||
TForm_stampemg(name,code)
|
||||
{
|
||||
_giaclev= new TMag_livelli("FCG");
|
||||
_artlev= new TMag_livelli("FCA");
|
||||
_giacgrp= new TDecoder("GCG");
|
||||
_artgrp= new TDecoder("GCA");
|
||||
_cau=NULL;
|
||||
_causali_mag=new TRecord_cache("%CAU");
|
||||
_tolivgiac=0;
|
||||
_tolivart=0;
|
||||
|
||||
@ -366,14 +368,10 @@ TForm_schedemag::TForm_schedemag(const char *name,const char *code) :
|
||||
|
||||
TForm_schedemag::~TForm_schedemag()
|
||||
{
|
||||
delete _giaclev;
|
||||
delete _artlev;
|
||||
delete _giacgrp;
|
||||
delete _artgrp;
|
||||
delete _rmov_sortexp;
|
||||
delete _rmov_joinexp;
|
||||
delete _rmov_raggcond;
|
||||
if (_cau) delete _cau;
|
||||
delete _causali_mag;
|
||||
}
|
||||
|
||||
|
||||
@ -487,8 +485,8 @@ void TStampa_schede_mag::setprint_permagazzini()
|
||||
|
||||
// Imposta i livelli di dettaglio della scheda
|
||||
_form->setdett_permag(
|
||||
_mask->get_bool(F_SUDDIV_MAGAZZINI),
|
||||
_mask->get_bool(F_SUDDIV_DEPOSITI),
|
||||
_mask->get_bool(F_DETTAGLIOMAG),
|
||||
_mask->get_bool(F_DETTAGLIODEP),
|
||||
_mask->get_int(F_TOLIVELLOART),
|
||||
_mask->get_int(F_TOLIVELLOGIAC));
|
||||
|
||||
@ -642,6 +640,7 @@ bool TStampa_schede_mag::user_create()
|
||||
_files->add(new TLocalisamfile(LF_RMOVMAG));
|
||||
_files->add(new TLocalisamfile(LF_MOVMAG));
|
||||
_files->add(new TLocalisamfile(LF_MAG));
|
||||
_files->add(new TLocalisamfile(LF_TABCOM));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user