From 97da70e5830f7664e8a156a42e49be8d2203f7d2 Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Wed, 28 Jun 2017 16:38:06 +0200 Subject: [PATCH] bug lines supplier --- htdocs/accountancy/supplier/lines.php | 158 ++++++++++++++------------ 1 file changed, 83 insertions(+), 75 deletions(-) diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 319da0a46c5..398d12503ab 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,10 +1,10 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2014 Juanjo Menent - * + * Copyright (C) 2014 Juanjo Menent + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -27,7 +27,7 @@ require '../../main.inc.php'; // Class -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; @@ -44,6 +44,7 @@ $langs->load("productbatch"); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost +$search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -51,9 +52,11 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); +$search_country = GETPOST('search_country', 'alpha'); +$search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -75,7 +78,7 @@ if ($user->societe_id > 0) if (! $user->rights->accounting->bind->write) accessforbidden(); -$formventilation = new FormVentilation($db); +$formaccounting = new FormAccounting($db); /* @@ -85,6 +88,7 @@ $formventilation = new FormVentilation($db); // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { + $search_lineid = ''; $search_ref = ''; $search_invoice = ''; $search_label = ''; @@ -98,13 +102,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - + $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l"; $sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; - + dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1); $resql1 = $db->query($sql1); if (! $resql1) { @@ -149,37 +153,40 @@ print '