Skip to content
Snippets Groups Projects
Commit 8536841a authored by aspangaro's avatar aspangaro
Browse files

Fix: 3.9rc2 Show accountancy account ventilated instead of the orwid of the account.

parent 071ca6d1
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* \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'; ...@@ -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");
...@@ -128,7 +129,6 @@ print '<script type="text/javascript"> ...@@ -128,7 +129,6 @@ print '<script type="text/javascript">
/* /*
* 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)) { ...@@ -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)) { ...@@ -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) { ...@@ -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 '&nbsp;&nbsp;';
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) { ...@@ -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 '&nbsp;'; print '&nbsp;';
...@@ -339,7 +337,7 @@ if ($result) { ...@@ -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>';
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* \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'; ...@@ -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");
...@@ -129,10 +130,10 @@ print '<script type="text/javascript"> ...@@ -129,10 +130,10 @@ 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)) { ...@@ -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)) { ...@@ -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) { ...@@ -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">&nbsp;</td>'; print '<td class="liste_titre" align="center">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">'; print '<td align="right" colspan="2" class="liste_titre">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment