';
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index 7e1e40b8702..038b3e20b46 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -216,7 +216,7 @@ if ($result) {
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('');
print_liste_field_titre('');
- print_liste_field_titre($langs->trans("Ventilate") . '
/
', '', '', '', '', 'align="center"');
+ print_liste_field_titre('', '', '', '', '', 'align="center"');
print "\n";
print '
| ';
@@ -228,7 +228,7 @@ if ($result) {
print ' | ';
print ' | ';
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons(0);
+ $searchpitco=$form->showFilterAndCheckAddButtons(1);
print $searchpitco;
print ' | ';
print "
\n";
@@ -270,7 +270,7 @@ if ($result) {
print img_edit();
print '';
- print '
| ';
+ print '
| ';
print "";
$i ++;
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index e48f0141318..8ae8dd17996 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -98,17 +98,61 @@ $accounting = new AccountingAccount($db);
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
+
+/*
+ * Action
+ */
+
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
- $search_ref = '';
- $search_label = '';
- $search_desc = '';
- $search_amount = '';
- $search_account = '';
- $search_vat = '';
+ $search_ref = '';
+ $search_label = '';
+ $search_desc = '';
+ $search_amount = '';
+ $search_account = '';
+ $search_vat = '';
}
+if ($action == 'ventil' && ! empty($btn_ventil)) {
+ $msg='';
+ //print '
' . $langs->trans("Processing") . '...
';
+ if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
+ $msg = '
' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '
';
+ $mesCodesVentilChoisis = $codeventil;
+ $cpt = 0;
+
+ foreach ( $mesCasesCochees as $maLigneCochee ) {
+ // print '
id selectionnee : '.$monChoix."
";
+ $maLigneCourante = explode("_", $maLigneCochee);
+ $monId = $maLigneCourante[0];
+ $monNumLigne = $maLigneCourante[1];
+ $monCompte = $mesCodesVentilChoisis[$monNumLigne];
+
+ $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
+ $sql .= " SET fk_code_ventilation = " . $monCompte;
+ $sql .= " WHERE rowid = " . $monId;
+
+ $accountventilated = new AccountingAccount($db);
+ $accountventilated->fetch($monCompte, '');
+
+ dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
+ if ($db->query($sql)) {
+ $msg.= '
' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
';
+ } else {
+ $msg.= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
' . $sql . '
';
+ }
+
+ $cpt ++;
+ }
+ } else {
+ $msg.= '
' . $langs->trans("AnyLineVentilate") . '
';
+ }
+ $msg.= '
' . $langs->trans("EndProcessing") . '
';
+}
+
+
+
/*
* View
*/
@@ -131,45 +175,6 @@ print '';
-/*
- * Action
- */
-if ($action == 'ventil' && ! empty($btn_ventil)) {
- $msg='';
- //print '
' . $langs->trans("Processing") . '...
';
- if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
- $msg = '
' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '
';
- $mesCodesVentilChoisis = $codeventil;
- $cpt = 0;
-
- foreach ( $mesCasesCochees as $maLigneCochee ) {
- // print '
id selectionnee : '.$monChoix."
";
- $maLigneCourante = explode("_", $maLigneCochee);
- $monId = $maLigneCourante[0];
- $monNumLigne = $maLigneCourante[1];
- $monCompte = $mesCodesVentilChoisis[$monNumLigne];
-
- $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
- $sql .= " SET fk_code_ventilation = " . $monCompte;
- $sql .= " WHERE rowid = " . $monId;
-
- $accountventilated = new AccountingAccount($db);
- $accountventilated->fetch($monCompte, '');
-
- dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
- if ($db->query($sql)) {
- $msg.= '
' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
';
- } else {
- $msg.= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
' . $sql . '
';
- }
-
- $cpt ++;
- }
- } else {
- $msg.= '
' . $langs->trans("AnyLineVentilate") . '
';
- }
- $msg.= '
' . $langs->trans("EndProcessing") . '
';
-}
/*
* Supplier Invoice Lines
@@ -236,7 +241,7 @@ if ($result) {
if ($msg) print $msg.'
';
- print '
' . $langs->trans("DescVentilTodoCustomer") . '';
+ print $langs->trans("DescVentilTodoCustomer") . '
';
print '