Corretta gestione occasionali.
Corretta gestione valori di default in sede di cambio tipo riga git-svn-id: svn://10.65.10.50/branches/R_10_00@22718 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5bfd248c7b
								
							
						
					
					
						commit
						6b39ab9e24
					
				| @ -1,10 +1,9 @@ | |||||||
| #include <applicat.h> | #include <applicat.h> | ||||||
| #include <modaut.h> | #include <modaut.h> | ||||||
| #include <relation.h> |  | ||||||
| 
 | 
 | ||||||
| #include "clifor.h" |  | ||||||
| #include "condv.h" |  | ||||||
| #include "velib.h" | #include "velib.h" | ||||||
|  | 
 | ||||||
|  | #include "condv.h" | ||||||
| #include "../li/letint.h" | #include "../li/letint.h" | ||||||
| #include "../cg/cfban.h"  | #include "../cg/cfban.h"  | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -50,8 +50,6 @@ class TCli_for : public TMultiple_rectype | |||||||
|   bool _extended; |   bool _extended; | ||||||
| 	bool _lettera_found; | 	bool _lettera_found; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| protected: | protected: | ||||||
|    virtual int write_rewrite(TBaseisamfile& f, bool re = FALSE) const; |    virtual int write_rewrite(TBaseisamfile& f, bool re = FALSE) const; | ||||||
| 	 void init(); | 	 void init(); | ||||||
|  | |||||||
| @ -14,10 +14,10 @@ | |||||||
| #include "veuml1.h" | #include "veuml1.h" | ||||||
| #include "verig.h" | #include "verig.h" | ||||||
| #include "velib04.h" | #include "velib04.h" | ||||||
|  | #include "../mg/mglib.h" | ||||||
| 
 | 
 | ||||||
| #include "sconti.h" | #include "sconti.h" | ||||||
| #include "../mg/anamag.h" | #include <occas.h> | ||||||
| #include "../mg/mglib.h" |  | ||||||
| 
 | 
 | ||||||
| TCursor& TMotore_application::get_filtered_cursor() const | TCursor& TMotore_application::get_filtered_cursor() const | ||||||
| { | { | ||||||
| @ -753,7 +753,7 @@ void TMotore_application::sheet2ini(TSheet_field &sheet,TConfig& ini) | |||||||
|   { |   { | ||||||
|     defpar.format("%d,%d",LF_RIGHEDOC,r); |     defpar.format("%d,%d",LF_RIGHEDOC,r); | ||||||
|     const TMask* sm = m.riga_mask(r-1); |     const TMask* sm = m.riga_mask(r-1); | ||||||
|     const TToken_string rigar = sheet.row(r-1); |     const TToken_string& rigar = sheet.row(r-1); | ||||||
|     for (int sf = 0; sf < sm->fields(); sf++) |     for (int sf = 0; sf < sm->fields(); sf++) | ||||||
|     { |     { | ||||||
|       TMask_field& campo = sm->fld(sf); |       TMask_field& campo = sm->fld(sf); | ||||||
| @ -765,8 +765,7 @@ void TMotore_application::sheet2ini(TSheet_field &sheet,TConfig& ini) | |||||||
|         if (str.empty())  |         if (str.empty())  | ||||||
|           str = " "; |           str = " "; | ||||||
|         const word field_class = campo.class_id(); |         const word field_class = campo.class_id(); | ||||||
|         if (field_class == CLASS_MEMO_FIELD ||  |         if (field_class == CLASS_MEMO_FIELD || field_class == CLASS_ZOOM_FIELD) | ||||||
|             field_class == CLASS_ZOOM_FIELD) |  | ||||||
|         {              |         {              | ||||||
|           int p; |           int p; | ||||||
|           while ((p = str.find('\n', 0)) >= 0) |           while ((p = str.find('\n', 0)) >= 0) | ||||||
| @ -777,7 +776,7 @@ void TMotore_application::sheet2ini(TSheet_field &sheet,TConfig& ini) | |||||||
|         }   |         }   | ||||||
| 				if (campo.field()->name() == RDOC_PREZZO) | 				if (campo.field()->name() == RDOC_PREZZO) | ||||||
| 				{ | 				{ | ||||||
| 					TCodiceIVA c(sm->get(FR_CODIVA)); | 					const TCodiceIVA c(sm->get(FR_CODIVA)); | ||||||
| 					TFieldref l; | 					TFieldref l; | ||||||
| 					real prezzo(str); | 					real prezzo(str); | ||||||
| 					real prezzol; | 					real prezzol; | ||||||
| @ -839,20 +838,40 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) | |||||||
|       str = cache().get(LF_DOC, key, DOC_TIPODOC); |       str = cache().get(LF_DOC, key, DOC_TIPODOC); | ||||||
|     } |     } | ||||||
|     campo.set(str);       |     campo.set(str);       | ||||||
|        |  | ||||||
|   } |   } | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
| 		TDocumento& d = doc(); | 		TDocumento& d = doc(); | ||||||
| 
 |  | ||||||
| 		d.put(DOC_TIPOCF, msk.get(F_TIPOCF)); | 		d.put(DOC_TIPOCF, msk.get(F_TIPOCF)); | ||||||
| 		d.put(DOC_CODCF, msk.get(F_CODCF)); | 		d.put(DOC_CODCF, msk.get(F_CODCF)); | ||||||
| 
 |  | ||||||
| 		const TCli_for& c = d.clifor();  | 		const TCli_for& c = d.clifor();  | ||||||
| 	  const TRectype & ven_rec = c.vendite(); | 
 | ||||||
|  |     // Compilo dati occasionale se presenti
 | ||||||
|  |     if (c.occasionale() && ini.set_paragraph("18")) // LF_OCCAS
 | ||||||
|  |     { | ||||||
|  |       const TString& ocfpi = ini.get(OCC_CFPI); | ||||||
|  |       if (ocfpi.full()) | ||||||
|  |       { | ||||||
|  |         TLocalisamfile occas(LF_OCCAS); | ||||||
|  |         TRectype& rec = occas.curr(); | ||||||
|  |         rec.put(OCC_CFPI, ocfpi); | ||||||
|  |         if (occas.read(_isequal, _lock) != NOERR) | ||||||
|  |           rec.zero(); | ||||||
|  |         TAssoc_array& vars = ini.list_variables(); | ||||||
|  |         FOR_EACH_ASSOC_STRING(vars, obj, key, str) | ||||||
|  |         { | ||||||
|  |           if (rec.exist(key)) | ||||||
|  |             rec.put(key, str); | ||||||
|  |         } | ||||||
|  |         if (occas.write_rewrite() == NOERR) | ||||||
|  |         { | ||||||
|  |           doc().put(DOC_OCFPI, ocfpi); | ||||||
|  |           doc().occas() = rec; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|      |      | ||||||
|     ini.set_paragraph("33"); |     ini.set_paragraph("33"); | ||||||
| 
 |  | ||||||
|     if (!ini.exist(DOC_CODVAL)) |     if (!ini.exist(DOC_CODVAL)) | ||||||
| 		{ | 		{ | ||||||
| 		  const TString4 codval = c.get(CLI_CODVAL);  // Attenzione: Non usare TString& qui!
 | 		  const TString4 codval = c.get(CLI_CODVAL);  // Attenzione: Non usare TString& qui!
 | ||||||
| @ -885,7 +904,10 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) | |||||||
|         msk.set(F_BBAN_CONTO, iban.mid(15,12)); |         msk.set(F_BBAN_CONTO, iban.mid(15,12)); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     // Setta i campi che appartengono al file LF_CFVEN
 |     // Setta i campi che appartengono al file LF_CFVEN
 | ||||||
|  |  	  const TRectype& ven_rec = c.vendite(); | ||||||
|  | 
 | ||||||
|     if (!ini.exist(DOC_CODABIP)) |     if (!ini.exist(DOC_CODABIP)) | ||||||
| 			msk.set(F_CODABIP, ven_rec.get(CFV_CODABIPR), true); | 			msk.set(F_CODABIP, ven_rec.get(CFV_CODABIPR), true); | ||||||
|     if (!ini.exist(DOC_CODCABP)) |     if (!ini.exist(DOC_CODCABP)) | ||||||
| @ -1051,15 +1073,20 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) | |||||||
| 
 | 
 | ||||||
| bool TMotore_application::save_and_print(bool savedoc, TPrtype mode) | bool TMotore_application::save_and_print(bool savedoc, TPrtype mode) | ||||||
| { | { | ||||||
|  |   static bool already_printing = false; | ||||||
|  |   if (already_printing) | ||||||
|  |     return false; | ||||||
|  |   already_printing = true; | ||||||
|  | 
 | ||||||
|   if (savedoc) |   if (savedoc) | ||||||
| 	{ | 	{ | ||||||
|     if (save(false)) |     if (save(false)) | ||||||
|   		edit_mask().update_father_rows(false); |   		edit_mask().update_father_rows(false); | ||||||
|     else |     else | ||||||
|       return false; |       return already_printing = false; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   TDocumento& doc = (TDocumento&)get_relation()->curr(); |   const TDocumento& doc = (const TDocumento&)get_relation()->curr(); | ||||||
|   |   | ||||||
|   const TTipo_documento& tipo = doc.tipo(); |   const TTipo_documento& tipo = doc.tipo(); | ||||||
|   TFilename rep;  |   TFilename rep;  | ||||||
| @ -1117,9 +1144,11 @@ bool TMotore_application::save_and_print(bool savedoc, TPrtype mode) | |||||||
| 	else | 	else | ||||||
| 	{ | 	{ | ||||||
| 		rep.ext(""); | 		rep.ext(""); | ||||||
| 		return error_box("Il profilo %s non esiste", (const char*)rep); |     error_box("Il profilo %s non esiste", (const char*)rep); | ||||||
|  | 		return already_printing = false; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |   already_printing = false; | ||||||
|   return true; |   return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -54,7 +54,6 @@ END | |||||||
| STRING O_STATOPAIV 2 | STRING O_STATOPAIV 2 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 37 2 "Partita IVA  " |   PROMPT 37 2 "Partita IVA  " | ||||||
|   FIELD STATOPAIV |  | ||||||
|   HELP "Codice ISO dello stato" |   HELP "Codice ISO dello stato" | ||||||
|   FLAGS "U" |   FLAGS "U" | ||||||
|   USE %SCE |   USE %SCE | ||||||
| @ -148,7 +147,6 @@ BEGIN | |||||||
|   PROMPT 2 9 "Sesso " |   PROMPT 2 9 "Sesso " | ||||||
|   ITEM "M|Maschio" |   ITEM "M|Maschio" | ||||||
|   ITEM "F|Femmina" |   ITEM "F|Femmina" | ||||||
| 	FIELD SESSO |  | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| DATE O_DATANAS | DATE O_DATANAS | ||||||
|  | |||||||
							
								
								
									
										100
									
								
								ve/ve2800.cpp
									
									
									
									
									
								
							
							
						
						
									
										100
									
								
								ve/ve2800.cpp
									
									
									
									
									
								
							| @ -22,6 +22,7 @@ class TRicarico_listini_mask : public TAutomask | |||||||
|   TBit_array _dirty; |   TBit_array _dirty; | ||||||
|   bool _loading; |   bool _loading; | ||||||
|   TString4 _curlis; |   TString4 _curlis; | ||||||
|  |   TString _codart; // Nuovo articolo
 | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|   virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); |   virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); | ||||||
| @ -220,10 +221,16 @@ void TRicarico_listini_mask::load() | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |    | ||||||
|  |   if (get(F_SORT) != "A") | ||||||
|  |     send_key(K_SPACE, F_SORT); | ||||||
|  |   else | ||||||
|     s.force_update(); |     s.force_update(); | ||||||
|  |    | ||||||
|   _dirty.reset(); |   _dirty.reset(); | ||||||
|   disable(DLG_SAVEREC); |   disable(DLG_SAVEREC); | ||||||
|   enable(DLG_RECALC); |   enable(DLG_RECALC); | ||||||
|  |   set(F_RECORDS, s.items()); | ||||||
| 
 | 
 | ||||||
|   _loading = false; |   _loading = false; | ||||||
| } | } | ||||||
| @ -268,15 +275,14 @@ bool TRicarico_listini_mask::import() | |||||||
|           rcondv.put(RCONDV_COD, _curlis); |           rcondv.put(RCONDV_COD, _curlis); | ||||||
|           rcondv.put(RCONDV_TIPORIGA, "A"); |           rcondv.put(RCONDV_TIPORIGA, "A"); | ||||||
|           rcondv.put(RCONDV_CODRIGA, codart); |           rcondv.put(RCONDV_CODRIGA, codart); | ||||||
|           if (rcondv.write() != NOERR) |           if (rcondv.write() == NOERR) | ||||||
|           { |           { | ||||||
|             msg = codart; |             msg = codart; | ||||||
|             msg << TR(" articolo già a listino"); |             msg << TR(" articolo inserito a listino"); | ||||||
|             log.log(1, msg); |             log.log(1, msg); | ||||||
|           } |  | ||||||
|           else |  | ||||||
|             n++; |             n++; | ||||||
|           } |           } | ||||||
|  |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|           msg = codart; |           msg = codart; | ||||||
| @ -294,6 +300,41 @@ bool TRicarico_listini_mask::import() | |||||||
|   return n > 0; |   return n > 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static int sort_by_artic(const TSortable& r1, const TSortable& r2, void* jolly) | ||||||
|  | { | ||||||
|  |   const TToken_string& row1 = (const TToken_string&)r1; | ||||||
|  |   const TToken_string& row2 = (const TToken_string&)r2; | ||||||
|  |   return xvt_str_compare_ignoring_case(row1, row2); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | static int sort_by_delta(const TSortable& r1, const TSortable& r2, void* jolly) | ||||||
|  | { | ||||||
|  |   const TSheet_field& s = *(TSheet_field*)jolly; | ||||||
|  |   const int i = s.cid2index(F_DELTAPRICE); | ||||||
|  |   const TToken_string& row1 = (const TToken_string&)r1; | ||||||
|  |   const TToken_string& row2 = (const TToken_string&)r2; | ||||||
|  |   real d1, d2; | ||||||
|  |   row1.get(i, d1); | ||||||
|  |   row2.get(i, d2); | ||||||
|  |   if (d1 == d2) | ||||||
|  |     return sort_by_artic(r1, r2, jolly); | ||||||
|  |   return d1 > d2 ? +1 : -1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | static int sort_by_price(const TSortable& r1, const TSortable& r2, void* jolly) | ||||||
|  | { | ||||||
|  |   const TSheet_field& s = *(TSheet_field*)jolly; | ||||||
|  |   const int i = s.cid2index(F_OLDPRICE); | ||||||
|  |   const TToken_string& row1 = (const TToken_string&)r1; | ||||||
|  |   const TToken_string& row2 = (const TToken_string&)r2; | ||||||
|  |   real p1, p2; | ||||||
|  |   row1.get(i, p1); | ||||||
|  |   row2.get(i, p2); | ||||||
|  |   if (p1 == p2) | ||||||
|  |     return sort_by_artic(r1, r2, jolly); | ||||||
|  |   return p1 > p2 ? +1 : -1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| bool TRicarico_listini_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) | bool TRicarico_listini_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) | ||||||
| { | { | ||||||
|   switch (o.dlg()) |   switch (o.dlg()) | ||||||
| @ -349,13 +390,15 @@ bool TRicarico_listini_mask::on_field_event(TOperable_field& o, TField_event e, | |||||||
|       real scontato = prezzo * (CENTO - sconto) / CENTO;  |       real scontato = prezzo * (CENTO - sconto) / CENTO;  | ||||||
|       scontato.round(2); |       scontato.round(2); | ||||||
|       real margine = (scontato > ZERO) ? CENTO * (scontato - costo) / scontato : ZERO; |       real margine = (scontato > ZERO) ? CENTO * (scontato - costo) / scontato : ZERO; | ||||||
|  |       margine.round(0); | ||||||
|       sm.set(o.dlg() + (F_NEWMARGIN-F_NEWPRICE), margine, 0x3); |       sm.set(o.dlg() + (F_NEWMARGIN-F_NEWPRICE), margine, 0x3); | ||||||
| 
 | 
 | ||||||
|       const real oldprice = sm.get(F_OLDPRICE); |       const real oldprice = sm.get(F_OLDPRICE); | ||||||
|       if (oldprice> ZERO) |       if (oldprice> ZERO) | ||||||
|       { |       { | ||||||
|         const real newprice = sm.get(F_NEWPRICE); |         const real newprice = sm.get(F_NEWPRICE); | ||||||
|         const real delta = (newprice - oldprice) * CENTO / oldprice; |         real delta = (newprice - oldprice) * CENTO / oldprice; | ||||||
|  |         delta.round(0); | ||||||
|         sm.set(F_DELTAPRICE, delta); |         sm.set(F_DELTAPRICE, delta); | ||||||
|       } |       } | ||||||
|       const real deltam = sm.get_real(F_NEWMARGIN) - sm.get_real(F_OLDMARGIN); |       const real deltam = sm.get_real(F_NEWMARGIN) - sm.get_real(F_OLDMARGIN); | ||||||
| @ -369,13 +412,56 @@ bool TRicarico_listini_mask::on_field_event(TOperable_field& o, TField_event e, | |||||||
|       set_dirty();  |       set_dirty();  | ||||||
|       break; |       break; | ||||||
|     case se_query_add: |     case se_query_add: | ||||||
|       send_key(K_SPACE, DLG_NEWREC, &o); |       if (_curlis.full()) | ||||||
|  |       { | ||||||
|  |         TMask m("ve2800b"); | ||||||
|  |         m.set(F_CODLIS, _curlis, 0x3); | ||||||
|  |         if (m.run() == K_ENTER) | ||||||
|  |         { | ||||||
|  |           _codart = m.get(F_FROMCOD); | ||||||
|  |           return _codart.full(); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       return false; | ||||||
|  |     case se_notify_add: | ||||||
|  |       if (_codart.full()) | ||||||
|  |       { | ||||||
|  |         TSheet_field& s = sfield(F_LISTINO); | ||||||
|  |         TToken_string& r = s.row(jolly); | ||||||
|  |         r = _codart; | ||||||
|  |         TMask& m = s.sheet_mask(); | ||||||
|  |         const TRectype& anamag = cache().get(LF_ANAMAG, _codart); | ||||||
|  |         FOR_EACH_MASK_FIELD(m, i, f) | ||||||
|  |         { | ||||||
|  |           const TFieldref* fld = f->field(); | ||||||
|  |           if (fld != NULL && fld->file() == LF_ANAMAG) | ||||||
|  |             r.add(anamag.get(fld->name()), s.cid2index(f->dlg())); | ||||||
|  |         } | ||||||
|  |         _codart.cut(0); | ||||||
|  |         return true; | ||||||
|  |       } | ||||||
|  |       return false; | ||||||
|     case se_query_del: |     case se_query_del: | ||||||
|       return false; |       return false; | ||||||
|     default:           |     default:           | ||||||
|       break; |       break; | ||||||
|     } |     } | ||||||
|     break; |     break; | ||||||
|  |   case F_SORT: | ||||||
|  |     if (e == fe_modify) | ||||||
|  |     { | ||||||
|  |       TWait_cursor hourglass; | ||||||
|  |       TSheet_field& s = sfield(F_LISTINO); | ||||||
|  |       TArray& r = s.rows_array(); | ||||||
|  |       switch (o.get()[0]) | ||||||
|  |       { | ||||||
|  |       case 'D': r.sort(sort_by_delta, &s); break; | ||||||
|  |       case 'P': r.sort(sort_by_price, &s); break; | ||||||
|  |       default : r.sort(sort_by_artic, &s); break; | ||||||
|  |       } | ||||||
|  |       s.force_update(); | ||||||
|  |     } | ||||||
|  |     break; | ||||||
|   case DLG_EDIT: |   case DLG_EDIT: | ||||||
|     if (e == fe_button && jolly == 1) |     if (e == fe_button && jolly == 1) | ||||||
| 	  { | 	  { | ||||||
| @ -471,7 +557,7 @@ bool TRicarico_listini::create() | |||||||
| { | { | ||||||
|   Tdninst dninst; |   Tdninst dninst; | ||||||
|   if (!dninst.can_I_run(true)) |   if (!dninst.can_I_run(true)) | ||||||
|     return error_box(TR("Programma non autorizzato!")); |     return error_box(TR("Programma personalizzato non autorizzato!")); | ||||||
|   TSheet_field::set_line_number_width(4); |   TSheet_field::set_line_number_width(4); | ||||||
|   return TSkeleton_application::create(); |   return TSkeleton_application::create(); | ||||||
| } | } | ||||||
|  | |||||||
| @ -6,6 +6,8 @@ | |||||||
| #define F_FROMDES      206 | #define F_FROMDES      206 | ||||||
| #define F_TOCOD        207 | #define F_TOCOD        207 | ||||||
| #define F_TODES        208 | #define F_TODES        208 | ||||||
|  | #define F_SORT         209 | ||||||
|  | #define F_RECORDS      210 | ||||||
| 
 | 
 | ||||||
| #define F_LISTINO      300 | #define F_LISTINO      300 | ||||||
| 
 | 
 | ||||||
| @ -23,3 +25,4 @@ | |||||||
| #define F_DESCFRA      112 | #define F_DESCFRA      112 | ||||||
| #define F_DESCENG      113 | #define F_DESCENG      113 | ||||||
| #define F_DESCDEU      114 | #define F_DESCDEU      114 | ||||||
|  | #define F_CODARTALT    115 | ||||||
|  | |||||||
| @ -101,6 +101,7 @@ BEGIN | |||||||
|   DISPLAY "Descrizione@20" DESCR |   DISPLAY "Descrizione@20" DESCR | ||||||
|   DISPLAY "Costo" ULTCOS1 |   DISPLAY "Costo" ULTCOS1 | ||||||
|   DISPLAY "Ricarico" USER3 |   DISPLAY "Ricarico" USER3 | ||||||
|  |   DISPLAY "Replaced by@20" CODARTALT | ||||||
|   OUTPUT F_FROMCOD CODART |   OUTPUT F_FROMCOD CODART | ||||||
|   OUTPUT F_FROMDES DESCR |   OUTPUT F_FROMDES DESCR | ||||||
|   CHECKTYPE SEARCH |   CHECKTYPE SEARCH | ||||||
| @ -116,6 +117,7 @@ BEGIN | |||||||
|   DISPLAY "Codice@20" CODART |   DISPLAY "Codice@20" CODART | ||||||
|   DISPLAY "Costo" ULTCOS1 |   DISPLAY "Costo" ULTCOS1 | ||||||
|   DISPLAY "Ricarico" USER3 |   DISPLAY "Ricarico" USER3 | ||||||
|  |   DISPLAY "Replaced by@20" CODARTALT | ||||||
|   COPY OUTPUT F_FROMCOD |   COPY OUTPUT F_FROMCOD | ||||||
|   CHECKTYPE SEARCH |   CHECKTYPE SEARCH | ||||||
| END | END | ||||||
| @ -142,10 +144,23 @@ BEGIN | |||||||
|   CHECKTYPE SEARCH |   CHECKTYPE SEARCH | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | LIST F_SORT 1 10 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 6 "Ordinamento      " | ||||||
|  |   ITEM "A|Articolo" | ||||||
|  |   ITEM "D|Delta" | ||||||
|  |   ITEM "P|Prezzo" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | NUMBER F_RECORDS 6 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 47 6 "Righe di listino " | ||||||
|  |   FLAGS "D" | ||||||
|  | END | ||||||
| 
 | 
 | ||||||
| SPREADSHEET F_LISTINO | SPREADSHEET F_LISTINO | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 0 6 "Listino" |   PROMPT 0 7 "Listino" | ||||||
|   ITEM "Articolo@20" |   ITEM "Articolo@20" | ||||||
|   ITEM "Descrizione@30" |   ITEM "Descrizione@30" | ||||||
|   ITEM "Sconto" |   ITEM "Sconto" | ||||||
| @ -160,6 +175,7 @@ BEGIN | |||||||
|   ITEM "Descrizione\nFrancese@30" |   ITEM "Descrizione\nFrancese@30" | ||||||
|   ITEM "Descrizione\nInglese@30" |   ITEM "Descrizione\nInglese@30" | ||||||
|   ITEM "Descrizione\nTedesco@30" |   ITEM "Descrizione\nTedesco@30" | ||||||
|  |   ITEM "Replaced by@20" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| ENDPAGE | ENDPAGE | ||||||
| @ -176,6 +192,13 @@ BEGIN | |||||||
|   FIELD CODRIGA |   FIELD CODRIGA | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | STRING F_CODARTALT 20 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 35 1 "Rep. by " | ||||||
|  |   FLAGS "D" | ||||||
|  |   FIELD LF_ANAMAG->CODARTALT | ||||||
|  | END | ||||||
|  | 
 | ||||||
| STRING F_DESCART 50 | STRING F_DESCART 50 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 1 2 "Descrizione " |   PROMPT 1 2 "Descrizione " | ||||||
| @ -212,6 +235,7 @@ BEGIN | |||||||
|   OUTPUT F_RICARICO CODTAB |   OUTPUT F_RICARICO CODTAB | ||||||
|   CHEKTYPE NORMAL |   CHEKTYPE NORMAL | ||||||
|   FIELD LF_ANAMAG->USER3 |   FIELD LF_ANAMAG->USER3 | ||||||
|  |   FLAGS "U" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| TEXT DLG_NULL  | TEXT DLG_NULL  | ||||||
| @ -242,25 +266,25 @@ BEGIN | |||||||
|   FLAGS "DUG" |   FLAGS "DUG" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| NUMBER F_DELTAPRICE 6 2 | NUMBER F_DELTAPRICE 4 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 50 6 "" |   PROMPT 50 6 "" | ||||||
|   FLAGS "D" |   FLAGS "D" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| NUMBER F_OLDMARGIN 6 2 | NUMBER F_OLDMARGIN 4 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 2 7 "@bMargine  " |   PROMPT 2 7 "@bMargine  " | ||||||
|   FLAGS "D" |   FLAGS "D" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| NUMBER F_NEWMARGIN 6 2 | NUMBER F_NEWMARGIN 4 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 32 7 "" |   PROMPT 32 7 "" | ||||||
|   FLAGS "D" |   FLAGS "D" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| NUMBER F_DELTAMARGIN 6 2 | NUMBER F_DELTAMARGIN 4 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 50 7 "" |   PROMPT 50 7 "" | ||||||
|   FLAGS "D" |   FLAGS "D" | ||||||
|  | |||||||
							
								
								
									
										76
									
								
								ve/ve2800b.uml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								ve/ve2800b.uml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,76 @@ | |||||||
|  | #include "ve2800.h" | ||||||
|  | 
 | ||||||
|  | PAGE "Nuovo articolo" -1 -1 54 6 | ||||||
|  | 
 | ||||||
|  | STRING F_CODLIS 3 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 1 "Listino  " | ||||||
|  |   USE LF_CONDV  | ||||||
|  |   INPUT TIPO "L" | ||||||
|  |   INPUT COD F_CODLIS | ||||||
|  |   DISPLAY "Codice" COD | ||||||
|  |   DISPLAY "Descrizione@50" DESCR | ||||||
|  |   DISPLAY "Valuta" CODVAL | ||||||
|  |   OUTPUT F_CODLIS COD | ||||||
|  |   OUTPUT F_DESLIS COD | ||||||
|  |   CHECKTYPE REQUIRED | ||||||
|  |   FLAGS "DUG" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | STRING F_DESLIS 50 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 2 "" | ||||||
|  |   FLAGS "D" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | STRING F_FROMCOD 20 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 3 "Articolo " | ||||||
|  |   USE ANAMAG SELECT LF_RCONDV->CODRIGA="" | ||||||
|  |   JOIN LF_RCONDV INTO TIPO="L" COD=#F_CODLIS TIPORIGA="A" CODRIGA=CODART | ||||||
|  |   INPUT CODART F_FROMCOD | ||||||
|  |   DISPLAY "Codice@20" CODART | ||||||
|  |   DISPLAY "Descrizione@20" DESCR | ||||||
|  |   DISPLAY "Costo" ULTCOS1 | ||||||
|  |   DISPLAY "Ricarico" USER3 | ||||||
|  |   DISPLAY "Replaced by@20" CODARTALT | ||||||
|  |   OUTPUT F_FROMCOD CODART | ||||||
|  |   OUTPUT F_FROMDES DESCR | ||||||
|  |   CHECKTYPE SEARCH | ||||||
|  |   FLAGS "U" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | STRING F_FROMDES 50 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 4 "" | ||||||
|  |   USE ANAMAG KEY 2 SELECT LF_RCONDV->CODRIGA="" | ||||||
|  |   JOIN LF_RCONDV INTO TIPO="L" COD=#F_CODLIS TIPORIGA="A" CODRIGA=CODART | ||||||
|  |   INPUT DESCR F_FROMDES | ||||||
|  |   DISPLAY "Descrizione@20" DESCR | ||||||
|  |   DISPLAY "Codice@20" CODART | ||||||
|  |   DISPLAY "Costo" ULTCOS1 | ||||||
|  |   DISPLAY "Ricarico" USER3 | ||||||
|  |   DISPLAY "Replaced by@20" CODARTALT | ||||||
|  |   COPY OUTPUT F_FROMCOD | ||||||
|  |   CHECKTYPE SEARCH | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | ENDPAGE | ||||||
|  | 
 | ||||||
|  | TOOLBAR "Toolbar" 0 0 0 2 | ||||||
|  | 
 | ||||||
|  | BUTTON DLG_OK 2 2 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 1 1 "" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | BUTTON DLG_CANCEL 2 2 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 2 1 "" | ||||||
|  | END | ||||||
|  | 
 | ||||||
|  | #include <helpbar.h> | ||||||
|  | 
 | ||||||
|  | ENDPAGE | ||||||
|  | 
 | ||||||
|  | ENDMASK | ||||||
| @ -2576,23 +2576,18 @@ TOccasionale& TDocumento::occas() const | |||||||
| { | { | ||||||
|   const TString16 occ_code = cod_occas(); // Codice occasionale in testata
 |   const TString16 occ_code = cod_occas(); // Codice occasionale in testata
 | ||||||
| 
 | 
 | ||||||
|   if (occ_code != _occas.codice()) |   TOccasionale& rec = (TOccasionale&)_occas; | ||||||
|  |   if (occ_code != rec.codice()) | ||||||
|   {  |   {  | ||||||
| /* Antidiluvian mode
 |  | ||||||
|     TLocalisamfile o(LF_OCCAS); |     TLocalisamfile o(LF_OCCAS); | ||||||
|     ((TDocumento *) this)->_occas.zero(); |     rec.put(OCC_CFPI, occ_code); | ||||||
|     ((TDocumento *) this)->_occas.put(OCC_CFPI, occ_code); |     if (rec.read(o) != NOERR) | ||||||
|     TRectype oc(_occas); |     { | ||||||
|     if (((TDocumento *) this)->_occas.read(o) != NOERR) |       rec.zero(); | ||||||
|       ((TDocumento *) this)->_occas = oc; |       rec.put(OCC_CFPI, occ_code); | ||||||
| */ |  | ||||||
|     // Postdiluvian mode
 |  | ||||||
|     TRectype& o = (TRectype&)_occas;     // Inganna const (una volta sola, non 4)
 |  | ||||||
|     o = cache().get(LF_OCCAS, occ_code); // Ricerca tramite cache
 |  | ||||||
|     if (o.empty())                       // Occasionale cancellato per errore
 |  | ||||||
|       o.put(OCC_CFPI, occ_code);         // Ripristina almeno il codice
 |  | ||||||
|     } |     } | ||||||
|   return (TOccasionale&)_occas; |   } | ||||||
|  |   return rec; | ||||||
| } | } | ||||||
|                                          |                                          | ||||||
| const TAgente & TDocumento::agente(bool first) const | const TAgente & TDocumento::agente(bool first) const | ||||||
|  | |||||||
| @ -2032,10 +2032,15 @@ bool TDocumento_mask::occas_handler( TMask_field& f, KEY key ) | |||||||
| 			if (c) | 			if (c) | ||||||
| 				f.set(c->read(occ)); | 				f.set(c->read(occ)); | ||||||
| 		} | 		} | ||||||
|  | 
 | ||||||
|  |     const TString& cf = occas_mask.get(O_COFI); | ||||||
|  |     if (cf.full() && atoi(cf.mid(9, 2)) > 40) | ||||||
|  |       occas_mask.set(O_SESSO, "F"); | ||||||
|  | 
 | ||||||
| 		if (occas_mask.run() != K_ESC) | 		if (occas_mask.run() != K_ESC) | ||||||
| 		{ | 		{ | ||||||
| 			const TString ocfpi(occas_mask.get(O_CODICE)); | 			const TString ocfpi(occas_mask.get(O_CODICE)); | ||||||
| 			doc.put("OCFPI", ocfpi); | 			doc.put(DOC_OCFPI, ocfpi); | ||||||
| 			m.set(F_OCFPI, ocfpi); | 			m.set(F_OCFPI, ocfpi); | ||||||
| 	 | 	 | ||||||
| 			for (int i = occas_mask.fields() - 1; i >= 0; i--) | 			for (int i = occas_mask.fields() - 1; i >= 0; i--) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user