} else { print $langs->trans('RecordedProducts'); } print '</td>'; print '<td align="right">' . $langs->trans('Qty') . '</td>'; print '<td align="right">' . $langs->trans('ReductionShort') . '</td>'; print '<td colspan="4"> </td>'; print '</tr>'; print '<form id="addpredefinedproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#add" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="addline">'; print '<input type="hidden" name="id" value="' . $object->id . '">'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td colspan="3">'; $html->select_produits_fournisseurs($object->fourn_id, '', 'idprodfournprice', '', $filtre); if (!$conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { print '<br>'; } // Editor wysiwyg require_once DOL_DOCUMENT_ROOT . "/lib/doleditor.class.php"; $nbrows = ROWS_2; if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } $doleditor = new DolEditor('np_desc', $_POST["np_desc"], '', 100, 'dolibarr_details', '', false, true, $conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70); $doleditor->Create(); print '</td>'; print '<td align="right"><input type="text" size="2" name="pqty" value="' . ($_POST["pqty"] ? $_POST["pqty"] : '1') . '"></td>'; print '<td align="right" nowrap="nowrap"><input type="text" size="1" name="p_remise_percent" value="' . ($_POST["p_remise_percent"] ? $_POST["p_remise_percent"] : $soc->remise_client) . '">%</td>'; print '<td align="center" colspan="4"><input type="submit" class="button" value="' . $langs->trans('Add') . '"></td>';
} print '</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; print '<td align="right"> </td>'; print '<td colspan="4"> </td>'; print '</tr>'; print '<form name="addline_predef" action="fiche.php?facid='.$fac->id.'&action=addline" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="socid" value="'. $fac->socid .'">'; print '<input type="hidden" name="facid" value="'.$fac->id.'">'; print '<input type="hidden" name="socid" value="'.$fac->socid.'">'; $var=! $var; print '<tr '.$bc[$var].'>'; print '<td colspan="4">'; $html->select_produits_fournisseurs($fac->socid,'','idprodfournprice','',$filtre); print '</td>'; print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>'; print '<td> </td>'; print '<td> </td>'; print '<td align="center" valign="middle" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; print '</tr>'; print '</form>'; } } print '</table>'; print '</div>'; }
} else { print $langs->trans('RecordedProducts'); } print '</td>'; print '<td align="right">' . $langs->trans('Qty') . '</td>'; print '<td align="right">' . $langs->trans('ReductionShort') . '</td>'; print '<td colspan="4"> </td>'; print '</tr>'; print '<form id="addpredefinedproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '#add" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="addline">'; print '<input type="hidden" name="id" value="' . $object->id . '">'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td colspan="3">'; $form->select_produits_fournisseurs($object->fourn_id, '', 'idprodfournprice'); if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { print '<br>'; } if (is_object($hookmanager)) { $parameters = array('htmlname' => 'idprodfournprice'); echo $hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action); } $nbrows = ROWS_2; if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } $doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70); $doleditor->Create(); print '</td>'; print '<td align="right"><input type="text" size="2" name="pqty" value="' . (GETPOST('pqty') ? GETPOST('pqty') : '1') . '"></td>';
print '<form name="addline_predef" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=addline" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="socid" value="' . $object->socid . '">'; print '<input type="hidden" name="facid" value="' . $object->id . '">'; print '<script type="text/javascript"> jQuery(document).ready(function() { jQuery(\'#idprodfournprice\').change(function() { if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus(); }); }); </script>'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td colspan="4">'; $ajaxoptions = array('update' => array('pqty' => 'qty', 'p_remise_percent' => 'discount'), 'disabled' => 'addPredefinedProductButton', 'error' => $langs->trans("NoPriceDefinedForThisSupplier")); $form->select_produits_fournisseurs($object->socid, '', 'idprodfournprice', '', '', $ajaxoptions); if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { print '<br>'; } if (is_object($hookmanager)) { $parameters = array('htmlname' => 'idprodfournprice'); $reshook = $hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action); } $nbrows = ROWS_2; if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } $doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70); $doleditor->Create(); print '</td>'; print '<td align="right"><input type="text" id="pqty" name="qty" value="1" size="1"></td>';