From b185cfb85f1875099643cfeee6c178b13974aa0c Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Thu, 6 Aug 2015 21:23:02 +0200 Subject: [PATCH] Update product account choose between code sell or code buy cleaning code need some tests --- htdocs/accountancy/admin/productaccount.php | 511 ++++++++++---------- 1 file changed, 247 insertions(+), 264 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 52c4a0d1862..8d79a81e8e3 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -2,9 +2,9 @@ /* * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Ari Elbaz (elarifr) - + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Ari Elbaz (elarifr) * * 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 @@ -21,15 +21,16 @@ */ /** - * \file htdocs/accountancy/admin/productaccount.php - * \ingroup Accounting Expert - * \brief Onglet de gestion de parametrages des ventilations + * \file htdocs/accountancy/admin/productaccount.php + * \ingroup Accounting Expert + * \brief Onglet de gestion de parametrages des ventilations */ require '../../main.inc.php'; // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; @@ -41,7 +42,7 @@ $langs->load("compta"); $langs->load("main"); $langs->load("accountancy"); -// Search & action GETPOST +//search & action GETPOST $action = GETPOST('action'); $codeventil_buy = GETPOST('codeventil_buy', 'array'); $codeventil_sell = GETPOST('codeventil_sell', 'array'); @@ -63,23 +64,98 @@ $pageprev = $page - 1; $pagenext = $page + 1; //bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed ! if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) { - $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; //} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { -// $limit = $conf->liste_limit; +// $limit = $conf->liste_limit; } else { - $limit = $conf->liste_limit; + $limit = $conf->liste_limit; } $offset = $limit * $page; if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; +// sales or purchase + +//$accounting_product_mode = defined('ACCOUNTING_PRODUCT_MODE')?ACCOUNTING_PRODUCT_MODE:'ACCOUNTANCY_SELL'; + +if ($action == 'update') { + if ($_POST["button"] == $langs->trans('Modify')) { + $error = 0; + + $accounting_product_modes = array( + 'ACCOUNTANCY_SELL', + 'ACCOUNTANCY_BUY' + ); + + $accounting_product_mode = GETPOST('accounting_product_mode','alpha'); + + if (in_array($accounting_product_mode,$accounting_product_modes)) { + + if (!dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } else { + $error++; + } +} +} + +if ($action == $langs->trans("Change_Account")) +{ + print '
' . $langs->trans("Processing") . '...
'; + if (! empty($codeventil) && ! empty($mesCasesCochees)) + { + print '
' . count($mesCasesCochees) . ' ' . $langs->trans("SelectedLines") . '
'; + + IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { + $mesCodesVentilChoisis = $codeventil_buy ; + } + IF ($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '') { + $mesCodesVentilChoisis = $codeventil_sell; + } + + $cpt = 0; + foreach ( $mesCasesCochees as $maLigneCochee ) + { + $maLigneCourante = explode("_", $maLigneCochee); + $monId = $maLigneCourante[0]; + $monNumLigne = $maLigneCourante[2]; + $monCompte = $mesCodesVentilChoisis[$monNumLigne]; + + $sql = " UPDATE " . MAIN_DB_PREFIX . "product"; + IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { + $sql .= " SET accountancy_code_buy = " . $monCompte; + } + IF ($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '') { + $sql .= " SET accountancy_code_sell = " . $monCompte; + } + $sql .= " WHERE rowid = " . $monId; + + dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG); + if ($db->query($sql)) + { + print '
' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '
'; + } else { + print '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '
' . $sql . '
'; + } + + $cpt ++; + } + } else { + print '
' . $langs->trans("AnyLineVentilate") . '
'; + } + print '
' . $langs->trans("EndProcessing") . '
'; +} + + + // Security check if ($user->societe_id > 0) - accessforbidden(); -// TODO after adding menu -// if (! $user->rights->accounting->ventilation->dispatch) -// accessforbidden(); + accessforbidden(); +//TODO after adding menu +//if (! $user->rights->accounting->ventilation->dispatch) +// accessforbidden(); $form = new FormVentilation($db); @@ -109,138 +185,51 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both //debug move header to top llxHeader('', $langs->trans("Accounts")); - -//TODO: modify to update all selected product with a sell account -if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) { -//print_r ($changeaccount); - $error = 0; - - $db->begin(); - - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; - $sql1 .= " SET p.accountancy_code_sell=" . $account_number_sell; - $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; - - dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1); -print_r ($sql1); - $resql1 = $db->query($sql1); - if (! $resql1) { - $error ++; - setEventMessage($db->lasterror(), 'errors'); - } - if (! $error) { - $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); - } else { - $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); - } -} - - -//TODO: modify to update all selected product with a buy account -if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) { - $error = 0; - - $db->begin(); - - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; - $sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy; - $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; -print_r ($sql1); - dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1); - $resql1 = $db->query($sql1); - if (! $resql1) { - $error ++; - setEventMessage($db->lasterror(), 'errors'); - } - if (! $error) { - $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); - } else { - $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); - } -} - /* * View */ -//DEBUG elarifr -//llxHeader('', $langs->trans("Accounts")); -//For updating account export -print ''; -//TODO For select box print ''; + $(function () { + $(\'#select-all\').click(function(event) { + // Iterate each checkbox + $(\':checkbox\').each(function() { + this.checked = true; + }); + }); + $(\'#unselect-all\').click(function(event) { + // Iterate each checkbox + $(\':checkbox\').each(function() { + this.checked = false; + }); + }); + }); + '; -/* - * Action - */ -//TODO -/* -if ($action == 'ventil') { - print '
' . $langs->trans("Processing") . '...
'; - if (! empty($codeventil_buy) && ! empty($mesCasesCochees)) { - if (! empty($codeventil_sell) && ! empty($mesCasesCochees)) { - } else { - print '
' . $langs->trans("AnyLineVentilate") . '
'; - } - print '
' . $langs->trans("EndProcessing") . '
'; -} -*/ -//do we really need to exclude old product not tosell / tobuy ? -//$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type , p.tosell , p.tobuy "; -//$sql .= " WHERE p.accountancy_code_sell IS NULL AND p.tosell = 1 OR p.accountancy_code_buy IS NULL AND p.tobuy = 1"; -//$sql .= " WHERE p.accountancy_code_sell ='' AND p.tosell = 1 OR p.accountancy_code_buy ='' AND p.tobuy = 1"; $sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type"; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p"; -//$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa"; $sql .= " WHERE ("; $sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; -//Search on correct pcg version + $pcgver = $conf->global->CHARTOFACCOUNTS; $sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; - //(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))"; + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; $sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; - //(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))"; + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; $sql .= ")"; //Add search filter like if (strlen(trim($search_ref))) { - $sql .= " AND (p.ref like '" . $search_ref . "%')"; + $sql .= " AND (p.ref like '" . $search_ref . "%')"; } if (strlen(trim($search_label))) { - $sql .= " AND (p.label like '" . $search_label . "%')"; + $sql .= " AND (p.label like '" . $search_label . "%')"; } if (strlen(trim($search_desc))) { - $sql .= " AND (p.description like '%" . $search_desc . "%')"; + $sql .= " AND (p.description like '%" . $search_desc . "%')"; } $sql.= $db->order($sortfield,$sortorder); @@ -249,176 +238,170 @@ $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num_lines = $db->num_rows($result); - $i = 0; + $num_lines = $db->num_rows($result); + $i = 0; /* - - * View */ - print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); + print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); - print '' . $langs->trans("DescProductAccountingAccount") . ' '; - print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"p.rowid","",$param,'',$sortfield,$sortorder); - print '  '; +print '
'; +print ''; +print ''; + +print ''; +print ''; +print ''; +print "\n"; +print ''; +print '\n"; +print ''; +print '\n"; + +print "
'.$langs->trans('OptionMode').''.$langs->trans('Description').'
'.$langs->trans('Accountancy_code_sell').''.nl2br($langs->trans('OptionModeProductSell')); +print "
'.$langs->trans('Accountancy_code_buy').''.nl2br($langs->trans('OptionModeProductBuy'))."
\n"; + +print '

'; + +print "
\n"; -//DEBUG -//print $sql; - print '
'; -// print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - print '
' . $langs->trans("ChangeAccount") . '
'; - print $langs->trans("Accountancy_code_buy") . ': ' . $form->select_account($account_number_buy, 'account_number_buy', 1,'', 0, 1); - print '
'; - print '
'; - print '
' . $langs->trans("ChangeAccount") . '
'; - print $langs->trans("Accountancy_code_sell") . ': ' . $form->select_account($account_number_sell, 'account_number_sell', 1, '', 0, 1); - print '
'; - print '
'; - //TODO change button - print ''; - print '
'; - print ''; - print ''; -// print ''; -// print ''; -// print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder); - print ''; - print ''; - print ''; - print ''; - print_liste_field_titre(''); -// print_liste_field_titre(''); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ' '; + print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"p.rowid","",$param,'',$sortfield,$sortorder); + print '  '; - print ''; - print ''; -// print ''; - print ''; - - $var = true; - - while ( $i < min($num_lines, 250) ) { - $obj = $db->fetch_object($result); - $var = ! $var; - - $compta_prodsell = $obj->accountancy_code_sell; - if (empty($compta_prodsell)) { - if ($obj->product_type == 0) { - $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodsell_id = $aarowid_prodsell; - } else { - $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodsell_id = $aarowid_servsell; - } - } - - $compta_prodbuy = $obj->accountancy_code_buy; - if (empty($compta_prodbuy)) { - if ($obj->product_type == 0) { - $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodbuy_id = $aarowid_prodbuy; - } else { - $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodbuy_id = $aarowid_servbuy; - } - } - - $product_static = new Product($db); - - print ""; -//debug -print ''; + print '
' . $langs->trans("Ref") . '' . $langs->trans("Label") . '' . $langs->trans("Description") . '' . $langs->trans("Accountancy_code_buy") . '' . $langs->trans("Accountancy_code_buy_suggest") . '' . $langs->trans("Accountancy_code_sell") . '' . $langs->trans("Accountancy_code_sell_suggest") . '' . $langs->trans("Ventilate") . '
/'.'
%%' . $langs->trans("DescProductAccountingAccount") . ' '; - print ''; -// print ''; - print ' '; - print ''; -// print ''; - print ' 
Compte Suggeres compta_prodbuy=' . $compta_prodbuy . ' -- compta_prodbuy_id' . $compta_prodbuy_id . '-- compta_prodsell:' . $compta_prodsell . '-- compta_prodsell_id' . $compta_prodsell_id . '
'; + print ''; + print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder); + IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { + print ''; + print ''; + } + else { + print ''; + print ''; + } + print_liste_field_titre(''); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ""; - print ""; - // Ref produit as link - $product_static->ref = $obj->ref; - $product_static->id = $obj->rowid; - $product_static->type = $obj->type; - print ''; + print ''; + print ''; + print ''; + + $var = true; + + while ( $i < min($num_lines, 250) ) { + $obj = $db->fetch_object($result); + $var = ! $var; + + $compta_prodsell = $obj->accountancy_code_sell; + + if ($obj->product_type == 0) { + $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodsell_id = $aarowid_prodsell; + } else { + $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodsell_id = $aarowid_servsell; + } + + + $compta_prodbuy = $obj->accountancy_code_buy; + + if ($obj->product_type == 0) { + $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodbuy_id = $aarowid_prodbuy; + } else { + $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodbuy_id = $aarowid_servbuy; + } + + + $product_static = new Product($db); + + print ""; - print ''; + print ""; + print ""; + // Ref produit as link + $product_static->ref = $obj->ref; + $product_static->id = $obj->rowid; + $product_static->type = $obj->type; + print ''; + print ''; //TODO ADJUST DESCRIPTION SIZE -// print ''; - //TODO: we shoul set a user defined value to adjust user square / wide screen size - $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; - print ''; +// print ''; + //TODO: we shoul set a user defined value to adjust user square / wide screen size + $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + print ''; - //acountingaccount buy - print ''; + //acountingaccount buy + + IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { + print ''; //TODO: replace by select -// print ''; - //TODO: we shoul set a user defined value to adjust user square / wide screen size - //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; - print ''; - - //acountingaccount sel - print ''; +// print ''; + //TODO: we shoul set a user defined value to adjust user square / wide screen size + //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print ''; + } + Else { + //acountingaccount sel + print ''; //TODO: replace by select - //TODO: we shoul set a user defined value to adjust user square / wide screen size - //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; - print ''; - //action edit & select box - print ''; - print ''; - //Checkbox select - print ''; + //TODO: we shoul set a user defined value to adjust user square / wide screen size + //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print ''; + } + + //Checkbox select + print ''; - print ""; - $i ++; - } + print ""; + $i ++; + } + print '
' . $langs->trans("Accountancy_code_buy") . '' . $langs->trans("Accountancy_code_buy_suggest") . '' . $langs->trans("Accountancy_code_sell") . '' . $langs->trans("Accountancy_code_sell_suggest") . '' . $langs->trans("Ventilate") . '
/'.'
%%
'; - if ($product_static->id) - print $product_static->getNomUrl(1); - else - print '- '; - print ' '; + print ''; + print ' '; + print ''; + print '
' . $obj->label . '
'; + if ($product_static->id) + print $product_static->getNomUrl(1); + else + print '- '; + print '' . $obj->label . '' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '' . $obj->accountancy_code_buy . '' . $obj->accountancy_code_buy . '' . $compta_prodbuy . ''; - print $form->select_account($compta_prodbuy_id, 'codeventil[]', 1); - print '' . $obj->accountancy_code_sell . '' . $compta_prodbuy . ''; + print $form->select_account($compta_prodbuy_id, 'codeventil[]', 1); + print '' . $obj->accountancy_code_sell . ''; - print $form->select_account($compta_prodsell_id, 'codeventil[]', 1); - print '' . $obj->rowid . ''; - print img_edit(); - print ''; - print ''; + print $form->select_account($compta_prodsell_id, 'codeventil[]', 1); + print ''; + print '
'; + print '
'; + print '
'; - $db->free($result); + + + $db->free($result); } else { -// print $db->error(); - dol_print_error($db); + dol_print_error($db); } -print ""; + llxFooter(); $db->close(); \ No newline at end of file