Completed
Push — master ( 017158...db914b )
by Daniel
04:20
created

Salariu::setFormInput()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 11
Bugs 0 Features 0
Metric Value
c 11
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 1
eloc 19
nc 1
nop 4
1
<?php
2
3
/**
4
 *
5
 * The MIT License (MIT)
6
 *
7
 * Copyright (c) 2016 Daniel Popiniuc
8
 *
9
 * Permission is hereby granted, free of charge, to any person obtaining a copy
10
 * of this software and associated documentation files (the "Software"), to deal
11
 * in the Software without restriction, including without limitation the rights
12
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
 * copies of the Software, and to permit persons to whom the Software is
14
 * furnished to do so, subject to the following conditions:
15
 *
16
 * The above copyright notice and this permission notice shall be included in all
17
 * copies or substantial portions of the Software.
18
 *
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
 * SOFTWARE.
26
 *
27
 */
28
29
namespace danielgp\salariu;
30
31
class Salariu
32
{
33
34
    use \danielgp\bank_holidays\Romanian,
35
        \danielgp\salariu\FormattingSalariu,
36
        \danielgp\salariu\Bonuses,
37
        \danielgp\salariu\ForeignCurrency,
38
        \danielgp\salariu\Taxation;
39
40
    public function __construct()
41
    {
42
        $configPath     = 'Salariu' . DIRECTORY_SEPARATOR . 'config';
43
        $inElmnts       = $this->readTypeFromJsonFileUniversal($configPath, 'interfaceElements');
44
        $this->appFlags = [
45
            'FI'   => $inElmnts['Form Input'],
46
            'TCAS' => $inElmnts['Table Cell Applied Style'],
47
            'TCSD' => $inElmnts['Table Cell Style Definitions'],
48
        ];
49
        $this->initializeSprGlbAndSession();
50
        $this->handleLocalizationSalariu($inElmnts['Application']);
51
        echo $this->setHeaderHtml();
52
        $this->establishLocalizationToDisplay();
53
        $dtR            = $this->dateRangesInScope();
54
        $ymVals         = $this->buildYMvalues($dtR);
55
        $arySts         = $this->readTypeFromJsonFileUniversal($configPath, 'valuesToCompute');
56
        $this->applyYMvalidations($this->tCmnSuperGlobals, $ymVals, $dtR);
57
        $minWage        = $this->determineCrtMinWage(['EMW' => $arySts['Minimum Wage'], 'YM range' => $dtR]);
58
        echo $this->setFormInput($dtR, $ymVals, $inElmnts['Values Filter Rules'], $minWage);
59
        echo $this->setFormOutput($arySts, $inElmnts);
60
        echo $this->setFooterHtml($inElmnts['Application']);
61
    }
62
63
    private function getIncomeTaxValue($inDate, $lngBase, $vBA, $aryDeductions, $arySettings)
64
    {
65
        $rest = $lngBase - array_sum($aryDeductions);
66
        if ($inDate >= 20100701) {
67
            $rest += round($vBA, -4);
68
            if ($inDate >= 20101001) {
69
                $rest += round($this->tCmnSuperGlobals->request->get('gbns') * pow(10, 4), -4);
70
            }
71
        }
72
        $rest += $this->tCmnSuperGlobals->request->get('afet') * pow(10, 4);
73
        return $this->setIncomeTax($inDate, $rest, $arySettings['Income Tax']);
74
    }
75
76
    private function getOvertimes($aryStngs)
77
    {
78
        $pcToBoolean = [0 => true, 1 => false];
79
        $pcBoolean   = $pcToBoolean[$this->tCmnSuperGlobals->request->get('pc')];
80
        $ymVal       = (string) $this->tCmnSuperGlobals->request->get('ym');
81
        $snVal       = $this->tCmnSuperGlobals->request->get('sn');
82
        $mnth        = $this->setMonthlyAverageWorkingHours($ymVal, $aryStngs, $pcBoolean);
0 ignored issues
show
Documentation introduced by
$ymVal is of type string, but the function expects a object<danielgp\salariu\date>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
83
        return [
84
            'os175' => ceil($this->tCmnSuperGlobals->request->get('os175') * 1.75 * $snVal / $mnth),
85
            'os200' => ceil($this->tCmnSuperGlobals->request->get('os200') * 2 * $snVal / $mnth),
86
        ];
87
    }
88
89
    private function getValues($lngBase, $aStngs, $shLabels)
90
    {
91
        $inDate             = $this->tCmnSuperGlobals->request->get('ym');
92
        $aReturn            = $this->getValuesPrimary($inDate, $lngBase, $aStngs, $shLabels);
93
        $pdV                = [
94
            ($lngBase + $aReturn['ba']),
95
            $this->tCmnSuperGlobals->request->get('pi'),
96
        ];
97
        $aReturn['pd']      = $this->setPersonalDeduction($inDate, $pdV[0], $pdV[1], $aStngs['Personal Deduction']);
98
        $aryDeductions      = [
99
            $this->txLvl['cas'],
100
            $this->txLvl['snt'],
101
            $this->txLvl['smj'],
102
            $aReturn['pd'],
103
        ];
104
        $aReturn['impozit'] = $this->getIncomeTaxValue($inDate, $lngBase, $aReturn['ba'], $aryDeductions, $aStngs);
105
        return $aReturn;
106
    }
107
108
    private function getValuesPrimary($inDate, $lngBase, $aStngs, $shLbl)
109
    {
110
        $this->setHealthFundTax($inDate, $lngBase, $aStngs[$shLbl['HFP']], $aStngs[$shLbl['HFUL']]);
111
        $this->setHealthTax($inDate, $lngBase, $aStngs[$shLbl['HTP']], $aStngs[$shLbl['HFUL']]);
112
        $nMealDays        = $this->tCmnSuperGlobals->request->get('nDays');
113
        $unemploymentBase = $lngBase;
114
        if ($this->tCmnSuperGlobals->request->get('ym') < 20080101) {
115
            $unemploymentBase = $this->tCmnSuperGlobals->request->get('sn');
116
        }
117
        $this->setUnemploymentTax($inDate, $unemploymentBase);
118
        return [
119
            'b1'   => $this->setFoodTicketsValue($inDate, $aStngs[$shLbl['MTV']]),
120
            'ba'   => $this->setFoodTicketsValue($inDate, $aStngs[$shLbl['MTV']]) * $nMealDays,
121
            'gbns' => $this->tCmnSuperGlobals->request->get('gbns') * pow(10, 4),
122
        ];
123
    }
124
125
    private function getWorkingDays()
126
    {
127
        $components = [
128
            \DateTime::createFromFormat('Ymd', $this->tCmnSuperGlobals->request->get('ym')),
129
            $this->tCmnSuperGlobals->request->get('pc'),
130
        ];
131
        $this->tCmnSuperGlobals->request->set('wkDays', $this->setWorkingDaysInMonth($components[0], $components[1]));
0 ignored issues
show
Security Bug introduced by
It seems like $components[0] can also be of type false; however, danielgp\bank_holidays\R...setWorkingDaysInMonth() does only seem to accept object<DateTime>, did you maybe forget to handle an error condition?
Loading history...
132
        $vDays      = $this->tCmnSuperGlobals->request->get('wkDays') - $this->tCmnSuperGlobals->request->get('zfb');
133
        $this->tCmnSuperGlobals->request->set('nDays', max($vDays, 0));
134
    }
135
136
    private function setFormInput($dtR, $ymValues, $inVFR, $minWage)
137
    {
138
        $this->processFormInputDefaults($this->tCmnSuperGlobals, [
139
            'VFR'               => $inVFR,
140
            'Year Month Values' => $ymValues,
141
            'MW'                => $minWage,
142
            'YM range'          => $dtR,
143
        ]);
144
        $sReturn     = $this->setFormInputElements($ymValues, $minWage);
145
        $btn         = $this->setStringIntoShortTag('input', [
146
            'type'  => 'submit',
147
            'id'    => 'submit',
148
            'value' => $this->tApp->gettext('i18n_Form_Button_Recalculate')
149
        ]);
150
        $sReturn[]   = $this->setFormRow($this->setLabel('fd'), $btn, 1) . '</tbody>';
151
        $frm         = $this->setStringIntoTag($this->setStringIntoTag(implode('', $sReturn), 'table'), 'form', [
152
            'method' => 'get',
153
            'action' => $this->tCmnSuperGlobals->getScriptName()
154
        ]);
155
        $aryFieldSet = [
156
            $this->setStringIntoTag($this->tApp->gettext('i18n_FieldsetLabel_Inputs'), 'legend'),
157
            $frm
158
        ];
159
        return $this->setStringIntoTag(implode('', $aryFieldSet), 'fieldset', ['style' => 'float: left;']);
160
    }
161
162
    private function setFormInputElements($ymValues, $crtMinWage)
163
    {
164
        $sReturn   = [];
165
        $sReturn[] = '<thead><tr><th>' . $this->tApp->gettext('i18n_Form_Label_InputElements')
166
            . '</th><th>' . $this->tApp->gettext('i18n_Form_Label_InputValues') . '</th></tr></thead><tbody>';
167
        $sReturn[] = $this->setFormRow($this->setLabel('ym'), $this->setFormInputSelectYM($ymValues), 1);
168
        $sReturn[] = $this->setFormRow($this->setLabel('sm'), $this->setFormInputText('sm', 10, 'RON', $crtMinWage), 1);
169
        $sReturn[] = $this->setFormRow($this->setLabel('sn'), $this->setFormInputText('sn', 10, 'RON'), 1);
170
        $sReturn[] = $this->setFormRow($this->setLabel('sc'), $this->setFormInputText('sc', 7, '%'), 1);
171
        $sReturn[] = $this->setFormRow($this->setLabel('pb'), $this->setFormInputText('pb', 10, 'RON'), 1);
172
        $sReturn[] = $this->setFormRow($this->setLabel('pn'), $this->setFormInputText('pn', 10, 'RON'), 1);
173
        $sReturn[] = $this->setFormRow($this->setLabel('os175'), $this->setFormInputText('os175', 2, 'ore'), 1);
174
        $sReturn[] = $this->setFormRow($this->setLabel('os200'), $this->setFormInputText('os200', 2, 'ore'), 1);
175
        $sReturn[] = $this->setFormRow($this->setLabel('pi'), $this->setFormInputSelectPI(), 1);
176
        $sReturn[] = $this->setFormRow($this->setLabel('pc'), $this->setFormInputSelectPC(), 1);
177
        $sReturn[] = $this->setFormRow($this->setLabel('szamnt'), $this->setFormInputText('szamnt', 10, 'RON'), 1);
178
        $sReturn[] = $this->setFormRow($this->setLabel('zfb'), $this->setFormInputText('zfb', 2, 'zile'), 1);
179
        $sReturn[] = $this->setFormRow($this->setLabel('zfs'), $this->setFormInputText('zfs', 2, 'zile'), 1);
180
        $sReturn[] = $this->setFormRow($this->setLabel('gbns'), $this->setFormInputText('gbns', 10, 'RON'), 1);
181
        $sReturn[] = $this->setFormRow($this->setLabel('afet'), $this->setFormInputText('afet', 10, 'RON'), 1);
182
        return $sReturn;
183
    }
184
185
    private function setFormInputText($inName, $inSize, $inAfterLabel, $crtMinWage = 0)
186
    {
187
        $inputParameters = [
188
            'type'      => 'text',
189
            'name'      => $inName,
190
            'value'     => $this->tCmnSuperGlobals->request->get($inName),
191
            'size'      => $inSize,
192
            'maxlength' => $inSize,
193
        ];
194
        if ($inName == 'sm') {
195
            $inputParameters['readonly'] = 'readonly';
196
            $inputParameters['value']    = $crtMinWage;
197
            $this->tCmnSuperGlobals->request->set('sm', $crtMinWage);
198
        }
199
        return $this->setStringIntoShortTag('input', $inputParameters) . ' ' . $inAfterLabel;
200
    }
201
202
    private function setFormOutput($aryStngs, $inElements)
203
    {
204
        $sReturn     = [];
205
        $this->setExchangeRateValues($inElements['Application'], $inElements['Relevant Currencies']);
206
        $sReturn[]   = $this->setFormOutputHeader();
207
        $ovTimeVal   = $this->getOvertimes($aryStngs['Monthly Average Working Hours']);
208
        $additions   = $this->tCmnSuperGlobals->request->get('pb') + $ovTimeVal['os175'] + $ovTimeVal['os200'];
209
        $this->getWorkingDays();
210
        $bComponents = [
211
            'sc'   => $this->tCmnSuperGlobals->request->get('sc'),
212
            'sn'   => $this->tCmnSuperGlobals->request->get('sn'),
213
            'zile' => $this->tCmnSuperGlobals->request->get('wkDays'),
214
        ];
215
        $xDate       = '<span style="font-size:smaller;">' . date('d.m.Y', $this->currencyDetails['CXD']) . '</span>';
216
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('xrate@Date'), $xDate, pow(10, 7));
217
        $snValue     = $this->tCmnSuperGlobals->request->get('sn') * pow(10, 4);
218
        $amntLAA     = round(($this->tCmnSuperGlobals->request->get('zfs') / $bComponents['zile']) * $snValue, -4);
219
        $sReturn[]   = $this->setFormOutputBonuses($snValue, $bComponents['zile'], $amntLAA, $ovTimeVal);
220
        $brut        = ($bComponents['sn'] * (1 + $bComponents['sc'] / 100) + $additions) * pow(10, 4) - $amntLAA;
221
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('sb'), '&nbsp;', $brut);
222
        $brut2       = $brut + $this->tCmnSuperGlobals->request->get('afet') * pow(10, 4);
223
        $amnt        = $this->getValues($brut2, $aryStngs, $inElements['Short Labels']);
224
        $sReturn[]   = $this->setFormOutputTaxations($brut2, $amnt);
225
        $pnValue     = $this->tCmnSuperGlobals->request->get('pn') * pow(10, 4);
226
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('pn'), '&nbsp;', $pnValue);
227
        $retineri    = $this->txLvl['cas'] + $this->txLvl['smj'] + $this->txLvl['snt'] + $amnt['impozit'];
228
        $net         = $brut2 - $retineri + $this->tCmnSuperGlobals->request->get('pn') * pow(10, 4);
229
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('ns'), '&nbsp;', $net);
230
        $szamntValue = $this->tCmnSuperGlobals->request->get('szamnt') * pow(10, 4);
231
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('szamnt'), '&nbsp;', $szamntValue);
232
        $nsc         = $net - $this->tCmnSuperGlobals->request->get('szamnt') * pow(10, 4);
233
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('nsc'), '&nbsp;', $nsc);
234
        $fBonus      = [
235
            'main'   => $this->setLabel('gb'),
236
            'value'  => $this->tApp->gettext('i18n_Form_Label_FoodBonusesChoiceValue'),
237
            'mtDays' => $this->tCmnSuperGlobals->request->get('nDays') . '&nbsp;/&nbsp;' . $bComponents['zile']
238
        ];
239
        $fBonusTxt   = sprintf($fBonus['main'], $fBonus['value']);
240
        $sReturn[]   = $this->setFrmRowTwoLbls($fBonusTxt, $fBonus['mtDays'], $amnt['ba']);
241
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('gbns'), '&nbsp;', $amnt['gbns']);
242
        $total       = ($net + $amnt['ba'] + $amnt['gbns'] - $this->tCmnSuperGlobals->request->get('szamnt') * 10000);
243
        $sReturn[]   = $this->setFrmRowTwoLbls($this->setLabel('total'), '&nbsp;', $total);
244
        $sReturn[]   = '</tbody>';
245
        $tDate       = \DateTime::createFromFormat('Ymd', $this->tCmnSuperGlobals->request->get('ym'));
246
        $legentText  = sprintf($this->tApp->gettext('i18n_FieldsetLabel_Results')
247
            . '', strftime('%B', mktime(0, 0, 0, $tDate->format('n'), 1, $tDate->format('Y'))), $tDate->format('Y'));
248
        $fieldsetC   = $this->setStringIntoTag($legentText, 'legend')
249
            . $this->setStringIntoTag(implode('', $sReturn), 'table');
250
        return $this->setStringIntoTag($fieldsetC, 'fieldset', [
251
                'style' => 'float: left;'
252
        ]);
253
    }
254
255
    private function setFormOutputBonuses($snValue, $wkDays, $amntLAA, $ovTimeVal)
256
    {
257
        $sRt      = [];
258
        $sMin     = $this->tCmnSuperGlobals->request->get('sm') * pow(10, 4);
259
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('sm'), '&nbsp;', $sMin);
260
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('sn'), '&nbsp;', $snValue);
261
        $scValue  = $this->tCmnSuperGlobals->request->get('sc');
262
        $prima    = $this->tCmnSuperGlobals->request->get('sn') * $scValue * 100;
263
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('sc'), $scValue . '%', $prima);
264
        $pbValue  = $this->tCmnSuperGlobals->request->get('pb') * pow(10, 4);
265
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('pb'), '&nbsp;', $pbValue);
266
        $ovTime   = [
267
            'o1' => $this->tCmnSuperGlobals->request->get('os175'),
268
            'o2' => $this->tCmnSuperGlobals->request->get('os200'),
269
        ];
270
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('ovAmount1'), '<span style="font-size:smaller;">'
271
            . $ovTime['o1'] . 'h&nbsp;x&nbsp;175%</span>', $ovTimeVal['os175'] * pow(10, 4));
272
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('ovAmount2'), '<span style="font-size:smaller;">'
273
            . $ovTime['o2'] . 'h&nbsp;x&nbsp;200%</span>', $ovTimeVal['os200'] * pow(10, 4));
274
        $fLeaveAA = $this->tCmnSuperGlobals->request->get('zfs') . '&nbsp;/&nbsp;' . $wkDays;
275
        $sRt[]    = $this->setFrmRowTwoLbls($this->setLabel('zfsa'), $fLeaveAA, $amntLAA);
276
        return implode('', $sRt);
277
    }
278
279
    private function setFormOutputHeader()
280
    {
281
        $sReturn   = [];
282
        $sReturn[] = '<thead><tr><th>' . $this->tApp->gettext('i18n_Form_Label_ResultedElements') . '</th>';
283
        $sReturn[] = '<th><i class="fa fa-map-signs floatRight" style="font-size:2em;">&nbsp;</i></th>';
284
        foreach ($this->currencyDetails['CX'] as $value) {
285
            $sReturn[] = '<th style="text-align:center;"><span class="flag-icon flag-icon-' . $value['country']
286
                . '" style="font-size:2em;" title="'
287
                . $this->tApp->gettext('i18n_CountryName_' . strtoupper($value['country'])) . '">&nbsp;</span></th>';
288
        }
289
        return implode('', $sReturn) . '</tr></thead></tbody>';
290
    }
291
292
    private function setFormOutputTaxations($brut, $amnt)
293
    {
294
        $sRn              = [];
295
        $limitDisplayBase = false;
296 View Code Duplication
        if ($brut > $this->txLvl['casP_base']) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
297
            $limitDisplayBase = true;
298
            $sRn[]            = $this->setFrmRowTwoLbls($this->setLabel('cas_base'), '', $this->txLvl['casP_base']);
299
        }
300
        $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('cas'), $this->txLvl['casP'] . '%', $this->txLvl['cas']);
301
        $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('somaj'), $this->txLvl['smjP'] . '%', $this->txLvl['smj']);
302 View Code Duplication
        if ($limitDisplayBase && array_key_exists('sntP_base', $this->txLvl)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
303
            $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('sntP_base'), '', $this->txLvl['sntP_base']);
304
        }
305
        $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('sanatate'), $this->txLvl['sntP'] . '%', $this->txLvl['snt']);
306
        $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('pd'), '&nbsp;', $amnt['pd']);
307
        $sRn[] = $this->setFrmRowTwoLbls($this->setLabel('impozit'), $this->txLvl['inTaxP'] . '%', $amnt['impozit']);
308
        return implode('', $sRn);
309
    }
310
311
    private function setFormRow($text, $value, $type = 'amount')
312
    {
313
        $defaultCellStyle = $this->setFormatRow($text, $value);
314
        switch ($type) {
315
            case 'amount':
316
                $value2show = $this->setFormRowAmount(($value / pow(10, 4)), $defaultCellStyle);
317
                break;
318
            case 'value':
319
                $value2show = $this->setStringIntoTag($value, 'td', array_merge($defaultCellStyle, [
320
                    'colspan' => count($this->currencyDetails['CX'])
321
                ]));
322
                break;
323
            default:
324
                $value2show = $this->setStringIntoTag($value, 'td');
325
                break;
326
        }
327
        return $this->setStringIntoTag($this->setStringIntoTag($text, 'td', $defaultCellStyle) . $value2show, 'tr');
328
    }
329
330
    private function setFormRowAmount($value, $defaultCellStyle)
331
    {
332
        $cellValue                 = [];
333
        $defaultCellStyle['style'] .= 'text-align:right;';
334
        foreach ($this->currencyDetails['CX'] as $key2 => $value2) {
335
            $fmt         = new \NumberFormatter($value2['locale'], \NumberFormatter::CURRENCY);
336
            $fmt->setAttribute(\NumberFormatter::FRACTION_DIGITS, $value2['decimals']);
337
            $finalValue  = $fmt->formatCurrency($value / $this->currencyDetails['CXV'][$key2], $key2);
338
            $cellValue[] = $this->setStringIntoTag($finalValue, 'td', $defaultCellStyle);
339
        }
340
        return implode('', $cellValue);
341
    }
342
343
    private function setFrmRowTwoLbls($text1, $text2, $value)
344
    {
345
        return str_replace(':</td>', ':</td><td class="labelS" style="text-align:right;">'
346
            . $text2 . '</td>', $this->setFormRow($text1, $value, 'amount'));
347
    }
348
}
349