';
+ $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 '
';
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/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index 8e529fe92f2..88ff8fecdb6 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -99,7 +99,8 @@ CashDeskRefNumberingModules=Numbering module for POS sales
CashDeskGenericMaskCodes6 = {TN} tag is used to add the terminal number
TakeposGroupSameProduct=Group same products lines
StartAParallelSale=Start a new parallel sale
-ControlCashOpening=Control cash desk at opening POS
+SaleStartedAt=Sale started at %s
+ControlCashOpening=Control cash popup at opening POS
CloseCashFence=Close cash desk control
CashReport=Cash report
MainPrinterToUse=Main printer to use
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 961168221f6..5e75749dc00 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -483,7 +483,7 @@ function TakeposOrderNotes() {
}
function Refresh() {
- console.log("Refresh");
+ console.log("Refresh by reloading place="+place);
$("#poslines").load("invoice.php?place="+place, function() {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
@@ -491,9 +491,10 @@ function Refresh() {
function New() {
// If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined
- console.log("New with place = , js place="+place);
-
invoiceid = $("#invoiceid").val();
+
+ console.log("New with place = , js place="+place+", invoiceid="+invoiceid);
+
$.getJSON('/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) {
var r;
@@ -831,7 +832,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
- " autofocus>
+ " autofocus>
dol_use_jmobile)) { ?>
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index d2fd153e5be..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);
@@ -572,16 +574,9 @@ if ($action == "deleteline") {
}
}
+// Action to delete or discard an invoice
if ($action == "delete") {
// $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at begining of page works.
-
- /*$reg = array();
- if (preg_match('/^(\d+)-(\d+)$/', $place, $reg)) {
-
- $place = $reg[1];
- var_dump($place);
- }*/
-
if ($placeid > 0) {
$result = $invoice->fetch($placeid);
@@ -599,7 +594,9 @@ if ($action == "delete") {
}
}
- $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]};
+ $sql = "UPDATE ".MAIN_DB_PREFIX."facture";
+ $sql .= " SET fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}.", ";
+ $sql .= " datec = '".$db->idate(dol_now())."'";
$sql .= " WHERE ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
$resql1 = $db->query($sql);
@@ -1024,13 +1021,13 @@ $( document ).ready(function() {
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
- 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 date('H:i', strtotime($obj->datec));
+ echo dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser');
if ($placeid == $obj->rowid) echo "";
echo '\');';
}