From c8ccc456b0dc72eea04b43dc3fa6f6f4f11d0c99 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 18 Aug 2021 19:35:06 +0200 Subject: [PATCH] FIX : no need to have stock transfer ref in inventory code + need to change size of origintype field to be able to save StockTransfer@product/stock/stocktransfer --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ .../stock/stocktransfer/class/stocktransfer.class.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 43482d94fdd..697cb00e541 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -144,3 +144,5 @@ create table llx_stocktransfer_stocktransferline_extrafields ) ENGINE=innodb; ALTER TABLE llx_stocktransfer_stocktransferline_extrafields ADD INDEX idx_fk_object(fk_object); + +ALTER TABLE `llx_stock_mouvement` CHANGE `origintype` `origintype` VARCHAR(64) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index d34666b7cb2..dd55392b70d 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -184,7 +184,7 @@ class StockTransfer extends CommonObject global $conf, $langs; $this->db = $db; - $this->origin_type = 'StockTransfer@stocktransfer'; + $this->origin_type = 'StockTransfer@product/stock/stocktransfer'; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index aaf7f92701a..f57ffb8078f 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -510,28 +510,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Create an array for form $formquestion = array( 'text' => '', array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size'=>40), - array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => $object->ref.'_'.dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) + array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1); } elseif ($action == 'destockcancel') { // Destock confirmation cancel // Create an array for form $formquestion = array( 'text' => '', array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size'=>40), - array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => $object->ref.'_'.dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) + array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1); } elseif ($action == 'addstock') { // Addstock confirmation // Create an array for form $formquestion = array( 'text' => '', array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size'=>40), - array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => $object->ref.'_'.dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) + array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1); } elseif ($action == 'addstockcancel') { // Addstock confirmation cancel // Create an array for form $formquestion = array( 'text' => '', array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size'=>40), - array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => $object->ref.'_'.dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) + array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProductCancel'), '', 'confirm_addstockcancel', $formquestion, 'yes', 1); }