Patch level : 10.0 934
Files correlati : sc2.exe sc2100a.msk Ricompilazione Demo : [ ] Commento : 0001749: Stampa E/C : se nota di credito non viene considerata nella colonna scaduto Stampa E/C : se nota di credito non viene considerata nella colonna scaduto git-svn-id: svn://10.65.10.50/branches/R_10_00@21653 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									7e9848fc44
								
							
						
					
					
						commit
						1737696f00
					
				| @ -14,6 +14,5 @@ int main(int argc,char** argv) | |||||||
|   case  5: sc2600(argc,argv); break; // Stampa Prospetto Scadenze
 |   case  5: sc2600(argc,argv); break; // Stampa Prospetto Scadenze
 | ||||||
|   default: sc2100(argc,argv); break; // Stampa Estratti conto
 |   default: sc2100(argc,argv); break; // Stampa Estratti conto
 | ||||||
|   } |   } | ||||||
|   exit(0); |  | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  | |||||||
| @ -71,6 +71,7 @@ class TEC_form : public TForm | |||||||
|   word _total_rows;            // Numero di righe usate per i totali
 |   word _total_rows;            // Numero di righe usate per i totali
 | ||||||
|   word _maxtot;                // Numero massimo di totali da stampare       
 |   word _maxtot;                // Numero massimo di totali da stampare       
 | ||||||
|   bool _stampa_saldo;          // Stampa il saldo di ogni partita 
 |   bool _stampa_saldo;          // Stampa il saldo di ogni partita 
 | ||||||
|  |   bool _note_scadenti;         // Considera scadute le note di credito non assegnate
 | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|   void init_header(const TMask& m);                         |   void init_header(const TMask& m);                         | ||||||
| @ -95,6 +96,7 @@ public: | |||||||
|   const TDate& data_limite_scaduto() const    { return _dls; } |   const TDate& data_limite_scaduto() const    { return _dls; } | ||||||
|   int giorni_rischio() const                  { return _giorni_rischio; } |   int giorni_rischio() const                  { return _giorni_rischio; } | ||||||
|   const TDate& data_inizio_rischio() const    { return _dir; } |   const TDate& data_inizio_rischio() const    { return _dir; } | ||||||
|  |   bool note_scadenti() const                  { return _note_scadenti; } | ||||||
| 
 | 
 | ||||||
|   const TString& lingua() const { return _lingua; } |   const TString& lingua() const { return _lingua; } | ||||||
|   bool in_valuta() const { return _in_valuta; } |   bool in_valuta() const { return _in_valuta; } | ||||||
| @ -410,7 +412,7 @@ protected: | |||||||
|    |    | ||||||
|   TImporto* importo_riga_scaduto_ptr(int n) const { return (TImporto*)_scaduto.objptr(n); } |   TImporto* importo_riga_scaduto_ptr(int n) const { return (TImporto*)_scaduto.objptr(n); } | ||||||
|   TImporto& importo_riga_scaduto(int n); |   TImporto& importo_riga_scaduto(int n); | ||||||
| 
 |   bool is_unassigned(const TRiga_partite& row) const; | ||||||
|   TImporto importo(const TPartita& game, const TRectype& pag, bool valuta) const; |   TImporto importo(const TPartita& game, const TRectype& pag, bool valuta) const; | ||||||
|    |    | ||||||
|   static TPartita* _sort_game; |   static TPartita* _sort_game; | ||||||
| @ -442,7 +444,7 @@ TImporto TEC_array::importo(const TPartita& game, const TRectype& pag, bool valu | |||||||
|    |    | ||||||
|   if (!fat_val)  |   if (!fat_val)  | ||||||
|   { |   { | ||||||
|     imp.valore() += pag.get_real(PAGSCA_RITENUTE);   // Sommo le ritenute se sono il lire
 |     imp.valore() += pag.get_real(PAGSCA_RITENUTE);   // Sommo le ritenute se sono il Euro
 | ||||||
|     const TImporto ritsoc(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC)); |     const TImporto ritsoc(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC)); | ||||||
|     imp += ritsoc; |     imp += ritsoc; | ||||||
|   } |   } | ||||||
| @ -450,11 +452,11 @@ TImporto TEC_array::importo(const TPartita& game, const TRectype& pag, bool valu | |||||||
|   if (pag.get_char(PAGSCA_ACCSAL) == 'S') // Se il pagamento ha abbuoni o differenze cambio
 |   if (pag.get_char(PAGSCA_ACCSAL) == 'S') // Se il pagamento ha abbuoni o differenze cambio
 | ||||||
|   { |   { | ||||||
|     real abb(pag.get(PAGSCA_ABBUONI)); |     real abb(pag.get(PAGSCA_ABBUONI)); | ||||||
|     if (!valuta && fat_val)                // Se voglio gli abbuoni in lire ma la fattura non lo e'
 |     if (!valuta && fat_val)                // Se voglio gli abbuoni in Euro ma la fattura non lo e'
 | ||||||
|     { |     { | ||||||
|       const TValuta val(sum);              // Leggo il cambio dalla riga di partita
 |       const TValuta val(sum);              // Leggo il cambio dalla riga di partita
 | ||||||
|       val.val2lit(abb);                    // Converto in lire gli abbuoni
 |       val.val2lit(abb);                    // Converto in lire gli abbuoni
 | ||||||
|       abb += pag.get_real(PAGSCA_DIFFCAM); // Sommo l'eventuale differenza cambio (gia' in lire)
 |       abb += pag.get_real(PAGSCA_DIFFCAM); // Sommo l'eventuale differenza cambio (gia' in Euro)
 | ||||||
|     } |     } | ||||||
|     imp.valore() += abb;   // Sommo il tutto all'importo base (sez e' uguale per tutti i valori)
 |     imp.valore() += abb;   // Sommo il tutto all'importo base (sez e' uguale per tutti i valori)
 | ||||||
|   } |   } | ||||||
| @ -562,6 +564,14 @@ real TEC_array::calcola_scaduto(const TRiga_scadenze& rata, bool valuta) | |||||||
|   return scaduto_rata.valore(); |   return scaduto_rata.valore(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // Determina se una riga pagamento o nota di credito non è associata ad alcuna rata
 | ||||||
|  | bool TEC_array::is_unassigned(const TRiga_partite& row) const | ||||||
|  | { | ||||||
|  |   const TPartita& game = row.partita(); | ||||||
|  |   const int riga = row.get_int(PART_NRIGA); | ||||||
|  |   return game.esiste(TPartita::UNASSIGNED, TPartita::UNASSIGNED, riga); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| TEC_row& TEC_array::new_row(const TRiga_partite& row, const TDate& data,  | TEC_row& TEC_array::new_row(const TRiga_partite& row, const TDate& data,  | ||||||
|                             const TImporto& imp, int n) |                             const TImporto& imp, int n) | ||||||
| {  | {  | ||||||
| @ -583,7 +593,7 @@ void TEC_array::add_row(const TRiga_partite& row) | |||||||
| 
 | 
 | ||||||
| 		if (main_app().has_module(CAAUT)) | 		if (main_app().has_module(CAAUT)) | ||||||
| 		{ | 		{ | ||||||
| 			const TString & numregcg = row.get(PART_NREG); | 			const TString& numregcg = row.get(PART_NREG); | ||||||
| 			const long numreg = atol(_anal.decode(numregcg)); | 			const long numreg = atol(_anal.decode(numregcg)); | ||||||
| 
 | 
 | ||||||
| 			if (numreg > 0) | 			if (numreg > 0) | ||||||
| @ -594,8 +604,7 @@ void TEC_array::add_row(const TRiga_partite& row) | |||||||
| 
 | 
 | ||||||
| 				for (int i = 1; i <= nrows; i++) | 				for (int i = 1; i <= nrows; i++) | ||||||
| 				{ | 				{ | ||||||
| 					const TString80 s(anal_mov.row_code(i)); | 					const TString80 s = anal_mov.row_code(i); | ||||||
| 					 |  | ||||||
| 					if (s.full() && codanal.find(s) < 0) | 					if (s.full() && codanal.find(s) < 0) | ||||||
| 					{ | 					{ | ||||||
| 						if (codanal.full()) | 						if (codanal.full()) | ||||||
| @ -648,6 +657,7 @@ void TEC_array::add_row(const TRiga_partite& row) | |||||||
|         const TImporto impval(row.importo(true, 0x1));   // Importo pulito senza nient'altro
 |         const TImporto impval(row.importo(true, 0x1));   // Importo pulito senza nient'altro
 | ||||||
|         riga.importo_valuta(-impval.valore()); |         riga.importo_valuta(-impval.valore()); | ||||||
|       } |       } | ||||||
|  | 			riga.codici_analitica(codanal); | ||||||
|        |        | ||||||
|       const int tipo_pag = row.get_int(PART_TIPOPAG); |       const int tipo_pag = row.get_int(PART_TIPOPAG); | ||||||
|       const tipo_movimento tipo_mov = row.tipo();     |       const tipo_movimento tipo_mov = row.tipo();     | ||||||
| @ -671,7 +681,17 @@ void TEC_array::add_row(const TRiga_partite& row) | |||||||
|           riga.esposto(esposto.valore()); |           riga.esposto(esposto.valore()); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| 			riga.codici_analitica(codanal); | 
 | ||||||
|  |       if (tipo_mov == tm_nota_credito && form().note_scadenti()) | ||||||
|  |       { | ||||||
|  |         const TDate& dls = form().data_limite_scaduto(); | ||||||
|  |         if (data_pag <= dls && is_unassigned(row)) | ||||||
|  |         { | ||||||
|  |           const int nriga = row.get_int(PART_NRIGA); | ||||||
|  |           const TImporto imp = row.importo(in_valuta, 0x1);   // Importo pulito senza nient'altro
 | ||||||
|  |           importo_riga_scaduto(nriga) += imp;  | ||||||
|  |         } | ||||||
|  |       } | ||||||
|        |        | ||||||
|       const TImporto abbuoni(row.importo(in_valuta, 0x2)); |       const TImporto abbuoni(row.importo(in_valuta, 0x2)); | ||||||
|       if (!abbuoni.is_zero()) |       if (!abbuoni.is_zero()) | ||||||
| @ -964,8 +984,7 @@ void TEC_form::print_total(int riga, const THash_object& o) | |||||||
|    |    | ||||||
|   // Sostituisce magic-names nei prompt
 |   // Sostituisce magic-names nei prompt
 | ||||||
|   TString80 s; |   TString80 s; | ||||||
|   int i; |   for (int i = 0; i < MAXID; i++) | ||||||
|   for (i = 0; i < MAXID; i++) |  | ||||||
|   { |   { | ||||||
|     TForm_item& desc_field = foot.find_field(f_id[i]); |     TForm_item& desc_field = foot.find_field(f_id[i]); | ||||||
|     if (desc_field.shown()) |     if (desc_field.shown()) | ||||||
| @ -1048,7 +1067,7 @@ void TEC_form::print_total(int riga, const THash_object& o) | |||||||
|   foot.update(); |   foot.update(); | ||||||
|    |    | ||||||
|   // Ripristina prompt originari
 |   // Ripristina prompt originari
 | ||||||
|   for (i = 0; i < MAXID; i++) |   for (int i = 0; i < MAXID; i++) | ||||||
|   {             |   {             | ||||||
|     const TString* p = (const TString*)prompt.objptr(i); |     const TString* p = (const TString*)prompt.objptr(i); | ||||||
|     if (p) |     if (p) | ||||||
| @ -1271,8 +1290,7 @@ void TEC_form::set_agente(const TString& codag) | |||||||
|   if (good) |   if (good) | ||||||
|   { |   { | ||||||
|     TString ag; |     TString ag; | ||||||
|     ag << codag << ' '; |     ag << codag << ' ' << cache().get(LF_AGENTI, codag, AGE_RAGSOC); | ||||||
|     ag << cache().get(LF_AGENTI, codag, AGE_RAGSOC); |  | ||||||
| 
 | 
 | ||||||
|     if (printing()) |     if (printing()) | ||||||
|     { |     { | ||||||
| @ -1281,7 +1299,7 @@ void TEC_form::set_agente(const TString& codag) | |||||||
|     else |     else | ||||||
|     { |     { | ||||||
|       _recordset->new_rec(); |       _recordset->new_rec(); | ||||||
|       _recordset->set("Descrizione", TVariant(ag)); |       _recordset->set("Descrizione", ag); | ||||||
|       _recordset->new_rec(); |       _recordset->new_rec(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @ -1303,6 +1321,7 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval, bool excel) | |||||||
|   _dls = m.get(F_DATALIMSC); |   _dls = m.get(F_DATALIMSC); | ||||||
|   _giorni_rischio = m.get_int(F_GIORISCH);  |   _giorni_rischio = m.get_int(F_GIORISCH);  | ||||||
|   _dir = _dls; _dir -= _giorni_rischio; |   _dir = _dls; _dir -= _giorni_rischio; | ||||||
|  |   _note_scadenti = m.get_bool(F_NC_SCAD); | ||||||
| 
 | 
 | ||||||
|   TForm_item& flags = find_field('H', last_page, PEC_FLAGS); |   TForm_item& flags = find_field('H', last_page, PEC_FLAGS); | ||||||
| 
 | 
 | ||||||
| @ -1315,7 +1334,6 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval, bool excel) | |||||||
| 	if (oem == 0 && main_app().has_module(CAAUT)) | 	if (oem == 0 && main_app().has_module(CAAUT)) | ||||||
| 	{ | 	{ | ||||||
|     TForm_item& codanal = _form->find_field('B', odd_page, PEC_ANALITICA); |     TForm_item& codanal = _form->find_field('B', odd_page, PEC_ANALITICA); | ||||||
| 
 |  | ||||||
| 		codanal.show(); | 		codanal.show(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ | |||||||
| #define F_CODPROF    103 | #define F_CODPROF    103 | ||||||
| #define F_LINPROF    104 | #define F_LINPROF    104 | ||||||
| #define F_DESPROF    105 | #define F_DESPROF    105 | ||||||
|  | #define F_NC_SCAD    106 | ||||||
| #define F_DATALIMOP  110 | #define F_DATALIMOP  110 | ||||||
| #define F_DATALIMSC  111 | #define F_DATALIMSC  111 | ||||||
| #define F_GIORISCH   112 | #define F_GIORISCH   112 | ||||||
|  | |||||||
| @ -96,10 +96,15 @@ END | |||||||
| 
 | 
 | ||||||
| NUMBER F_GIORISCH 3 | NUMBER F_GIORISCH 3 | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 2 6 "Giorni calcolo rischio  " |   PROMPT 49 5 "Giorni calcolo rischio  " | ||||||
|   GROUP 1 |   GROUP 1 | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | BOOLEAN F_NC_SCAD | ||||||
|  | BEGIN | ||||||
|  |   PROMPT 2 6 "Considera scadute le note di credito non associate ad alcuna rata" | ||||||
|  | END | ||||||
|  | 
 | ||||||
| BOOLEAN F_STAMPCHIU | BOOLEAN F_STAMPCHIU | ||||||
| BEGIN | BEGIN | ||||||
|   PROMPT 2 7 "Stampa partite chiuse" |   PROMPT 2 7 "Stampa partite chiuse" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user