Patch level : 10.0 250

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :

Bug 0001128

Nella gestione documenti provvisori è possibile definire come documento definitovo diverso un tipo documento non appartenente alla numerazione.
Inoltre nella tabella delle numerazioni se premo nuovo per aggiungere una nuova numerazione non svuota i campi S8 ed S9,


git-svn-id: svn://10.65.10.50/trunk@18368 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-02-26 23:46:50 +00:00
parent 2a3520ba47
commit e1b1201862
2 changed files with 50 additions and 3 deletions

@ -4,6 +4,7 @@
#include <tabapp.h>
#include "vetbnum.h"
#include "velib.h"
#include "../ca/calib01.h"
#include "vetbspp.h"
@ -60,9 +61,49 @@ void TVendite_mask::reset_printer_config() const
ini.remove_all();
}
static TString16 __tab_codnum;
bool tab_tipodoc_ok(const TString & tipodoc)
{
const TString4 module(main_app().name().left(2));
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
const TString & tipomod = tipo.module();
if (module == "ve" && tipomod.blank())
return true;
return tipomod == module;
}
bool tab_tip_filter(const TRelation* r)
{
if (__tab_codnum.blank())
return true;
const TCodice_numerazione & cod_num = cached_numerazione(__tab_codnum);
const TString4 tipo = r->curr().get("CODTAB");
int last = cod_num.ntipi_doc();
for (int i = 0; i < last; i++ )
{
const TString & curtipo = cod_num.tipo_doc(i);
if (curtipo == tipo && tab_tipodoc_ok(curtipo))
return true;
}
return false;
}
bool TVendite_mask::on_num_event(TOperable_field& o, TField_event e, long jolly)
{
return true; //metodo che gestiva la stampante per le numerazioni documenti
switch (o.dlg())
{
case F_CODNUM:
if (e == fe_modify)
__tab_codnum = o.get();
break;
default:
break;
}
return true; //metodo che gestiva la stampante per le numerazioni documenti
}
bool TVendite_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -77,6 +118,12 @@ TVendite_mask::TVendite_mask(const char* name) : TAutomask(name)
const TFixed_string n(name);
_tab = n.mid(4,3);
_tab.upper();
if (is_table("NUM"))
{
TCursor * cur = efield(F_TIPODOC).browse()->cursor();
cur->set_filterfunction(tab_tip_filter);
}
}
///////////////////////////////////////////////////////////

@ -84,7 +84,7 @@ PAGE "Numerazione documenti" 0 0 0 0
DISPLAY "Descrizione@50" S0
OUTPUT F_CODNUM CODTAB
CHECKTYPE NORMAL
FLAG "UPAD"
FLAG "UD"
WARNING "Numerazione assente"
FIELD S8
GROUP 2
@ -100,7 +100,7 @@ PAGE "Numerazione documenti" 0 0 0 0
DISPLAY "Descrizione@50" S0
OUTPUT F_TIPODOC CODTAB
CHECKTYPE NORMAL
FLAG "UPD"
FLAG "UD"
FIELD S9
GROUP 2
END