diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 5ee0989c97c..f1883f0da77 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -758,40 +758,42 @@ while ($i < min($num, $limit)) $i++; } -// Show sub-total of last shown account -if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { - $colnumber = 3; - $colnumberend = 7; -} else { - $colnumber = 4; - $colnumberend = 7; +if ($num > 0) { + // Show sub-total of last shown account + if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { + $colnumber = 3; + $colnumberend = 7; + } else { + $colnumber = 4; + $colnumberend = 7; + } + $colspan = $totalarray['nbfield'] - $colnumber; + $colspanend = $totalarray['nbfield'] - $colnumberend; + print ''; + print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; + print ''.price($sous_total_debit).''; + print ''.price($sous_total_credit).''; + print ''; + print ''; + // Show balance of last shown account + $balance = $sous_total_debit - $sous_total_credit; + print ''; + print ''.$langs->trans("Balance").':'; + if ($balance > 0) + { + print ''; + print price($sous_total_debit - $sous_total_credit); + print ''; + print ''; + } else { + print ''; + print ''; + print price($sous_total_credit - $sous_total_debit); + print ''; + } + print ''; + print ''; } -$colspan = $totalarray['nbfield'] - $colnumber; -$colspanend = $totalarray['nbfield'] - $colnumberend; -print ''; -print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; -print ''.price($sous_total_debit).''; -print ''.price($sous_total_credit).''; -print ''; -print ''; -// Show balance of last shown account -$balance = $sous_total_debit - $sous_total_credit; -print ''; -print ''.$langs->trans("Balance").':'; -if ($balance > 0) -{ - print ''; - print price($sous_total_debit - $sous_total_credit); - print ''; - print ''; -} else { - print ''; - print ''; - print price($sous_total_credit - $sous_total_debit); - print ''; -} -print ''; -print ''; // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index e54d20cd647..10d4dc3084b 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -770,40 +770,42 @@ while ($i < min($num, $limit)) $i++; } -// Show sub-total of last shown account -if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { - $colnumber = 3; - $colnumberend = 7; -} else { - $colnumber = 4; - $colnumberend = 7; +if ($num > 0) { + // Show sub-total of last shown account + if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { + $colnumber = 3; + $colnumberend = 7; + } else { + $colnumber = 4; + $colnumberend = 7; + } + $colspan = $totalarray['nbfield'] - $colnumber; + $colspanend = $totalarray['nbfield'] - $colnumberend; + print ''; + print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; + print ''.price($sous_total_debit).''; + print ''.price($sous_total_credit).''; + print ''; + print ''; + // Show balance of last shown account + $balance = $sous_total_debit - $sous_total_credit; + print ''; + print ''.$langs->trans("Balance").':'; + if ($balance > 0) + { + print ''; + print price($sous_total_debit - $sous_total_credit); + print ''; + print ''; + } else { + print ''; + print ''; + print price($sous_total_credit - $sous_total_debit); + print ''; + } + print ''; + print ''; } -$colspan = $totalarray['nbfield'] - $colnumber; -$colspanend = $totalarray['nbfield'] - $colnumberend; -print ''; -print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; -print ''.price($sous_total_debit).''; -print ''.price($sous_total_credit).''; -print ''; -print ''; -// Show balance of last shown account -$balance = $sous_total_debit - $sous_total_credit; -print ''; -print ''.$langs->trans("Balance").':'; -if ($balance > 0) -{ - print ''; - print price($sous_total_debit - $sous_total_credit); - print ''; - print ''; -} else { - print ''; - print ''; - print price($sous_total_credit - $sous_total_debit); - print ''; -} -print ''; -print ''; // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 80454403a32..1100b86f412 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -224,7 +224,7 @@ if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) print '  => price(1234.56)'.price(1234.56).''."\n"; // Timezone $txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'
'."\n"; -$txt .= $langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone") ?ini_get("date.timezone") : $langs->trans("NotDefined")).''."
\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."
\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php $txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ); print ''.$langs->trans("CurrentTimeZone").''; // Timezone server PHP $a = getServerTimeZoneInt('now'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e16d07f084f..cbcb49583b1 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/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 '\');'; }