Fix standardize date format for payment between customer and supplier

This commit is contained in:
Laurent Destailleur 2018-11-20 10:16:54 +01:00
parent 4845e90d95
commit be4dc40dfa
3 changed files with 11 additions and 7 deletions

View File

@ -305,7 +305,9 @@ if ($resql)
print '</td>';
// Date
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'dayhour').'</td>';
$dateformatforpayment = 'day';
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
print '<td align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment).'</td>';
// Thirdparty
print '<td>';

View File

@ -817,8 +817,8 @@ if (empty($action))
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($day) $param.=($day?"&day=".urlencode($day):"");
if ($month) $param.=($month?"&month=".urlencode($month):"");
if ($year) $param.=($year?"&year=".urlencode($year):"");
@ -826,7 +826,7 @@ if (empty($action))
if ($search_company) $param.=($search_company?"&search_company=".urlencode($search_company):"");
if ($search_amount != '') $param.=($search_amount?"&search_amount=".urlencode($search_amount):"");
if ($search_payment_num) $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@ -915,7 +915,9 @@ if (empty($action))
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$objp->pid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.'</a></td>';
// Date
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
$dateformatforpayment = 'day';
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
// Thirdparty
print '<td>';

View File

@ -124,7 +124,7 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
if ($action == 'setdatep' && ! empty($_POST['datepday']))
{
$object->fetch($id);
$datepaye = dol_mktime(12, 0, 0, $_POST['datepmonth'], $_POST['datepday'], $_POST['datepyear']);
$datepaye = dol_mktime(GETPOST('datephour','int'), GETPOST('datepmin','int'), GETPOST('datepsec','int'), GETPOST('datepmonth','int'), GETPOST('datepday','int'), GETPOST('datepyear','int'));
$res = $object->update_date($datepaye);
if ($res === 0)
{
@ -193,7 +193,7 @@ if ($result > 0)
// Date payment
print '<tr><td class="titlefield" colspan="2">'.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datehourpicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
print '</td></tr>';
// Payment mode