Patch level :4.0 820
Files correlati : Ricompilazione Demo : [ ] Commento :aggiunti cdc al bilancio di commessa e al rendiconto git-svn-id: svn://10.65.10.50/trunk@15755 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									a3d9558f8e
								
							
						
					
					
						commit
						262e6f6cad
					
				| @ -668,13 +668,14 @@ void TPrint_rendiconto_ca_recordset::scrive_riga(const TRectype& rmovana, const | ||||
| 				//commessa e fase della riga documento
 | ||||
| 				const TString& codcms_rigadoc = riga.codice_commessa(); | ||||
| 				const TString& codfase_rigadoc = riga.fase_commessa(); | ||||
|         const TString& codcdc_rigadoc = riga.codice_costo(); | ||||
| 				//per evitare di scrivere per ogni riga documento tutte le righe del doc babbo (in pratica..
 | ||||
| 				//..per evitare di avere n righe ordine ogni riga fattura) confronta commessa e fase..
 | ||||
| 				//..per evitare di avere n righe ordine ogni riga fattura) confronta commessa e fase e cdc..
 | ||||
| 				//..della riga movimento analitico con quelli la riga movimento e procede solo nel..
 | ||||
| 				//..caso coincidano (richiesta Adolfica!)
 | ||||
| 				//..caso coincidano (richiesta Adolfica! heil Magnavakken!)
 | ||||
| 
 | ||||
|         //Altra richiesta Adolfica: nel caso di ripartizioni, per non perdere la connessione tra..
 | ||||
|         //..commessa/fase originale della riga analitica non ripartita e cms/fase della riga doc,..
 | ||||
|         //..commessa/fase/cdc originale della riga analitica non ripartita e cms/fase/cdc della riga doc,..
 | ||||
|         //..e' necessario controllare l'esistenza dei campi ori che segnalano una ripartizione avvenuta.
 | ||||
|         //Se i campi ori sono compilati vanno usati!!! In caso contrario verrebbe perso il legame tra riga anal..
 | ||||
|         //..e riga doc e doc_babbo, perdendo la giusta configurazione del SELETTORE
 | ||||
| @ -685,8 +686,11 @@ void TPrint_rendiconto_ca_recordset::scrive_riga(const TRectype& rmovana, const | ||||
| 				TString codfase_rmovana = rmovana.get(RMOVANA_CODFASEORI); | ||||
|         if (!codfase_rmovana.full()) | ||||
|           codfase_rmovana = rmovana.get(RMOVANA_CODFASE); | ||||
|         TString codcdc_rmovana = rmovana.get(RMOVANA_CODCCORI); | ||||
|         if (!codcdc_rmovana.full()) | ||||
|           codcdc_rmovana = rmovana.get(RMOVANA_CODCCOSTO); | ||||
| 
 | ||||
| 				if (codcms_rigadoc == codcms_rmovana && codfase_rigadoc == codfase_rmovana) | ||||
| 				if (codcms_rigadoc == codcms_rmovana && codfase_rigadoc == codfase_rmovana && codcdc_rigadoc == codcdc_rmovana) | ||||
| 				{ | ||||
| 					const TRectype* babbo = riga.find_original_rdoc();	//cerca il doc padre della riga doc attuale
 | ||||
| 					if (babbo != NULL)	//se trova il doc padre..
 | ||||
|  | ||||
| @ -38,7 +38,7 @@ | ||||
|    <font face="Courier New" bold="1" size="16" /> | ||||
|   </field> | ||||
|   <field x="1" y="3" type="Testo" width="18" pattern="1" text="Centro di Costo:" /> | ||||
|   <field x="14" y="3" type="Stringa" width="23" pattern="1"> | ||||
|   <field x="19" y="3" type="Stringa" width="18" pattern="1"> | ||||
|    <font face="Courier New" bold="1" size="8" /> | ||||
|    <source>#COSTO</source> | ||||
|    <prescript description="H1.0 PRESCRIPT">CA_FORMAT_COSTO</prescript> | ||||
|  | ||||
| @ -6,6 +6,7 @@ | ||||
| #include "calib01.h" | ||||
| #include "calib02.h" | ||||
| #include "pconana.h" | ||||
| #include "cdc.h" | ||||
| #include "fasi.h" | ||||
| 
 | ||||
| 
 | ||||
| @ -16,10 +17,10 @@ class TPrint_bilancio_cms_mask : public TAnal_report_mask | ||||
| { | ||||
| protected: | ||||
|   virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); | ||||
| 	const TString& get_report_class() const;  | ||||
|   bool test_compatible_report(); | ||||
| 	 | ||||
| public: | ||||
|   const TString& get_report_class() const;  | ||||
|   TPrint_bilancio_cms_mask(); | ||||
|   virtual ~TPrint_bilancio_cms_mask() {} | ||||
| }; | ||||
| @ -27,10 +28,13 @@ public: | ||||
| const TString& TPrint_bilancio_cms_mask::get_report_class() const | ||||
| { | ||||
|   TString& classe = get_tmp_string(); | ||||
|   if (get_bool(F_FASI_GROUP)) | ||||
|     classe = "ca3800b"; | ||||
|   else | ||||
|     classe = "ca3800a"; | ||||
|   const int tipostampa = get_int(F_TIPOSTAMPA); | ||||
|   switch (tipostampa) | ||||
|   { | ||||
|   case  4: classe = "ca3800b"; break; | ||||
|   case  8: classe = "ca3800c"; break; | ||||
|   default: classe = "ca3800a"; break; | ||||
|   }    | ||||
|   return classe; | ||||
| } | ||||
| 
 | ||||
| @ -116,7 +120,7 @@ TPrint_bilancio_cms_mask::TPrint_bilancio_cms_mask() | ||||
|   { | ||||
|     if (pconana_levels >= 2 && prefix < pconana_levels && esistono_riclassificazioni()) | ||||
|     { | ||||
|     	ca_create_fields(*this, 0, LF_PCONANA, 1, 13, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO); | ||||
|     	ca_create_fields(*this, 0, LF_PCONANA, 1, 16, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO); | ||||
| 
 | ||||
|       // Nascondi i campi che non fanno parte del prefisso
 | ||||
| 	    for (int i = 0; i < pconana_levels; i++) | ||||
| @ -182,11 +186,13 @@ bool TPrint_bilancio_cms_rep::set_recordset() | ||||
|   return TReport::set_recordset(rs); | ||||
| } | ||||
| 
 | ||||
| void TPrint_bilancio_cms_rep::set_filter(const TPrint_bilancio_cms_mask& msk, const TString& curr_fase) | ||||
| void TPrint_bilancio_cms_rep::set_filter(const TPrint_bilancio_cms_mask& msk, const TString& curr_fase_cdc) | ||||
| { | ||||
| 	TPrint_bilancio_cms_recordset* recset = new TPrint_bilancio_cms_recordset();  | ||||
| 
 | ||||
|   recset->set_filter(msk, curr_fase); | ||||
|   //la set_filter del recordset puo' essere chiamata per fase o per centro di costo; se curr_fase_cdc e' vuota..
 | ||||
|   //..e' nel caso della stampa principale dettagliata (ca3800a.rep)
 | ||||
|   recset->set_filter(msk, curr_fase_cdc); | ||||
| 	TReport::set_recordset(recset); | ||||
| } | ||||
| 
 | ||||
| @ -214,17 +220,21 @@ void TPrint_bilancio_cms::main_loop() | ||||
| 		const TString& prefix = mask.get(F_PRE1); | ||||
| 		const int depth = mask.get_int(F_DEPTH); | ||||
| 		TString path = mask.get(F_REPORT); | ||||
|     const bool use_fasi = mask.get_bool(F_FASI); | ||||
| 
 | ||||
|     const int tipostampa = mask.get_int(F_TIPOSTAMPA); | ||||
|     //fasi
 | ||||
|     const bool use_fasi = (tipostampa == 1) || (tipostampa == 3); | ||||
|     const TString& fase = mask.get(F_FASE); | ||||
|     const bool group_fasi = mask.get_bool(F_FASI_GROUP); | ||||
|     const bool fasi_crpa = use_fasi && fase.empty() && group_fasi; | ||||
|     const bool group_fasi = tipostampa == 4; | ||||
| 
 | ||||
|     //cdc
 | ||||
|     const bool use_cdc = (tipostampa == 2) || (tipostampa == 3); | ||||
|     const TString& cdc = mask.get(F_CDC); | ||||
|     const bool group_cdc = tipostampa == 8; | ||||
| 
 | ||||
| 		if (path.empty()) | ||||
|     { | ||||
|       if (fasi_crpa) | ||||
|         path = "ca3800b"; //report riassuntivo con fasi raggruppate (crpa special edition)
 | ||||
|       else | ||||
| 			  path = "ca3800a"; //report standard
 | ||||
|       path = mask.get_report_class(); | ||||
|     } | ||||
| 
 | ||||
|     //crea il report in base ai parametri (tipo report,struttura,profondita' di stampa)
 | ||||
| @ -232,7 +242,7 @@ void TPrint_bilancio_cms::main_loop() | ||||
| 
 | ||||
|     //se e' una stampa di tipo fasi riassunte (crpa special edition) deve fare lo scanning di tutte le fasi..
 | ||||
|     //..singolarmente e stampare un report per ogni fase.Senno' stampa un solo report
 | ||||
|     if (fasi_crpa) | ||||
|     if (group_fasi) | ||||
|     { | ||||
|       //stampa tutte le fasi distinte in modo riassuntivo (crpa dedicate)
 | ||||
|       TString_array lista_fasi; | ||||
| @ -261,7 +271,23 @@ void TPrint_bilancio_cms::main_loop() | ||||
|         book.print_or_preview(); | ||||
|       } | ||||
| 
 | ||||
|     } //if(fasi_crpa...
 | ||||
|     } //if(group_fasi...
 | ||||
|     else if (group_cdc) | ||||
|     { | ||||
|       //stampa tutte le fasi distinte in modo riassuntivo (crpa dedicate)
 | ||||
|       TString_array lista_cdc; | ||||
|       //crea un TString_array con tutte le fasi distinte non ripetute
 | ||||
|       TISAM_recordset file_cdc("USE CDC"); | ||||
|       for (TRecnotype j = 0; file_cdc.move_to(j); j++) | ||||
|       { | ||||
|         const TString& curr_cdc = file_cdc.get(CDC_CODCOSTO).as_string(); | ||||
|         rep.set_filter(mask, curr_cdc); | ||||
|         book.add(rep); | ||||
| 
 | ||||
|       } | ||||
|       book.print_or_preview(); | ||||
| 
 | ||||
|     } //if(group_cdc...
 | ||||
|     else  //...senno' stampa standard in un giro solo
 | ||||
|     {		   | ||||
| 		  rep.set_filter(mask, "");	 | ||||
|  | ||||
| @ -71,54 +71,60 @@ BEGIN | ||||
|   FLAGS "A" | ||||
| END | ||||
| 
 | ||||
| GROUPBOX DLG_NULL 76 6 | ||||
| GROUPBOX DLG_NULL 76 8 | ||||
| BEGIN | ||||
|   PROMPT 0 6 "@bParametri" | ||||
| END | ||||
| 
 | ||||
| BOOLEAN F_VITAINTERA | ||||
| LISTBOX F_TIPOSTAMPA 1 30 | ||||
| BEGIN | ||||
|   PROMPT 2 7 "Includere esercizi successivi (vita intera)" | ||||
|   PROMPT 1 7 "Stampa" | ||||
|   ITEM "0|Normale" | ||||
| 	MESSAGE CLEAR,F_FASE|CLEAR,F_CDC | ||||
|   ITEM "1|Dettaglia per Fase" | ||||
| 	MESSAGE ENABLE,F_FASE|CLEAR,F_CDC | ||||
|   ITEM "2|Dettaglia per CdC" | ||||
| 	MESSAGE CLEAR,F_FASE|ENABLE,F_CDC | ||||
|   ITEM "3|Dettaglia per Fase e CdC" | ||||
| 	MESSAGE ENABLE,F_FASE|ENABLE,F_CDC | ||||
|   ITEM "4|Riassuntiva per Fase" | ||||
| 	MESSAGE CLEAR,F_FASE|CLEAR,F_CDC | ||||
|   ITEM "8|Riassuntiva per CdC" | ||||
| 	MESSAGE CLEAR,F_FASE|CLEAR,F_CDC | ||||
| END | ||||
| 
 | ||||
| STRING F_FASE 10 | ||||
| BEGIN | ||||
|   PROMPT 2 8 "Fase " | ||||
| END | ||||
| 
 | ||||
| STRING F_CDC 20 | ||||
| BEGIN | ||||
|   PROMPT 2 9 "CdC  " | ||||
| END | ||||
| 
 | ||||
| RADIOBUTTON F_TIPOSTIMA 1 35 | ||||
| BEGIN | ||||
|   PROMPT 35 7 "Tipo di stima" | ||||
|   PROMPT 41 7 "Tipo di stima" | ||||
|   ITEM "T|Tempo" | ||||
|   ITEM "C|Costi consuntivi\Ricavi preventivi" | ||||
|   ITEM "R|Costi consuntivi\Ricavi consuntivi" | ||||
| END | ||||
| 
 | ||||
| BOOLEAN F_FASI | ||||
| BOOLEAN F_VITAINTERA | ||||
| BEGIN | ||||
|   PROMPT 2 8 "Esplodere Fasi" | ||||
|   MESSAGE FALSE CLEAR,F_FASE|CLEAR,F_FASI_GROUP | ||||
|   MESSAGE TRUE ENABLE,F_FASE|ENABLE,F_FASI_GROUP | ||||
| END | ||||
| 
 | ||||
| STRING F_FASE 10 | ||||
| BEGIN | ||||
|   PROMPT 2 9 "Fase " | ||||
|   MESSAGE EMPTY ENABLE,F_FASI_GROUP | ||||
|   MESSAGE CLEAR,F_FASI_GROUP | ||||
| END | ||||
| 
 | ||||
| BOOLEAN F_FASI_GROUP | ||||
| BEGIN | ||||
|   PROMPT 2 10 "Riassuntiva per Fase" | ||||
|   MESSAGE FALSE ENABLE,F_FASE | ||||
|   MESSAGE TRUE CLEAR,F_FASE | ||||
|   PROMPT 41 12 "Includere esercizi successivi (vita intera)" | ||||
| END | ||||
| 
 | ||||
| GROUPBOX F_PRE0 76 5 | ||||
| BEGIN | ||||
|   PROMPT 0 12 "@bPrefisso del piano dei conti analitico:" | ||||
|   PROMPT 0 14 "@bPrefisso del piano dei conti analitico:" | ||||
|   GROUP 6 | ||||
| END | ||||
| 
 | ||||
| LISTBOX F_DEPTH 1 20 | ||||
| BEGIN | ||||
|   PROMPT 1 18 "Profondita' del piano dei conti da considerare " | ||||
|   PROMPT 1 19 "Profondita' del piano dei conti da considerare " | ||||
|   ITEM "1|Gruppo" | ||||
|   ITEM "2|Conto" | ||||
| END | ||||
|  | ||||
| @ -13,11 +13,13 @@ | ||||
|   <field x="165" type="Numero" align="right" width="3" pattern="1"> | ||||
|    <source>#REPORT.PAGE</source> | ||||
|   </field> | ||||
|   <field x="80" y="1.25" type="Testo" align="center" width="13" pattern="1" text="Margine" /> | ||||
|   <field x="54" y="2" type="Testo" align="center" width="6" pattern="1" text="% Av." /> | ||||
|   <field x="80" y="2" type="Testo" align="center" width="13" pattern="1" text=" Contribuz. " /> | ||||
|   <field x="86" y="1.25" type="Testo" align="center" width="13" pattern="1" text="Margine" /> | ||||
|   <field x="46.5" y="2" type="Testo" align="center" width="6" pattern="1" text="Fase" /> | ||||
|   <field x="54.5" y="2" type="Testo" align="center" width="6" pattern="1" text="CdC" /> | ||||
|   <field x="60" y="2" type="Testo" align="center" width="6" pattern="1" text="% Av." /> | ||||
|   <field x="86" y="2" type="Testo" align="center" width="13" pattern="1" text=" Contribuz. " /> | ||||
|   <field border="1" x="1" y="3" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="59" y="1" type="Testo" valign="bottom" align="right" width="13" height="2" id="69" pattern="1" text="Testata" /> | ||||
|   <field x="65" y="2" type="Testo" align="right" width="13" id="69" pattern="1" text="Testata" /> | ||||
|   <field x="1" y="2" type="Testo" width="15" id="121" pattern="1" text="Commessa" /> | ||||
|  </section> | ||||
|  <section type="Head" level="1"> | ||||
| @ -68,6 +70,13 @@ | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>FASESPEC</source> | ||||
|   </field> | ||||
|   <field x="100" y="4.25" type="Testo" width="15" pattern="1" text="CdC specificato"> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field x="112" y="4.25" type="Stringa" width="20" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>CDCSPEC</source> | ||||
|   </field> | ||||
|   <field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" /> | ||||
|  </section> | ||||
|  <section type="Head" level="2" height="1.5" page_break="1"> | ||||
| @ -114,7 +123,7 @@ | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Head" level="4" hidden="1"> | ||||
|   <condition>STAMPAFASI != ""</condition> | ||||
|   <condition>(STAMPAFASI != "" )||(STAMPACDC != "")</condition> | ||||
|   <groupby>CODCMS</groupby> | ||||
|   <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|   <field type="Stringa" width="1" id="1" pattern="1"> | ||||
| @ -141,21 +150,24 @@ | ||||
|   <field x="47" type="Stringa" width="9" pattern="1"> | ||||
|    <source>FASE</source> | ||||
|   </field> | ||||
|   <field x="56" type="Numero" align="right" width="3" pattern="1"> | ||||
|   <field x="57" type="Stringa" width="5" pattern="1"> | ||||
|    <source>CDC</source> | ||||
|   </field> | ||||
|   <field x="62" type="Numero" align="right" width="3" pattern="1"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <source>ROUND(AVANZAMENTO;0)</source> | ||||
|   </field> | ||||
|   <field x="91" type="Testo" align="center" width="2" pattern="1" text="%" /> | ||||
|   <field x="59" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="97" type="Testo" align="center" width="2" pattern="1" text="%" /> | ||||
|   <field x="65" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="B1.69 POSTSCRIPT">MESSAGE ADD,F4.69 | ||||
| MESSAGE ADD,F3.69</postscript> | ||||
|   </field> | ||||
|   <field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="79" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <source>#RICAVI-#COSTI</source> | ||||
|    <postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F4.169 | ||||
| MESSAGE ADD,F3.169</postscript> | ||||
|   </field> | ||||
|   <field x="87" type="Numero" align="right" width="4" id="170" pattern="1"> | ||||
|   <field x="93" type="Numero" align="right" width="4" id="170" pattern="1"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <prescript description="B1.170 PRESCRIPT">#RICAVI @ | ||||
| EMPTY= IF | ||||
| @ -179,8 +191,8 @@ THEN | ||||
|   <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|   <field border="2" x="1" y="0.75" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="1" y="1.5" type="Testo" fg_color="#FFFFFF" bg_color="#000000" width="25" height="1.5" text="TOTALI GENERALI " /> | ||||
|   <field x="59" y="1.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="73" y="1.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="65" y="1.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="79" y="1.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@" /> | ||||
|  </section> | ||||
|  <section type="Foot" level="2" height="2.5"> | ||||
|   <font italic="1" face="Courier New" bold="1" size="8" /> | ||||
| @ -199,7 +211,7 @@ THEN | ||||
|    <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|    <source>H2.102</source> | ||||
|   </field> | ||||
|   <field x="59" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="65" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|    <postscript description="F2.69 POSTSCRIPT">MESSAGE ADD,F1.69</postscript> | ||||
|   </field> | ||||
| @ -207,7 +219,7 @@ THEN | ||||
|   <field x="35" y="1" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1"> | ||||
|    <postscript description="F2.102 POSTSCRIPT">MESSAGE COPY,F2.101</postscript> | ||||
|   </field> | ||||
|   <field x="73" y="1" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="79" y="1" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|    <postscript description="F2.169 POSTSCRIPT">MESSAGE ADD,F1.169 | ||||
| MESSAGE RESET,169</postscript> | ||||
| @ -225,25 +237,25 @@ MESSAGE RESET,169</postscript> | ||||
|     <li Value="TOTALI Commesse avviate nell'esercizio selezionato" Code="3" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="59" y="0.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="65" y="0.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F3.69 POSTSCRIPT">MESSAGE ADD,F2.69</postscript> | ||||
|   </field> | ||||
|   <field y="0.5" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" /> | ||||
|   <field x="73" y="0.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="79" y="0.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F3.169 POSTSCRIPT">MESSAGE ADD,F2.169 | ||||
| MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Foot" level="4" height="1.25"> | ||||
|   <condition>(STAMPAFASI != "")(#H4.3 E; 0)(TIPOSTIMA!='T')(FASESPEC=="")</condition> | ||||
|   <condition>((STAMPAFASI !="")||(STAMPACDC !=""))(#H4.3 E; 0)(TIPOSTIMA!='T')(FASESPEC=="")</condition> | ||||
|   <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|   <field border="1" x="2" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="22" type="Testo" width="20" pattern="1" text="Totali commessa" /> | ||||
|   <field x="2" type="Stringa" bg_color="#C0C0C0" width="20" id="2" pattern="1"> | ||||
|    <source>H4.2</source> | ||||
|   </field> | ||||
|   <field x="59" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|   <field x="65" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="79" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F4.169 POSTSCRIPT">MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  | ||||
							
								
								
									
										258
									
								
								ca/ca3800c.rep
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										258
									
								
								ca/ca3800c.rep
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,258 @@ | ||||
| 
 | ||||
| <report libraries="ve1300" name="ca3800c" orientation="2" lpi="6" class="ca3800c"> | ||||
|  <description>Bilancio commessa CA per CdC</description> | ||||
|  <font face="Arial Narrow" size="8" /> | ||||
|  <section type="Head"> | ||||
|   <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|   <field x="1" type="Stringa" width="50" pattern="1"> | ||||
|    <source>#SYSTEM.RAGSOC</source> | ||||
|   </field> | ||||
|   <field x="80" type="Data" width="12" pattern="1"> | ||||
|    <source>#SYSTEM.DATE</source> | ||||
|   </field> | ||||
|   <field x="165" type="Numero" align="right" width="3" pattern="1"> | ||||
|    <source>#REPORT.PAGE</source> | ||||
|   </field> | ||||
|   <field x="80" y="1.25" type="Testo" align="center" width="13" pattern="1" text="Margine" /> | ||||
|   <field x="17.5" y="2" type="Stringa" width="12" pattern="1"> | ||||
|    <font face="Arial" bold="1" size="10" /> | ||||
|    <source>CDCSPEC</source> | ||||
|   </field> | ||||
|   <field x="54" y="2" type="Testo" align="center" width="6" pattern="1" text="% Av." /> | ||||
|   <field x="80" y="2" type="Testo" align="center" width="13" pattern="1" text=" Contribuz. " /> | ||||
|   <field border="1" x="1" y="3" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="59" y="1" type="Testo" valign="bottom" align="right" width="13" height="2" id="69" pattern="1" text="Testata" /> | ||||
|   <field x="1" y="2" type="Testo" width="14" id="121" pattern="1" text="Centro di costo" /> | ||||
|  </section> | ||||
|  <section type="Head" level="1"> | ||||
|   <field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO RAGGRUPPATO PER CENTRI DI COSTO"> | ||||
|    <font face="Courier New" bold="1" size="16" /> | ||||
|   </field> | ||||
|   <field x="10" y="3" type="Testo" width="35" pattern="1" text="Costi e ricavi di Commessa maturati nell'esercizio"> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field x="45" y="3" type="Stringa" width="4" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>ANNO</source> | ||||
|   </field> | ||||
|   <field x="60" y="3" type="Testo" width="15" pattern="1" text="Stima avanzamento "> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field x="75" y="3" type="Array" width="30" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>TIPOSTIMA</source> | ||||
|    <list> | ||||
|     <li Value="TEMPO" Code="T" /> | ||||
|     <li Value="COSTI Consuntivi \ RICAVI Preventivi" Code="C" /> | ||||
|     <li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="120" y="3" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame"> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field x="145" y="3" type="Array" width="7" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>DEPTH</source> | ||||
|    <list> | ||||
|     <li Value="Gruppo" Code="1" /> | ||||
|     <li Value="Conto" Code="2" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="10" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi"> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field x="30" y="4.25" type="Stringa" width="3" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>VITAINTERA</source> | ||||
|   </field> | ||||
|   <field x="60" y="4.25" type="Testo" width="15" pattern="1" text="Centro di Costo"> | ||||
|    <font italic="1" face="Arial Narrow" size="9" /> | ||||
|   </field> | ||||
|   <field border="2" x="1" y="5.5" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="80" y="4.25" type="Stringa" width="10" id="1" pattern="1"> | ||||
|    <font face="Arial Narrow" bold="1" size="9" /> | ||||
|    <source>CDCSPEC</source> | ||||
|    <postscript description="H1.1 POSTSCRIPT">MESSAGE COPY,F1.1</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Head" level="2" height="1.5"> | ||||
|   <groupby>LEVEL C; 2</groupby> | ||||
|   <font italic="1" face="Arial Narrow" size="8" /> | ||||
|   <field x="1" type="Array" bg_color="#C0C0C0" width="22"> | ||||
|    <source>LEVEL</source> | ||||
|    <list> | ||||
|     <li Value="Commesse terminate nel" Code="0" /> | ||||
|     <li Value="Commesse terminate nel" Code="1" /> | ||||
|     <li Value="Commesse in corso entro fine" Code="2" /> | ||||
|     <li Value="Commesse in corso entro fine" Code="3" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="23" type="Numero" align="right" bg_color="#C0C0C0" width="6"> | ||||
|    <source>ANNO</source> | ||||
|   </field> | ||||
|   <field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1"> | ||||
|    <source>LEVEL</source> | ||||
|    <postscript description="H2.101 POSTSCRIPT">MESSAGE COPY,F2.101</postscript> | ||||
|   </field> | ||||
|   <field x="29" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1"> | ||||
|    <source>ANNO</source> | ||||
|    <postscript description="H2.102 POSTSCRIPT">MESSAGE COPY,F2.102</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Head" level="3" hidden="1" height="1.5"> | ||||
|   <groupby>LEVEL</groupby> | ||||
|   <font italic="1" face="Arial Narrow" size="8" /> | ||||
|   <field x="3" type="Array" bg_color="#C0C0C0" width="40" pattern="1"> | ||||
|    <source>LEVEL</source> | ||||
|    <list> | ||||
|     <li Value="Commesse avviate in esercizi precedenti" Code="0" /> | ||||
|     <li Value="Commesse avviate nell'esercizio selezionato" Code="1" /> | ||||
|     <li Value="Commesse avviate in esercizi precedenti" Code="2" /> | ||||
|     <li Value="Commesse avviate nell'esercizio selezionato" Code="3" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field border="1" x="2" y="1.25" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field type="Numero" hidden="1" align="right" width="1" id="101" pattern="1"> | ||||
|    <source>LEVEL</source> | ||||
|    <postscript description="H3.101 POSTSCRIPT">MESSAGE COPY,F3.101</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Head" level="4" hidden="1"> | ||||
|   <condition>STAMPACDC != ""</condition> | ||||
|   <groupby>CODCMS</groupby> | ||||
|   <font italic="1" face="Arial Narrow" size="8" /> | ||||
|   <field type="Stringa" width="1" id="1" pattern="1"> | ||||
|    <source>STAMPACDC</source> | ||||
|   </field> | ||||
|   <field x="2" type="Stringa" bg_color="#C0C0C0" width="20" id="2" pattern="1"> | ||||
|    <source>CODCMS</source> | ||||
|   </field> | ||||
|   <field x="23" type="Numero" align="right" width="2" id="3" pattern="1"> | ||||
|    <source>0</source> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Body" /> | ||||
|  <section type="Body" level="1" hidden="1"> | ||||
|   <prescript description="B1 PRESCRIPT">1 #H4.3  \ incrementa il contatore per il numero di righe di cdc | ||||
| +!</prescript> | ||||
|   <field x="1" type="Stringa" width="20" pattern="1"> | ||||
|    <source>CODCMS</source> | ||||
|   </field> | ||||
|   <field x="21" type="Stringa" width="25" pattern="1"> | ||||
|    <font face="Arial Narrow" size="7" /> | ||||
|    <source>IF(#H4.3=0;DESCRIZ;"")</source> | ||||
|   </field> | ||||
|   <field x="47" type="Stringa" width="9" pattern="1"> | ||||
|    <source>CDC</source> | ||||
|   </field> | ||||
|   <field x="56" type="Numero" align="right" width="3" pattern="1"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <source>ROUND(AVANZAMENTO;0)</source> | ||||
|   </field> | ||||
|   <field x="91" type="Testo" align="center" width="2" pattern="1" text="%" /> | ||||
|   <field x="59" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="B1.69 POSTSCRIPT">MESSAGE ADD,F4.69 | ||||
| MESSAGE ADD,F3.69</postscript> | ||||
|   </field> | ||||
|   <field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <source>#RICAVI-#COSTI</source> | ||||
|    <postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F4.169 | ||||
| MESSAGE ADD,F3.169</postscript> | ||||
|   </field> | ||||
|   <field x="87" type="Numero" align="right" width="4" id="170" pattern="1"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <prescript description="B1.170 PRESCRIPT">#RICAVI @ | ||||
| EMPTY= IF | ||||
| 0 | ||||
| ELSE | ||||
| 1 | ||||
| #COSTI @ | ||||
| #RICAVI @ | ||||
| F; | ||||
| - | ||||
| 100 | ||||
| * | ||||
| 0 | ||||
| ROUND | ||||
| THEN | ||||
| #THIS !</prescript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Foot" /> | ||||
|  <section type="Foot" level="1" height="3"> | ||||
|   <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|   <field border="2" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="1" y="1" type="Testo" valign="center" fg_color="#FFFFFF" bg_color="#000000" width="20" height="1.5" text="TOTALI GENERALI " /> | ||||
|   <field x="21" y="1" type="Stringa" valign="center" fg_color="#FFFFFF" bg_color="#400040" width="15" height="1.5" id="1"> | ||||
|    <font italic="1" face="Arial" bold="1" size="8" /> | ||||
|   </field> | ||||
|   <field x="59" y="1.25" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="73" y="1.25" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F1.169 POSTSCRIPT">MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Foot" level="2" height="3.5"> | ||||
|   <font italic="1" face="Courier New" size="8" /> | ||||
|   <field border="1" x="1" y="0.5" type="Linea" width="169" height="0" pattern="1" /> | ||||
|   <field x="1" y="1" type="Array" bg_color="#C0C0C0" width="28"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <source>H2.101</source> | ||||
|    <list> | ||||
|     <li Value="TOTALI Commesse terminate nel" Code="0" /> | ||||
|     <li Value="TOTALI Commesse terminate nel" Code="1" /> | ||||
|     <li Value="TOTALI Commesse in corso entro fine" Code="2" /> | ||||
|     <li Value="TOTALI Commesse in corso entro fine" Code="3" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="29" y="1" type="Numero" align="right" bg_color="#C0C0C0" width="6"> | ||||
|    <font italic="1" face="Arial Narrow" size="8" /> | ||||
|    <source>H2.102</source> | ||||
|   </field> | ||||
|   <field x="59" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|    <postscript description="F2.69 POSTSCRIPT">MESSAGE ADD,F1.69</postscript> | ||||
|   </field> | ||||
|   <field y="1" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" /> | ||||
|   <field x="35" y="1" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1"> | ||||
|    <postscript description="F2.102 POSTSCRIPT">MESSAGE COPY,F2.101</postscript> | ||||
|   </field> | ||||
|   <field x="73" y="1" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <font italic="1" face="Arial Narrow" bold="1" size="8" /> | ||||
|    <postscript description="F2.169 POSTSCRIPT">MESSAGE ADD,F1.169 | ||||
| MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Foot" level="3" height="2"> | ||||
|   <font italic="1" face="Arial Narrow" size="8" /> | ||||
|   <field x="2" y="0.5" type="Array" bg_color="#C0C0C0" width="40" pattern="1"> | ||||
|    <source>H3.101</source> | ||||
|    <list> | ||||
|     <li Value="Commesse avviate in esercizi precedenti" Code="0" /> | ||||
|     <li Value="Commesse avviate nell'esercizio selezionato" Code="1" /> | ||||
|     <li Value="Commesse avviate in esercizi precedenti" Code="2" /> | ||||
|     <li Value="Commesse avviate nell'esercizio selezionato" Code="3" /> | ||||
|    </list> | ||||
|   </field> | ||||
|   <field x="59" y="0.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F3.69 POSTSCRIPT">MESSAGE ADD,F2.69</postscript> | ||||
|   </field> | ||||
|   <field y="0.5" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" /> | ||||
|   <field x="73" y="0.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F3.169 POSTSCRIPT">MESSAGE ADD,F2.169 | ||||
| MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <section type="Foot" level="4" height="1.25"> | ||||
|   <condition>(STAMPACDC != "")(#H4.3 E; 0)(TIPOSTIMA!='T')(CDCSPEC=="")</condition> | ||||
|   <font italic="1" face="Arial Narrow" size="8" /> | ||||
|   <field x="22" type="Testo" width="20" pattern="1" text="Totali commessa" /> | ||||
|   <field x="2" type="Stringa" bg_color="#C0C0C0" width="20" id="2" pattern="1"> | ||||
|    <source>H4.2</source> | ||||
|   </field> | ||||
|   <field x="59" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" /> | ||||
|   <field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@"> | ||||
|    <postscript description="F4.169 POSTSCRIPT">MESSAGE RESET,169</postscript> | ||||
|   </field> | ||||
|  </section> | ||||
|  <sql>USE SALDANA</sql> | ||||
| </report> | ||||
							
								
								
									
										147
									
								
								ca/ca3883.cpp
									
									
									
									
									
								
							
							
						
						
									
										147
									
								
								ca/ca3883.cpp
									
									
									
									
									
								
							| @ -354,6 +354,11 @@ static int righe_compare(const TObject** o1, const TObject** o2) | ||||
|       const TString& f1 = *(TString*)a1.objptr("FASE"); | ||||
|       const TString& f2 = *(TString*)a2.objptr("FASE"); | ||||
|       cmp = f1.compare(f2); | ||||
|       if (cmp == 0) | ||||
|       { | ||||
|         const TString& d1 = *(TString*)a1.objptr("CDC"); | ||||
|         const TString& d2 = *(TString*)a2.objptr("CDC"); | ||||
|         cmp = d1.compare(d2); | ||||
|       } | ||||
|       else | ||||
|       { | ||||
| @ -363,6 +368,7 @@ static int righe_compare(const TObject** o1, const TObject** o2) | ||||
|           cmp = z1 - z2; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   return cmp; | ||||
| } | ||||
| @ -395,7 +401,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRecordset& saldana, const int | ||||
| 																					 TImporto& saldo, TImporto& saldop) const | ||||
| { | ||||
| 	int flag = 0; | ||||
|   //stampa bilancio di commessa (_tipo=8)
 | ||||
|   //stampa bilancio di commessa ca3800 (_tipo=8)
 | ||||
|   if (_tipo == 8) | ||||
|   { | ||||
|     if (_tipostima == 'R')  //stampa adolfica nuova con ricavi consuntivi (spezzabili per fase)
 | ||||
| @ -444,7 +450,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRecordset& saldana, const int | ||||
| 		    saldop.reset(); | ||||
|     } | ||||
|   } | ||||
|   // stampa stima ricavi (_tipo=9)
 | ||||
|   // stampa stima ricavi ca3900 (_tipo=9)
 | ||||
|   else | ||||
|   { | ||||
|     const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],  | ||||
| @ -471,7 +477,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRecordset& saldana, const int | ||||
| 
 | ||||
| TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* chiave, | ||||
| 																										 const int indice, const TString& codcms, const TString& fase, | ||||
| 																										 const TString& descrizione) | ||||
| 																										 const TString& cdc, const TString& descrizione) | ||||
| { | ||||
| 	//cerca se la commessa (e l'eventuale fase) esistono gia' nell'assocarray delle commesse
 | ||||
| 	TAssoc_array* riga_array = (TAssoc_array*)cms.objptr(chiave); | ||||
| @ -486,20 +492,23 @@ TAssoc_array& TPrint_saldana_recordset::get_row(TAssoc_array& cms, const char* c | ||||
| 		riga_array->add("LEVEL", str_indice); | ||||
| 		riga_array->add("CODCMS", codcms); | ||||
|     if (_tipo == 8) | ||||
|     { | ||||
| 		  riga_array->add("FASE", fase); | ||||
|       riga_array->add("CDC", cdc); | ||||
|     } | ||||
| 
 | ||||
| 		riga_array->add("DESCRIZ", descrizione); | ||||
|     //inizializza i campi importo sicuramente presenti (modifica DECISIVA)
 | ||||
|     //senza questa inizializzazione, nel caso trovasse campi nulli (in realta' 0), il bastardo..
 | ||||
|     //..anziche' considerarli 0 ci mette l'ultimo valore != che ha in memoria nella stessa posizione..
 | ||||
|     //..facendo sballare tutti i conti!
 | ||||
|     //bilancio commessa (_tipo=8)
 | ||||
|     //bilancio commessa ca3800 (_tipo=8)
 | ||||
|     if (_tipo == 8) | ||||
|     { | ||||
|       riga_array->add("RICAVI", EMPTY_STRING); | ||||
|       riga_array->add("COSTI", EMPTY_STRING); | ||||
|     } | ||||
|     //stima ricavi (_tipo=9)
 | ||||
|     //stima ricavi ca3900 (_tipo=9)
 | ||||
|     else | ||||
|     { | ||||
|       riga_array->add("COS_BDG", EMPTY_STRING); | ||||
| @ -554,6 +563,9 @@ real TPrint_saldana_recordset::calcola_avanzamento_tempo() const | ||||
| 	const TDate& datafinesc = _esc[_anno].fine(); | ||||
|   TDate dataini, datafine; | ||||
|   const TString& codfase = get("FASE").as_string(); | ||||
|   const TString& codcdc = get("CDC").as_string(); | ||||
| 
 | ||||
|   //fasi e cdc non specificati
 | ||||
|   if (codfase.empty()) | ||||
|   { | ||||
| 	  const TString& codcms = get("CODCMS").as_string(); | ||||
| @ -566,7 +578,7 @@ real TPrint_saldana_recordset::calcola_avanzamento_tempo() const | ||||
|     else | ||||
| 	    datafine = rec_commesse.get(COMMESSE_DATAFINE); | ||||
|   } | ||||
|   else | ||||
|   else  //specificata la fase
 | ||||
|   { | ||||
| 	  const TRectype& rec_fasi = cache().get(LF_FASI, codfase); | ||||
| 
 | ||||
| @ -613,7 +625,7 @@ void TPrint_saldana_recordset::incrementa_importo(TAssoc_array& riga_array, | ||||
| 	*str_imp = imp.valore().string(); | ||||
| } | ||||
| 
 | ||||
| //metodo usato solo per la stima ricavi (_tipo=9, ca3900)
 | ||||
| //metodo usato solo per la stima ricavi ca3900 (_tipo=9)
 | ||||
| void TPrint_saldana_recordset::aggiorna_importi(TAssoc_array& riga_array,  | ||||
| 		         const int indbil, const TRecordset& saldana, const bool inverti) const | ||||
| { | ||||
| @ -673,6 +685,7 @@ void TPrint_saldana_recordset::create_lines_to_print(TString& query) | ||||
| 			{ | ||||
| 				const TString& codcms = saldana.get(SALDANA_COMMESSA).as_string(); | ||||
| 				const TString& fase = saldana.get(SALDANA_FASE).as_string(); | ||||
|         const TString& cdc = saldana.get(SALDANA_COSTO).as_string(); | ||||
| 
 | ||||
| 				const TRectype& rec_commesse = cache().get(LF_COMMESSE, codcms); | ||||
| 
 | ||||
| @ -693,8 +706,25 @@ void TPrint_saldana_recordset::create_lines_to_print(TString& query) | ||||
| 
 | ||||
| 					TString80 chiave = codcms; | ||||
|           //selezione fasi solo su bilancio commessa (_tipo=8)
 | ||||
|           if (_tipo == 8 && _use_fasi) | ||||
|           if (_tipo == 8 && (_tipostampa >= 1 && _tipostampa <= 3)) | ||||
|           { | ||||
|             //se vuole entrambi i livelli di dettaglio occorre sapere chi e' il babbo delle fasi o dei cdc
 | ||||
|             if (_tipostampa == 3) | ||||
|             { | ||||
|               //le fasi sono figlie dei cdc?
 | ||||
|               if (ca_multilevel_code_info(LF_FASI).parent() == LF_CDC) | ||||
|                 chiave << '|' << cdc << '|' << fase; | ||||
|               else  //in ogni altro caso (figlie delle commesse o di nessuno...)
 | ||||
| 						    chiave << '|' << fase << '|' << cdc; | ||||
|             } | ||||
|             else  //livelli di dettaglio semplici
 | ||||
|             { | ||||
|               if (_tipostampa == 1) | ||||
| 						    chiave << '|' << fase; | ||||
|               else | ||||
|                 chiave << '|' << cdc; | ||||
|             } | ||||
|           } | ||||
| 
 | ||||
| 					//riempie le righe degli array da mandare poi in stampa
 | ||||
| 					//dapprima le righe normali..
 | ||||
| @ -703,19 +733,19 @@ void TPrint_saldana_recordset::create_lines_to_print(TString& query) | ||||
|           const char* gruppo = indbil == 3 ? "COSTI" : "RICAVI"; | ||||
|           TString80 conto; | ||||
| 					parse_bill(conto_anale, conto); | ||||
|           //bilancio di commessa (_tipo=8)
 | ||||
|           //bilancio di commessa ca3800 (_tipo=8)
 | ||||
|           if (_tipo == 8) | ||||
|           { | ||||
|             TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase,  | ||||
|             TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase, cdc, | ||||
| 																						   rec_commesse.get(COMMESSE_DESCRIZ)); | ||||
| 					  //aggiunge gli importi e normalizza
 | ||||
| 					  aggiorna_importo(riga_array, gruppo, indbil, saldana); | ||||
| 					  aggiorna_importo(riga_array, conto, indbil, saldana); | ||||
|           } | ||||
|           //stima ricavi (_tipo=9)
 | ||||
|           //stima ricavi ca3900 (_tipo=9)
 | ||||
|           else | ||||
|           { | ||||
|             TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, EMPTY_STRING,  | ||||
|             TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, EMPTY_STRING, EMPTY_STRING,  | ||||
| 																						   rec_commesse.get(COMMESSE_DESCRIZ)); | ||||
|             //aggiunge gli importi e normalizza
 | ||||
| 					  aggiorna_importi(riga_array, indbil, saldana); | ||||
| @ -734,7 +764,7 @@ void TPrint_saldana_recordset::create_lines_to_print(TString& query) | ||||
| 							TString cazzo_descr = "DETRAZIONE PER COMPETENZA "; | ||||
| 							cazzo_descr << (_anno - 1); | ||||
|               TAssoc_array& riga_array = get_row(cms[indice], CMS_DEL_CAZZO, indice, cazzo_cod,  | ||||
| 																								  EMPTY_STRING, cazzo_descr); | ||||
| 																								  EMPTY_STRING, EMPTY_STRING, cazzo_descr); | ||||
|               if (_tipo == 8) | ||||
|               { | ||||
| 							  aggiorna_importo(riga_array, gruppo, indbil, saldana, true); | ||||
| @ -777,11 +807,36 @@ void TPrint_saldana_recordset::requery() | ||||
| 	TString query; | ||||
| 	query = "USE SALDANA";  //vale sia per la 8 che per la 9
 | ||||
| 
 | ||||
|   //se ca3800...
 | ||||
|   if (_tipo == 8) | ||||
|   { | ||||
|     //stampa per una singola fase in modo dettagliato
 | ||||
|     if (_use_fasi && _fase.full()) | ||||
|     switch (_tipostampa) | ||||
|     { | ||||
|     case 1: | ||||
|       if (_fase.full()) | ||||
|         query << " SELECT FASE=\"" << _fase << "\""; | ||||
|       break; | ||||
|     case 2: | ||||
|       if (_cdc.full()) | ||||
|         query << " SELECT COSTO=\"" << _cdc << "\""; | ||||
|       break; | ||||
|     case 3: | ||||
|       if (_fase.full() || _cdc.full()) | ||||
|       { | ||||
|         if (_fase.full() && _cdc.full()) | ||||
|           query << " SELECT (FASE=\"" << _fase << "\")&&(COSTO=\"" << _cdc << "\")"; | ||||
|         else | ||||
|         { | ||||
|           if (_fase.full()) | ||||
|             query << " SELECT FASE=\"" << _fase << "\""; | ||||
|           else | ||||
|             query << " SELECT COSTO=\"" << _cdc << "\""; | ||||
|         } | ||||
|       } | ||||
|          | ||||
|       break; | ||||
|     } | ||||
| 
 | ||||
|     //stampa standard non a vita intera per la 3800
 | ||||
|     if (!_vitaintera) | ||||
| 	    query << "\nTO ANNO=" << _anno; | ||||
| @ -840,12 +895,28 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const | ||||
| 		else | ||||
|     if (strcmp(column_name, "STAMPAFASI") == 0) | ||||
| 		{ | ||||
|       var.set(_use_fasi  == true ? "X" : ""); | ||||
|       var.set((_tipostampa == 1 || _tipostampa == 3) ? "X" : ""); | ||||
| 		} | ||||
| 		else | ||||
| 		if (strcmp(column_name, "FASESPEC") == 0) | ||||
| 		{ | ||||
|       if (_tipostampa == 1 || _tipostampa == 3 || _tipostampa == 4) | ||||
| 			  var.set(_fase); | ||||
|       else | ||||
|         var.set(EMPTY_STRING); | ||||
| 		} | ||||
|     else | ||||
|     if (strcmp(column_name, "STAMPACDC") == 0) | ||||
| 		{ | ||||
|       var.set((_tipostampa  == 2 || _tipostampa == 3) ? "X" : ""); | ||||
| 		} | ||||
|     else | ||||
|     if (strcmp(column_name, "CDCSPEC") == 0) | ||||
| 		{ | ||||
|       if (_tipostampa == 2 || _tipostampa == 3 || _tipostampa == 8) | ||||
| 			  var.set(_cdc); | ||||
|       else | ||||
|         var.set(EMPTY_STRING); | ||||
| 		} | ||||
| 		else | ||||
| 		if (strcmp(column_name, "AVANZAMENTO") == 0) | ||||
| @ -876,8 +947,9 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const | ||||
|   return NULL_VARIANT; | ||||
| } | ||||
| 
 | ||||
| void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_fase) | ||||
| void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_sublevel) | ||||
| { | ||||
|   _fase = _cdc = ""; | ||||
| 	//tira su un po' di parametri dalla maschera...
 | ||||
| 	_anno = msk.get_int(F_ESERCIZIO); | ||||
| 	//prende anche il prefix
 | ||||
| @ -885,30 +957,39 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_ | ||||
| 	for (short id = F_PRE1; id <= F_PRE3 && msk.id2pos(id) > 0; id++) | ||||
| 		prefix << msk.get(id); | ||||
| 	_indicatori.set_prefix(prefix); | ||||
| 
 | ||||
|   //solo per ca3800
 | ||||
|   if (_tipo == 8) | ||||
|   { | ||||
|     _tipostima = msk.get(F_TIPOSTIMA)[0]; | ||||
| 	  _vitaintera = msk.get_bool(F_VITAINTERA); | ||||
|     _depth = msk.get_int(F_DEPTH); | ||||
| 
 | ||||
|     //trattazione delle fasi
 | ||||
|     _use_fasi = msk.get_bool(F_FASI); | ||||
|     _fase.cut(0); | ||||
|     _tipostampa = msk.get_int(F_TIPOSTAMPA); | ||||
| 
 | ||||
|     if (_use_fasi) | ||||
|     //in base al tipo di stampa selezionata setta un po' di parametri
 | ||||
|     switch (_tipostampa) | ||||
|     { | ||||
|       /* ***gestione fasi multilivello
 | ||||
|       for (short id = F_FASE1; msk.id2pos(id) > 0; id++) | ||||
|         _fase << msk.get(id);*/ | ||||
| 
 | ||||
|       //usa le fasi e ne seleziona una per la stampa completa
 | ||||
|       if (curr_fase.empty()) | ||||
|     case 1: | ||||
|       _fase = msk.get(F_FASE); | ||||
| 
 | ||||
|       //usa le fasi ma le stampa tutte, una alla volta, con stampa riassuntiva
 | ||||
|       _fasi_group = msk.get_bool(F_FASI_GROUP); | ||||
|       if (_fase.empty() && _fasi_group && !curr_fase.empty()) | ||||
|         _fase = curr_fase; | ||||
|     }   | ||||
|       _cdc.cut(0); | ||||
|       break; | ||||
|     case 2: | ||||
|       _cdc = msk.get(F_CDC); | ||||
|       _fase.cut(0); | ||||
|       break; | ||||
|     case 3: | ||||
|       _fase = msk.get(F_FASE); | ||||
|       _cdc = msk.get(F_CDC); | ||||
|       break; | ||||
|     case 4: | ||||
|       _fase = curr_sublevel; | ||||
|       break; | ||||
|     case 8: | ||||
|       _cdc = curr_sublevel; | ||||
|       break; | ||||
|     default: | ||||
|       break; | ||||
|     } | ||||
|   } //if(tipo==8..
 | ||||
| } | ||||
|  | ||||
| @ -63,9 +63,11 @@ class TPrint_saldana_recordset : public TRecordset | ||||
|   int _tipo; | ||||
| 	int _anno; | ||||
| 	int _depth; | ||||
| 	bool _vitaintera, _use_fasi, _fasi_group; | ||||
|   int _tipostampa; | ||||
| 	bool _vitaintera; | ||||
| 	char _tipostima; | ||||
|   TString16 _fase; | ||||
|   TString80 _cdc; | ||||
| 
 | ||||
| protected: | ||||
|   virtual int tipo() const { return _tipo; } | ||||
| @ -95,10 +97,10 @@ protected: | ||||
| 
 | ||||
|   TAssoc_array& get_row(TAssoc_array& cms, const char* chiave, | ||||
| 												const int indice, const TString& codcms, const TString& fase, | ||||
| 												const TString& descrizione); | ||||
| 												const TString& cdc, const TString& descrizione); | ||||
| 
 | ||||
| public: | ||||
|   virtual void set_filter(const TMask& msk, const TString& curr_fase); | ||||
|   virtual void set_filter(const TMask& msk, const TString& curr_sublevel); | ||||
|   TPrint_saldana_recordset(int tipo) : _tipo(tipo) { } | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -10,10 +10,11 @@ | ||||
| #define F_FINE_ES				107 | ||||
| #define F_TIPOSTIMA			108 | ||||
| #define F_VITAINTERA		109 | ||||
| #define F_FASI					110 | ||||
| #define F_DEPTH					111 | ||||
| #define F_FASE          112 | ||||
| #define F_FASI_GROUP    113 | ||||
| #define F_FASE          110 | ||||
| #define F_CDC           111 | ||||
| #define F_DEPTH					112 | ||||
| #define F_TIPOSTAMPA    113 | ||||
| 
 | ||||
| /* campi per la generazione automatica
 | ||||
| #define F_FASE1         112 | ||||
| #define F_FASE2         113 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user