Patch level : 12.0 412
Files correlati : ve2.exe md1.exe ve0.exe ve1.exe ve5.exe ve6.exe Modificato il modo di aggiornare le giacenze di magazzino: 1) Viene bloccato il record di giacenza singolo. 2) l'aggiornamento dell'anagrafica non scrive più le giacenze, l'aggiornamento si può attivare premendo Shift-F12 3) l'aggiornamento dall'anagrafica di magazzino aggiorna solo i record cambiati di giacenza e di giacenza per cliente. git-svn-id: svn://10.65.10.50/branches/R_10_00@23902 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5ed80b3ffb
								
							
						
					
					
						commit
						a90d9a4176
					
				@ -3,11 +3,43 @@
 | 
			
		||||
#include "ve2401.h"
 | 
			
		||||
 | 
			
		||||
#include "../ca/calib01.h"
 | 
			
		||||
#include "../lv/lvrcondv.h"
 | 
			
		||||
 | 
			
		||||
#include <defmask.h>
 | 
			
		||||
#include <modaut.h>
 | 
			
		||||
#include <progind.h>
 | 
			
		||||
#include <tabutil.h>
 | 
			
		||||
 | 
			
		||||
 const char * get_token(TSheet_field & s, int r, int dlg)
 | 
			
		||||
 {
 | 
			
		||||
   TString & tmp = get_tmp_string(50);
 | 
			
		||||
   TToken_string & row = s.row(r);
 | 
			
		||||
 | 
			
		||||
   tmp = row.get(s.cid2index(dlg));
 | 
			
		||||
   tmp.rpad(s.sheet_mask().field(dlg).size());
 | 
			
		||||
 | 
			
		||||
   return tmp;
 | 
			
		||||
 }
 | 
			
		||||
   
 | 
			
		||||
int cmp_rows(TSheet_field & s, int r1, int r2)
 | 
			
		||||
 {
 | 
			
		||||
   TString key1(get_token(s, r1, F_LIV1));
 | 
			
		||||
   TString key2(get_token(s, r2, F_LIV1));
 | 
			
		||||
 | 
			
		||||
   key1 << get_token(s, r1, F_LIV2);
 | 
			
		||||
   key1 << get_token(s, r1, F_LIV3);
 | 
			
		||||
   key1 << get_token(s, r1, F_LIV4);
 | 
			
		||||
   key1 << get_token(s, r1, F_CODMAG);
 | 
			
		||||
   key1 << get_token(s, r1, F_CODDEP);
 | 
			
		||||
   key2 << get_token(s, r2, F_LIV2);
 | 
			
		||||
   key2 << get_token(s, r2, F_LIV3);
 | 
			
		||||
   key2 << get_token(s, r2, F_LIV4);
 | 
			
		||||
   key2 << get_token(s, r2, F_CODMAG);
 | 
			
		||||
   key2 << get_token(s, r2, F_CODDEP);
 | 
			
		||||
 | 
			
		||||
   return key1.compare(key2);
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
//---------------------------------------------------
 | 
			
		||||
// MASCHERA ANAGRAFICA MAGAZZINO
 | 
			
		||||
//---------------------------------------------------
 | 
			
		||||
@ -25,6 +57,7 @@ class TMask_anamag: public TMask
 | 
			
		||||
  TString8 _ean13_pref;
 | 
			
		||||
	bool		 _ean8_cin;
 | 
			
		||||
  TString16 _generated_code;
 | 
			
		||||
	TString_array _giacs;
 | 
			
		||||
 | 
			
		||||
  TMagazzini *_magazzini;
 | 
			
		||||
 | 
			
		||||
@ -48,6 +81,7 @@ class TMask_anamag: public TMask
 | 
			
		||||
  static bool handle_sheet_giac_valgiac(TMask_field &, KEY); // handler 
 | 
			
		||||
  static bool handle_sheet_stomag_stoval(TMask_field &, KEY); // handler 
 | 
			
		||||
  static bool handle_autoinsert_livgiac(TMask_field &, KEY); // handler del campo 
 | 
			
		||||
  static bool handle_valconv(TMask_field&, KEY); // handler del valore convenzionale
 | 
			
		||||
 | 
			
		||||
  static void sheetgiac_get(TSheet_field &fld_righe, int item);
 | 
			
		||||
  static void sheetgiac_put(TSheet_field &fld_righe, int item);
 | 
			
		||||
@ -61,12 +95,15 @@ class TMask_anamag: public TMask
 | 
			
		||||
  void update_totali_storico(TString & codmag);
 | 
			
		||||
  bool check_totali_storico();
 | 
			
		||||
	void create_user_fields();
 | 
			
		||||
	void write_enable(bool on);
 | 
			
		||||
	virtual bool on_key(KEY key);
 | 
			
		||||
  
 | 
			
		||||
public:
 | 
			
		||||
  bool generate_code(int _type = 0, const char * codart = NULL);
 | 
			
		||||
  void update_ordc_ordf();
 | 
			
		||||
  void set_parametered_fields();
 | 
			
		||||
  void ricalcola_giacenze();
 | 
			
		||||
	TString_array & giacs() { return _giacs;}
 | 
			
		||||
	void disable_user_page() { disable_page(_disabled_user_page);}
 | 
			
		||||
  TCodart_livelli * get_livelli_art() const { return livelli_art; }
 | 
			
		||||
 | 
			
		||||
@ -86,6 +123,11 @@ class TAnagrafica_magazzino : public TRelation_application
 | 
			
		||||
{
 | 
			
		||||
  TMask_anamag *_msk; // maschera principale
 | 
			
		||||
  TRelation *_rel; // relazione principale di un solo file (anagrafiche di magazzino)
 | 
			
		||||
	real _uc1;
 | 
			
		||||
  TDate _duc1;
 | 
			
		||||
	real _uc2;
 | 
			
		||||
  TDate _duc2;
 | 
			
		||||
	bool	_write_giacenze;
 | 
			
		||||
 | 
			
		||||
protected:    
 | 
			
		||||
  virtual bool user_create();
 | 
			
		||||
@ -112,6 +154,9 @@ protected:
 | 
			
		||||
  static bool handle_copia(TMask_field &, KEY); // handler della copia articolo
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	bool	write_giacenze() const {return _write_giacenze;} 
 | 
			
		||||
	void	set_write_giacenze(bool on) {_write_giacenze = on;} 
 | 
			
		||||
 | 
			
		||||
	virtual TRelation *get_relation() const { return _rel; }
 | 
			
		||||
  // @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
 | 
			
		||||
  virtual bool check_autorization() const { return false; }
 | 
			
		||||
@ -374,8 +419,11 @@ void TMask_anamag::set_parametered_fields()
 | 
			
		||||
  enable_page(PAGE_GIACENZE,gestmag);
 | 
			
		||||
  enable_page(PAGE_STORICO,gestmag);
 | 
			
		||||
 | 
			
		||||
  /* Obsoleto
 | 
			
		||||
  // abilita la visualizzazione dei campi per la vendita al dettaglio
 | 
			
		||||
 
 | 
			
		||||
// if (app().has_module(LVAUT))
 | 
			
		||||
//   set_handler(F_VALCONV, handle_valconv);
 | 
			
		||||
 | 
			
		||||
 /* abilita la visualizzazione dei campi per la vendita al dettaglio
 | 
			
		||||
	const bool dettaglio = app().has_module(VDAUT);
 | 
			
		||||
  show(-G_VD, dettaglio);
 | 
			
		||||
  */
 | 
			
		||||
@ -471,6 +519,7 @@ TMask_anamag::TMask_anamag(TRelation * rel) : TMask("ve2400")
 | 
			
		||||
{
 | 
			
		||||
  _rel=rel;
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
	// sheet unità di misura
 | 
			
		||||
  set_handler(F_SHEETUM, handle_sheet_um);
 | 
			
		||||
  TSheet_field &f= sfield(F_SHEETUM);
 | 
			
		||||
@ -572,17 +621,12 @@ void TMask_anamag::sheetsto_get(TSheet_field &sheet_sto, int item)
 | 
			
		||||
 | 
			
		||||
bool TMask_anamag::info_sto_dirty()
 | 
			
		||||
{
 | 
			
		||||
  return 
 | 
			
		||||
  field(F_STOULTCOS1).focusdirty() ||
 | 
			
		||||
    field(F_STOULTCOS2).focusdirty() ||
 | 
			
		||||
      field(F_STOCOSTOSTD).focusdirty() ||
 | 
			
		||||
        field(F_STOCOSTOMEDIO).focusdirty()||
 | 
			
		||||
          field(F_STOCATVEN ).focusdirty()||
 | 
			
		||||
            field(F_STOCODLIST).focusdirty()||
 | 
			
		||||
  return field(F_STOULTCOS1).focusdirty() || field(F_STOULTCOS2).focusdirty() ||
 | 
			
		||||
				 field(F_STOCOSTOSTD).focusdirty() || field(F_STOCOSTOMEDIO).focusdirty()||
 | 
			
		||||
				 field(F_STOCATVEN ).focusdirty()|| field(F_STOCODLIST).focusdirty()||
 | 
			
		||||
				 field(F_STOPREZZOLIST).focusdirty();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void TMask_anamag::clear_info_sto()
 | 
			
		||||
{
 | 
			
		||||
  reset(F_STOULTCOS1);
 | 
			
		||||
@ -594,6 +638,26 @@ void TMask_anamag::clear_info_sto()
 | 
			
		||||
  reset(F_STOPREZZOLIST);
 | 
			
		||||
}
 | 
			
		||||
  
 | 
			
		||||
void TMask_anamag::write_enable(bool on)
 | 
			
		||||
{
 | 
			
		||||
  TSheet_field& sgiac = sfield(F_SHEETGIAC);
 | 
			
		||||
	int annoes = get_int(F_ANNORIF);
 | 
			
		||||
 | 
			
		||||
	app().set_write_giacenze(on);
 | 
			
		||||
	show(F_WRITEON, on);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TMask_anamag::on_key(KEY key)
 | 
			
		||||
{
 | 
			
		||||
	if (key == K_SHIFT + K_F12)
 | 
			
		||||
	{
 | 
			
		||||
    TMask_field& w = field(F_WRITEON);
 | 
			
		||||
		const bool write = !w.shown();
 | 
			
		||||
 | 
			
		||||
		write_enable(write);
 | 
			
		||||
	}
 | 
			
		||||
	return TMask::on_key(key);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TMask_anamag::~TMask_anamag()
 | 
			
		||||
{
 | 
			
		||||
@ -839,18 +903,56 @@ bool TMask_anamag::handle_anno(TMask_field &fld, KEY k)
 | 
			
		||||
    }
 | 
			
		||||
    if (mask.last_annogiac>0 && mask.last_annogiac!=fld.mask().get_int(F_ANNO)) 
 | 
			
		||||
    {
 | 
			
		||||
      if (fld_giac.dirty() && handle_sheetgiac(fld_giac,K_ENTER)) 
 | 
			
		||||
      if (app().write_giacenze() && fld_giac.dirty() && handle_sheetgiac(fld_giac,K_ENTER)) 
 | 
			
		||||
      {
 | 
			
		||||
        if (fld.yesno_box("Salvare le righe di giacenza per l'anno %d",mask.last_annogiac )) 
 | 
			
		||||
        {
 | 
			
		||||
				  int annoes = mask.last_annogiac;
 | 
			
		||||
					const int original_rows = mask.giacs().items();
 | 
			
		||||
					int rows = fld_giac.items();
 | 
			
		||||
				  TLocalisamfile mag(LF_MAG);
 | 
			
		||||
 | 
			
		||||
					mag.setkey(2);
 | 
			
		||||
					rows = min(original_rows, rows);
 | 
			
		||||
					for (int i = 0; i < rows; i++)
 | 
			
		||||
					{
 | 
			
		||||
						TToken_string & original_row = mask.giacs().row(i);
 | 
			
		||||
						TToken_string & row = fld_giac.row(i);
 | 
			
		||||
 | 
			
		||||
						if (original_row == row)
 | 
			
		||||
						{
 | 
			
		||||
							mag.zero();
 | 
			
		||||
							TString16 codmag = original_row.get(fld_giac.cid2index(F_CODMAG));
 | 
			
		||||
 | 
			
		||||
							codmag.rpad(3);
 | 
			
		||||
							codmag << original_row.get(fld_giac.cid2index(F_CODDEP));
 | 
			
		||||
							mag.put(MAG_CODMAG, codmag);
 | 
			
		||||
							mag.put(MAG_CODART, mask.get(F_CODART));
 | 
			
		||||
 | 
			
		||||
							TString livello = original_row.get(fld_giac.cid2index(F_LIV1));
 | 
			
		||||
							
 | 
			
		||||
							livello << original_row.get(fld_giac.cid2index(F_LIV2));
 | 
			
		||||
							livello << original_row.get(fld_giac.cid2index(F_LIV3));
 | 
			
		||||
							livello << original_row.get(fld_giac.cid2index(F_LIV4));
 | 
			
		||||
							mag.put(MAG_LIVELLO, livello);
 | 
			
		||||
							mag.put(MAG_ANNOES, annoes);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							if (mag.read(_isequal) == NOERR)
 | 
			
		||||
								fld_giac.autoload_line(i + 1, mag.curr());
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					mask._giacs = fld_giac.rows_array();
 | 
			
		||||
          fld_giac.autosave(*mask._rel);
 | 
			
		||||
          fld_giac.record()->rewrite();
 | 
			
		||||
        } 
 | 
			
		||||
      }
 | 
			
		||||
			mask.write_enable(false);
 | 
			
		||||
      mask.field(F_ANNORIF).set(fld.get());
 | 
			
		||||
      // rilegge le giacenze relative a quell'anno ed aggiorna il layout
 | 
			
		||||
      fld_giac.record()->read(*fld_giac.putkey(*mask._rel));
 | 
			
		||||
      fld_giac.autoload(*mask._rel);
 | 
			
		||||
		  fld_giac.sort(cmp_rows);
 | 
			
		||||
			fld_giac.force_update();
 | 
			
		||||
			
 | 
			
		||||
      mask.update_ordc_ordf();         //chiamata del metodo successivo
 | 
			
		||||
@ -1187,6 +1289,63 @@ bool TMask_anamag::handle_sheetgiac(TMask_field &fld, KEY k)
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TMask_anamag::handle_valconv(TMask_field& f, KEY k)
 | 
			
		||||
{
 | 
			
		||||
  if (k == K_ENTER && f.dirty())
 | 
			
		||||
  {
 | 
			
		||||
    if (f.noyes_box(TR("Devo aggiornare il valore convenzionale sui contratti")))
 | 
			
		||||
    {
 | 
			
		||||
      TString filter("(CODART=='"); filter << f.mask().get(F_CODART) << "')";
 | 
			
		||||
      TCursor c(new TRelation(LF_LVRCONDV), filter, 1);
 | 
			
		||||
      const int items = c.items();
 | 
			
		||||
      const real val(f.get());
 | 
			
		||||
      TProgind * p = NULL;
 | 
			
		||||
 | 
			
		||||
      if (items > 100)
 | 
			
		||||
        p = new TProgind(items, TR("Aggiornamento valore convenzionale"));
 | 
			
		||||
      for (c = 0L; c.pos() < items; ++c)
 | 
			
		||||
      {
 | 
			
		||||
        if (p!= NULL)
 | 
			
		||||
        {
 | 
			
		||||
          p->addstatus(1L);
 | 
			
		||||
          if (p->iscancelled())
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        c.curr().put(LVRCONDV_VALCONV, val);
 | 
			
		||||
        c.relation()->rewrite();
 | 
			
		||||
      }
 | 
			
		||||
      if (p != NULL)
 | 
			
		||||
        delete p;
 | 
			
		||||
    }
 | 
			
		||||
    if (f.noyes_box(TR("Devo aggiornare il prezzo dei danneggiati sui contratti")))
 | 
			
		||||
    {
 | 
			
		||||
      TString filter("(CODART=='"); filter << f.mask().get(F_CODART) << "')";
 | 
			
		||||
      TCursor c(new TRelation(LF_LVRCONDV), filter, 1);
 | 
			
		||||
      const int items = c.items();
 | 
			
		||||
      const real val(f.get());
 | 
			
		||||
      TProgind * p = NULL;
 | 
			
		||||
 | 
			
		||||
      if (items > 100)
 | 
			
		||||
        p = new TProgind(items, TR("Aggiornamento articoli"));
 | 
			
		||||
      for (c = 0L; c.pos() < items; ++c)
 | 
			
		||||
      {
 | 
			
		||||
        if (p!= NULL)
 | 
			
		||||
        {
 | 
			
		||||
          p->addstatus(1L);
 | 
			
		||||
          if (p->iscancelled())
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        c.curr().put(LVRCONDV_PREZDAN, val);
 | 
			
		||||
        c.relation()->rewrite();
 | 
			
		||||
      }
 | 
			
		||||
      if (p != NULL)
 | 
			
		||||
        delete p;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int TMask_anamag::add_totali_storico(TString & codmag)
 | 
			
		||||
{
 | 
			
		||||
  TSheet_field &s =(TSheet_field &)field(F_SHEETSTOMAG);
 | 
			
		||||
@ -1785,7 +1944,7 @@ void TMask_anamag::ricalcola_giacenze()
 | 
			
		||||
    }
 | 
			
		||||
    while ((annoes = esercizi().next(annoes)) > 0); // qui verificare
 | 
			
		||||
  }
 | 
			
		||||
  return;
 | 
			
		||||
	write_enable(false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//---------------------------------------
 | 
			
		||||
@ -1865,6 +2024,11 @@ int TAnagrafica_magazzino::read(TMask& m)
 | 
			
		||||
  int err= TRelation_application::read(m);
 | 
			
		||||
  if (err == NOERR)
 | 
			
		||||
  {
 | 
			
		||||
		_write_giacenze = false;
 | 
			
		||||
		_uc1 = get_relation()->file().get_real(ANAMAG_ULTCOS1);
 | 
			
		||||
    _duc1 = get_relation()->file().get_date(ANAMAG_DULTCOS1);
 | 
			
		||||
		_uc2 = get_relation()->file().get_real(ANAMAG_ULTCOS2);
 | 
			
		||||
    _duc2 = get_relation()->file().get_date(ANAMAG_DULTCOS2);
 | 
			
		||||
    // LETTURA SHEET STORICO MAGAZZINO  IN AUTOMATICO
 | 
			
		||||
    TSheet_field &fld_stomag= m.sfield(F_SHEETSTOMAG); 
 | 
			
		||||
    fld_stomag.sheet_mask().field(F_STOCODART).set(m.field(F_CODART).get());  // necessario se lo sheet è vuoto
 | 
			
		||||
@ -1874,6 +2038,10 @@ int TAnagrafica_magazzino::read(TMask& m)
 | 
			
		||||
    load_um(m);
 | 
			
		||||
    ((TMask_anamag&) m).update_ordc_ordf();  //chiama la funzione che calcola i totali degli ordinati
 | 
			
		||||
  }
 | 
			
		||||
  TSheet_field &fld_giac= m.sfield(F_SHEETGIAC); 
 | 
			
		||||
 | 
			
		||||
  fld_giac.sort(cmp_rows);
 | 
			
		||||
	((TMask_anamag&) m).giacs() = fld_giac.rows_array();
 | 
			
		||||
  return err;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1922,6 +2090,7 @@ bool TAnagrafica_magazzino::remove()
 | 
			
		||||
 | 
			
		||||
int TAnagrafica_magazzino::write(const TMask& m)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  int err = TRelation_application::write(m);
 | 
			
		||||
  if (err == NOERR)
 | 
			
		||||
  {
 | 
			
		||||
@ -1933,7 +2102,82 @@ int TAnagrafica_magazzino::write(const TMask& m)
 | 
			
		||||
 | 
			
		||||
int TAnagrafica_magazzino::rewrite(const TMask& m)
 | 
			
		||||
{
 | 
			
		||||
	TSheet_field & fld_giac= m.sfield(F_SHEETGIAC); 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (_uc1 == get_relation()->file().get_real(ANAMAG_ULTCOS1) &&
 | 
			
		||||
			_duc1 == get_relation()->file().get_date(ANAMAG_DULTCOS1) &&
 | 
			
		||||
			_uc2 == get_relation()->file().get_real(ANAMAG_ULTCOS2) &&
 | 
			
		||||
			_duc2 == get_relation()->file().get_date(ANAMAG_DULTCOS2))
 | 
			
		||||
	{
 | 
			
		||||
		TLocalisamfile anag(LF_ANAMAG);
 | 
			
		||||
		const TString40 codice(get_relation()->file().get(ANAMAG_CODART));
 | 
			
		||||
 | 
			
		||||
		anag.put(ANAMAG_CODART, codice);
 | 
			
		||||
    const int err = anag.read(_isequal);
 | 
			
		||||
 | 
			
		||||
		if (err == NOERR)
 | 
			
		||||
		{
 | 
			
		||||
			get_relation()->file().put(ANAMAG_ULTCOS1, anag.get(ANAMAG_ULTCOS1));
 | 
			
		||||
			get_relation()->file().put(ANAMAG_DULTCOS1, anag.get(ANAMAG_DULTCOS1));
 | 
			
		||||
			get_relation()->file().put(ANAMAG_ULTCOS2, anag.get(ANAMAG_ULTCOS2));
 | 
			
		||||
			get_relation()->file().put(ANAMAG_DULTCOS2, anag.get(ANAMAG_DULTCOS2));
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			error_box(FR("non riesco a leggere il codice %s : Errore %d"), (const char *) codice, err);
 | 
			
		||||
			fld_giac.record()->read(*fld_giac.putkey(*get_relation()));
 | 
			
		||||
			fld_giac.autoload(*get_relation());
 | 
			
		||||
			fld_giac.sort(cmp_rows);
 | 
			
		||||
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
	} 
 | 
			
		||||
	if (_write_giacenze)
 | 
			
		||||
	{
 | 
			
		||||
		int annoes = m.get_int(F_ANNORIF);
 | 
			
		||||
		const int original_rows = ((TMask_anamag&)m).giacs().items();
 | 
			
		||||
		int rows = fld_giac.items();
 | 
			
		||||
		TLocalisamfile mag(LF_MAG);
 | 
			
		||||
 | 
			
		||||
		mag.setkey(2);
 | 
			
		||||
		rows = min(original_rows, rows);
 | 
			
		||||
		for (int i = 0; i < rows; i++)
 | 
			
		||||
		{
 | 
			
		||||
			TToken_string & original_row = ((TMask_anamag&)m).giacs().row(i);
 | 
			
		||||
			TToken_string & row = fld_giac.row(i);
 | 
			
		||||
 | 
			
		||||
			if (original_row == row)
 | 
			
		||||
			{
 | 
			
		||||
				mag.zero();
 | 
			
		||||
				mag.put(MAG_ANNOES, annoes);
 | 
			
		||||
				TString16 codmag = original_row.get(fld_giac.cid2index(F_CODMAG));
 | 
			
		||||
 | 
			
		||||
				codmag.rpad(3);
 | 
			
		||||
				codmag << original_row.get(fld_giac.cid2index(F_CODDEP));
 | 
			
		||||
				mag.put(MAG_CODMAG, codmag);
 | 
			
		||||
				mag.put(MAG_CODART, m.get(F_CODART));
 | 
			
		||||
 | 
			
		||||
				TString livello = original_row.get(fld_giac.cid2index(F_LIV1));
 | 
			
		||||
							
 | 
			
		||||
				livello << original_row.get(fld_giac.cid2index(F_LIV2));
 | 
			
		||||
				livello << original_row.get(fld_giac.cid2index(F_LIV3));
 | 
			
		||||
				livello << original_row.get(fld_giac.cid2index(F_LIV4));
 | 
			
		||||
				mag.put(MAG_LIVELLO, livello);
 | 
			
		||||
 | 
			
		||||
				if (mag.read(_isequal) == NOERR)
 | 
			
		||||
					fld_giac.autoload_line(i + 1, mag.curr());
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
    fld_giac.record()->read(*fld_giac.putkey(*get_relation()));
 | 
			
		||||
		fld_giac.autoload(*get_relation());
 | 
			
		||||
		fld_giac.sort(cmp_rows);
 | 
			
		||||
	}
 | 
			
		||||
	int err =TRelation_application::rewrite(m);
 | 
			
		||||
 | 
			
		||||
	if (err == NOERR)
 | 
			
		||||
  {
 | 
			
		||||
    TSheet_field& f= m.sfield(F_SHEETUM); // prende lo sheet delle unità di misura
 | 
			
		||||
@ -2027,7 +2271,7 @@ void TAnagrafica_magazzino::init_query_mode(TMask &m)
 | 
			
		||||
 | 
			
		||||
  if (advanced_codart_enabled())
 | 
			
		||||
    m.show(F_ADVANCED);
 | 
			
		||||
 | 
			
		||||
	write_enable(false);
 | 
			
		||||
  ((TMask_anamag&)m).set_um_principale("");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2040,6 +2284,7 @@ void TAnagrafica_magazzino::init_insert_mode(TMask &m)
 | 
			
		||||
 | 
			
		||||
  if (advanced_codart_enabled())
 | 
			
		||||
    m.hide(F_ADVANCED);
 | 
			
		||||
	write_enable(false);
 | 
			
		||||
	((TMask_anamag&)m).disable_user_page();  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2050,6 +2295,7 @@ void TAnagrafica_magazzino::init_modify_mode(TMask &m)
 | 
			
		||||
 | 
			
		||||
  if (advanced_codart_enabled())
 | 
			
		||||
    m.hide(F_ADVANCED);
 | 
			
		||||
	write_enable(false);
 | 
			
		||||
	((TMask_anamag&)m).disable_user_page();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -94,6 +94,8 @@
 | 
			
		||||
#define F_LIVART7 196
 | 
			
		||||
#define F_LIVART8 197
 | 
			
		||||
#define F_LIVART9 198
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define F_DESLIVART1 390
 | 
			
		||||
#define F_DESLIVART2 391
 | 
			
		||||
#define F_DESLIVART3 392
 | 
			
		||||
@ -114,7 +116,6 @@
 | 
			
		||||
#define F_SHEETCOD         203
 | 
			
		||||
#define F_SHEETGIAC      204
 | 
			
		||||
#define F_SHEETSTOMAG      205
 | 
			
		||||
 | 
			
		||||
#define F_STOULTCOS1 210
 | 
			
		||||
#define F_STOULTCOS2 211
 | 
			
		||||
#define F_STOCOSTOSTD 212
 | 
			
		||||
@ -125,6 +126,8 @@
 | 
			
		||||
 | 
			
		||||
#define F_STOTOTALE_RIM 217
 | 
			
		||||
#define F_STOTOTALE_VAL 218
 | 
			
		||||
#define F_WRITEON				219
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define F_SEARCHLAV 260
 | 
			
		||||
#define F_CODICELAV 261
 | 
			
		||||
@ -191,6 +194,7 @@
 | 
			
		||||
#define F_ECMAGIC3       342
 | 
			
		||||
#define F_ECMAGIC4       343
 | 
			
		||||
#define F_ECMAGIC_DESCR  344
 | 
			
		||||
#define F_VALCONV		     345
 | 
			
		||||
 | 
			
		||||
#define F_USER1     371
 | 
			
		||||
#define F_USER2     372
 | 
			
		||||
 | 
			
		||||
@ -262,7 +262,7 @@ BEGIN
 | 
			
		||||
	PROMPT 1 6 "Reparto        "
 | 
			
		||||
	HELP "Codice reparto"
 | 
			
		||||
	FIELD LF_ANAMAG->REPARTO
 | 
			
		||||
	FLAGS "UZ"
 | 
			
		||||
	FLAGS "UZH"
 | 
			
		||||
	USE RPD
 | 
			
		||||
	INPUT CODTAB F_REPARTO
 | 
			
		||||
	DISPLAY "Codice" CODTAB
 | 
			
		||||
@ -270,17 +270,20 @@ BEGIN
 | 
			
		||||
	OUTPUT F_REPARTO CODTAB
 | 
			
		||||
	OUTPUT F_DESREPARTO S0
 | 
			
		||||
	CHECKTYPE NORMAL
 | 
			
		||||
	GROUP G_VD
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESREPARTO 70 50
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 23 6 ""
 | 
			
		||||
  FLAGS "H"
 | 
			
		||||
  USE RPD KEY 2
 | 
			
		||||
  INPUT S0 F_DESREPARTO
 | 
			
		||||
  DISPLAY "Descrizione@70" S0
 | 
			
		||||
  DISPLAY "Codice" CODTAB
 | 
			
		||||
  COPY OUTPUT F_REPARTO
 | 
			
		||||
  CHECKTYPE NORMAL
 | 
			
		||||
	GROUP G_VD
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_STAGIONE 4
 | 
			
		||||
@ -288,26 +291,29 @@ BEGIN
 | 
			
		||||
	PROMPT 1 7 "Stagione       "
 | 
			
		||||
	HELP "Codice stagione"
 | 
			
		||||
  FIELD LF_ANAMAG->STAGIONE
 | 
			
		||||
	FLAGS "UZ"
 | 
			
		||||
	USE STG
 | 
			
		||||
	FLAGS "UZH"
 | 
			
		||||
	USE %STG
 | 
			
		||||
	INPUT CODTAB F_STAGIONE
 | 
			
		||||
	DISPLAY "Codice" CODTAB
 | 
			
		||||
	DISPLAY "Descrizione @70" S0
 | 
			
		||||
	OUTPUT F_STAGIONE CODTAB
 | 
			
		||||
	OUTPUT F_DESSTAGIONE S0
 | 
			
		||||
  CHECKTYPE NORMAL
 | 
			
		||||
	GROUP G_VD
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESSTAGIONE 70 50
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 23 7 ""
 | 
			
		||||
  HELP "Descrizione stagione"
 | 
			
		||||
	USE STG KEY 2
 | 
			
		||||
    FLAGS "H"
 | 
			
		||||
	USE %STG KEY 2
 | 
			
		||||
	INPUT S0 F_DESSTAGIONE
 | 
			
		||||
	DISPLAY "Descrizione@70" S0
 | 
			
		||||
	DISPLAY "Codice" CODTAB
 | 
			
		||||
  COPY OUTPUT F_STAGIONE
 | 
			
		||||
  CHECKTYPE NORMAL
 | 
			
		||||
	GROUP G_VD
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_CATCONV 3
 | 
			
		||||
@ -1035,6 +1041,12 @@ BEGIN
 | 
			
		||||
	FIELD LIVPERART
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
TEXT F_WRITEON
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 60 5 "@bSCRITTURA ATTIVA"
 | 
			
		||||
  FLAGS "H"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
SPREADSHEET F_SHEETGIAC 0 -2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 0 6 "Giacenze"
 | 
			
		||||
@ -1561,6 +1573,13 @@ BEGIN
 | 
			
		||||
  GROUP G_LV
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
CURRENCY F_VALCONV
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 1 16 "Valore convenzionale "
 | 
			
		||||
  FIELD 41@->R0 //LVAUT = 41
 | 
			
		||||
  GROUP G_LV
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
PAGE "Personalizzazioni" 0 0 80 20
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user