Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop

This commit is contained in:
Philippe GRAND 2018-09-01 14:27:53 +02:00
commit 17e349eba2
17 changed files with 141 additions and 65 deletions

View File

@ -209,7 +209,7 @@ if (empty($reshook))
}
else
{
setEventMessages($object->errors, $object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}

View File

@ -75,7 +75,7 @@ if ($action == 'dolibarr2ldap')
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
}
else {
setEventMessages($ldap->errors, $ldap->error, 'errors');
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
}

View File

@ -160,7 +160,7 @@ print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockManagementDecrease")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print " <td align=\"right\">&nbsp;</td>\n";
print '</tr>'."\n";
$found=0;
@ -262,7 +262,7 @@ print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockManagementIncrease")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print " <td align=\"right\">&nbsp;</td>\n";
print '</tr>'."\n";
$found=0;
@ -341,7 +341,7 @@ print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockAvailability")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print " <td align=\"right\">&nbsp;</td>\n";
print '</tr>'."\n";
@ -416,7 +416,7 @@ if ($virtualdiffersfromphysical)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help',$langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print " <td align=\"right\">&nbsp;</td>\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
@ -439,12 +439,12 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("Other")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print " <td align=\"right\">&nbsp;</td>\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td class="width100" align="right">';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
@ -456,7 +456,8 @@ print "</tr>\n";
print '<tr class="oddeven">';
print '<td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")).'</td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
print '</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -502,7 +503,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Inventory").'</td>'."\n";
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">&nbsp;</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
// Example with a yes / no select
print '<tr class="oddeven">';

View File

@ -40,7 +40,7 @@ if (! empty($conf->accounting->enabled)) {
}
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
$langs->loadLangs(array('compta', 'bills', 'banks'));
$id=GETPOST('id','int');
$action=GETPOST('action','aZ09');

View File

@ -1,11 +1,9 @@
<?php
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
@ -13,8 +11,9 @@
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* 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
@ -6144,6 +6143,9 @@ abstract class CommonObject
$e = 0;
foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label)
{
//Show only the key field in params
if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue;
$enabled = 1;
if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))
{

View File

@ -4984,7 +4984,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
*
* @param int $idprod Id of product or 0 if not a predefined product
* @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...)
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" order/invoice)
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice)
* @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)'
* @see get_product_localtax_for_country
*/
@ -5005,7 +5005,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours
{
if ($idprodfournprice > 0) // We want vat for product for a "supplier" order or invoice
if ($idprodfournprice > 0) // We want vat for product for a "supplier" object
{
$product->get_buyprice($idprodfournprice,0,0,0);
$ret=$product->vatrate_supplier;
@ -5030,7 +5030,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS))
{
// If vat of product for the country not found or not defined, we return the first higher vat of country.
$sql = "SELECT taux as vat_rate";
$sql = "SELECT t.taux as vat_rate, t.code as default_vat_code";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC";
@ -5043,6 +5043,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
if ($obj)
{
$ret=$obj->vat_rate;
if ($obj->default_vat_code) $ret.=' ('.$obj->default_vat_code.')';
}
$db->free($sql);
}

View File

@ -393,6 +393,48 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
// Web
if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
}
// Intra VAT
if (! empty($conf->global->MAIN_TVAINTRA_IN_SOURCE_ADDRESS))
{
if ($sourcecompany->tva_intra) $stringaddress.=($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($sourcecompany->tva_intra);
}
// Professionnal Ids
if (! empty($conf->global->MAIN_PROFID1_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof1))
{
$tmp=$outputlangs->transcountrynoentities("ProfId1",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof1);
}
if (! empty($conf->global->MAIN_PROFID2_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof2))
{
$tmp=$outputlangs->transcountrynoentities("ProfId2",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof2);
}
if (! empty($conf->global->MAIN_PROFID3_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof3))
{
$tmp=$outputlangs->transcountrynoentities("ProfId3",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof3);
}
if (! empty($conf->global->MAIN_PROFID4_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof4))
{
$tmp=$outputlangs->transcountrynoentities("ProfId4",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof4);
}
if (! empty($conf->global->MAIN_PROFID5_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof5))
{
$tmp=$outputlangs->transcountrynoentities("ProfId5",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof5);
}
if (! empty($conf->global->MAIN_PROFID6_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof6))
{
$tmp=$outputlangs->transcountrynoentities("ProfId6",$sourcecompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof6);
}
}
if ($mode == 'target' || preg_match('/targetwithdetails/',$mode))

View File

@ -317,7 +317,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
$subordinatesids = $user->getAllChildIds();
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
$this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : '';
}
$this->export_sql_end[$r] .=')';
}
@ -368,7 +368,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
$subordinatesids = $user->getAllChildIds();
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
$this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : '';
}
$this->export_sql_end[$r] .=')';
}

View File

@ -137,7 +137,7 @@ class InterfaceStripe
$servicestatus = 1;
}
// If customer is linked to Strip, we update/delete Stripe too
// If customer is linked to Stripe, we update/delete Stripe too
if ($action == 'COMPANY_MODIFY') {
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
@ -173,7 +173,8 @@ class InterfaceStripe
$stripeacc = $stripe->getStripeAccount($service); // No need of network access for this
$customer = $stripe->customerStripe($object, $stripeacc, $servicestatus);
if ($customer) {
if ($customer)
{
$customer->delete();
}
@ -182,7 +183,7 @@ class InterfaceStripe
$this->db->query($sql);
}
// If payment mode is linked to Strip, we update/delete Stripe too
// If payment mode is linked to Stripee, we update/delete Stripe too
if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') {
// For creation of credit card, we do not create in Stripe automatically

View File

@ -513,9 +513,9 @@ if ($id > 0 || ! empty($ref)) {
print '<td>' . $langs->trans("Description") . '</td>';
if (! empty($conf->productbatch->enabled))
{
print '<td>' . $langs->trans("batch_number") . '</td>';
print '<td>' . $langs->trans("EatByDate") . '</td>';
print '<td>' . $langs->trans("SellByDate") . '</td>';
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
}
else
{
@ -568,16 +568,21 @@ if ($id > 0 || ! empty($ref)) {
if (! empty($conf->productbatch->enabled)) {
if ($objp->tobatch) {
print '<td colspan="4">';
print '<td>';
print $linktoprod;
print "</td>";
print '<td class="dispatch_batch_number"></td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
} else {
print '<td>';
print $linktoprod;
print "</td>";
print '<td colspan="3">';
print '<td class="dispatch_batch_number">';
print $langs->trans("ProductDoesNotUseBatchSerial");
print '</td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
}
} else {
print '<td colspan="4">';
@ -639,6 +644,7 @@ if ($id > 0 || ! empty($ref)) {
print '</td>';
print '<td colspan="3">&nbsp</td>'; // Supplier ref + Qty ordered + qty already dispatched
} else {
$type = 'dispatch';
print '<td align="right">';
print '</td>'; // Qty to dispatch
@ -713,21 +719,27 @@ if ($id > 0 || ! empty($ref)) {
if ($nbproduct)
{
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
$checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
print '<br><div class="center">';
print $langs->trans("Comment") . ' : ';
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
// print ' / '.$object->ref_supplier; // Not yet available
print '" class="flat"><br>';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if (empty($reshook))
{
print $langs->trans("Comment").' : ';
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
// print ' / '.$object->ref_supplier; // Not yet available
print '" class="flat"><br>';
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"';
if (count($listwarehouses) <= 0)
print ' disabled';
print '>';
print '<br><input type="submit" class="button" value="'.$langs->trans("DispatchVerb").'"';
if (count($listwarehouses) <= 0)
print ' disabled';
print '>';
}
print '</div>';
}
@ -767,14 +779,14 @@ if ($id > 0 || ! empty($ref)) {
print load_fiche_titre($langs->trans("ReceivingForSameOrder"));
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
print '<table id="dispatch_received_products" class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Product") . '</td>';
if (! empty($conf->productbatch->enabled)) {
print '<td>' . $langs->trans("batch_number") . '</td>';
print '<td>' . $langs->trans("EatByDate") . '</td>';
print '<td>' . $langs->trans("SellByDate") . '</td>';
print '<td class="dispatch_batch_number_title">' . $langs->trans("batch_number") . '</td>';
print '<td class="dispatch_dluo_title">' . $langs->trans("EatByDate") . '</td>';
print '<td class="dispatch_dlc_title">' . $langs->trans("SellByDate") . '</td>';
}
print '<td align="right">' . $langs->trans("QtyDispatched") . '</td>';
print '<td></td>';
@ -797,9 +809,9 @@ if ($id > 0 || ! empty($ref)) {
print "</td>\n";
if (! empty($conf->productbatch->enabled)) {
print '<td>' . $objp->batch . '</td>';
print '<td>' . dol_print_date($db->jdate($objp->eatby), 'day') . '</td>';
print '<td>' . dol_print_date($db->jdate($objp->sellby), 'day') . '</td>';
print '<td class="dispatch_batch_number">' . $objp->batch . '</td>';
print '<td class="dispatch_dluo">' . dol_print_date($db->jdate($objp->eatby), 'day') . '</td>';
print '<td class="dispatch_dlc">' . dol_print_date($db->jdate($objp->sellby), 'day') . '</td>';
}
// Qty

View File

@ -284,6 +284,13 @@ CREATE TABLE llx_ticket_extrafields
import_key varchar(14)
)ENGINE=innodb;
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
-- Create dictionaries tables for ticket

View File

@ -100,7 +100,7 @@ AgendaUrlOptions3=<b>logina=%s</b> to restrict output to actions owned by a user
AgendaUrlOptionsNotAdmin=<b>logina=!%s</b> to restrict output to actions not owned by user <b>%s</b>.
AgendaUrlOptions4=<b>logint=%s</b> to restrict output to actions assigned to user <b>%s</b> (owner and others).
AgendaUrlOptionsProject=<b>project=__PROJECT_ID__</b> to restrict output to actions linked to project <b>__PROJECT_ID__</b>.
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> to exclude automatic event.
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> to exclude automatic events.
AgendaShowBirthdayEvents=Show birthdays of contacts
AgendaHideBirthdayEvents=Hide birthdays of contacts
Busy=Busy

View File

@ -50,4 +50,4 @@ BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs modu
BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log).
OnlyNonValid=Non-valid
TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters.
RestrictYearToExport=Restrict month / year to export
RestrictYearToExport=Restrict month / year to export

View File

@ -181,6 +181,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'LINEORDER_SUPPLIER_DISPATCH':
//case 'LINEORDER_SUPPLIER_CREATE':
//case 'LINEORDER_SUPPLIER_UPDATE':
//case 'LINEORDER_SUPPLIER_DELETE':
// Proposals
//case 'PROPAL_CREATE':

View File

@ -1682,10 +1682,13 @@ else
print '</td><td colspan="2">';
if (! empty($conf->accounting->enabled))
{
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$object->accountancy_code_sell,1);
if (! empty($object->accountancy_code_sell))
{
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$object->accountancy_code_sell,1);
print $accountingaccount->getNomUrl(0,1,1,'',1);
print $accountingaccount->getNomUrl(0,1,1,'',1);
}
} else {
print $object->accountancy_code_sell;
}
@ -1701,10 +1704,13 @@ else
print '</td><td colspan="2">';
if (! empty($conf->accounting->enabled))
{
$accountingaccount2 = new AccountingAccount($db);
$accountingaccount2->fetch('',$object->accountancy_code_sell_intra,1);
if (! empty($object->accountancy_code_sell_intra))
{
$accountingaccount2 = new AccountingAccount($db);
$accountingaccount2->fetch('',$object->accountancy_code_sell_intra,1);
print $accountingaccount2->getNomUrl(0,1,1,'',1);
print $accountingaccount2->getNomUrl(0,1,1,'',1);
}
} else {
print $object->accountancy_code_sell_intra;
}
@ -1717,10 +1723,13 @@ else
print '</td><td colspan="2">';
if (! empty($conf->accounting->enabled))
{
$accountingaccount3 = new AccountingAccount($db);
$accountingaccount3->fetch('',$object->accountancy_code_sell_export,1);
if (! empty($object->accountancy_code_sell_export))
{
$accountingaccount3 = new AccountingAccount($db);
$accountingaccount3->fetch('',$object->accountancy_code_sell_export,1);
print $accountingaccount3->getNomUrl(0,1,1,'',1);
print $accountingaccount3->getNomUrl(0,1,1,'',1);
}
} else {
print $object->accountancy_code_sell_export;
}
@ -1733,10 +1742,13 @@ else
print '</td><td colspan="2">';
if (! empty($conf->accounting->enabled))
{
$accountingaccount4 = new AccountingAccount($db);
$accountingaccount4->fetch('',$object->accountancy_code_buy,1);
if (! empty($object->accountancy_code_buy))
{
$accountingaccount4 = new AccountingAccount($db);
$accountingaccount4->fetch('',$object->accountancy_code_buy,1);
print $accountingaccount4->getNomUrl(0,1,1,'',1);
print $accountingaccount4->getNomUrl(0,1,1,'',1);
}
} else {
print $object->accountancy_code_buy;
}

View File

@ -4430,8 +4430,6 @@ class Product extends CommonObject
$langs->load('products');
//$this->db->begin();
$label_type = 'label';
if ($type == 'short')

View File

@ -31,9 +31,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logg
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
// TODO This should be useless. Because entity must be retreive from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : (! empty($_GET['e']) ? (int) $_GET['e'] : (! empty($_POST['e']) ? (int) $_POST['e'] : 1))));
if (is_numeric($entity)) define("DOLENTITY", $entity);
require '../../main.inc.php';