This commit is contained in:
Laurent Destailleur
2020-12-14 10:44:51 +01:00
parent ae5da8d55c
commit cce0b2f31b
4 changed files with 15 additions and 4 deletions

View File

@@ -27,6 +27,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@@ -181,7 +182,8 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre
if (!$dateech)
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
setEventMessages($langs->trans("ErrorFieldReqrequire_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
uired", $langs->transnoentities("Date")), null, 'errors');
$action = 'edit';
} elseif (!$dateperiod)
{
@@ -610,14 +612,22 @@ if ($id > 0)
print '<td class="right">'.$langs->trans("Amount").'</td>';
print '</tr>';
$paymentsocialcontributiontmp = new PaymentSocialContribution($db);
if ($num > 0)
{
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$paymentsocialcontributiontmp->id = $objp->rowid;
$paymentsocialcontributiontmp->ref = $objp->rowid;
$paymentsocialcontributiontmp->datep = $db->jdate($objp->dp);
print '<tr class="oddeven"><td>';
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
print $paymentsocialcontributiontmp->getNomUrl(1);
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";

View File

@@ -694,7 +694,7 @@ class PaymentSocialContribution extends CommonObject
}
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
}
if ($this->date) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->date, 'day');
if ($this->datep) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
if (!empty($this->id)) {
$link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@@ -1783,6 +1783,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
// Add if object was dispatched "into accountancy"
if (!empty($conf->accounting->enabled) && in_array($object->element, array('bank', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various')))
{
// Note: For 'chargesociales', 'salaries'... this is the payments that are dispatched (so element = 'bank')
if (method_exists($object, 'getVentilExportCompta'))
{
$accounted = $object->getVentilExportCompta();

View File

@@ -2461,7 +2461,7 @@ class ExpenseReport extends CommonObject
}
/**
* Return if an expensereport was dispatched into bookkeeping
* Return if object was dispatched into bookkeeping
*
* @return int <0 if KO, 0=no, 1=yes
*/