Completed
Push — master ( f3c8ce...dcb10a )
by Daniel
02:27
created
Salariu/Salariu.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -146,6 +146,9 @@  discard block
 block discarded – undo
146 146
         ];
147 147
     }
148 148
 
149
+    /**
150
+     * @param double $lngBase
151
+     */
149 152
     private function getValues($lngBase)
150 153
     {
151 154
         $aReturn['cas']      = $this->setHealthFundTax($_REQUEST['ym'], $lngBase);
@@ -406,6 +409,9 @@  discard block
 block discarded – undo
406 409
                         ]), 'fieldset', ['style' => 'float: left;']);
407 410
     }
408 411
 
412
+    /**
413
+     * @param string $text
414
+     */
409 415
     private function setFormRow($text, $value, $type = 'amount')
410 416
     {
411 417
         $a                = '';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     private function getExchangeRates()
62 62
     {
63
-        $this->appFlags['currency_exchanges']          = [
63
+        $this->appFlags['currency_exchanges'] = [
64 64
             'RON' => [
65 65
                 'decimals' => 2,
66 66
                 'locale'   => 'ro_RO',
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
         if ($_REQUEST['ym'] < mktime(0, 0, 0, 1, 1, 2008)) {
156 156
             $unemploymentBase = $_REQUEST['sn'];
157 157
         }
158
-        $aReturn           = [
158
+        $aReturn = [
159 159
             'ba'       => $this->setFoodTicketsValue($_REQUEST['ym'], $aryStngs['Meal Ticket Value']) * $nMealDays,
160 160
             'cas'      => $this->setHealthFundTax($_REQUEST['ym'], $lngBase),
161 161
             'sanatate' => $this->setHealthTax($_REQUEST['ym'], $lngBase),
162 162
             'somaj'    => $this->setUnemploymentTax($_REQUEST['ym'], $unemploymentBase),
163 163
         ];
164
-        $pdVal             = [
164
+        $pdVal = [
165 165
             $_REQUEST['ym'],
166 166
             ($lngBase + $aReturn['ba']),
167 167
             $_REQUEST['pi'],
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
             $aReturn['somaj'],
175 175
             $aReturn['pd'],
176 176
         ];
177
-        $rest              = $lngBase - array_sum($restArrayToDeduct);
177
+        $rest = $lngBase - array_sum($restArrayToDeduct);
178 178
         if ($_REQUEST['ym'] >= mktime(0, 0, 0, 7, 1, 2010)) {
179 179
             $rest += round($aReturn['ba'], -4);
180 180
         }
181 181
         if ($_REQUEST['ym'] >= mktime(0, 0, 0, 10, 1, 2010)) {
182 182
             $aReturn['gbns'] = $_REQUEST['gbns'] * pow(10, 4);
183
-            $rest            += round($aReturn['gbns'], -4);
183
+            $rest += round($aReturn['gbns'], -4);
184 184
         }
185 185
         $rest               += $_REQUEST['afet'] * pow(10, 4);
186 186
         $aReturn['impozit'] = $this->setIncomeTax($_REQUEST['ym'], $rest);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                     'value' => $_REQUEST['pn'],
251 251
                     'size'  => 10
252 252
                 ]) . ' RON', 1);
253
-        $pieces    = [
253
+        $pieces = [
254 254
             $this->tApp->gettext('i18n_Form_Label_OvertimeHours'),
255 255
             $this->tApp->gettext('i18n_Form_Label_OvertimeChoice1'),
256 256
         ];
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                     'value' => $_REQUEST['os175'],
262 262
                     'size'  => 2
263 263
                 ]), 1);
264
-        $pieces    = [
264
+        $pieces = [
265 265
             $this->tApp->gettext('i18n_Form_Label_OvertimeHours'),
266 266
             $this->tApp->gettext('i18n_Form_Label_OvertimeChoice2'),
267 267
         ];
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                     'id'    => 'submit',
334 334
                     'value' => $submitBtnTxt
335 335
                 ]), 1);
336
-        $frm       = $this->setStringIntoTag($this->setStringIntoTag(implode('', $sReturn), 'table'), 'form', [
336
+        $frm = $this->setStringIntoTag($this->setStringIntoTag(implode('', $sReturn), 'table'), 'form', [
337 337
             'method' => 'get',
338 338
             'action' => $_SERVER['SCRIPT_NAME']
339 339
         ]);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $sReturn[] = $this->setFormRow(sprintf($ovTime['main'], $ovTime[1], '175%'), ($overtime['os175'] * pow(10, 4)));
381 381
         $sReturn[] = $this->setFormRow(sprintf($ovTime['main'], $ovTime[2], '200%'), ($overtime['os200'] * pow(10, 4)));
382 382
         $sReturn[] = $this->setFormRow($this->tApp->gettext('i18n_Form_Label_BruttoSalary'), $brut);
383
-        $brut      += $_REQUEST['afet'] * pow(10, 4);
383
+        $brut += $_REQUEST['afet'] * pow(10, 4);
384 384
         $amount    = $this->getValues($brut);
385 385
         $sReturn[] = $this->setFormRow($this->tApp->gettext('i18n_Form_Label_PensionFund'), $amount['cas']);
386 386
         $sReturn[] = $this->setFormRow($this->tApp->gettext('i18n_Form_Label_UnemploymentTax'), $amount['somaj']);
Please login to merge, or discard this patch.
Salariu/Taxation.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             2015 => min($lngBrutto, 5 * 24150000),
112 112
             2016 => min($lngBrutto, 5 * 26810000),
113 113
         ];
114
-        $base      = $lngBrutto;
114
+        $base = $lngBrutto;
115 115
         if ($givenYear == 2005) {
116 116
             $base = min($lngBrutto, 5 * 9210000);
117 117
             if (date('n', $lngDate) <= 6) {
@@ -192,37 +192,37 @@  discard block
 block discarded – undo
192 192
     {
193 193
         $mnth = date('n', $lngDate);
194 194
         if ($mnth <= 6) {
195
-            $nReturn = 1822070 + ($lngTaxBase - 6867000 ) * 40 / 100;
195
+            $nReturn = 1822070 + ($lngTaxBase - 6867000) * 40 / 100;
196 196
             if ($lngTaxBase <= 1259000) {
197 197
                 $nReturn = $lngTaxBase * 18 / 100;
198 198
             } elseif ($lngTaxBase <= 3090000) {
199
-                $nReturn = 226620 + ($lngTaxBase - 1259000 ) * 23 / 100;
199
+                $nReturn = 226620 + ($lngTaxBase - 1259000) * 23 / 100;
200 200
             } elseif ($lngTaxBase <= 4921000) {
201
-                $nReturn = 647750 + ($lngTaxBase - 3090000 ) * 28 / 100;
201
+                $nReturn = 647750 + ($lngTaxBase - 3090000) * 28 / 100;
202 202
             } elseif ($lngTaxBase <= 6867000) {
203
-                $nReturn = 1160430 + ($lngTaxBase - 4921000 ) * 34 / 100;
203
+                $nReturn = 1160430 + ($lngTaxBase - 4921000) * 34 / 100;
204 204
             }
205 205
         } elseif ($mnth <= 9) {
206
-            $nReturn = 2109940 + ($lngTaxBase - 7952000 ) * 40 / 100;
206
+            $nReturn = 2109940 + ($lngTaxBase - 7952000) * 40 / 100;
207 207
             if ($lngTaxBase <= 1458000) {
208 208
                 $nReturn = $lngTaxBase * 18 / 100;
209 209
             } elseif ($lngTaxBase <= 3578000) {
210
-                $nReturn = 262440 + ($lngTaxBase - 1458000 ) * 23 / 100;
210
+                $nReturn = 262440 + ($lngTaxBase - 1458000) * 23 / 100;
211 211
             } elseif ($lngTaxBase <= 5699000) {
212
-                $nReturn = 750040 + ($lngTaxBase - 3578000 ) * 28 / 100;
212
+                $nReturn = 750040 + ($lngTaxBase - 3578000) * 28 / 100;
213 213
             } elseif ($lngTaxBase <= 7952000) {
214
-                $nReturn = 1343920 + ($lngTaxBase - 5699000 ) * 34 / 100;
214
+                $nReturn = 1343920 + ($lngTaxBase - 5699000) * 34 / 100;
215 215
             }
216 216
         } elseif ($mnth > 9) {
217
-            $nReturn = 2231000 + ($lngTaxBase - 8400000 ) * 40 / 100;
217
+            $nReturn = 2231000 + ($lngTaxBase - 8400000) * 40 / 100;
218 218
             if ($lngTaxBase <= 1500000) {
219 219
                 $nReturn = $lngTaxBase * 18 / 100;
220 220
             } elseif ($lngTaxBase <= 3800000) {
221
-                $nReturn = 270000 + ($lngTaxBase - 1500000 ) * 23 / 100;
221
+                $nReturn = 270000 + ($lngTaxBase - 1500000) * 23 / 100;
222 222
             } elseif ($lngTaxBase <= 6000000) {
223
-                $nReturn = 799000 + ($lngTaxBase - 3800000 ) * 28 / 100;
223
+                $nReturn = 799000 + ($lngTaxBase - 3800000) * 28 / 100;
224 224
             } elseif ($lngTaxBase <= 8400000) {
225
-                $nReturn = 1415000 + ($lngTaxBase - 6000000 ) * 34 / 100;
225
+                $nReturn = 1415000 + ($lngTaxBase - 6000000) * 34 / 100;
226 226
             }
227 227
         }
228 228
         return $nReturn;
@@ -230,45 +230,45 @@  discard block
 block discarded – undo
230 230
 
231 231
     private function setIncomeTax2002($lngTaxBase)
232 232
     {
233
-        $nReturn = 2710000 + ($lngTaxBase - 10200000 ) * 40 / 100;
233
+        $nReturn = 2710000 + ($lngTaxBase - 10200000) * 40 / 100;
234 234
         if ($lngTaxBase <= 1800000) {
235 235
             $nReturn = $lngTaxBase * 18 / 100;
236 236
         } elseif ($lngTaxBase <= 4600000) {
237
-            $nReturn = 324000 + ($lngTaxBase - 1800000 ) * 23 / 100;
237
+            $nReturn = 324000 + ($lngTaxBase - 1800000) * 23 / 100;
238 238
         } elseif ($lngTaxBase <= 7300000) {
239
-            $nReturn = 968000 + ($lngTaxBase - 4600000 ) * 28 / 100;
239
+            $nReturn = 968000 + ($lngTaxBase - 4600000) * 28 / 100;
240 240
         } elseif ($lngTaxBase <= 10200000) {
241
-            $nReturn = 1724000 + ($lngTaxBase - 7300000 ) * 34 / 100;
241
+            $nReturn = 1724000 + ($lngTaxBase - 7300000) * 34 / 100;
242 242
         }
243 243
         return $nReturn;
244 244
     }
245 245
 
246 246
     private function setIncomeTax2003($lngTaxBase)
247 247
     {
248
-        $nReturn = 3081000 + ($lngTaxBase - 11600000 ) * 40 / 100;
248
+        $nReturn = 3081000 + ($lngTaxBase - 11600000) * 40 / 100;
249 249
         if ($lngTaxBase <= 2100000) {
250 250
             $nReturn = ($lngTaxBase * 18) / 100;
251 251
         } elseif ($lngTaxBase <= 5200000) {
252
-            $nReturn = 324000 + ($lngTaxBase - 2100000 ) * 23 / 100;
252
+            $nReturn = 324000 + ($lngTaxBase - 2100000) * 23 / 100;
253 253
         } elseif ($lngTaxBase <= 8300000) {
254
-            $nReturn = 1091000 + ($lngTaxBase - 5200000 ) * 28 / 100;
254
+            $nReturn = 1091000 + ($lngTaxBase - 5200000) * 28 / 100;
255 255
         } elseif ($lngTaxBase <= 11600000) {
256
-            $nReturn = 1959000 + ($lngTaxBase - 8300000 ) * 34 / 100;
256
+            $nReturn = 1959000 + ($lngTaxBase - 8300000) * 34 / 100;
257 257
         }
258 258
         return $nReturn;
259 259
     }
260 260
 
261 261
     private function setIncomeTax2004($lngTaxBase)
262 262
     {
263
-        $nReturn = 3452000 + ($lngTaxBase - 13000000 ) * 40 / 100;
263
+        $nReturn = 3452000 + ($lngTaxBase - 13000000) * 40 / 100;
264 264
         if ($lngTaxBase <= 2400000) {
265 265
             $nReturn = ($lngTaxBase * 18) / 100;
266 266
         } elseif ($lngTaxBase <= 5800000) {
267
-            $nReturn = 432000 + ($lngTaxBase - 2400000 ) * 23 / 100;
267
+            $nReturn = 432000 + ($lngTaxBase - 2400000) * 23 / 100;
268 268
         } elseif ($lngTaxBase <= 9300000) {
269
-            $nReturn = 1214000 + ($lngTaxBase - 5800000 ) * 28 / 100;
269
+            $nReturn = 1214000 + ($lngTaxBase - 5800000) * 28 / 100;
270 270
         } elseif ($lngTaxBase <= 13000000) {
271
-            $nReturn = 2194000 + ($lngTaxBase - 9300000 ) * 34 / 100;
271
+            $nReturn = 2194000 + ($lngTaxBase - 9300000) * 34 / 100;
272 272
         }
273 273
         return $nReturn;
274 274
     }
Please login to merge, or discard this patch.
Salariu/Bonuses.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
                 2003 => 1800000,
104 104
                 2004 => 2000000,
105 105
             ];
106
-            $nReturn      = $valuesYearly[$yrDate];
106
+            $nReturn = $valuesYearly[$yrDate];
107 107
         } elseif ($yr == 2001) {
108 108
             $nReturn = $this->setPersonalDeductionSimple2001($lngDate);
109 109
         }
Please login to merge, or discard this patch.