Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :sistemato problema dei conti contabili nei movimenti git-svn-id: svn://10.65.10.50/trunk@14363 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									36e835a42c
								
							
						
					
					
						commit
						4af434baab
					
				| @ -132,6 +132,7 @@ class TBudget_Import : public TSkeleton_application | ||||
|   TCursor*					_cur; | ||||
|   TProgind*					_prog; | ||||
| 	TString						_lastfile; | ||||
| 	TString4					_codcaus; | ||||
| 
 | ||||
| 	virtual const char * extra_modules() const {return "ba";} | ||||
| 
 | ||||
| @ -140,6 +141,7 @@ protected: | ||||
| 	void ini2mask(); | ||||
| 	bool transfer(); | ||||
| 	void transfer_movimento(const TRecord_text& curr); //, TError_log& log);
 | ||||
| 	const TString& ana2bill(const TString& contone) const; | ||||
| 
 | ||||
| 	long get_next_key(); | ||||
| 
 | ||||
| @ -173,6 +175,20 @@ long TBudget_Import::get_next_key() | ||||
|   return numreg; | ||||
| } | ||||
| 
 | ||||
| const TString& TBudget_Import::ana2bill(const TString& contone) const | ||||
| { | ||||
| 	TToken_string key; | ||||
| 	key = contone; | ||||
| 	key.add("1"); | ||||
| 	const TRectype& rec = cache().get(LF_PANAPDC, key); | ||||
| 	if (rec.empty()) | ||||
| 		return EMPTY_STRING; | ||||
| 
 | ||||
|   TString& tmp = get_tmp_string(); | ||||
| 	tmp.format("%03d%03d%06ld",  | ||||
| 		         rec.get_int("GRUPPO"), rec.get_int("CONTO"), rec.get_long("SOTTOCONTO")); | ||||
| 	return tmp; | ||||
| } | ||||
| 
 | ||||
| void TBudget_Import::transfer_movimento(const TRecord_text& curr) //, TError_log& log)
 | ||||
| { | ||||
| @ -210,6 +226,7 @@ void TBudget_Import::transfer_movimento(const TRecord_text& curr) //, TError_log | ||||
| 	movana.put(MOVANA_DATAREG, dataini); | ||||
| 	movana.put(MOVANA_DATACOMP, dataini); | ||||
| 	movana.put(MOVANA_DESCR, "Movimento di budget importato"); | ||||
| 	movana.put(MOVANA_CODCAUS, _codcaus); | ||||
| 	movana.put(MOVANA_TIPOMOV, 'P'); | ||||
| 	movana.put(MOVANA_TOTDOC, soldini); | ||||
| 
 | ||||
| @ -222,14 +239,18 @@ void TBudget_Import::transfer_movimento(const TRecord_text& curr) //, TError_log | ||||
| 	TISAM_recordset pconana(query); | ||||
| 	const TRecnotype items = pconana.items(); | ||||
| 	if (items <= 0) | ||||
| 		warning_box(TR("Il sottoconto %s NON esiste!"), codconto); | ||||
| 		warning_box(FR("Il sottoconto %s NON esiste!"), (const char*)codconto); | ||||
| 
 | ||||
| 	if (items > 1) | ||||
| 		warning_box(TR("Esiste piu' di un sottoconto %s!"),codconto); | ||||
| 		warning_box(FR("Esiste piu' di un sottoconto %s!"), (const char*)codconto); | ||||
| 
 | ||||
| 	pconana.move_last();	//si posiziona sul record corretto
 | ||||
| 	const TString contone = pconana.get(PCONANA_CODCONTO).as_string(); | ||||
| 	const TString4 sezione = pconana.get(PCONANA_SEZSALDI).as_string(); | ||||
| 	const TString& contone = pconana.get(PCONANA_CODCONTO).as_string(); | ||||
|   const TString& contcon = ana2bill(contone); | ||||
| 	if (contcon.empty()) | ||||
| 		warning_box(FR("Il conto analitico %s non corrisponde ad alcun conto contabile!"), (const char*)contone); | ||||
| 
 | ||||
| 	const TString& sezione = pconana.get(PCONANA_SEZSALDI).as_string(); | ||||
| 	//mette quella bastarda di sezione nel record
 | ||||
| 	movana.put(MOVANA_SEZIONE, sezione); | ||||
| 
 | ||||
| @ -243,7 +264,7 @@ void TBudget_Import::transfer_movimento(const TRecord_text& curr) //, TError_log | ||||
| 	rec_rmovana.put(RMOVANA_SEZIONE ,sezione); | ||||
| 	rec_rmovana.put(RMOVANA_DATACOMP ,dataini); | ||||
| 	rec_rmovana.put(RMOVANA_CODCMS ,codcms); | ||||
| 	rec_rmovana.put(RMOVANA_CODCONTO, contone); | ||||
| 	rec_rmovana.put(RMOVANA_CODCONTO, contcon); | ||||
| 	rec_rmovana.put(RMOVANA_DESCR, "Riga movimento di budget importato"); | ||||
| 	rec_rmovana.put(RMOVANA_IMPORTO, soldini); | ||||
| 
 | ||||
| @ -285,6 +306,9 @@ bool TBudget_Import::transfer() | ||||
|   _trasfile = new TBudget_Import_file(file); | ||||
|   _trasfile->open(file,'r'); | ||||
| 
 | ||||
| 	//la causale!!!
 | ||||
| 	_codcaus = _msk->get(F_COD_CAUS); | ||||
| 
 | ||||
| 	//*** prima va inserito il log in libreria preparazione del log
 | ||||
| //	TError_log log;
 | ||||
| //	log.set_header(TR("Importazione movimenti"));
 | ||||
| @ -317,16 +341,23 @@ void TBudget_Import::mask2ini() | ||||
| 	_configfile->set_paragraph("BUDGET"); | ||||
| 	_configfile->set("PATH", _msk->get(F_PATH)); | ||||
| 	_configfile->set("LASTFILE", _lastfile); | ||||
| 	_msk->set(F_COD_CAUS, _codcaus); | ||||
| 	_configfile->set("CODCAUS", _msk->get(F_COD_CAUS)); | ||||
| } | ||||
| 
 | ||||
| void TBudget_Import::ini2mask() | ||||
| { | ||||
| 	//carica i parametri del file di configurazione
 | ||||
| 	_configfile->set_paragraph("BUDGET"); | ||||
| 
 | ||||
| 	TString path = _configfile->get("PATH"); | ||||
| 	_lastfile = _configfile->get("LASTFILE"); | ||||
| 	_msk->set(F_PATH, path); | ||||
| 
 | ||||
| 	_lastfile = _configfile->get("LASTFILE"); | ||||
| 	_msk->set(F_LASTFILE, _lastfile); | ||||
| 
 | ||||
| 	_codcaus = _configfile->get("CODCAUS"); | ||||
| 	_msk->set(F_COD_CAUS, _codcaus); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -4,3 +4,5 @@ | ||||
| #define F_NAMEFILE		102 | ||||
| #define F_LASTFILE		103 | ||||
| #define F_KILLOLD			104 | ||||
| #define F_COD_CAUS		105 | ||||
| #define F_DESCR_CAUS	106 | ||||
|  | ||||
| @ -50,5 +50,28 @@ BEGIN | ||||
|   PROMPT 1 7 "Elimina tutti i movimenti ed i saldi preventivi esistenti" | ||||
| END | ||||
| 
 | ||||
| STRING F_COD_CAUS 3 | ||||
| BEGIN | ||||
|   PROMPT 1 9 "Causale " | ||||
|   FLAGS "UZ" | ||||
|   USE LF_CAUSALI | ||||
|   INPUT CODCAUS F_COD_CAUS | ||||
|   DISPLAY "Cod." CODCAUS | ||||
|   DISPLAY "Descrizione@50" DESCR | ||||
|   OUTPUT F_COD_CAUS CODCAUS | ||||
|   OUTPUT F_DESCR_CAUS DESCR | ||||
|   CHECKTYPE REQUIRED | ||||
| END | ||||
| 
 | ||||
| STRING F_DESCR_CAUS 50 40 | ||||
| BEGIN | ||||
|   PROMPT 20 9 "Descriz." | ||||
|   USE LF_CAUSALI KEY 2 | ||||
|   INPUT DESCR F_DESCR_CAUS | ||||
|   DISPLAY "Descrizione @50" DESCR | ||||
|   DISPLAY "Cod." CODCAUS | ||||
|   COPY OUTPUT F_COD_CAUS | ||||
| END | ||||
| 
 | ||||
| ENDPAGE | ||||
| ENDMASK | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user