Fix responsive and bad closing td

This commit is contained in:
Laurent Destailleur 2019-10-23 03:50:48 +02:00
parent 2e573fd794
commit 161f2a018f
4 changed files with 28 additions and 34 deletions

View File

@ -58,7 +58,7 @@ if (!empty($conf->variants->enabled)) {
}
// Load translation files required by the page
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'sendings'));
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'sendings', 'other'));
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
if (! empty($conf->margin->enabled))
$langs->load('margins');

View File

@ -138,22 +138,20 @@ if ($nolinesbefore) {
print '<td class="linecolcycleref2 right"></td>';
}
if (! empty($usemargins))
{
if (!empty($user->rights->margins->creer)) {
?>
<td class="margininfos linecolmargin1 right">
<?php
if (empty($user->rights->margins->creer)) {
$colspan++;
}
else {
print '<td class="margininfos linecolmargin1 right">';
if ($conf->global->MARGIN_TYPE == "1")
echo $langs->trans('BuyingPrice');
else
echo $langs->trans('CostPrice');
echo '</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td class="margininfos linecolmargin2 right"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td class="margininfos linecolmargin2 right"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
}
else $colspan++;
if ($conf->global->MARGIN_TYPE == "1")
echo $langs->trans('BuyingPrice');
else
echo $langs->trans('CostPrice');
echo '</td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td class="margininfos linecolmargin2 right"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td class="margininfos linecolmargin2 right"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
}
?>
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td>
@ -439,20 +437,16 @@ if ($nolinesbefore) {
{
if (!empty($user->rights->margins->creer)) {
$coldisplay++;
?>
<td class="nobottom margininfos linecolmargin right">
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
<?php } ?>
<!-- For free product -->
<input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price", 'alpha', 2):''); ?>">
</td>
<?php
}
if ($user->rights->margins->creer)
{
?>
<td class="nobottom margininfos linecolmargin right">
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat minwidth75imp" style="display: none;"></select>
<?php } ?>
<!-- For free product -->
<input type="text" id="buying_price" name="buying_price" class="flat maxwidth75 right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price", 'alpha', 2):''); ?>">
</td>
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{
echo '<td class="nobottom nowrap margininfos right"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?GETPOST("np_marginRate", 'alpha', 2):'').'"><span class="np_marginRate hideonsmartphone">%</span></td>';

View File

@ -218,10 +218,10 @@ $coldisplay=0;
<td class="margininfos right">
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
<select id="fournprice_predef" name="fournprice_predef" class="flat minwidth75imp right" style="display: none;"></select>
<?php } ?>
<!-- For free product -->
<input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>">
<input class="flat maxwidth75 right" type="text" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>">
</td>
<?php }
@ -233,7 +233,7 @@ $coldisplay=0;
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
echo '<td class="right nowrap margininfos"><input class="right maxwidth75" type="text" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
elseif (! empty($conf->global->DISPLAY_MARK_RATES))
@ -243,7 +243,7 @@ $coldisplay=0;
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
echo '<td class="right nowrap margininfos"><input class="right maxwidth75" type="text" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
}

View File

@ -42,7 +42,7 @@ if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propa
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Load translation files required by the page
$langs->loadLangs(array('orders',"companies","bills",'propal','deliveries','stocks',"productbatch",'incoterm'));
$langs->loadLangs(array('orders',"companies","bills",'propal','deliveries','stocks',"productbatch",'incoterm','other'));
$id = GETPOST('id', 'int'); // id of order
$ref = GETPOST('ref', 'alpha');