Merge pull request #4725 from aspangaro/3.9-p15
Fix: 3.9rc2 Show accountancy account ventilated instead of the rowid of the account
This commit is contained in:
commit
4ea00fe1c5
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,9 +20,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/customer/list.php
|
* \file htdocs/accountancy/customer/list.php
|
||||||
* \ingroup Accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Ventilation page from customers invoices
|
* \brief Ventilation page from customers invoices
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -123,12 +124,11 @@ print '<script type="text/javascript">
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil' && ! empty($btn_ventil)) {
|
if ($action == 'ventil' && ! empty($btn_ventil)) {
|
||||||
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||||
if (! empty($codeventil) && ! empty($mesCasesCochees)) {
|
if (! empty($codeventil) && ! empty($mesCasesCochees)) {
|
||||||
@ -146,11 +146,14 @@ if ($action == 'ventil' && ! empty($btn_ventil)) {
|
|||||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||||
$sql .= " WHERE rowid = " . $monId;
|
$sql .= " WHERE rowid = " . $monId;
|
||||||
|
|
||||||
|
$accountventilated = new AccountingAccount($db);
|
||||||
|
$accountventilated->fetch($monCompte, '');
|
||||||
|
|
||||||
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
|
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
|
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cpt ++;
|
$cpt ++;
|
||||||
@ -164,7 +167,6 @@ if ($action == 'ventil' && ! empty($btn_ventil)) {
|
|||||||
/*
|
/*
|
||||||
* Customer Invoice lines
|
* Customer Invoice lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||||
@ -227,9 +229,6 @@ if ($result) {
|
|||||||
|
|
||||||
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||||
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
|
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
|
||||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder);
|
|
||||||
print ' ';
|
|
||||||
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||||
print '<input type="hidden" name="action" value="ventil">';
|
print '<input type="hidden" name="action" value="ventil">';
|
||||||
@ -249,14 +248,13 @@ if ($result) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// We add search filter
|
// We add search filter
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_invoice" value="' . $search_invoice . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_invoice" value="' . $search_invoice . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '">%</td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="3" name="search_vat" value="' . $search_vat . '">%</td>';
|
||||||
print '<td align="right" class="liste_titre" colspan="4">';
|
print '<td align="right" class="liste_titre" colspan="4">';
|
||||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||||
print ' ';
|
print ' ';
|
||||||
@ -339,7 +337,7 @@ if ($result) {
|
|||||||
if ($objp->code_sell_l == $objp->code_sell_p) {
|
if ($objp->code_sell_l == $objp->code_sell_p) {
|
||||||
print $objp->code_sell_l;
|
print $objp->code_sell_l;
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("Purchase") . ' = ' . $objp->code_sell_l . '<br />' . $langs->trans("Sell") . ' = ' . $objp->code_sell_p;
|
print $langs->trans("Buy") . ' = ' . $objp->code_sell_l . '<br />' . $langs->trans("Sell") . ' = ' . $objp->code_sell_p;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -20,9 +20,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/supplier/list.php
|
* \file htdocs/accountancy/supplier/list.php
|
||||||
* \ingroup Accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Ventilation page from suppliers invoices
|
* \brief Ventilation page from suppliers invoices
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -128,11 +129,11 @@ print '<script type="text/javascript">
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil' && ! empty($btn_ventil)) {
|
if ($action == 'ventil' && ! empty($btn_ventil)) {
|
||||||
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||||
if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
|
if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
|
||||||
@ -151,11 +152,14 @@ if ($action == 'ventil' && ! empty($btn_ventil)) {
|
|||||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||||
$sql .= " WHERE rowid = " . $monId;
|
$sql .= " WHERE rowid = " . $monId;
|
||||||
|
|
||||||
|
$accountventilated = new AccountingAccount($db);
|
||||||
|
$accountventilated->fetch($monCompte, '');
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
|
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
|
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
|
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cpt ++;
|
$cpt ++;
|
||||||
@ -169,7 +173,6 @@ if ($action == 'ventil' && ! empty($btn_ventil)) {
|
|||||||
/*
|
/*
|
||||||
* Supplier Invoice Lines
|
* Supplier Invoice Lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||||
@ -255,7 +258,7 @@ if ($result) {
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '">%</td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="3" name="search_vat" value="' . $search_vat . '">%</td>';
|
||||||
print '<td class="liste_titre" align="center"> </td>';
|
print '<td class="liste_titre" align="center"> </td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td align="right" colspan="2" class="liste_titre">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user