$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print "</td></tr>"; // Note Private if ($object->note_private && !$user->societe_id) { print '<tr><td>' . $langs->trans("NotePrivate") . '</td>'; print '<td colspan="3">'; $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print "</td></tr>"; } // Weight print '<tr><td>'; print $langs->trans("Weight"); print '</td><td width="90px"><input name="weight" size="5" value="' . GETPOST('weight', 'int') . '"></td><td>'; print $formproduct->select_measuring_units("weight_units", "weight", GETPOST('weight_units', 'int')); print '</td></tr><tr><td>'; print $langs->trans("Width"); print ' </td><td><input name="sizeW" size="5" value="' . GETPOST('sizeW', 'int') . '"></td><td rowspan="3">'; print $formproduct->select_measuring_units("size_units", "size"); print '</td></tr><tr><td>'; print $langs->trans("Height"); print '</td><td><input name="sizeH" size="5" value="' . GETPOST('sizeH', 'int') . '"></td>'; print '</tr><tr><td>'; print $langs->trans("Depth"); print '</td><td><input name="sizeS" size="5" value="' . GETPOST('sizeS', 'int') . '"></td>'; print '</tr>'; // Delivery method print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>"; print '<td colspan="3">'; $expe->fetch_delivery_methods();
} // Duration if ($type == 1) { print '<tr><td>' . $langs->trans("Duration") . '</td><td colspan="3"><input name="duration_value" size="6" maxlength="5" value="' . $duration_value . '"> '; print '<input name="duration_unit" type="radio" value="h">' . $langs->trans("Hour") . ' '; print '<input name="duration_unit" type="radio" value="d">' . $langs->trans("Day") . ' '; print '<input name="duration_unit" type="radio" value="w">' . $langs->trans("Week") . ' '; print '<input name="duration_unit" type="radio" value="m">' . $langs->trans("Month") . ' '; print '<input name="duration_unit" type="radio" value="y">' . $langs->trans("Year") . ' '; print '</td></tr>'; } if ($type != 1) { // Weight print '<tr><td>' . $langs->trans("Weight") . '</td><td colspan="3">'; print '<input name="weight" size="4" value="' . GETPOST('weight') . '">'; print $formproduct->select_measuring_units("weight_units", "weight"); print '</td></tr>'; // Length print '<tr><td>' . $langs->trans("Length") . '</td><td colspan="3">'; print '<input name="size" size="4" value="' . GETPOST('size') . '">'; print $formproduct->select_measuring_units("size_units", "size"); print '</td></tr>'; // Surface print '<tr><td>' . $langs->trans("Surface") . '</td><td colspan="3">'; print '<input name="surface" size="4" value="' . GETPOST('surface') . '">'; print $formproduct->select_measuring_units("surface_units", "surface"); print '</td></tr>'; // Volume print '<tr><td>' . $langs->trans("Volume") . '</td><td colspan="3">'; print '<input name="volume" size="4" value="' . GETPOST('volume') . '">'; print $formproduct->select_measuring_units("volume_units", "volume");
print '<td colspan="3">'; if (!empty($object->fk_delivery_address)) { $html->form_address($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_delivery_address, $_GET['socid'], 'none', 'commande', $object->id); } print '</td></tr>' . "\n"; } // Note if ($object->note && !$user->societe_id) { print '<tr><td>' . $langs->trans("NotePrivate") . '</td>'; print '<td colspan="3">' . nl2br($object->note) . "</td></tr>"; } // Weight print '<tr><td>'; print $langs->trans("Weight"); print '</td><td><input name="weight" size="4" value="' . $_POST["weight"] . '"></td><td>'; print $formproduct->select_measuring_units("weight_units", "weight", $_POST["weight_units"]); print '</td></tr><tr><td>'; print $langs->trans("Width"); print ' </td><td><input name="sizeW" size="4" value="' . $_POST["sizeW"] . '"></td><td rowspan="3">'; print $formproduct->select_measuring_units("size_units", "size"); print '</td></tr><tr><td>'; print $langs->trans("Height"); print '</td><td><input name="sizeH" size="4" value="' . $_POST["sizeH"] . '"></td>'; print '</tr><tr><td>'; print $langs->trans("Depth"); print '</td><td><input name="sizeS" size="4" value="' . $_POST["sizeS"] . '"></td>'; print '</tr>'; // Delivery method print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>"; print '<td colspan="3">'; $expe->fetch_delivery_methods();
function tabImport(&$TImport, &$commande) { global $langs, $db, $conf; $PDOdb = new TPDOdb(); $form = new TFormCore(); $formDoli = new Form($db); $formproduct = new FormProduct($db); if ($commande->statut >= 5 || $commande->statut <= 2) { $form->type_aff = "view"; } if ($commande->statut <= 2 || $commande->statut >= 6) { print $langs->trans("OrderStatusNotReadyToDispatch"); } _show_product_ventil($TImport, $commande, $form); print count($TImport) . ' équipement(s) dans votre réception'; ?> <script type="text/javascript"> $(document).ready(function() { $("#dispatchAsset").change(function() { $("#actionVentilation").addClass("error").html("<?php echo $langs->trans('SaveBeforeVentil'); ?> "); }); }); </script> <table width="100%" class="border" id="dispatchAsset"> <tr class="liste_titre"> <td>Produit</td> <td>Numéro de Série</td> <td>Numéro de Lot</td> <td><?php echo $langs->trans('Warehouse'); ?> </td> <?php if ($conf->global->ASSET_SHOW_DLUO) { ?> <td>DLUO</td> <?php } if (empty($conf->global->DISPATCH_USE_ONLY_UNIT_ASSET_RECEPTION)) { ?> <td>Quantité</td> <?php if (!empty($conf->global->DISPATCH_SHOW_UNIT_RECEPTION)) { echo '<td>Unité</td>'; } } if ($conf->global->clinomadic->enabled) { ?> <td>IMEI</td> <td>Firmware</td> <?php } ?> <td> </td> </tr> <?php $prod = new Product($db); $warning_asset = false; if (is_array($TImport)) { foreach ($TImport as $k => $line) { if ($prod->id == 0 || $line['ref'] != $prod->ref) { if (empty($line['fk_product']) === false) { $prod->fetch($line['fk_product']); } else { if (empty($line['ref']) === false) { $prod->fetch('', $line['ref']); } else { continue; } } } ?> <tr> <td><?php echo $prod->getNomUrl(1) . $form->hidden('TLine[' . $k . '][fk_product]', $prod->id) . $form->hidden('TLine[' . $k . '][ref]', $prod->ref) . " - " . $prod->label; ?> </td> <td><?php echo $form->texte('', 'TLine[' . $k . '][numserie]', $line['numserie'], 30); $asset = new TAsset(); if (empty($line['numserie'])) { echo img_picto($langs->trans('SerialNumberNeeded'), 'warning.png'); $warning_asset = true; } else { if ($asset->loadReference($PDOdb, $line['numserie'])) { echo '<a href="' . dol_buildpath('/asset/fiche.php?id=' . $asset->getId(), 1) . '">' . img_picto('Equipement lié à cet import', 'info.png') . '</a>'; } else { echo img_picto('Aucun équipement créé en Base', 'warning.png'); $warning_asset = true; } } echo $form->hidden('TLine[' . $k . '][commande_fournisseurdet_asset]', $line['commande_fournisseurdet_asset'], 30); ?> </td> <td><?php echo $form->texte('', 'TLine[' . $k . '][lot_number]', $line['lot_number'], 30); ?> </td> <td rel="entrepotChild" fk_product="<?php echo $prod->id; ?> "><?php $formproduct = new FormProduct($db); $formproduct->loadWarehouses(); if (count($formproduct->cache_warehouses) > 1) { print $formproduct->selectWarehouses($line['fk_warehouse'], 'TLine[' . $k . '][entrepot]', '', 1, 0, $prod->id, '', 0, 1); } elseif (count($formproduct->cache_warehouses) == 1) { print $formproduct->selectWarehouses($line['fk_warehouse'], 'TLine[' . $k . '][entrepot]', '', 0, 0, $prod->id, '', 0, 1); } else { print $langs->trans("NoWarehouseDefined"); } ?> </td> <?php if (!empty($conf->global->ASSET_SHOW_DLUO)) { ?> <td><?php echo $form->calendrier('', 'TLine[' . $k . '][dluo]', date('d/m/Y', strtotime($line['dluo']))); ?> </td> <?php } if (empty($conf->global->DISPATCH_USE_ONLY_UNIT_ASSET_RECEPTION)) { ?> <td><?php echo $form->texte('', 'TLine[' . $k . '][quantity]', $line['quantity'], 10); ?> </td><?php if (!empty($conf->global->DISPATCH_SHOW_UNIT_RECEPTION)) { echo '<td>' . ($commande->statut < 5) ? $formproduct->select_measuring_units('TLine[' . $k . '][quantity_unit]', 'weight', $line['quantity_unit']) : measuring_units_string($line['quantity_unit'], 'weight') . '</td>'; } } else { echo $form->hidden('TLine[' . $k . '][quantity]', $line['quantity']); echo $form->hidden('TLine[' . $k . '][quantity_unit]', $line['quantity_unit']); } if ($conf->global->clinomadic->enabled) { ?> <td><?php echo $form->texte('', 'TLine[' . $k . '][imei]', $line['imei'], 30); ?> </td> <td><?php echo $form->texte('', 'TLine[' . $k . '][firmware]', $line['firmware'], 30); ?> </td> <?php } ?> <td> <?php if ($commande->statut < 5) { echo '<a href="?action=DELETE_LINE&k=' . $k . '&id=' . $commande->id . '&rowid=' . $line['commande_fournisseurdet_asset'] . '">' . img_delete() . '</a>'; } ?> </td> </tr> <?php } } if ($commande->statut < 5 && $commande->statut > 2) { $pListe[0] = "Sélectionnez un produit"; foreach ($commande->lines as $line) { if ($line->fk_product) { $pListe[$line->fk_product] = $line->product_ref . " - " . $line->product_label; } } $defaultDLUO = ''; if ($conf->global->DISPATCH_DLUO_BY_DEFAULT) { $defaultDLUO = date('d/m/Y', strtotime(date('Y-m-d') . " " . $conf->global->DISPATCH_DLUO_BY_DEFAULT)); } echo $defaultDLUO; ?> <tr style="background-color: lightblue;"> <td><?php print $form->combo('', 'new_line_fk_product', $pListe, ''); ?> </td> <td><?php echo $form->texte('', 'TLine[-1][numserie]', '', 30); ?> </td> <td><?php echo $form->texte('', 'TLine[-1][lot_number]', '', 30); ?> </td> <td><?php $formproduct = new FormProduct($db); $formproduct->loadWarehouses(); if (count($formproduct->cache_warehouses) > 1) { print $formproduct->selectWarehouses('', 'TLine[-1][entrepot]', '', 1, 0, $prod->id, '', 0, 1); } elseif (count($formproduct->cache_warehouses) == 1) { print $formproduct->selectWarehouses('', 'TLine[-1][entrepot]', '', 0, 0, $prod->id, '', 0, 1); } else { print $langs->trans("NoWarehouseDefined"); } ?> </td> <?php if (!empty($conf->global->ASSET_SHOW_DLUO)) { ?> <td><?php echo $form->calendrier('', 'TLine[-1][dluo]', $defaultDLUO); ?> </td> <?php } if (empty($conf->global->DISPATCH_USE_ONLY_UNIT_ASSET_RECEPTION)) { ?> <td><?php echo $form->texte('', 'TLine[-1][quantity]', '', 10); ?> </td><?php if (!empty($conf->global->DISPATCH_SHOW_UNIT_RECEPTION)) { echo '<td>' . $formproduct->select_measuring_units('TLine[-1][quantity_unit]', 'weight') . '</td>'; } } if ($conf->global->clinomadic->enabled) { ?> <td><?php echo $form->texte('', 'TLine[-1][imei]', '', 30); ?> </td> <td><?php echo $form->texte('', 'TLine[-1][firmware]', '', 30); ?> </td> <?php } ?> <td>Nouveau </td> </tr> <?php } ?> </table> <?php if ($commande->statut < 5 || $warning_asset) { if ($commande->statut < 5) { echo '<div class="tabsAction">' . $form->btsubmit('Enregistrer', 'bt_save') . '</div>'; } $form->type_aff = 'edit'; ?> <hr /> <?php echo '<div id="actionVentilation">'; echo 'Date de réception : ' . $form->calendrier('', 'date_recep', time()); echo ' - ' . $langs->trans("Comment") . ' : ' . $form->texte('', 'comment', $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $commande->ref), 60, 128); echo ' ' . $form->btsubmit($langs->trans('AssetVentil'), 'bt_create'); echo '</div>'; } }