Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : gestione nuovi listini: aggiunta ricerca automatica e controllo OEM git-svn-id: svn://10.65.10.50/trunk@19347 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8226b1074f
commit
abe8417d5e
@ -11,7 +11,7 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// MASCHERA
|
||||
///////////////////////////////////////////////////////////////
|
||||
class TGestione_listini_semplice_mask: public TAutomask
|
||||
class TGestione_listini_semplice_mask: public TAutomask
|
||||
{
|
||||
|
||||
protected:
|
||||
@ -21,7 +21,7 @@ protected:
|
||||
|
||||
public:
|
||||
int find_art(TSheet_field& s, const char tipo, const TString& art, const int tranne = -1) const;
|
||||
int guess_art(TSheet_field& s, const char tipo, const TString& art) const;
|
||||
int guess_art(TSheet_field& s, const char tipo, const TString& art, const int column) const;
|
||||
TGestione_listini_semplice_mask();
|
||||
|
||||
};
|
||||
@ -40,9 +40,21 @@ TGestione_listini_semplice_mask::TGestione_listini_semplice_mask() : TAutomask("
|
||||
|
||||
//metodo per la ricerca al volo di un articolo (serve per posizionare il cursore sullo sheet in tempo reale..
|
||||
//..mentre si digita il codice articolo nel campo di ricerca
|
||||
int TGestione_listini_semplice_mask::guess_art(TSheet_field& s, const char tipo, const TString& art) const
|
||||
int TGestione_listini_semplice_mask::guess_art(TSheet_field& s, const char tipo, const TString& art,
|
||||
const int column) const
|
||||
{
|
||||
return 0;
|
||||
int i = -1;
|
||||
FOR_EACH_SHEET_ROW(s, r, row)
|
||||
{
|
||||
const char tiporiga = row->get_char(0);
|
||||
const TString& cod = row->get(column);
|
||||
if (tipo == tiporiga && cod.starts_with(art, true))
|
||||
{
|
||||
i = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
//metodo che restituisce l'indice della riga dello sheet che contiene
|
||||
@ -83,14 +95,38 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
|
||||
case F_L_CODRIGA_G:
|
||||
case F_L_CODRIGA_S:
|
||||
case F_L_CODRIGA_R:
|
||||
if (e == fe_modify)
|
||||
if (e == fe_edit || e == fe_modify)
|
||||
{
|
||||
const char tiporiga = get(F_L_TIPORIGA)[0];
|
||||
const TString& codriga = o.get();
|
||||
const TString& codriga = ((TEditable_field&)o).get_window_data();
|
||||
TSheet_field& sf_righe = sfield(F_L_RIGHE);
|
||||
const long riga = find_art(sf_righe, tiporiga, codriga);
|
||||
const long riga = guess_art(sf_righe, tiporiga, codriga, 1);
|
||||
if (riga >= 0)
|
||||
{
|
||||
sf_righe.select(riga, true);
|
||||
const short f_descr = o.dlg() + 1;
|
||||
const char* descr = sf_righe.cell(riga, 2);
|
||||
set(f_descr, descr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case F_L_DESRIGA_A:
|
||||
case F_L_DESRIGA_G:
|
||||
case F_L_DESRIGA_S:
|
||||
case F_L_DESRIGA_R:
|
||||
if (e == fe_edit || e == fe_modify)
|
||||
{
|
||||
const char tiporiga = get(F_L_TIPORIGA)[0];
|
||||
const TString& desriga = ((TEditable_field&)o).get_window_data();
|
||||
TSheet_field& sf_righe = sfield(F_L_RIGHE);
|
||||
const long riga = guess_art(sf_righe, tiporiga, desriga, 2);
|
||||
if (riga >= 0)
|
||||
{
|
||||
sf_righe.select(riga, true);
|
||||
const short f_cod = o.dlg() - 1;
|
||||
const char* cod = sf_righe.cell(riga, 1);
|
||||
set(f_cod, cod);
|
||||
}
|
||||
}
|
||||
break;
|
||||
//se abilita la gestione scaglioni nello sheet devono comparire le colonne NSCAGL e QLIM
|
||||
@ -202,6 +238,8 @@ public:
|
||||
|
||||
void TGestione_listini_semplice::save_rows()
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
|
||||
//attenzione!!! fatto questo casino per poter usare la find_art() che è un metodo della maschera listini
|
||||
const TGestione_listini_semplice_mask& m = *_mask;
|
||||
//instanzio un TISAM_recordset sulle righe listino e un localisamfile
|
||||
@ -296,6 +334,7 @@ int TGestione_listini_semplice::read(TMask& m)
|
||||
//se la read va a buon fine
|
||||
if (err == NOERR)
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
//instanzio un TISAM_recordset sulle righe listino (RCONDV)
|
||||
TISAM_recordset righelist(build_query());
|
||||
righelist.set_var("#CATVEN", m.get(F_L_CATVEN));
|
||||
@ -353,10 +392,18 @@ int TGestione_listini_semplice::write(const TMask& m)
|
||||
}
|
||||
|
||||
bool TGestione_listini_semplice::user_create()
|
||||
{
|
||||
{
|
||||
//controlla che solo il producer AGA possa usare questo programma
|
||||
const int oem = ini_get_int(CONFIG_OEM, "MAIN", "OEM", -1);
|
||||
if (oem != 0)
|
||||
{
|
||||
error_box(TR("Programma non autorizzato!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
_rel = new TRelation(LF_CONDV);
|
||||
|
||||
//attenzione!! questo è il parametro per avere la lunghezza del numero riga
|
||||
//attenzione!! questo è il parametro per avere la lunghezza del numero riga sullo sheet
|
||||
TSheet_field::set_line_number_width(5);
|
||||
|
||||
_mask = new TGestione_listini_semplice_mask;
|
||||
|
@ -124,7 +124,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_L_CODRIGA_A CODART
|
||||
OUTPUT F_L_DESRIGA_A DESCR
|
||||
//CHECKTYPE FORCED
|
||||
CHECKTYPE SEARCH
|
||||
ADD RUN ve2 -3
|
||||
GROUP 1
|
||||
END
|
||||
@ -137,7 +137,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Articolo@20" CODART
|
||||
COPY OUTPUT F_L_CODRIGA_A
|
||||
//CHECKTYPE NORMAL
|
||||
CHECKTYPE SEARCH
|
||||
ADD RUN ve2 -3
|
||||
GROUP 1
|
||||
END
|
||||
@ -152,7 +152,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_L_CODRIGA_G CODTAB[1,3]
|
||||
OUTPUT F_L_DESRIGA_G S0
|
||||
//CHECKTYPE FORCED
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
@ -164,7 +164,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Gr. merc." CODTAB[1,3]
|
||||
COPY OUTPUT F_L_CODRIGA_G
|
||||
//CHECKTYPE NORMAL
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
@ -179,7 +179,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_L_CODRIGA_S CODTAB
|
||||
OUTPUT F_L_DESRIGA_S S0
|
||||
//CHECKTYPE FORCED
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
@ -192,7 +192,7 @@ BEGIN
|
||||
DISPLAY "Gr. merc." CODTAB[1,3]
|
||||
DISPLAY "Sottogr. merc." CODTAB[4,5]
|
||||
COPY OUTPUT F_L_CODRIGA_S
|
||||
//CHECKTYPE NORMAL
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
@ -206,7 +206,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_L_CODRIGA_R CODTAB
|
||||
OUTPUT F_L_DESRIGA_R S0
|
||||
//CHECKTYPE FORCED
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 4
|
||||
END
|
||||
|
||||
@ -218,7 +218,7 @@ BEGIN
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Ragg. fisc." CODTAB
|
||||
COPY OUTPUT F_L_CODRIGA_R
|
||||
//CHECKTYPE NORMAL
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 4
|
||||
END
|
||||
//------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user