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) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8fcc2af6634..1a9139cf9a1 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-2019 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 * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -1020,21 +1021,12 @@ 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) { print '' . $langs->trans("Duration") . '  '; print ''.$langs->trans("Minute").' '; - print ''.$langs->trans("Hour").' '; + print ''.$langs->trans("Hour").' '; print ''.$langs->trans("Day").' '; print ''.$langs->trans("Week").' '; print ''.$langs->trans("Month").' '; @@ -1042,8 +1034,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','alpha'), 1); + print ''; + // Weight print ''.$langs->trans("Weight").''; print ''; @@ -1375,7 +1373,7 @@ else // Public Url print ''.$langs->trans("PublicUrl").''; - print ''; + print ''; print ''; // Stock @@ -1403,22 +1401,13 @@ 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 print ''.$langs->trans("Duration").''; print '  '; print 'duration_unit=='i'?' checked':'').'>'.$langs->trans("Minute"); - print '  '; + print '  '; print 'duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour"); print '  '; print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); @@ -1431,7 +1420,13 @@ else print ''; } 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 ' '; @@ -1439,13 +1434,13 @@ else print ''; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - // Length - print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; - print 'x'; - print 'x'; - print ' '; - print $formproduct->select_measuring_units("size_units", "size", $object->length_units); - print ''; + // Length + print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; + print 'x'; + print 'x'; + print ' '; + print $formproduct->select_measuring_units("size_units", "size", $object->length_units); + print ''; } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { @@ -1823,14 +1818,6 @@ else print '
'; print ''; - // Nature - if($object->type!= Product::TYPE_SERVICE) - { - print ''; - } - if ($object->isService()) { // Duration @@ -1849,6 +1836,10 @@ else } else { + // Nature + print ''; // Weight print '';
'.$langs->trans("Nature").''; - print $object->getLibFinished(); - print '
'.$langs->trans("Nature").''; + print $object->getLibFinished(); + print '
'.$langs->trans("Weight").''; if ($object->weight != '') @@ -1920,7 +1911,7 @@ else } // Custom code - if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) + if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { print '
'.$langs->trans("CustomCode").''.$object->customcode.'