@@ -107,6 +107,14 @@ protected function createViewsBalance(string $viewName = 'ListReportBalance'): v
107107 ->setSettings ('btnPrint ' , false );
108108
109109 $ this ->addCommonFilters ($ viewName );
110+
111+ $ this ->listView ($ viewName )->addFilterSelect ('type ' , 'type ' , 'type ' , [
112+ ['code ' => '' , 'description ' => '------ ' ],
113+ ['code ' => ReportBalance::TYPE_SHEET , 'description ' => Tools::trans (ReportBalance::TYPE_SHEET )],
114+ ['code ' => ReportBalance::TYPE_PROFIT , 'description ' => Tools::trans (ReportBalance::TYPE_PROFIT )],
115+ ['code ' => ReportBalance::TYPE_INCOME , 'description ' => Tools::trans (ReportBalance::TYPE_INCOME )],
116+ ]);
117+
110118 $ this ->addGenerateButton ($ viewName );
111119 }
112120
@@ -143,19 +151,18 @@ protected function createViewsPreferences(string $viewName = 'ListBalanceCode'):
143151 ->addSearchFields (['codbalance ' , 'nature ' , 'description1 ' , 'description2 ' , 'description3 ' , 'description4 ' ]);
144152
145153 // añadimos filtros
146- $ i18n = Tools::lang ();
147154 $ subTypes = $ this ->codeModel ->all ('balance_codes ' , 'subtype ' , 'subtype ' );
148155 foreach ($ subTypes as $ subtype ) {
149- $ subtype ->description = $ i18n -> trans ($ subtype ->description );
156+ $ subtype ->description = Tools:: trans ($ subtype ->description );
150157 }
151158
152159 $ this ->listView ($ viewName )
153160 ->addFilterSelect ('nature ' , 'nature ' , 'nature ' , [
154161 ['code ' => '' , 'description ' => '------ ' ],
155- ['code ' => 'A ' , 'description ' => $ i18n -> trans ('asset ' )],
156- ['code ' => 'P ' , 'description ' => $ i18n -> trans ('liabilities ' )],
157- ['code ' => 'PG ' , 'description ' => $ i18n -> trans ('profit-and-loss ' )],
158- ['code ' => 'IG ' , 'description ' => $ i18n -> trans ('income-and-expenses ' )]
162+ ['code ' => 'A ' , 'description ' => Tools:: trans ('asset ' )],
163+ ['code ' => 'P ' , 'description ' => Tools:: trans ('liabilities ' )],
164+ ['code ' => 'PG ' , 'description ' => Tools:: trans ('profit-and-loss ' )],
165+ ['code ' => 'IG ' , 'description ' => Tools:: trans ('income-and-expenses ' )]
159166 ])
160167 ->addFilterSelect ('subtype ' , 'sub-type ' , 'subtype ' , $ subTypes );
161168 }
0 commit comments