diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 4583d28a456..c2ccf442c28 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -819,84 +819,6 @@ if ($resql) {
print '';
}
- // Form to reconcile
- if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
- print '
';
- if (getDolGlobalInt('NW_RECEIPTNUMBERFORMAT')) {
- print ''.$langs->trans("InputReceiptNumber").': ';
- print '';
- } else {
- $texttoshow = $langs->trans("InputReceiptNumber").': ';
- $yyyy = dol_substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1);
- $mm = dol_substr($langs->transnoentitiesnoconv("Month"), 0, 1).substr($langs->transnoentitiesnoconv("Month"), 0, 1);
- $dd = dol_substr($langs->transnoentitiesnoconv("Day"), 0, 1).substr($langs->transnoentitiesnoconv("Day"), 0, 1);
- $placeholder = $yyyy.$mm;
- $placeholder .= ' '.$langs->trans("or").' ';
- $placeholder .= $yyyy.$mm.$dd;
- if (!$placeholder) {
- $texttoshow .= $langs->trans("InputReceiptNumberBis");
- }
- print $texttoshow;
- print ''; // The only default value is value we just entered
- }
- print '
';
- if (is_array($options) && count($options)) {
- print $langs->trans("EventualyAddCategory").': ';
- print Form::selectarray('cat', $options, GETPOST('cat'), 1);
- }
- print '
'.$langs->trans("ThenCheckLinesAndConciliate").' ';
- print '';
- print ' '.$langs->trans("or").' ';
- print '';
- print ' '.$langs->trans("or").' ';
- print '';
- print '
';
-
- // Show last bank statements
- $nbmax = 12; // We show last 12 receipts (so we can have more than one year)
- $liste = "";
- $sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
- $sql .= " WHERE fk_account = ".((int) $object->id)." AND num_releve IS NOT NULL";
- $sql .= $db->order("num_releve", "DESC");
- $sql .= $db->plimit($nbmax + 1);
- print '
';
- print $langs->trans("LastAccountStatements").' : ';
- $resqlr = $db->query($sql);
- if ($resqlr) {
- $numr = $db->num_rows($resqlr);
- $i = 0;
- $last_ok = 0;
- while (($i < $numr) && ($i < $nbmax)) {
- $objr = $db->fetch_object($resqlr);
- if (!$last_ok) {
- $last_releve = $objr->num_releve;
- $last_ok = 1;
- }
- $i++;
- $liste = ''.$objr->num_releve.' '.$liste;
- }
- if ($numr >= $nbmax) {
- $liste = "... ".$liste;
- }
- print $liste;
- if ($numr <= 0) {
- print ''.$langs->trans("None").'';
- }
- } else {
- dol_print_error($db);
- }
-
- // Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
- if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
- print '
-
- ';
- }
- print '
';
- }
-
// Form to add a transaction with no invoice
if ($user->hasRight('banque', 'modifier') && $action == 'addline' && getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) {
print load_fiche_titre($langs->trans("AddBankRecordLong"), '', '');
@@ -991,7 +913,7 @@ if ($resql) {
$bankcateg = new BankCateg($db);
$newcardbutton = '';
- if ($action != 'addline' && $action != 'reconcile') {
+ if ($action != 'addline') {
if (!getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
if (!getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { // Default is to record miscellaneous direct entries using miscellaneous payments
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
@@ -1015,7 +937,7 @@ if ($resql) {
$morehtml .= $buttonreconcile;
}
- $morehtml .= ''.$newcardbutton;
+ $morehtmlright = ''.$newcardbutton;
$picto = 'bank_account';
if ($id > 0 || !empty($ref)) {
@@ -1023,7 +945,86 @@ if ($resql) {
}
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
- print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
+ print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton.$morehtml, $num, $nbtotalofrecords, $picto, 0, $morehtmlright, '', $limit, 0, 0, 1);
+
+ // Form to reconcile
+ if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
+ print ''."\n";
+ print '';
+ if (getDolGlobalInt('NW_RECEIPTNUMBERFORMAT')) {
+ print ''.$langs->trans("InputReceiptNumber").': ';
+ print '';
+ } else {
+ $texttoshow = $langs->trans("InputReceiptNumber").': ';
+ $yyyy = dol_substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1);
+ $mm = dol_substr($langs->transnoentitiesnoconv("Month"), 0, 1).substr($langs->transnoentitiesnoconv("Month"), 0, 1);
+ $dd = dol_substr($langs->transnoentitiesnoconv("Day"), 0, 1).substr($langs->transnoentitiesnoconv("Day"), 0, 1);
+ $placeholder = $yyyy.$mm;
+ $placeholder .= ' '.$langs->trans("or").' ';
+ $placeholder .= $yyyy.$mm.$dd;
+ if (!$placeholder) {
+ $texttoshow .= $langs->trans("InputReceiptNumberBis");
+ }
+ print $texttoshow;
+ print ''; // The only default value is value we just entered
+ }
+ print '
';
+ if (is_array($options) && count($options)) {
+ print $langs->trans("EventualyAddCategory").': ';
+ print Form::selectarray('cat', $options, GETPOST('cat'), 1);
+ }
+ print '
'.$langs->trans("ThenCheckLinesAndConciliate").' ';
+ print '';
+ print ' '.$langs->trans("or").' ';
+ print '';
+ print ' '.$langs->trans("or").' ';
+ print '';
+ print '
';
+
+ // Show last bank statements
+ $nbmax = 12; // We show last 12 receipts (so we can have more than one year)
+ $liste = "";
+ $sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
+ $sql .= " WHERE fk_account = ".((int) $object->id)." AND num_releve IS NOT NULL";
+ $sql .= $db->order("num_releve", "DESC");
+ $sql .= $db->plimit($nbmax + 1);
+ print '
';
+ print $langs->trans("LastAccountStatements").' : ';
+ $resqlr = $db->query($sql);
+ if ($resqlr) {
+ $numr = $db->num_rows($resqlr);
+ $i = 0;
+ $last_ok = 0;
+ while (($i < $numr) && ($i < $nbmax)) {
+ $objr = $db->fetch_object($resqlr);
+ if (!$last_ok) {
+ $last_releve = $objr->num_releve;
+ $last_ok = 1;
+ }
+ $i++;
+ $liste = ''.dol_escape_htmltag($objr->num_releve).' '.$liste;
+ }
+ if ($numr >= $nbmax) {
+ $liste = "... ".$liste;
+ }
+ print $liste;
+ if ($numr <= 0) {
+ print ''.$langs->trans("None").'';
+ }
+ } else {
+ dol_print_error($db);
+ }
+
+ // Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
+ if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
+ print '
+
+ ';
+ }
+ print '
';
+ }
// We can add page now to param
if ($page != '') {
@@ -1031,7 +1032,6 @@ if ($resql) {
}
$moreforfilter = '';
-
$moreforfilter .= '';
$moreforfilter .= $langs->trans('DateOperationShort');
$moreforfilter .= ($conf->browser->layout == 'phone' ? '
' : ' ');
@@ -1456,7 +1456,7 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '
';
+ print ' | ';
if (!$objp->conciliated && $action == 'reconcile') {
print 'rowid]) ? ' checked' : '').'>';
}
@@ -1857,7 +1857,7 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print ' | ';
+ print ' | ';
if (!$objp->conciliated && $action == 'reconcile') {
print 'rowid]) ? ' checked' : '').'>';
}
@@ -1891,7 +1891,7 @@ if ($resql) {
} elseif ($i == $posconciliatecol) {
print ' | ';
if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
- print '';
+ print '';
}
print ' | ';
} else {
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index ef5d98f2d93..7911ff8406c 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -274,6 +274,7 @@ if (empty($numref)) {
$sql = "SELECT DISTINCT(b.num_releve) as numr";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= " WHERE b.fk_account = ".((int) $object->id);
+ $sql .= " AND b.num_releve IS NOT NULL";
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
@@ -285,9 +286,9 @@ if (empty($numref)) {
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
- $result = $db->query($sql);
- if ($result) {
- $numrows = $db->num_rows($result);
+ $resql = $db->query($sql);
+ if ($resql) {
+ $numrows = $db->num_rows($resql);
$i = 0;
// Onglets
@@ -360,7 +361,7 @@ if (empty($numref)) {
$content = array();
while ($i < min($numrows, $conf->liste_limit)) {
- $objp = $db->fetch_object($result);
+ $objp = $db->fetch_object($resql);
if (!isset($objp->numr)) {
//
@@ -414,6 +415,11 @@ if (empty($numref)) {
}
$i++;
}
+
+ if (empty($numrows)) {
+ print '| '.$langs->trans("None").' |
';
+ }
+
print "\n";
print '';
@@ -481,9 +487,9 @@ if (empty($numref)) {
// Recherche les ecritures pour le releve
$sql = $sqlrequestforbankline;
- $result = $db->query($sql);
- if ($result) {
- $numrows = $db->num_rows($result);
+ $resql = $db->query($sql);
+ if ($resql) {
+ $numrows = $db->num_rows($resql);
$i = 0;
// Ligne Solde debut releve
@@ -493,7 +499,7 @@ if (empty($numref)) {
print "\n";
while ($i < $numrows) {
- $objp = $db->fetch_object($result);
+ $objp = $db->fetch_object($resql);
$total = $total + $objp->amount;
print '';
@@ -696,7 +702,7 @@ if (empty($numref)) {
print "
";
$i++;
}
- $db->free($result);
+ $db->free($resql);
} else {
dol_print_error($db);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 4bf5d9f6fcf..bb19b01f538 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8587,6 +8587,7 @@ class Form
}
}
$out .= "";
+
// Add code for jquery to use multiselect
if ($addjscombo && $jsbeautify) {
// Enhance with select2
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 669a402e298..e16a732bd6c 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6235,7 +6235,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
print '';
} else {
print '';
- print ajax_combobox("limit");
+ print ajax_combobox("limit", array(), 0, 0, 'resolve', -1, 'limit');
+ //print ajax_combobox("limit");
}
if ($conf->use_javascript_ajax) {
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 3d684a71a09..7caef3b1493 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -335,6 +335,7 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
+//print $sql;
$result = $db->query($sql);
if ($result) {
@@ -358,7 +359,9 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
+ $sqlforcount = preg_replace('/LEFT JOIN [a-z]+_product_stock as ps ON t.rowid = ps.fk_entrepot LEFT JOIN [a-z]+_product as p ON ps.fk_product = p.rowid/', '', $sqlforcount);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
@@ -557,7 +560,7 @@ foreach ($object->fields as $key => $val) {
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
- print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), (isset($val['notnull']) ? $val['notnull'] : 0), 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
+ print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index d26256632c2..8095fb1ae42 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -1406,7 +1406,7 @@ select.flat.selectlimit {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
-.selectlimit, .marginrightonly {
+.marginrightonly {
margin-: 10px !important;
}
.marginleftonly {
@@ -6833,6 +6833,11 @@ select.multiselectononeline {
}
}
+/* must be after the other .select2-container.select2-container--open .select2-dropdown.ui-dialog */
+.limit.select2-container.select2-container--open .select2-dropdown.ui-dialog {
+ min-width: 100px !important;
+}
+
/* ============================================================================== */
/* For categories */
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 17e77437fbc..1d56e60b832 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -6714,6 +6714,11 @@ select.multiselectononeline {
}
}
+/* must be after the other .select2-container.select2-container--open .select2-dropdown.ui-dialog */
+.limit.select2-container.select2-container--open .select2-dropdown.ui-dialog {
+ min-width: 100px !important;
+}
+
.parentonrightofpage {
direction: rtl;
}
|