Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0

Conflicts:
	htdocs/compta/paiement/class/paiement.class.php
	htdocs/takepos/invoice.php
This commit is contained in:
Laurent Destailleur 2020-12-30 22:58:40 +01:00
commit 60d1b08f84
3 changed files with 24 additions and 4 deletions

View File

@ -4738,7 +4738,15 @@ if ($action == 'create')
print '<tr class="oddeven"><td>';
print $paymentstatic->getNomUrl(1);
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour').'</td>';
print '<td>';
$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 '</td>';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print '<td>'.$label.' '.$objp->num_payment.'</td>';
if (!empty($conf->banque->enabled))

View File

@ -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).' <u>'.$langs->trans("Payment").'</u><br>';
$label .= '<strong>'.$langs->trans("Ref").':</strong> '.$this->ref;
if ($this->datepaye ? $this->datepaye : $this->date) $label .= '<br><strong>'.$langs->trans("Date").':</strong> '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour');
$dateofpayment = ($this->datepaye ? $this->datepaye : $this->date);
if ($dateofpayment) {
$label .= '<br><strong>'.$langs->trans("Date").':</strong> ';
$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();

View File

@ -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 '<a class="valignmiddle" title="'.dol_escape_js($langs->trans("SaleStartedAt", dol_print_date($db->jdate($obj->datec), '%H:%M'))).'" onclick="place=\\\'';
echo '<a class="valignmiddle" title="'.dol_escape_js($langs->trans("SaleStartedAt", dol_print_date($db->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 "<b>";
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 "</b>";
echo '</a>\');';
}