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:
		
							parent
							
								
									541c0236eb
								
							
						
					
					
						commit
						542d857cdd
					
				@ -6,6 +6,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <defmask.h>
 | 
					#include <defmask.h>
 | 
				
			||||||
#include <modaut.h>
 | 
					#include <modaut.h>
 | 
				
			||||||
 | 
					#include <tabutil.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//---------------------------------------------------
 | 
					//---------------------------------------------------
 | 
				
			||||||
// MASCHERA ANAGRAFICA MAGAZZINO
 | 
					// MASCHERA ANAGRAFICA MAGAZZINO
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,4 @@
 | 
				
			|||||||
#include <automask.h>
 | 
					#include <automask.h>
 | 
				
			||||||
#include <defmask.h>
 | 
					 | 
				
			||||||
#include <dongle.h>
 | 
					#include <dongle.h>
 | 
				
			||||||
#include <progind.h>
 | 
					#include <progind.h>
 | 
				
			||||||
#include <recarray.h>
 | 
					#include <recarray.h>
 | 
				
			||||||
@ -15,7 +14,6 @@
 | 
				
			|||||||
#include "ve2500a.h"
 | 
					#include "ve2500a.h"
 | 
				
			||||||
#include "ve2500b.h"
 | 
					#include "ve2500b.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
const TString& build_query(const char tipo)
 | 
					const TString& build_query(const char tipo)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString& query = get_tmp_string();
 | 
					  TString& query = get_tmp_string();
 | 
				
			||||||
@ -43,12 +41,13 @@ const TString& build_query(const char tipo)
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  return query;
 | 
					  return query;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
////////////////////////////////////////////////////////////////////
 | 
					////////////////////////////////////////////////////////////////////
 | 
				
			||||||
//  MASCHERA SECONDARIA DI GENERAZIONE LISTINO 
 | 
					//  MASCHERA SECONDARIA DI GENERAZIONE LISTINO 
 | 
				
			||||||
////////////////////////////////////////////////////////////////////
 | 
					////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TGestione_listini_semplice_mask_genera: public TAutomask
 | 
					class TGestione_listini_semplice_mask_genera: public TAutomask
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					 | 
				
			||||||
  TMask* _main_mask;  //puntatore maschera principale
 | 
					  TMask* _main_mask;  //puntatore maschera principale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
@ -62,11 +61,8 @@ public:
 | 
				
			|||||||
  TGestione_listini_semplice_mask_genera(TMask* main_mask, const TString& mask_name);
 | 
					  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)
 | 
					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)
 | 
					TGestione_listini_semplice_mask_genera::TGestione_listini_semplice_mask_genera(TMask* main_mask, const TString& mask_name)
 | 
				
			||||||
                                      : TAutomask(mask_name), _main_mask(main_mask)
 | 
					                                      : 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)
 | 
					TGestione_listini_semplice_mask::TGestione_listini_semplice_mask(const TString& mask_name) : TAutomask(mask_name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  //assegna le posizioni delle colonne dello sheet
 | 
					  //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);
 | 
					      TSheet_field& sf_righe = sfield(FA_RIGHE);
 | 
				
			||||||
      const bool gest_um = o.get().full();
 | 
					      const bool gest_um = o.get().full();
 | 
				
			||||||
      sf_righe.enable_column(S_UM, gest_um);
 | 
					      sf_righe.enable_column(S_UM, gest_um);
 | 
				
			||||||
 | 
					 | 
				
			||||||
      sf_righe.force_update();
 | 
					      sf_righe.force_update();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    break;
 | 
					    break;
 | 
				
			||||||
@ -592,21 +586,15 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
 | 
				
			|||||||
        break;
 | 
					        break;
 | 
				
			||||||
      case 'G':
 | 
					      case 'G':
 | 
				
			||||||
        if (art.full() && get(FA_CODRIGA_G) != art)
 | 
					        if (art.full() && get(FA_CODRIGA_G) != art)
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          set(FA_CODRIGA_G, art, 0x2);
 | 
					          set(FA_CODRIGA_G, art, 0x2);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      case 'S':
 | 
					      case 'S':
 | 
				
			||||||
        if (art.full() && get(FA_CODRIGA_S) != art)
 | 
					        if (art.full() && get(FA_CODRIGA_S) != art)
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          set(FA_CODRIGA_S, art, 0x2);
 | 
					          set(FA_CODRIGA_S, art, 0x2);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      case 'R':
 | 
					      case 'R':
 | 
				
			||||||
        if (art.full() && get(FA_CODRIGA_R) != art)
 | 
					        if (art.full() && get(FA_CODRIGA_R) != art)
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          set(FA_CODRIGA_R, art, 0x2);
 | 
					          set(FA_CODRIGA_R, art, 0x2);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      default:
 | 
					      default:
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
@ -629,7 +617,7 @@ bool TGestione_listini_semplice_mask::on_field_event(TOperable_field &o, TField_
 | 
				
			|||||||
        if (err == NOERR)
 | 
					        if (err == NOERR)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          TToken_string& row = cs.row(cs.selected());
 | 
					          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.put(ANAMAG_GRMERC, grmerc);
 | 
				
			||||||
          anamag.rewrite();
 | 
					          anamag.rewrite();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -695,11 +683,13 @@ 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;
 | 
					  TRelation* _rel;
 | 
				
			||||||
  char _tipo;
 | 
					  char _tipo;
 | 
				
			||||||
 | 
					  long _codice;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
  void save_rows();
 | 
					  void save_rows();
 | 
				
			||||||
@ -731,9 +721,6 @@ public:
 | 
				
			|||||||
  virtual ~TGestione_listini_semplice() {}
 | 
					  virtual ~TGestione_listini_semplice() {}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void TGestione_listini_semplice::save_rows()
 | 
					void TGestione_listini_semplice::save_rows()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TWait_cursor hourglass;
 | 
					  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));
 | 
					      ini.set(field_name, rec.get(field_name));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TGestione_listini_semplice::init_query_mode(TMask& m)
 | 
					void TGestione_listini_semplice::init_query_mode(TMask& m)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  m.disable(DLG_CREA);
 | 
					  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)
 | 
					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
 | 
					  //decide il tipo di condizione di vendita: 'L'istino, 'C'ontratto 'O'fferta
 | 
				
			||||||
  _tipo = 'L';
 | 
					  _tipo = 'L';
 | 
				
			||||||
 | 
					  _codice = 0L;
 | 
				
			||||||
  if (argc() > 2) //se la chiamata ha un parametro ulteriore ('ve2 -4 c', ad esempio)..
 | 
					  if (argc() > 2) //se la chiamata ha un parametro ulteriore ('ve2 -4 c', ad esempio)..
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    TFilename trans = argv(2);  //..prende il parametro ulteriore
 | 
					    TFilename trans = argv(2);  //..prende il parametro ulteriore
 | 
				
			||||||
    if (trans.len() == 1) //se è lungo 1 -> chiamata da menu...
 | 
					    if (trans.len() == 1) //se è lungo 1 -> chiamata da menu...
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      _tipo = trans[0];
 | 
					      _tipo = trans[0];
 | 
				
			||||||
 | 
					      if (argc() > 3) // Es. Hardy:  ve2 -4 c 210100
 | 
				
			||||||
 | 
					        _codice = max(0, atol(argv(3)));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      if (trans.starts_with("-i", true) || trans.starts_with("/i", true))
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        trans.ltrim(2);   //..sennò chiamata interattiva con file .ini
 | 
					        trans.ltrim(2);   //..sennò chiamata interattiva con file .ini
 | 
				
			||||||
        if (trans.exist())
 | 
					        if (trans.exist())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          TConfig ini(trans, "52");
 | 
					          TConfig ini(trans, "52");
 | 
				
			||||||
          _tipo = ini.get_char("TIPO");
 | 
					          _tipo = ini.get_char("TIPO");
 | 
				
			||||||
 | 
					          if (_tipo == 'C')
 | 
				
			||||||
 | 
					            _codice = ini.get_char(CONDV_CODCF);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    _tipo = toupper(_tipo);
 | 
					    _tipo = toupper(_tipo);
 | 
				
			||||||
@ -1147,6 +1168,6 @@ bool TGestione_listini_semplice::user_destroy()
 | 
				
			|||||||
int ve2500(int argc, char* argv[])
 | 
					int ve2500(int argc, char* argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TGestione_listini_semplice a; 
 | 
					  TGestione_listini_semplice a; 
 | 
				
			||||||
  a.run(argc, argv, "Gestione listini");
 | 
					  a.run(argc, argv, TR("Gestione listini"));
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user