2
0
forked from Wavyzz/dolibarr

Code fixes

This commit is contained in:
Juanjo Menent
2015-05-09 14:23:26 +02:00
parent ce1769d2c5
commit 97ad7ca88b
3 changed files with 7 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 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
@@ -107,11 +108,11 @@ if ($conf->use_javascript_ajax)
} }
else else
{ {
if($conf->global->CATEGORIE_RECURSIV_ADD == 0) if (empty($conf->global->CATEGORIE_RECURSIV_ADD))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_CATEGORIE_RECURSIV_ADD">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_CATEGORIE_RECURSIV_ADD">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
else if($conf->global->CATEGORIE_RECURSIV_ADD == 1) else
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_CATEGORIE_RECURSIV_ADD">'.img_picto($langs->trans("Enabled"),'on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_CATEGORIE_RECURSIV_ADD">'.img_picto($langs->trans("Enabled"),'on').'</a>';
} }

View File

@@ -1252,7 +1252,7 @@ class Commande extends CommonOrder
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
$product_type=$product->type; $product_type=$product->type;
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{ {
$this->error=$langs->trans('ErrorStockIsNotEnough'); $this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);

View File

@@ -2179,7 +2179,7 @@ class Facture extends CommonInvoice
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
$product_type=$product->type; $product_type=$product->type;
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough'); $this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback(); $this->db->rollback();
return -3; return -3;