Patch level : 10.0 patch 767
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : visualizzazione giacenza componenti impostare la variabile nella ini della maschera: ART_TO_SHOW= 1|1 (livello|riga) Dalla versione 3.2 git-svn-id: svn://10.65.10.50/trunk@20606 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									91f8f092cd
								
							
						
					
					
						commit
						a6354e5440
					
				| @ -11,6 +11,7 @@ | |||||||
| #include <urldefid.h> | #include <urldefid.h> | ||||||
| #include <utility.h> | #include <utility.h> | ||||||
| 
 | 
 | ||||||
|  | #include "../db/dblib.h"  | ||||||
| #include "velib04.h" | #include "velib04.h" | ||||||
| #include "vepriv.h" | #include "vepriv.h" | ||||||
| #include "verig.h" | #include "verig.h" | ||||||
| @ -1480,12 +1481,44 @@ void TDocumento_mask::update_giacenza() | |||||||
| 	if (causmag.full()) | 	if (causmag.full()) | ||||||
| 	{ | 	{ | ||||||
| 		const TCausale_magazzino& c = cached_causale_magazzino(causmag); | 		const TCausale_magazzino& c = cached_causale_magazzino(causmag); | ||||||
| 		if (c.scarica_alternativi()) |         TString16 livello; | ||||||
|  | 	   const int db_liv = doc().tipo().dbliv(); | ||||||
|  | 
 | ||||||
|  |        for (int i = 0; i < 4; i++) | ||||||
|  |        { | ||||||
|  |           const char* liv = row.get(sf.cid2index(FR_LIV1+i)); | ||||||
|  |           if (*liv > ' ') | ||||||
|  |             livello << liv; | ||||||
|  |          else | ||||||
|  |            break;   | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 	_fconv_qta = UNO; | ||||||
|  | 	if (codart.full() && causmag.full()) | ||||||
|  | 	{ | ||||||
|  | 	   	if (c.scarica_alternativi()) | ||||||
| 		{ | 		{ | ||||||
| 			const TString& alt = cached_article(codart).get(ANAMAG_CODARTALT); | 			const TString& alt = cached_article(codart).get(ANAMAG_CODARTALT); | ||||||
| 			if (alt.full()) | 			if (alt.full()) | ||||||
| 				codart = alt; | 				codart = alt; | ||||||
| 		} | 		if (db_liv > 0) | ||||||
|  | 		{ | ||||||
|  |       const int expl_row = doc().tipo().dbrow()-1; // Sul file .ini l'indice parte da 1!
 | ||||||
|  |       if (expl_row >= 0)                           // Evito esplosioni inutili in primis
 | ||||||
|  |       { | ||||||
|  |         TDistinta_tree db;      | ||||||
|  |         TArray components; | ||||||
|  |         db.set_root(codart, "", 1, livello); | ||||||
|  | 
 | ||||||
|  |         const int items = db.explode(components, false, RAGGR_EXP_NONE, db_liv); | ||||||
|  |         if (items > 0 && expl_row < items)         // Controllo se la riga esplosione desiderata e' valida
 | ||||||
|  | 			  { | ||||||
|  | 				  const TRiga_esplosione& r = (const TRiga_esplosione &)components[expl_row]; | ||||||
|  |           codart = r.articolo();                   // Cambio il codice articola da elaborare
 | ||||||
|  | 				  _fconv_qta = r.val(); | ||||||
|  | 			  } | ||||||
|  |       } | ||||||
|  |     	} | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	real giac, disp; | 	real giac, disp; | ||||||
| @ -1510,27 +1543,19 @@ void TDocumento_mask::update_giacenza() | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   TString16 livello; |  | ||||||
| 
 |  | ||||||
|   for (int i = 0; i < 4; i++) |  | ||||||
|   { |  | ||||||
|     const char* liv = row.get(sf.cid2index(FR_LIV1+i)); |  | ||||||
|     if (*liv > ' ') |  | ||||||
|       livello << liv; |  | ||||||
|     else |  | ||||||
|       break;   |  | ||||||
|   } |  | ||||||
|    |  | ||||||
| 	const TString& annoes = get(F_ANNO); | 	const TString& annoes = get(F_ANNO); | ||||||
| 	TArticolo_giacenza& art = cached_article_balances(codart); | 	TArticolo_giacenza& art = cached_article_balances(codart); | ||||||
| 
 | 
 | ||||||
| 	giac = art.disponibilita(annoes, codmag, livello, TRUE); | 	giac = art.disponibilita(annoes, codmag, livello, TRUE); | ||||||
| 	disp = art.disponibilita(annoes, codmag, livello, FALSE); | 	disp = art.disponibilita(annoes, codmag, livello, FALSE); | ||||||
| 			 | 			 | ||||||
|   const TString4 um = row.get(sf.cid2index(FR_UMQTA)); |     if (db_liv == 0) | ||||||
| 
 | 		{ | ||||||
|   art.convert_to_um(giac, um); | 			const TString4 um = row.get(sf.cid2index(FR_UMQTA)); | ||||||
|   art.convert_to_um(disp, um); | 			art.convert_to_um(giac, um); | ||||||
|  | 			art.convert_to_um(disp, um); | ||||||
|  | 		} | ||||||
|  |   } | ||||||
| 	set(F_CURGIAC, giac.string()); | 	set(F_CURGIAC, giac.string()); | ||||||
| 	set(F_CURDISP, disp.string());														 | 	set(F_CURDISP, disp.string());														 | ||||||
| } | } | ||||||
| @ -1660,7 +1685,10 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key ) | |||||||
| 			if (r < doc.physical_rows()) | 			if (r < doc.physical_rows()) | ||||||
| 			{	 | 			{	 | ||||||
| 				m.update_giacenza(); | 				m.update_giacenza(); | ||||||
|  |      			const TRectype& rdoc = doc[r + 1]; | ||||||
| 				set_curr_um(rdoc.get(RDOC_UMQTA)); | 				set_curr_um(rdoc.get(RDOC_UMQTA)); | ||||||
|  | 				const bool on = rdoc.get(RDOC_DACODNUM).full(); | ||||||
|  | 				ss.sheet_mask().enable(DLG_USER, on); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty()) | 			if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty()) | ||||||
|  | |||||||
| @ -2103,7 +2103,30 @@ bool qtaart_handler( TMask_field& f, KEY key ) | |||||||
| 						else | 						else | ||||||
| 							break; | 							break; | ||||||
| 					} | 					} | ||||||
| 
 | 				 | ||||||
|  |       if ((doc.tipo().check_giac() || doc.tipo().check_disp()) && | ||||||
|  |           main_app().has_module(MGAUT, CHK_DONGLE) && doc.tipo().mov_mag()) | ||||||
|  |       {                              | ||||||
|  |         TSheet_field& sf = mask.sfield(F_SHEET); | ||||||
|  |         TToken_string& row = sf.row(sf.selected());        | ||||||
|  |         const TCodice_articolo codart = row.get(sf.cid2index(FR_CODARTMAG)); | ||||||
|  |          | ||||||
|  |         if (codart.full()) | ||||||
|  |         { | ||||||
|  |           TString8 codmag = row.get(sf.cid2index(FR_CODMAG)); | ||||||
|  |           const TString4 coddep = row.get(sf.cid2index(FR_CODDEP));     | ||||||
|  |           if (!coddep.blank()) | ||||||
|  |             codmag << coddep; | ||||||
|  |            | ||||||
|  |           TString16 livello; | ||||||
|  |           for (int i = 0; i < 4; i++) | ||||||
|  |           { | ||||||
|  |             const char* liv = row.get(sf.cid2index(FR_LIV1+i)); | ||||||
|  |             if (*liv > ' ') | ||||||
|  |               livello << liv; | ||||||
|  |             else | ||||||
|  |               break;   | ||||||
|  |           } | ||||||
| 					real qta(row.get(sf.cid2index(FR_QTA))); | 					real qta(row.get(sf.cid2index(FR_QTA))); | ||||||
| 					const TString16 caus(mask.get(F_CAUSMAG)); | 					const TString16 caus(mask.get(F_CAUSMAG)); | ||||||
| 					const TCausale_magazzino & c = cached_causale_magazzino(caus); | 					const TCausale_magazzino & c = cached_causale_magazzino(caus); | ||||||
| @ -2121,6 +2144,8 @@ bool qtaart_handler( TMask_field& f, KEY key ) | |||||||
| 						if (rmovmag.read() == NOERR) | 						if (rmovmag.read() == NOERR) | ||||||
| 							qta -= rmovmag.get_real(RMOVMAG_QUANT); | 							qta -= rmovmag.get_real(RMOVMAG_QUANT); | ||||||
| 					} | 					} | ||||||
|  | 					if (mask.fconv_qta() != UNO) | ||||||
|  | 						qta *= mask.fconv_qta(); | ||||||
| 					if (doc.tipo().check_giac()) | 					if (doc.tipo().check_giac()) | ||||||
| 					{ | 					{ | ||||||
| 						real giac(mask.get(F_CURGIAC)); | 						real giac(mask.get(F_CURGIAC)); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user