diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 733325f901b..d9c272df559 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4738,7 +4738,15 @@ if ($action == 'create')
print '
| ';
print $paymentstatic->getNomUrl(1);
print ' | ';
- print ''.dol_print_date($db->jdate($objp->dp), 'dayhour').' | ';
+ print '';
+ $dateofpayment = $db->jdate($objp->dp);
+ $tmparray = dol_getdate($dateofpayment);
+ if ($tmparray['seconds'] == 0 && $tmparray['minutes'] == 0 && ($tmparray['hours'] == 0 || $tmparray['hours'] == 12)) { // We set hours to 0:00 or 12:00 because we don't know it
+ print dol_print_date($dateofpayment, 'day');
+ } else { // Hours was set to real date of payment (special case for POS for example)
+ print dol_print_date($dateofpayment, 'dayhour', 'tzuser');
+ }
+ print ' | ';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print ''.$label.' '.$objp->num_payment.' | ';
if (!empty($conf->banque->enabled))
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 863e841f716..28635a2df60 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -1171,9 +1171,19 @@ class Paiement extends CommonObject
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = '';
+
$label = img_picto('', $this->picto).' '.$langs->trans("Payment").'
';
$label .= ''.$langs->trans("Ref").': '.$this->ref;
- if ($this->datepaye ? $this->datepaye : $this->date) $label .= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour');
+ $dateofpayment = ($this->datepaye ? $this->datepaye : $this->date);
+ if ($dateofpayment) {
+ $label .= '
'.$langs->trans("Date").': ';
+ $tmparray = dol_getdate($dateofpayment);
+ if ($tmparray['seconds'] == 0 && $tmparray['minutes'] == 0 && ($tmparray['hours'] == 0 || $tmparray['hours'] == 12)) { // We set hours to 0:00 or 12:00 because we don't know it
+ $label .= dol_print_date($dateofpayment, 'day');
+ } else { // Hours was set to real date of payment (special case for POS for example)
+ $label .= dol_print_date($dateofpayment, 'dayhour', 'tzuser');
+ }
+ }
if ($mode == 'withlistofinvoices')
{
$arraybill = $this->getBillsArray();
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 409ca6b2ce4..f8bbabf20c2 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -173,11 +173,13 @@ if ($action == 'valid' && $user->rights->facture->creer)
if ($invoice->total_ttc < 0) {
$invoice->type = $invoice::TYPE_CREDIT_NOTE;
+
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE";
$sql .= " fk_soc = ".((int) $invoice->socid);
$sql .= " AND type <> ".Facture::TYPE_CREDIT_NOTE;
$sql .= " AND fk_statut >= ".$invoice::STATUS_VALIDATED;
$sql .= " ORDER BY rowid DESC";
+
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
@@ -1019,13 +1021,13 @@ $( document ).ready(function() {
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
- echo 'jdate($obj->datec), '%H:%M'))).'" onclick="place=\\\'';
+ echo 'jdate($obj->datec), '%H:%M', 'tzuser'))).'" onclick="place=\\\'';
$num_sale = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref));
echo $num_sale;
if (str_replace("-", "", $num_sale) > $max_sale) $max_sale = str_replace("-", "", $num_sale);
echo '\\\';Refresh();">';
if ($placeid == $obj->rowid) echo "";
- echo dol_print_date($db->jdate($obj->datec), '%H:%M');
+ echo dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser');
if ($placeid == $obj->rowid) echo "";
echo '\');';
}