From c43515f4847f54bf362474337de93a51d67db8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Fri, 15 Sep 2017 17:11:03 +0200 Subject: [PATCH 1/2] Fix: Custom info view in services In services view, custom info should be hide. Also, Nature field is moved and grouped with product fields --- htdocs/product/card.php | 76 ++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 54afc80691f..6449ded2f93 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1,20 +1,21 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Auguria SARL - * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2013-2016 Marcos García - * Copyright (C) 2012-2013 Cédric Salvador - * Copyright (C) 2011-2017 Alexandre Spangaro - * Copyright (C) 2014 Cédric Gross - * Copyright (C) 2014-2015 Ferran Marcet - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2016 Meziane Sof + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2006 Auguria SARL + * Copyright (C) 2010-2015 Juanjo Menent + * Copyright (C) 2013-2016 Marcos García + * Copyright (C) 2012-2013 Cédric Salvador + * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2014 Cédric Gross + * Copyright (C) 2014-2015 Ferran Marcet + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2016 Meziane Sof + * Copyright (C) 2017 Josep Lluís Amador * * 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 @@ -1004,15 +1005,6 @@ else print ''; } - // Nature - if ($type != 1) - { - print ''.$langs->trans("Nature").''; - $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); - print $form->selectarray('finished',$statutarray,GETPOST('finished'),1); - print ''; - } - // Duration if ($type == 1) { @@ -1025,8 +1017,14 @@ else print ''; } - if ($type != 1) // Le poids et le volume ne concerne que les produits et pas les services + if ($type != 1) // Nature, Weight and volume only applies to products and not to services { + // Nature + print ''.$langs->trans("Nature").''; + $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); + print $form->selectarray('finished',$statutarray,GETPOST('finished'),1); + print ''; + // Weight print ''.$langs->trans("Weight").''; print ''; @@ -1318,15 +1316,6 @@ else print ''; }*/ - // Nature - if($object->type!= Product::TYPE_SERVICE) - { - print ''.$langs->trans("Nature").''; - $statutarray=array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); - print $form->selectarray('finished',$statutarray,$object->finished); - print ''; - } - if ($object->isService()) { // Duration @@ -1346,6 +1335,11 @@ else } else { + // Nature + print ''.$langs->trans("Nature").''; + $statutarray=array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); + print $form->selectarray('finished',$statutarray,$object->finished); + print ''; // Weight print ''.$langs->trans("Weight").''; print ' '; @@ -1659,14 +1653,6 @@ else print '
'; print ''; - // Nature - if($object->type!= Product::TYPE_SERVICE) - { - print ''; - } - if ($object->isService()) { // Duration @@ -1685,6 +1671,10 @@ else } else { + // Nature + print ''; // Weight print ''; From 4822a2d396eb89bc9c3502b8e1a3a4fab9280944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Mar 2019 09:51:57 +0100 Subject: [PATCH 2/2] Update accountancycategory.class.php --- .../class/accountancycategory.class.php | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 1f30bcfcef3..523fba7acda 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -63,7 +63,7 @@ class AccountancyCategory // extends CommonObject public $id; /** - * @var mixed Sample property 1 + * @var string Accountancy code */ public $code; @@ -73,7 +73,7 @@ class AccountancyCategory // extends CommonObject public $label; /** - * @var mixed Sample property 1 + * @var string Accountancy range account */ public $range_account; @@ -83,37 +83,37 @@ class AccountancyCategory // extends CommonObject public $sens; /** - * @var mixed Sample property 1 + * @var int Category type of accountancy */ public $category_type; /** - * @var mixed Sample property 1 + * @var string Formula */ public $formula; /** - * @var mixed Sample property 1 + * @var int Position */ public $position; /** - * @var mixed Sample property 1 + * @var int country id */ public $fk_country; /** - * @var mixed Sample property 1 + * @var int Is active */ public $active; /** - * @var mixed Sample property 1 + * @var array Lines cptbk */ public $lines_cptbk; /** - * @var mixed Sample property 1 + * @var array Lines display */ public $lines_display; @@ -151,12 +151,12 @@ class AccountancyCategory // extends CommonObject if (isset($this->code)) $this->code=trim($this->code); if (isset($this->label)) $this->label=trim($this->label); if (isset($this->range_account)) $this->range_account=trim($this->range_account); - if (isset($this->sens)) $this->sens=trim($this->sens); - if (isset($this->category_type)) $this->category_type=trim($this->category_type); + if (isset($this->sens)) $this->sens = (int) $this->sens; + if (isset($this->category_type)) $this->category_type = (int) $this->category_type; if (isset($this->formula)) $this->formula=trim($this->formula); - if (isset($this->position)) $this->position=trim($this->position); - if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country); - if (isset($this->active)) $this->active=trim($this->active); + if (isset($this->position)) $this->position = (int) $this->position; + if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country; + if (isset($this->active)) $this->active = (int) $this->active; // Check parameters // Put here code to add control on parameters values @@ -308,12 +308,12 @@ class AccountancyCategory // extends CommonObject if (isset($this->code)) $this->code=trim($this->code); if (isset($this->label)) $this->label=trim($this->label); if (isset($this->range_account)) $this->range_account=trim($this->range_account); - if (isset($this->sens)) $this->sens=trim($this->sens); - if (isset($this->category_type)) $this->category_type=trim($this->category_type); + if (isset($this->sens)) $this->sens = (int) $this->sens; + if (isset($this->category_type)) $this->category_type = (int) $this->category_type; if (isset($this->formula)) $this->formula=trim($this->formula); - if (isset($this->position)) $this->position=trim($this->position); - if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country); - if (isset($this->active)) $this->active=trim($this->active); + if (isset($this->position)) $this->position = (int) $this->position; + if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country; + if (isset($this->active)) $this->active = (int) $this->active; // Check parameters @@ -338,8 +338,8 @@ class AccountancyCategory // extends CommonObject $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - if (! $error) - { + //if (! $error) + //{ // Uncomment this and change MYOBJECT to your own tag if you // want this action call a trigger. //if (! $notrigger) @@ -351,7 +351,7 @@ class AccountancyCategory // extends CommonObject // if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers //} - } + //} // Commit or rollback if ($error) @@ -393,8 +393,8 @@ class AccountancyCategory // extends CommonObject $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - if (! $error) - { + //if (! $error) + //{ // Uncomment this and change MYOBJECT to your own tag if you // want this action call a trigger. //if (! $notrigger) @@ -406,7 +406,7 @@ class AccountancyCategory // extends CommonObject // if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers //} - } + //} // Commit or rollback if ($error)
'.$langs->trans("Nature").''; - print $object->getLibFinished(); - print '
'.$langs->trans("Nature").''; + print $object->getLibFinished(); + print '
'.$langs->trans("Weight").''; if ($object->weight != '') @@ -1756,7 +1746,7 @@ else } // Custom code - if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) + if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { print '
'.$langs->trans("CustomCode").''.$object->customcode.'