Enhance autofill of amount to pay for VAT

This commit is contained in:
Laurent Destailleur 2021-02-08 19:35:04 +01:00
parent 925d81d1b3
commit 8f7c35a221
3 changed files with 6 additions and 4 deletions

View File

@ -300,11 +300,13 @@ if ($action == 'create')
{
$namef = "amount_".$objp->id;
$nameRemain = "remain_".$objp->id;
if (!empty($conf->use_javascript_ajax))
/* Disabled, we autofil the amount with remain to pay by default
if (!empty($conf->use_javascript_ajax)) {
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'");
} */
$remaintopay = $objp->amount - $sumpaid;
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
print '<input type="text" class="right width100" name="'.$namef.'" id="'.$namef.'" value="'.$remaintopay.'">';
}
else {
print '-';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -148,7 +148,7 @@ if (!empty($search_account) && $search_account > 0) $sql .= ' AND b.fk_account='
if (!empty($search_amount)) $sql .= natural_search('t.amount', price2num(trim($search_amount)), 1);
if ($search_status != '' && $search_status >= 0) $sql .= " AND t.paye = ".$db->escape($search_status);
$sql .= " GROUP BY t.rowid, t.amount, t.datev, t.label, t.paye, pst.code";
$sql .= " GROUP BY t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment, t.num_payment, pst.code";
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';