Skip to content

Commit

Permalink
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top
Browse files Browse the repository at this point in the history
margin.
  • Loading branch information
eldy committed Jun 20, 2014
1 parent a2065d0 commit 28fd8c6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,7 @@ English Dolibarr ChangeLog
--------------------------------------------------------------

***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
Fix: The object deliverycompany was not used anymore and output of
details for delivery reports was lost during 3.5. Rewrite code to
Expand Down
51 changes: 22 additions & 29 deletions htdocs/fourn/commande/fiche.php
Expand Up @@ -198,7 +198,7 @@
}
if (GETPOST('addline_predefined')
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
)
{
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
$idprod=GETPOST('idprod', 'int');
Expand All @@ -221,7 +221,7 @@
}
if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not ''
{

setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors');
$error++;
}
Expand Down Expand Up @@ -760,10 +760,10 @@
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');

// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);

$id = $object->create($user);
if ($id < 0)
{
Expand Down Expand Up @@ -1118,12 +1118,12 @@
// Other options
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook

if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields,'edit');
}

// Bouton "Create Draft"
print "</table>\n";

Expand All @@ -1140,9 +1140,9 @@

$title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'card', $title, 0, 'order');

$res=$object->fetch_optionals($object->id,$extralabels);

/*
* Confirmation de la suppression de la commande
*/
Expand Down Expand Up @@ -1470,7 +1470,7 @@
}
}
}

// Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right"><b>'.price($object->total_ht).'</b></td>';
Expand Down Expand Up @@ -1731,30 +1731,30 @@
// TODO Use the predefinedproductline_create.tpl.php file

// Add free products/services form

//Fix Bug [ bug #1254 ] Error when using "Enter" on qty input box of a product
//this Fix Will be obsolete in 3.6 because 3.6 get one form to do every things
if (! empty($conf->use_javascript_ajax)) {
print '<script type="text/javascript">
jQuery(document).ready(function() {
$("#qty").bind("keypress", {}, keypressInBox);
$("#remise_percent").bind("keypress", {}, keypressInBox);
$("#pu").bind("keypress", {}, keypressInBox);
});
function keypressInBox(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode
if (code == 13) { //Enter keycode
e.preventDefault();
$(\'#addFreeProductButton\').click();
}
};
</script>';
}

$var=true;
print '<tr '.$bc[$var].'>';
print '<td>';
Expand Down Expand Up @@ -1788,26 +1788,26 @@ function keypressInBox(e) {
// Ajout de produits/services predefinis
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{

if (! empty($conf->use_javascript_ajax)) {
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
//Fix Bug [ bug #1254 ] Error when using "Enter" on qty input box of a product
//this Fix Will be obsolete in 3.6 because 3.6 get one form to do every things
$("#qty_predef").bind("keypress", {}, keypressInBox);
$("#remise_percent_predef").bind("keypress", {}, keypressInBox);
});
function keypressInBox(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode
if (code == 13) { //Enter keycode
e.preventDefault();
$(\'#addPredefinedProductButton\').click();
}
};
Expand Down Expand Up @@ -1971,8 +1971,6 @@ function keypressInBox(e) {


print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre

/*
* Documents generes
Expand Down Expand Up @@ -2001,10 +1999,6 @@ function keypressInBox(e) {
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'order_supplier',$socid);

print '</div></div></div>';

//print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

if ($user->rights->fournisseur->commande->commander && $object->statut == 2)
{
Expand Down Expand Up @@ -2073,7 +2067,6 @@ function keypressInBox(e) {
*/

print '</div></div></div>';
//print '</td></tr></table>';
}

/*
Expand Down

0 comments on commit 28fd8c6

Please sign in to comment.