Patch level : 12.0 332
Files correlati : ve0.exe ve6.exe Aggiunte le spese di trasporto all'imponibile intra suddivise per nomenclatura. La tabella spese ha ora una tipologia di spesa esplicita ( Altro, Incasso, Rimborsi, Trasporto). git-svn-id: svn://10.65.10.50/branches/R_10_00@23524 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5604127e3e
								
							
						
					
					
						commit
						cd0b472034
					
				| @ -64,6 +64,11 @@ class TSelect_color_mask; | |||||||
| #define RIGA_DESCRIZIONI  'D' | #define RIGA_DESCRIZIONI  'D' | ||||||
| #define RIGA_RETTIFICHE   'T' | #define RIGA_RETTIFICHE   'T' | ||||||
| 
 | 
 | ||||||
|  | #define TIPO_SPESE_ALTRO			"A" | ||||||
|  | #define TIPO_SPESE_INCASSO		"I" | ||||||
|  | #define TIPO_SPESE_RIMBORSO		"R" | ||||||
|  | #define TIPO_SPESE_TRASPORTO	"T" | ||||||
|  | 
 | ||||||
| #define MAX_IVA_SLICES 5 | #define MAX_IVA_SLICES 5 | ||||||
| 
 | 
 | ||||||
| class TDocumento; | class TDocumento; | ||||||
| @ -878,6 +883,7 @@ public: | |||||||
| 	real totale_netto() const; | 	real totale_netto() const; | ||||||
| 	real basesconto() const; | 	real basesconto() const; | ||||||
| 	real spese() const; | 	real spese() const; | ||||||
|  | 	real spese(const TString & tipo_spesa) const; | ||||||
| 	real ritenute(const char tipo = '\0', bool lordo = false, int ndec = AUTO_DECIMALS) const; | 	real ritenute(const char tipo = '\0', bool lordo = false, int ndec = AUTO_DECIMALS) const; | ||||||
| 	real provvigione(bool first = true, int ndec = AUTO_DECIMALS) const; | 	real provvigione(bool first = true, int ndec = AUTO_DECIMALS) const; | ||||||
| 	real valore(bool totale, bool lordo = false, int ndec = AUTO_DECIMALS) const; | 	real valore(bool totale, bool lordo = false, int ndec = AUTO_DECIMALS) const; | ||||||
|  | |||||||
| @ -70,6 +70,7 @@ protected: | |||||||
| public: | public: | ||||||
| 	TCodice_numerazione & num(const char* key); | 	TCodice_numerazione & num(const char* key); | ||||||
| 	TNumerazione_cache(); | 	TNumerazione_cache(); | ||||||
|  | 	virtual ~TNumerazione_cache() { } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| TNumerazione_cache::TNumerazione_cache() | TNumerazione_cache::TNumerazione_cache() | ||||||
| @ -2500,7 +2501,41 @@ real TDocumento::basesconto() const | |||||||
| real TDocumento::spese() const | real TDocumento::spese() const | ||||||
| { | { | ||||||
|   const TString& field = tipo().spese(); |   const TString& field = tipo().spese(); | ||||||
|   return field.full() ? get_real(field) : ZERO; | 
 | ||||||
|  |   if (field.full()) | ||||||
|  | 		return get_real(field); | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		real r; | ||||||
|  | 	   | ||||||
|  | 		FOR_EACH_PHYSICAL_RDOC(*this, i, rdoc) | ||||||
|  | 			if (rdoc->is_spese()) | ||||||
|  | 					r += rdoc->imponibile(); | ||||||
|  | 		return r; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | real TDocumento::spese(const TString & tipo_spesa) const | ||||||
|  | { | ||||||
|  |   TString16 field = tipo().spese(); | ||||||
|  | 
 | ||||||
|  | 	field << tipo_spesa; | ||||||
|  |   if (tipo().exist(field)) | ||||||
|  | 		return get_real(field); | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		real r; | ||||||
|  | 
 | ||||||
|  | 	  FOR_EACH_PHYSICAL_RDOC(*this, i, rdoc) | ||||||
|  | 			if (rdoc->is_spese()) | ||||||
|  | 			{ | ||||||
|  | 				const TSpesa_prest s(rdoc->get(RDOC_CODART));              | ||||||
|  | 
 | ||||||
|  | 				if (s.get("S11").sleft(1) == tipo_spesa) | ||||||
|  | 					r += rdoc->imponibile(); | ||||||
|  | 			} | ||||||
|  | 		return r; | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| real TDocumento::ritenute(const char tipo, bool lordo, int ndec) const | real TDocumento::ritenute(const char tipo, bool lordo, int ndec) const | ||||||
|  | |||||||
| @ -3963,14 +3963,37 @@ error_type TContabilizzazione::write_intra(TDocumento& doc) | |||||||
| 			totale_righe += imp.get_num(); | 			totale_righe += imp.get_num(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   if (nota_credito) | ||||||
|  | 		totale_righe -= doc.spese(TIPO_SPESE_TRASPORTO);   | ||||||
|  | 	else | ||||||
|  | 		totale_righe += doc.spese(TIPO_SPESE_TRASPORTO); | ||||||
|  |     | ||||||
|   if (_error == no_error) |   if (_error == no_error) | ||||||
|   { |   { | ||||||
|  | 		TGeneric_distrib d(doc.spese(TIPO_SPESE_TRASPORTO)); | ||||||
|  |     TRectype* rc; | ||||||
|  | 
 | ||||||
|  |     for(rc = (TRectype*)righe.first_item(); rc != NULL; rc = (TRectype*)righe.succ_item())  | ||||||
|  | 			d.add(is_val ? rc->get_real("AMMVALUTA") : rc->get_real("AMMLIRE")); | ||||||
|     // Copia il contenuto dell'assoc nel record array
 |     // Copia il contenuto dell'assoc nel record array
 | ||||||
|     TRectype* rc = new TRectype(LF_RINTRA); | 		rc = new TRectype(LF_RINTRA); | ||||||
|     rc->put("NUMREG", numreg); |     rc->put("NUMREG", numreg); | ||||||
|     rintra.set_key(rc); |     rintra.set_key(rc); | ||||||
|     for(rc = (TRectype*)righe.first_item(); rc != NULL; rc = (TRectype*)righe.succ_item())  |     for(rc = (TRectype*)righe.first_item(); rc != NULL; rc = (TRectype*)righe.succ_item())  | ||||||
|  | 		{ | ||||||
|  | 			real amm = is_val ? rc->get_real("AMMVALUTA") : rc->get_real("AMMLIRE"); | ||||||
|  | 			 | ||||||
|  | 			amm += d.get(); | ||||||
|  | 			rc->put(is_val ? "AMMVALUTA" : "AMMLIRE", amm); | ||||||
|  | 			if (is_val) | ||||||
|  | 			{ | ||||||
|  | 				TCurrency_documento imp(amm, doc); | ||||||
|  | 				 | ||||||
|  | 				imp.change_to_firm_val(); | ||||||
|  | 				rc->put("AMMLIRE", imp.get_num()); | ||||||
|  | 			} | ||||||
|       rintra.add_row(*rc); // Devo aggiungere una copia della riga dell'assoc array!
 |       rintra.add_row(*rc); // Devo aggiungere una copia della riga dell'assoc array!
 | ||||||
|  | 		} | ||||||
|     // Testa (de coccio...)
 |     // Testa (de coccio...)
 | ||||||
|     intra.zero(); |     intra.zero(); | ||||||
|     intra.put("NUMREG",    numreg); |     intra.put("NUMREG",    numreg); | ||||||
|  | |||||||
| @ -26,6 +26,7 @@ | |||||||
| #define SPP_CODTRB1       126 | #define SPP_CODTRB1       126 | ||||||
| #define SPP_SEZIONE       127 | #define SPP_SEZIONE       127 | ||||||
| #define SPP_CODCAUS770    128 | #define SPP_CODCAUS770    128 | ||||||
|  | #define SPP_TIPOSP		    129 | ||||||
| 
 | 
 | ||||||
| #define SPP_CDC_V1      130 | #define SPP_CDC_V1      130 | ||||||
| #define SPP_CDC_V2      131 | #define SPP_CDC_V2      131 | ||||||
|  | |||||||
| @ -330,6 +330,16 @@ BEGIN | |||||||
|   ADD RUN CG0 -0 |   ADD RUN CG0 -0 | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | LIST SPP_TIPOSP 1 20 | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 2 19 "Tipologia di spesa/prestazione " | ||||||
|  |   FIELD S11[1,1] | ||||||
|  |   ITEM " |Altro" | ||||||
|  |   ITEM "I|Incasso" | ||||||
|  |   ITEM "R|Rimborso"  | ||||||
|  |   ITEM "T|Trasporto"  | ||||||
|  | END | ||||||
|  | 
 | ||||||
| STRING SPP_CODTRB 4 | STRING SPP_CODTRB 4 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 2 20  "Cod. tributo   " |   PROMPT 2 20  "Cod. tributo   " | ||||||
| @ -376,7 +386,7 @@ END | |||||||
| LISTBOX SPP_SEZIONE 6 | LISTBOX SPP_SEZIONE 6 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 25 21 "Sezione per cooperative " |   PROMPT 25 21 "Sezione per cooperative " | ||||||
|   FIELD S11 |   FIELD S11[5,5] | ||||||
|   ITEM "D|Dare" |   ITEM "D|Dare" | ||||||
|   ITEM "A|Avere"  |   ITEM "A|Avere"  | ||||||
| END | END | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user