Patch level : 10.0 1178

Files correlati     : ve2.exe
Ricompilazione Demo : [ ]
Commento            :
Potenziato collegamento esterno a contratti (Hardy)


git-svn-id: svn://10.65.10.50/branches/R_10_00@22516 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-12-05 16:12:28 +00:00
parent 541c0236eb
commit 542d857cdd
2 changed files with 51 additions and 29 deletions

View File

@ -6,6 +6,7 @@
#include <defmask.h>
#include <modaut.h>
#include <tabutil.h>
//---------------------------------------------------
// MASCHERA ANAGRAFICA MAGAZZINO

View File

@ -1,5 +1,4 @@
#include <automask.h>
#include <defmask.h>
#include <dongle.h>
#include <progind.h>
#include <recarray.h>
@ -15,7 +14,6 @@
#include "ve2500a.h"
#include "ve2500b.h"
const TString& build_query(const char tipo)
{
TString& query = get_tmp_string();
@ -43,12 +41,13 @@ const TString& build_query(const char tipo)
}
return query;
}
////////////////////////////////////////////////////////////////////
// MASCHERA SECONDARIA DI GENERAZIONE LISTINO
////////////////////////////////////////////////////////////////////
class TGestione_listini_semplice_mask_genera: public TAutomask
{
TMask* _main_mask; //puntatore maschera principale
protected:
@ -62,11 +61,8 @@ public:
TGestione_listini_semplice_mask_genera(TMask* main_mask, const TString& mask_name);
};
bool TGestione_listini_semplice_mask_genera::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
return true;
}
{ return true; }
TGestione_listini_semplice_mask_genera::TGestione_listini_semplice_mask_genera(TMask* main_mask, const TString& mask_name)
: TAutomask(mask_name), _main_mask(main_mask)
@ -393,7 +389,6 @@ public:
};
TGestione_listini_semplice_mask::TGestione_listini_semplice_mask(const TString& mask_name) : TAutomask(mask_name)
{
//assegna le posizioni delle colonne dello sheet
@ -536,7 +531,6 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
TSheet_field& sf_righe = sfield(FA_RIGHE);
const bool gest_um = o.get().full();
sf_righe.enable_column(S_UM, gest_um);
sf_righe.force_update();
}
break;
@ -592,21 +586,15 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
break;
case 'G':
if (art.full() && get(FA_CODRIGA_G) != art)
{
set(FA_CODRIGA_G, art, 0x2);
}
break;
case 'S':
if (art.full() && get(FA_CODRIGA_S) != art)
{
set(FA_CODRIGA_S, art, 0x2);
}
break;
case 'R':
if (art.full() && get(FA_CODRIGA_R) != art)
{
set(FA_CODRIGA_R, art, 0x2);
}
break;
default:
break;
@ -629,7 +617,7 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
if (err == NOERR)
{
TToken_string& row = cs.row(cs.selected());
const TString& grmerc = row.get(0);
const char* grmerc = row.get(0);
anamag.put(ANAMAG_GRMERC, grmerc);
anamag.rewrite();
@ -693,13 +681,15 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
}
///////////////////////////////////////////////////////////////
// APPLICAZIONE
// APPLICAZIONE
///////////////////////////////////////////////////////////////
class TGestione_listini_semplice : public TRelation_application
class TGestione_listini_semplice : public TRelation_application
{
TGestione_listini_semplice_mask *_mask;
TGestione_listini_semplice_mask* _mask;
TRelation* _rel;
char _tipo;
long _codice;
private:
void save_rows();
@ -731,9 +721,6 @@ public:
virtual ~TGestione_listini_semplice() {}
};
void TGestione_listini_semplice::save_rows()
{
TWait_cursor hourglass;
@ -1077,12 +1064,36 @@ void TGestione_listini_semplice::mask2ini(const TMask& m, TConfig& ini)
ini.set(field_name, rec.get(field_name));
}
}
}
void TGestione_listini_semplice::init_query_mode(TMask& m)
{
m.disable(DLG_CREA);
// Simple transaction like behaviour with command line arguments only
if (_tipo == 'C' && _codice > 0L)
{
m.set(FA_C_CODCF, _codice);
TEdit_field& contr = m.efield(FA_COD);
TBrowse& browse = *contr.browse();
browse.do_input(true);
TCursor& cur = *browse.cursor();
const TRecnotype nrecs = cur.items();
if (nrecs > 0)
{
const TDate oggi(TODAY);
const TRectype& curr = cur.curr();
for (cur = 0L; cur.pos() < nrecs-1; ++cur)
{
const TDate fine = curr.get(CONDV_VALFIN);
if (!fine.ok() || fine >= oggi)
break;
}
browse.do_output();
m.send_key(K_AUTO_ENTER, 0);
}
}
}
void TGestione_listini_semplice::init_insert_mode(TMask& m)
@ -1108,18 +1119,28 @@ bool TGestione_listini_semplice::user_create()
//decide il tipo di condizione di vendita: 'L'istino, 'C'ontratto 'O'fferta
_tipo = 'L';
_codice = 0L;
if (argc() > 2) //se la chiamata ha un parametro ulteriore ('ve2 -4 c', ad esempio)..
{
TFilename trans = argv(2); //..prende il parametro ulteriore
if (trans.len() == 1) //se è lungo 1 -> chiamata da menu...
{
_tipo = trans[0];
if (argc() > 3) // Es. Hardy: ve2 -4 c 210100
_codice = max(0, atol(argv(3)));
}
else
{
trans.ltrim(2); //..sennò chiamata interattiva con file .ini
if (trans.exist())
if (trans.starts_with("-i", true) || trans.starts_with("/i", true))
{
TConfig ini(trans, "52");
_tipo = ini.get_char("TIPO");
trans.ltrim(2); //..sennò chiamata interattiva con file .ini
if (trans.exist())
{
TConfig ini(trans, "52");
_tipo = ini.get_char("TIPO");
if (_tipo == 'C')
_codice = ini.get_char(CONDV_CODCF);
}
}
}
_tipo = toupper(_tipo);
@ -1133,7 +1154,7 @@ bool TGestione_listini_semplice::user_create()
//super-attenzione! la maschera da caricare viene decisa in base al tipo di condizione di vendita
TString16 mask_name;
mask_name << "ve2500a" << _tipo;
_mask = new TGestione_listini_semplice_mask(mask_name);
_mask = new TGestione_listini_semplice_mask(mask_name);
return true;
}
@ -1147,6 +1168,6 @@ bool TGestione_listini_semplice::user_destroy()
int ve2500(int argc, char* argv[])
{
TGestione_listini_semplice a;
a.run(argc, argv, "Gestione listini");
a.run(argc, argv, TR("Gestione listini"));
return 0;
}