NEW Add css on column of detail lines to allow module to easily

manipulate fields.
This commit is contained in:
Laurent Destailleur 2015-10-20 16:08:25 +02:00
parent f123e11c8e
commit 8306d93286
3 changed files with 60 additions and 60 deletions

View File

@ -3005,60 +3005,60 @@ abstract class CommonObject
print '<tr class="liste_titre nodrag nodrop">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td align="center" width="5">&nbsp;</td>';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum" align="center" width="5">&nbsp;</td>';
// Description
print '<td>'.$langs->trans('Description').'</td>';
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
if ($this->element == 'askpricesupplier')
{
print '<td align="right"><span id="title_fourn_ref">'.$langs->trans("AskPriceSupplierRefFourn").'</span></td>';
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("AskPriceSupplierRefFourn").'</span></td>';
}
// VAT
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
print '<td class="linecolvat" align="right" width="50">'.$langs->trans('VAT').'</td>';
// Price HT
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
print '<td class="linecoluht" align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
if ($inputalsopricewithtax) print '<td align="right" width="80">'.$langs->trans('PriceUTTC').'</td>';
// Qty
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
print '<td class="linecolqty" align="right" width="50">'.$langs->trans('Qty').'</td>';
if($conf->global->PRODUCT_USE_UNITS)
{
print '<td align="left" width="50">'.$langs->trans('Unit').'</td>';
print '<td class="linecoluseunit" align="left" width="50">'.$langs->trans('Unit').'</td>';
}
// Reduction short
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
print '<td class="linecoldiscount" align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
if ($this->situation_cycle_ref) {
print '<td align="right" width="50">' . $langs->trans('Progress') . '</td>';
print '<td class="linecolcycleref" align="right" width="50">' . $langs->trans('Progress') . '</td>';
}
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" class="margininfos" width="80">'.$langs->trans('BuyingPrice').'</td>';
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
else
print '<td align="right" class="margininfos" width="80">'.$langs->trans('CostPrice').'</td>';
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarginRate').'</td>';
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarkRate').'</td>';
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarkRate').'</td>';
}
// Total HT
print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
print '<td class="linecolht" align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
print '<td></td>'; // No width to allow autodim
print '<td class="linecoledit"></td>'; // No width to allow autodim
print '<td width="10"></td>';
print '<td class="linecoldelete" width="10"></td>';
print '<td width="10"></td>';
print '<td class="linecolmove" width="10"></td>';
print "</tr>\n";

View File

@ -49,36 +49,36 @@ if (in_array($object->element,array('propal', 'askpricesupplier','facture','invo
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
<tr class="liste_titre nodrag nodrop">
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<td class="linecoldescription" <?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<td align="right"><span id="title_fourn_ref"><?php echo $langs->trans('AskPriceSupplierRefFourn'); ?></span></td>
<tdclass="linecolrefsupplier" align="right"><span id="title_fourn_ref"><?php echo $langs->trans('AskPriceSupplierRefFourn'); ?></span></td>
<?php } ?>
<td align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
<td align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
<td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
<td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
<?php if (! empty($inputalsopricewithtax)) { ?>
<td align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
<td class="linecoluttc" align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
<?php } ?>
<td align="right"><?php echo $langs->trans('Qty'); ?></td>
<td class="linecolqty" align="right"><?php echo $langs->trans('Qty'); ?></td>
<?php
if($conf->global->PRODUCT_USE_UNITS)
{
print '<td align="left">';
print '<td class="linecoluseunit" align="left">';
print '<span id="title_units">';
print $langs->trans('Unit');
print '</span></td>';
}
?>
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
<td class="linecoldiscount" align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
<?php
if ($this->situation_cycle_ref) {
print '<td align="right">' . $langs->trans('Progress') . '</td>';
print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>';
}
if (! empty($usemargins))
{
?>
<td align="right" class="margininfos">
<td align="right" class="margininfos linecolmargin1">
<?php
if ($conf->global->MARGIN_TYPE == "1")
echo $langs->trans('BuyingPrice');
@ -87,11 +87,11 @@ if (in_array($object->element,array('propal', 'askpricesupplier','facture','invo
?>
</td>
<?php
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>';
if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>';
}
?>
<td colspan="<?php echo $colspan; ?>">&nbsp;</td>
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr>
<tr <?php echo $bcnd[$var]; ?>>
@ -102,7 +102,7 @@ else {
$coldisplay=0; }
?>
<td class="nobottom"<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<td class="nobottom linecoldescription"<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<?php
@ -211,33 +211,33 @@ else {
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<td class="nobottom" align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="" size="12"></td>
<td class="nobottom linecolresupplier" align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="" size="12"></td>
<?php } ?>
<td class="nobottom" align="right"><?php
<td class="nobottom linecolvat" align="right"><?php
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
?>
</td>
<td class="nobottom" align="right">
<td class="nobottom linecoluht" align="right">
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
</td>
<?php if (! empty($inputalsopricewithtax)) { ?>
<td class="nobottom" align="right">
<td class="nobottom linecoluttc" align="right">
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?$_POST["price_ttc"]:''); ?>">
</td>
<?php } ?>
<td class="nobottom" align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
<td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
</td>
<?php
if($conf->global->PRODUCT_USE_UNITS)
{
print '<td class="nobottom" align="left">';
print '<td class="nobottom linecoluseunit" align="left">';
print $form->selectUnits($line->fk_unit, "units");
print '</td>';
}
?>
<td class="nobottom nowrap" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<?php
if ($this->situation_cycle_ref) {
$coldisplay++;
@ -246,7 +246,7 @@ else {
if (! empty($usemargins))
{
?>
<td class="nobottom" align="right" class="margininfos">
<td align="right" class="nobottom margininfos linecolmargin">
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat" data-role="none" style="display: none;"></select>
@ -277,7 +277,7 @@ else {
}
}
?>
<td class="nobottom" align="center" valign="middle" colspan="<?php echo $colspan; ?>">
<td class="nobottom linecoledit" align="center" valign="middle" colspan="<?php echo $colspan; ?>">
<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
</td>
<?php

View File

@ -50,9 +50,9 @@ if (empty($usemargins)) $usemargins=0;
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
<tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php } ?>
<td><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
<td class="linecoldescription"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
<?php
if (($line->info_bits & 2) == 2) {
?>
@ -125,17 +125,17 @@ if (empty($usemargins)) $usemargins=0;
?>
</td>
<?php if ($object->element == 'askpricesupplier') { ?>
<td align="right"><?php echo $line->ref_fourn; ?></td>
<td class="linecolrefsupplier" align="right"><?php echo $line->ref_fourn; ?></td>
<?php } ?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
<td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>
<td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>
<?php if ($inputalsopricewithtax) { ?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
<td align="right" class="linecoluttc nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
<?php } ?>
<td align="right" class="nowrap"><?php $coldisplay++; ?>
<td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?>
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
@ -148,7 +148,7 @@ if (empty($usemargins)) $usemargins=0;
<?php
if($conf->global->PRODUCT_USE_UNITS)
{
print '<td align="left" class="nowrap">';
print '<td align="left" class="linecoluseunit nowrap">';
$label = $line->getLabelOfUnit('short');
if ($label !== '') {
print $langs->trans($label);
@ -158,42 +158,42 @@ if (empty($usemargins)) $usemargins=0;
?>
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
<td align="right"><?php
<td class="linecoldiscount" align="right"><?php
$coldisplay++;
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
echo dol_print_reduction($line->remise_percent,$langs);
?></td>
<?php } else { ?>
<td><?php $coldisplay++; ?>&nbsp;</td>
<td class="linecoldiscount"><?php $coldisplay++; ?>&nbsp;</td>
<?php }
if ($this->situation_cycle_ref) {
$coldisplay++;
print '<td align="right" class="nowrap">' . $line->situation_percent . '%</td>';
print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>';
}
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
?>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
<td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<?php }
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
<td align="right" class="nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<?php }
}
?>
<?php if ($line->special_code == 3) { ?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<?php } else { ?>
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
<td align="right" class="liencolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
<?php } ?>
<?php if ($this->statut == 0 && ($object_rights->creer)) { ?>
<td align="center"><?php $coldisplay++; ?>
<td class="linecoledit" align="center"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) == 2) { ?>
<?php } else { ?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
@ -202,7 +202,7 @@ if (empty($usemargins)) $usemargins=0;
<?php } ?>
</td>
<td align="center"><?php $coldisplay++; ?>
<td class="linecoldelete" align="center"><?php $coldisplay++; ?>
<?php
if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=ask_deleteline&amp;lineid=' . $line->id . '">';
@ -213,7 +213,7 @@ if (empty($usemargins)) $usemargins=0;
</td>
<?php if ($num > 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref)) { ?>
<td align="center" class="tdlineupdown"><?php $coldisplay++; ?>
<td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?>
<?php if ($i > 0) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php echo img_up('default',0,'imgupforline'); ?>
@ -226,7 +226,7 @@ if (empty($usemargins)) $usemargins=0;
<?php } ?>
</td>
<?php } else { ?>
<td align="center"<?php echo (empty($conf->browser->phone)?' class="tdlineupdown"':''); ?>><?php $coldisplay++; ?></td>
<td align="center"<?php echo (empty($conf->browser->phone)?' class="linecolmove tdlineupdown"':' class="linecolmove"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php } else { ?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>