$info_bits = 0; if (preg_match('/\\*/', $vat_rate)) { $info_bits |= 0x1; } // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); // Add buying price $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields foreach ($extralabelsline as $key => $value) { unset($_POST["options_" . $key]); } } // Define special_code for special lines $special_code = GETPOST('special_code'); if (!GETPOST('qty')) { $special_code = 3; } $line = new FactureLigne($db); $line->fetch(GETPOST('lineid')); $percent = $line->get_prev_progress();
if ($search_type == '') { $search_type = '1'; } } if ($type === '0') { $contextpage = 'productlist'; if ($search_type == '') { $search_type = '0'; } } // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('product'); $search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_'); if (empty($action)) { $action = 'list'; } // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $canvas = GETPOST("canvas"); $objcanvas = null; if (!empty($canvas)) { require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php'; $objcanvas = new Canvas($db, $action); $objcanvas->getCanvas('product', 'list', $canvas); } // Security check if ($type == '0') { $result = restrictedArea($user, 'produit', '', '', '', '', '', $objcanvas); } else {
$j++; $stockLocation = "ent1" . $i . "_" . $j; $qty = "qtyl" . $i . '_' . $j; } } else { var_dump($_POST); var_dump($batch); //shipment line for product with no batch management and no multiple stock location if (GETPOST($qty, 'int') > 0) { $totalqty += GETPOST($qty, 'int'); } } } // Extrafields $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields foreach ($extralabelsline as $key => $value) { unset($_POST["options_" . $key]); } } } //var_dump($batch_line[2]); if ($totalqty > 0) { //var_dump($_POST);exit; for ($i = 0; $i < $num; $i++) { $qty = "qtyl" . $i; if (!isset($batch_line[$i])) { // not batch mode