|
@@ -144,7 +144,6 @@ if (empty($reshook))
|
|
|
*/
|
|
|
else if ($action == 'builddoc' && $user->rights->produit->creer)
|
|
|
{
|
|
|
-
|
|
|
// Save last template used to generate document
|
|
|
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
|
|
|
|
@@ -749,7 +748,7 @@ if (empty($reshook))
|
|
|
{
|
|
|
$buyprice = $result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$result = $facture->addline(
|
|
|
$desc,
|
|
|
$pu_ht,
|
|
@@ -790,7 +789,6 @@ if (empty($reshook))
|
|
|
else {
|
|
|
$action="";
|
|
|
setEventMessages($langs->trans("WarningSelectOneDocument"), null, 'warnings');
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -891,11 +889,12 @@ else
|
|
|
|
|
|
dol_fiche_head('');
|
|
|
|
|
|
- print '<table class="border" width="100%">';
|
|
|
+ print '<table class="border centpercent">';
|
|
|
+
|
|
|
print '<tr>';
|
|
|
$tmpcode='';
|
|
|
if (! empty($modCodeProduct->code_auto)) $tmpcode=$modCodeProduct->getNextValue($object,$type);
|
|
|
- print '<td class="fieldrequired" width="20%">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" size="32" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">';
|
|
|
+ print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">';
|
|
|
if ($refalreadyexists)
|
|
|
{
|
|
|
print $langs->trans("RefAlreadyExists");
|
|
@@ -903,7 +902,7 @@ else
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Label
|
|
|
- print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="label" size="40" maxlength="255" value="'.dol_escape_htmltag(GETPOST('label')).'"></td></tr>';
|
|
|
+ print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="label" class="minwidth300 maxwidth400onsmartphone" maxlength="255" value="'.dol_escape_htmltag(GETPOST('label')).'"></td></tr>';
|
|
|
|
|
|
// On sell
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
|
|
@@ -946,14 +945,14 @@ else
|
|
|
print '</td><td>'.$langs->trans("BarcodeValue").'</td><td>';
|
|
|
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
|
|
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
|
|
- print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
|
|
+ print '<input class="maxwidth100" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
|
|
|
// Description (used in invoice, propal...)
|
|
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
|
|
|
|
|
- $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '80%');
|
|
|
+ $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
|
|
$doleditor->Create();
|
|
|
|
|
|
print "</td></tr>";
|
|
@@ -967,11 +966,11 @@ else
|
|
|
if ($type != 1 && ! empty($conf->stock->enabled))
|
|
|
{
|
|
|
print '<tr><td>'.$langs->trans("StockLimit").'</td><td>';
|
|
|
- print '<input name="seuil_stock_alerte" size="4" value="'.GETPOST('seuil_stock_alerte').'">';
|
|
|
+ print '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
|
|
|
print '</td>';
|
|
|
// Stock desired level
|
|
|
print '<td>'.$langs->trans("DesiredStock").'</td><td>';
|
|
|
- print '<input name="desiredstock" size="4" value="'.GETPOST('desiredstock').'">';
|
|
|
+ print '<input name="desiredstock" class="maxwidth50" value="'.GETPOST('desiredstock').'">';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
else
|
|
@@ -1043,7 +1042,7 @@ else
|
|
|
// Custom code
|
|
|
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO) && empty($type))
|
|
|
{
|
|
|
- print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" size="10" value="'.GETPOST('customcode').'"></td>';
|
|
|
+ print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.GETPOST('customcode').'"></td>';
|
|
|
// Origin country
|
|
|
print '<td>'.$langs->trans("CountryOrigin").'</td><td>';
|
|
|
print $form->select_country(GETPOST('country_id','int'),'country_id');
|
|
@@ -1065,7 +1064,7 @@ else
|
|
|
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
|
|
|
|
|
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
|
|
- $doleditor = new DolEditor('note_private', GETPOST('note_private'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '80%');
|
|
|
+ $doleditor = new DolEditor('note_private', GETPOST('note_private'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%');
|
|
|
$doleditor->Create();
|
|
|
|
|
|
print "</td></tr>";
|
|
@@ -1093,18 +1092,18 @@ else
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
// Price
|
|
|
- print '<tr><td>'.$langs->trans("SellingPrice").'</td>';
|
|
|
- print '<td><input name="price" size="10" value="'.$object->price.'">';
|
|
|
+ print '<tr><td class="titlefieldcreate">'.$langs->trans("SellingPrice").'</td>';
|
|
|
+ print '<td><input name="price" class="maxwidth50" value="'.$object->price.'">';
|
|
|
print $form->selectPriceBaseType($object->price_base_type, "price_base_type");
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Min price
|
|
|
print '<tr><td>'.$langs->trans("MinPrice").'</td>';
|
|
|
- print '<td><input name="price_min" size="10" value="'.$object->price_min.'">';
|
|
|
+ print '<td><input name="price_min" class="maxwidth50" value="'.$object->price_min.'">';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// VAT
|
|
|
- print '<tr><td width="20%">'.$langs->trans("VATRate").'</td><td>';
|
|
|
+ print '<tr><td>'.$langs->trans("VATRate").'</td><td>';
|
|
|
print $form->load_tva("tva_tx",-1,$mysoc,'');
|
|
|
print '</td></tr>';
|
|
|
|
|
@@ -1113,32 +1112,33 @@ else
|
|
|
print '<br>';
|
|
|
}
|
|
|
|
|
|
+ // Accountancy codes
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
if (! empty($conf->accounting->enabled))
|
|
|
{
|
|
|
// Accountancy_code_sell
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
- print '<td class="maxwidthonsmartphone">';
|
|
|
- print $formaccountancy->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 0, 1);
|
|
|
+ print '<td>';
|
|
|
+ print $formaccountancy->select_account(GETPOST('accountancy_code_sell'), 'accountancy_code_sell', 1, null, 1, 1, '');
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Accountancy_code_buy
|
|
|
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
- print '<td class="maxwidthonsmartphone">';
|
|
|
- print $formaccountancy->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 0, 1);
|
|
|
+ print '<td>';
|
|
|
+ print $formaccountancy->select_account(GETPOST('accountancy_code_buy'), 'accountancy_code_buy', 1, null, 1, 1, '');
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
else // For external software
|
|
|
{
|
|
|
// Accountancy_code_sell
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
- print '<td class="maxwidthonsmartphone"><input name="accountancy_code_sell" size="16" value="'.$object->accountancy_code_sell.'">';
|
|
|
+ print '<td class="maxwidthonsmartphone"><input class="minwidth100" name="accountancy_code_sell" value="'.$object->accountancy_code_sell.'">';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Accountancy_code_buy
|
|
|
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
- print '<td class="maxwidthonsmartphone"><input name="accountancy_code_buy" size="16" value="'.$object->accountancy_code_buy.'">';
|
|
|
+ print '<td class="maxwidthonsmartphone"><input class="minwidth100" name="accountancy_code_buy" value="'.$object->accountancy_code_buy.'">';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
print '</table>';
|
|
@@ -1185,10 +1185,10 @@ else
|
|
|
print '<table class="border allwidth">';
|
|
|
|
|
|
// Ref
|
|
|
- print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" size="32" maxlength="128" value="'.dol_escape_htmltag($object->ref).'"></td></tr>';
|
|
|
+ print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag($object->ref).'"></td></tr>';
|
|
|
|
|
|
// Label
|
|
|
- print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="label" size="40" maxlength="255" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
|
|
+ print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="label" class="minwidth300 maxwidth400onsmartphone" maxlength="255" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
|
|
|
|
|
// Status To sell
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
|
|
@@ -1356,7 +1356,7 @@ else
|
|
|
// Custom code
|
|
|
if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
|
|
{
|
|
|
- print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" size="10" value="'.$object->customcode.'"></td>';
|
|
|
+ print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.$object->customcode.'"></td>';
|
|
|
// Origin country
|
|
|
print '<td>'.$langs->trans("CountryOrigin").'</td><td>';
|
|
|
print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
|
|
@@ -1406,13 +1406,13 @@ else
|
|
|
if (! empty($conf->accounting->enabled))
|
|
|
{
|
|
|
// Accountancy_code_sell
|
|
|
- print '<tr><td width="20%">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
+ print '<tr><td class="titlefield">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
print '<td>';
|
|
|
print $formaccountancy->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1);
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Accountancy_code_buy
|
|
|
- print '<tr><td width="20%">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
+ print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
print '<td>';
|
|
|
print $formaccountancy->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1);
|
|
|
print '</td></tr>';
|
|
@@ -1420,13 +1420,13 @@ else
|
|
|
else // For external software
|
|
|
{
|
|
|
// Accountancy_code_sell
|
|
|
- print '<tr><td width="20%">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
- print '<td><input name="accountancy_code_sell" size="16" value="'.$object->accountancy_code_sell.'">';
|
|
|
+ print '<tr><td class="titlefield">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
|
|
+ print '<td><input name="accountancy_code_sell" class="maxwidth200" value="'.$object->accountancy_code_sell.'">';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Accountancy_code_buy
|
|
|
- print '<tr><td width="20%">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
- print '<td><input name="accountancy_code_buy" size="16" value="'.$object->accountancy_code_buy.'">';
|
|
|
+ print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
|
|
+ print '<td><input name="accountancy_code_buy" class="maxwidth200" value="'.$object->accountancy_code_buy.'">';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
print '</table>';
|