From 24748edb59cd5fa96f3305f519bf94299b83fee9 Mon Sep 17 00:00:00 2001 From: Vincent Maury Date: Wed, 19 Jun 2024 20:48:43 +0200 Subject: [PATCH] NEW : option to allow freezing qty in BOM service's line (#29990) * Some manufacturing needs to freeze quantities for services to : in printing for example, the machine needs time to be tuned before starting the manufacturing, and this time is not dependant of the number of pieces printed * No more option to allow qty freeze for BOM services, it's now always authorized * No more option to allow qty freeze for BOM services, it's now always authorized --- htdocs/bom/tpl/objectline_create.tpl.php | 7 +++++++ htdocs/bom/tpl/objectline_edit.tpl.php | 5 +++++ htdocs/bom/tpl/objectline_title.tpl.php | 4 ++++ htdocs/bom/tpl/objectline_view.tpl.php | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index f76695eb2c1..28e4bc8070c 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -8,6 +8,7 @@ * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2024 Vincent Maury * * 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 @@ -88,6 +89,8 @@ if ($nolinesbefore) { print '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . ''; } else { print '' . $form->textwithpicto($langs->trans('Unit'), '').''; + print '' .$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . ''; + if (isModEnabled('workstation')) { print '' . $form->textwithpicto($langs->trans('Workstation'), '') . ''; } @@ -185,6 +188,10 @@ if ($filtertype != 1) { print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 0, 0); print ''; + $coldisplay++; + print ''; + print ''; + $coldisplay++; print ''; print $formproduct->selectWorkstations('', 'idworkstations', 1); diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 2d456007c73..ff2525fa969 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -6,6 +6,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2024 Vincent Maury * * 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 @@ -158,6 +159,10 @@ if ($filtertype != 1) { print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0); print ''; + $coldisplay++; + print 'qty_frozen ? ' checked="checked"' : '')) . '>'; + print ''; + $coldisplay++; print ''; print $formproduct->selectWorkstations($line->fk_default_workstation, 'idworkstations', 1); diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 303e735a498..5475e2a73d2 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -90,6 +90,10 @@ if ($filtertype != 1) { } else { print '' . $form->textwithpicto($langs->trans('Unit'), '').''; + // Qty frozen + print '' .$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . ''; + + // Workstation if (isModEnabled('workstation')) { print '' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . ''; } diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 463a92d4ee8..3162d43f00f 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -176,6 +176,12 @@ if ($filtertype != 1) { print ''; + // Qty frozen + print ''; + $coldisplay++; + echo $line->qty_frozen ? yn($line->qty_frozen) : ''; + print ''; + // Work station if (isModEnabled('workstation')) { $workstation = new Workstation($object->db);