|
@@ -313,9 +313,9 @@ discard block |
|
|
block discarded – undo |
|
313
|
313
|
// Create a line of payments |
|
314
|
314
|
$paiement = new PaymentSalary($db); |
|
315
|
315
|
$paiement->fk_salary = $object->id; |
|
316
|
|
- $paiement->chid = $object->id; // deprecated |
|
|
316
|
+ $paiement->chid = $object->id; // deprecated |
|
317
|
317
|
$paiement->datep = $datep; |
|
318
|
|
- $paiement->datev = $datev; |
|
|
318
|
+ $paiement->datev = $datev; |
|
319
|
319
|
$paiement->amounts = array($object->id => $amount); // Tableau de montant |
|
320
|
320
|
$paiement->fk_typepayment = $type_payment; |
|
321
|
321
|
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); |
|
@@ -344,10 +344,10 @@ discard block |
|
|
block discarded – undo |
|
344
|
344
|
|
|
345
|
345
|
if (GETPOST('saveandnew', 'alpha')) { |
|
346
|
346
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); |
|
347
|
|
- header("Location: card.php?action=create&fk_project=" . urlencode((string) ($projectid)) . "&accountid=" . urlencode((string) ($accountid)) . '&paymenttype=' . urlencode((string) (GETPOSTINT('paymenttype'))) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear")); |
|
|
347
|
+ header("Location: card.php?action=create&fk_project=".urlencode((string) ($projectid))."&accountid=".urlencode((string) ($accountid)).'&paymenttype='.urlencode((string) (GETPOSTINT('paymenttype'))).'&datepday='.GETPOSTINT("datepday").'&datepmonth='.GETPOSTINT("datepmonth").'&datepyear='.GETPOSTINT("datepyear")); |
|
348
|
348
|
exit; |
|
349
|
349
|
} else { |
|
350
|
|
- header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
|
350
|
+ header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id); |
|
351
|
351
|
exit; |
|
352
|
352
|
} |
|
353
|
353
|
} else { |
|
@@ -637,7 +637,7 @@ discard block |
|
|
block discarded – undo |
|
637
|
637
|
|
|
638
|
638
|
// Auto create payment |
|
639
|
639
|
print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>'; |
|
640
|
|
- print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_paiement) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n"; // Date payment |
|
|
640
|
+ print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.(empty($auto_create_paiement) ? '' : 'checked="checked"').' value="1"></td></tr>'."\n"; // Date payment |
|
641
|
641
|
|
|
642
|
642
|
// Bank |
|
643
|
643
|
if (isModEnabled("bank")) { |
|
@@ -905,10 +905,10 @@ discard block |
|
|
block discarded – undo |
|
905
|
905
|
$userstatic = new User($db); |
|
906
|
906
|
$result = $userstatic->fetch($object->fk_user); |
|
907
|
907
|
if ($result > 0) { |
|
908
|
|
- $morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); |
|
|
908
|
+ $morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); |
|
909
|
909
|
} |
|
910
|
910
|
} else { |
|
911
|
|
- $morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1); |
|
|
911
|
+ $morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1); |
|
912
|
912
|
|
|
913
|
913
|
if (!empty($object->fk_user)) { |
|
914
|
914
|
$userstatic = new User($db); |
|
@@ -960,7 +960,7 @@ discard block |
|
|
block discarded – undo |
|
960
|
960
|
$totalpaid = $object->getSommePaiement(); |
|
961
|
961
|
|
|
962
|
962
|
$object->totalpaid = $totalpaid; |
|
963
|
|
- $object->alreadypaid = $totalpaid; // Same then $totalpaid because there is no amount of credit note or deposits for salary payments. |
|
|
963
|
+ $object->alreadypaid = $totalpaid; // Same then $totalpaid because there is no amount of credit note or deposits for salary payments. |
|
964
|
964
|
|
|
965
|
965
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); |
|
966
|
966
|
|
|
@@ -976,7 +976,7 @@ discard block |
|
|
block discarded – undo |
|
976
|
976
|
print "</td></tr>"; |
|
977
|
977
|
} else { |
|
978
|
978
|
print "<tr>"; |
|
979
|
|
- print '<td class="titlefieldmiddle">' . $langs->trans("DateStartPeriod") . '</td><td>'; |
|
|
979
|
+ print '<td class="titlefieldmiddle">'.$langs->trans("DateStartPeriod").'</td><td>'; |
|
980
|
980
|
print dol_print_date($object->datesp, 'day'); |
|
981
|
981
|
print '</td></tr>'; |
|
982
|
982
|
} |
|
@@ -987,15 +987,15 @@ discard block |
|
|
block discarded – undo |
|
987
|
987
|
print "</td></tr>"; |
|
988
|
988
|
} else { |
|
989
|
989
|
print "<tr>"; |
|
990
|
|
- print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>'; |
|
|
990
|
+ print '<td>'.$langs->trans("DateEndPeriod").'</td><td>'; |
|
991
|
991
|
print dol_print_date($object->dateep, 'day'); |
|
992
|
992
|
print '</td></tr>'; |
|
993
|
993
|
} |
|
994
|
994
|
|
|
995
|
995
|
if ($action == 'edit') { |
|
996
|
|
- print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>'; |
|
|
996
|
+ print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>'; |
|
997
|
997
|
} else { |
|
998
|
|
- print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>'; |
|
|
998
|
+ print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>'; |
|
999
|
999
|
} |
|
1000
|
1000
|
|
|
1001
|
1001
|
// Default mode of payment |
|
@@ -1180,7 +1180,7 @@ discard block |
|
|
block discarded – undo |
|
1180
|
1180
|
if (empty($user->socid)) { |
|
1181
|
1181
|
$canSendMail = true; |
|
1182
|
1182
|
|
|
1183
|
|
- print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail); |
|
|
1183
|
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail); |
|
1184
|
1184
|
} |
|
1185
|
1185
|
} |
|
1186
|
1186
|
|
|
@@ -1196,12 +1196,12 @@ discard block |
|
|
block discarded – undo |
|
1196
|
1196
|
|
|
1197
|
1197
|
// Transfer request |
|
1198
|
1198
|
if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) { |
|
1199
|
|
- print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT . '/salaries/virement_request.php?id=' . $object->id, ''); |
|
|
1199
|
+ print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT.'/salaries/virement_request.php?id='.$object->id, ''); |
|
1200
|
1200
|
} |
|
1201
|
1201
|
|
|
1202
|
1202
|
// Emit payment |
|
1203
|
1203
|
if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) { |
|
1204
|
|
- print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, ''); |
|
|
1204
|
+ print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='.$object->id, ''); |
|
1205
|
1205
|
} |
|
1206
|
1206
|
|
|
1207
|
1207
|
// Classify 'paid' |