Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@17629 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5cb56fdb07
								
							
						
					
					
						commit
						e00e0393f8
					
				| @ -527,25 +527,27 @@ TPack_clifo::~TPack_clifo() | |||||||
| bool TPack_indsped::get_clifo(char& tipocf, long& codcf) | bool TPack_indsped::get_clifo(char& tipocf, long& codcf) | ||||||
| { | { | ||||||
|   TString query = query_header(); |   TString query = query_header(); | ||||||
|   query << "SELECT CodContab FROM Customers_Suppliers WHERE (FlagCustSupp=#TIPOCF) AND (CustSuppCode=#CODCF)"; |   query << "SELECT CodContab,FlagCustSupp FROM Customers_Suppliers WHERE CustSuppCode=#CODCF"; | ||||||
|   TODBC_recordset clifo(query); |   TODBC_recordset clifo(query); | ||||||
| 
 | 
 | ||||||
|   const TVariant tipo(tipocf == 'C' ? "C": "S"); |  | ||||||
|   const TVariant& code = recordset().get("CustSuppRefCode"); |   const TVariant& code = recordset().get("CustSuppRefCode"); | ||||||
| 
 |  | ||||||
|   clifo.set_var("#TIPOCF", tipo); |  | ||||||
|   clifo.set_var("#CODCF", code); |   clifo.set_var("#CODCF", code); | ||||||
|   bool ok = clifo.move_first(); |   bool ok = clifo.move_first(); | ||||||
|  | 
 | ||||||
|   if (ok) |   if (ok) | ||||||
|   { |   { | ||||||
|     tipocf = tipo.as_string()[0] == 'C' ? 'C' : 'F'; |  | ||||||
|     codcf = clifo.get(0u).as_int(); |     codcf = clifo.get(0u).as_int(); | ||||||
|  |     tipocf = clifo.get(1u).as_string()[0]; | ||||||
|  | 
 | ||||||
|  |     if (tipocf == 'T') | ||||||
|  |       return false; // Ignora clienti temporanei senza dare segnalazioni
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (!ok || codcf <= 0) |   if (!ok || codcf <= 0) | ||||||
|   { |   { | ||||||
|     TString msg = TR("Impossibile determinare il codice contabile del cliente/fornitore"); |     TString msg; | ||||||
|     msg << ' ' << tipo.as_string() << ' ' << code.as_string(); |     msg << TR("Impossibile determinare il codice contabile dell'anagrafica"); | ||||||
|  |     msg << " Customers_Suppliers.CustSuppCode=" << code.as_string(); | ||||||
|     ok = log_error(msg); |     ok = log_error(msg); | ||||||
|   } |   } | ||||||
|    |    | ||||||
| @ -598,7 +600,7 @@ bool TPack_indsped::trasferisci() | |||||||
| 	  codcontab.trim(); | 	  codcontab.trim(); | ||||||
| 		long codcf = -1; | 		long codcf = -1; | ||||||
| 		int codind = 0; | 		int codind = 0; | ||||||
| 		if (codcontab.not_empty()) | 		if (codcontab.full()) | ||||||
| 		{ | 		{ | ||||||
| 			codcf = codcontab.get_long(0); | 			codcf = codcontab.get_long(0); | ||||||
| 			codind = codcontab.get_int(); | 			codind = codcontab.get_int(); | ||||||
| @ -613,7 +615,7 @@ bool TPack_indsped::trasferisci() | |||||||
| 			good = clifo.read() == NOERR; | 			good = clifo.read() == NOERR; | ||||||
| 			if (!good) | 			if (!good) | ||||||
| 			{ | 			{ | ||||||
|     	  // custsupprefcode e' il cliente/fornitore a cui si riferisce l'indirizzo di spesione
 |     	  // custsupprefcode e' il cliente/fornitore a cui si riferisce l'indirizzo di spedizione
 | ||||||
| 		    const TString& custsupprefcode = get_str("CustSuppRefCode"); | 		    const TString& custsupprefcode = get_str("CustSuppRefCode"); | ||||||
| 				str.format(FR("Non esiste l'indirizzo di spedizione %ld/%d corrispondente a %s"),  | 				str.format(FR("Non esiste l'indirizzo di spedizione %ld/%d corrispondente a %s"),  | ||||||
|                    codcf, codind, (const char*)custsupprefcode); |                    codcf, codind, (const char*)custsupprefcode); | ||||||
| @ -634,7 +636,7 @@ bool TPack_indsped::trasferisci() | |||||||
| 		if (needs_creation && statusflag != 3 && good) | 		if (needs_creation && statusflag != 3 && good) | ||||||
| 		{ | 		{ | ||||||
| 			// inserisco indirizzo di spedizione
 | 			// inserisco indirizzo di spedizione
 | ||||||
| 			char tipo = tipocf=='C' ? 'C':'S'; | 			char tipo = ' '; | ||||||
| 			if (get_clifo(tipo, codcf)) | 			if (get_clifo(tipo, codcf)) | ||||||
| 			{ | 			{ | ||||||
| 				codind = get_next_key(tipocf, codcf); | 				codind = get_next_key(tipocf, codcf); | ||||||
| @ -653,6 +655,7 @@ bool TPack_indsped::trasferisci() | |||||||
| 		{ | 		{ | ||||||
| 			if (statusflag == 3) | 			if (statusflag == 3) | ||||||
| 			{ | 			{ | ||||||
|  |         // NON cancellare il cliente in quanto potrebbe avere dei movimenti associati
 | ||||||
| 				//const int flag = cancella_clifo(clifo);
 | 				//const int flag = cancella_clifo(clifo);
 | ||||||
| 				//update_statusflag_codcontab(custsuppcode, flag, "0");
 | 				//update_statusflag_codcontab(custsuppcode, flag, "0");
 | ||||||
| 			} | 			} | ||||||
| @ -662,16 +665,17 @@ bool TPack_indsped::trasferisci() | |||||||
| 				TString80 dencom = get_str("Locality"); | 				TString80 dencom = get_str("Locality"); | ||||||
| 				dencom.trim(); dencom.upper(); | 				dencom.trim(); dencom.upper(); | ||||||
| 				const TRectype& reccom = cache_comuni.get(dencom); | 				const TRectype& reccom = cache_comuni.get(dencom); | ||||||
| 				TString80 str = reccom.get(COM_DENCOM);	str.trim(); | 				TString256 str = reccom.get(COM_DENCOM);  | ||||||
|  |         str.trim(); str.upper(); | ||||||
| 				if (str == dencom) | 				if (str == dencom) | ||||||
| 					rec_indsped.put(IND_COM, reccom.get(COM_COM)); | 					rec_indsped.put(IND_COM, reccom.get(COM_COM)); | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					rec_clifo.put(IND_COM, " "); | 					rec_indsped.zero(IND_COM); | ||||||
| 					rec_clifo.put(IND_LOCALITA, dencom); | 					rec_indsped.put(IND_LOCALITA, dencom); | ||||||
| 
 | 
 | ||||||
| 					log(""); | 					log(""); | ||||||
| 					str.format(FR("Destinazioni diverse %d: comune non trovato %s"), codcf, (const char*) dencom); | 					str.format(FR("Destinazioni diverse %ld: comune non trovato %s"), codcf, (const char*) dencom); | ||||||
| 					log(str); | 					log(str); | ||||||
| 				} | 				} | ||||||
| 				aggiorna_record(indsped, lista_indsped); | 				aggiorna_record(indsped, lista_indsped); | ||||||
|  | |||||||
| @ -389,8 +389,6 @@ void TDichiarazione_CONAI::scrivi_csv(const TRectype& prima_riga, TDichiarazione | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 		if (anno == 2008 && codnum == "NAC" && (numdoc == 74 || numdoc == 75)) |  | ||||||
| 			int cazzone = 1; |  | ||||||
|     if (n_riga_generata > 0) |     if (n_riga_generata > 0) | ||||||
|       scrivi_csv_doc_con_riga_generata(doc, n_riga_generata, csv, conai_specie); |       scrivi_csv_doc_con_riga_generata(doc, n_riga_generata, csv, conai_specie); | ||||||
|     else |     else | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user