diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ef144c10e0d..22a8af0d270 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,6 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Thibault FOUCART * * 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 @@ -297,16 +298,18 @@ if (empty($reshook)) $object->duration_unit = $duration_unit; $object->fk_default_warehouse = GETPOST('fk_default_warehouse'); $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0; - $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; + $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit $object->weight = GETPOST('weight'); $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->length = GETPOST('size'); $object->length_units = GETPOST('size_units'); // This is not the fk_unit but the power of unit $object->width = GETPOST('sizewidth'); $object->height = GETPOST('sizeheight'); - $object->surface = GETPOST('surface'); - $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit + $object->surface = GETPOST('surface'); + $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit $object->volume = GETPOST('volume'); $object->volume_units = GETPOST('volume_units'); // This is not the fk_unit but the power of unit $object->finished = GETPOST('finished', 'alpha'); @@ -403,6 +406,8 @@ if (empty($reshook)) $object->duration_unit = GETPOST('duration_unit', 'alpha'); $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit $object->weight = GETPOST('weight'); $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->length = GETPOST('size'); @@ -1053,13 +1058,20 @@ else $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + print ''; + print $formproduct->selectMeasuringUnits("net_measure_units", "net_measure", GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); + print ''; - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; print ''; print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units')?GETPOST('weight_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); print ''; - // Length + + // Brut Length if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; @@ -1071,7 +1083,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; print ''; print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units')?GETPOST('surface_units', 'alpha'):'0', 0, 2); @@ -1079,7 +1091,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; print ''; print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units')?GETPOST('volume_units', 'alpha'):'0', 0, 2); @@ -1426,15 +1438,22 @@ else $statutarray=array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); print $form->selectarray('finished', $statutarray, $object->finished); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + print ' '; + print $form->selectUnits($object->net_measure_units, 'units'); + //print $formproduct->selectMeasuringUnits("net_measure_units", "weight", $object->net_measure_units, 0, 2); + print ''; - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; print ' '; print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2); print ''; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - // Length + // Brut Length print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; print 'x'; print 'x'; @@ -1444,7 +1463,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; print ' '; print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2); @@ -1452,7 +1471,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; print ' '; print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2); @@ -1833,8 +1852,19 @@ else print ''.$langs->trans("Nature").''; print $object->getLibFinished(); print ''; + + // Net Measure + print ''.$langs->trans("NetMeasure").''; + if ($object->net_measure != '') + { + print $object->net_measure." ".measuring_units_string(0, "weight", $object->net_measure_units); + } + else + { + print ' '; + } - // Weight + // Brut Weight print ''.$langs->trans("Weight").''; if ($object->weight != '') { @@ -1847,7 +1877,7 @@ else print "\n"; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - // Length + // Brut Length print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; if ($object->length != '' || $object->width != '' || $object->height != '') { @@ -1864,7 +1894,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { - // Surface + // Brut Surface print ''.$langs->trans("Surface").''; if ($object->surface != '') { @@ -1878,7 +1908,7 @@ else } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { - // Volume + // Brut Volume print ''.$langs->trans("Volume").''; if ($object->volume != '') {