Skip to content

Commit

Permalink
NEW Show the supplier ref into supplier cards
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 12, 2017
1 parent 2668b80 commit 955ed7d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -3504,9 +3504,9 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
// Description
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';

if ($this->element == 'supplier_proposal')
if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier')
{
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("SupplierProposalRefFourn").'</span></td>';
print '<td class="linerefsupplier"><span id="title_fourn_ref">'.$langs->trans("SupplierProposalRefFourn").'</span></td>';
}

// VAT
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/pdf.lib.php
Expand Up @@ -1294,7 +1294,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2)
$ref_prodserv = $ref_supplier. ' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')';
else
$ref_prodserv = $prodser->ref.' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')';
$ref_prodserv = $prodser->ref.($ref_supplier ? ' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')' : '');
}
else
$ref_prodserv = $prodser->ref; // Show local ref only
Expand Down
8 changes: 6 additions & 2 deletions htdocs/core/tpl/objectline_create.tpl.php
Expand Up @@ -65,7 +65,10 @@
<td class="linecoldescription minwidth500imp">
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
</td>
<?php if ($object->element == 'supplier_proposal') { ?>
<?php
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
<td class="linecolrefsupplier" align="right"><span id="title_fourn_ref"><?php echo $langs->trans('SupplierProposalRefFourn'); ?></span></td>
<?php } ?>
<td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
Expand Down Expand Up @@ -728,6 +731,7 @@ function setforfree() {
jQuery("#price_ht").show();
jQuery("#multicurrency_price_ht").show();
jQuery("#price_ttc").show(); // May no exists
jQuery("#fourn_ref").show();
jQuery("#tva_tx").show();
jQuery("#buying_price").val('').show();
jQuery("#fournprice_predef").hide();
Expand All @@ -751,9 +755,9 @@ function setforpredef() {
jQuery("#price_ht").val('').hide();
jQuery("#multicurrency_price_ht").hide();
jQuery("#price_ttc").hide(); // May no exists
jQuery("#fourn_ref").hide();
jQuery("#tva_tx").hide();
jQuery("#buying_price").show();
//jQuery("#fournprice_predef").show(); // management somewhere else
jQuery("#title_vat").hide();
jQuery("#title_up_ht").hide();
jQuery("#title_up_ht_currency").hide();
Expand Down
9 changes: 6 additions & 3 deletions htdocs/core/tpl/objectline_edit.tpl.php
Expand Up @@ -106,11 +106,14 @@
?>
</td>

<?php if ($object->element == 'supplier_proposal') { ?>
<?php
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
<td align="right"><input id="fourn_ref" name="fourn_ref" class="flat" value="<?php echo $line->ref_fourn; ?>" size="12"></td>
<?php } ?>

<?php
}

$coldisplay++;
if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>';
Expand Down
13 changes: 9 additions & 4 deletions htdocs/core/tpl/objectline_view.tpl.php
Expand Up @@ -137,13 +137,18 @@
}
?>
</td>
<?php if ($object->element == 'supplier_proposal') { ?>
<td class="linecolrefsupplier" align="right"><?php echo $line->ref_fourn; ?></td>
<?php }
<?php
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
<td class="linecolrefsupplier"><?php
echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier);
?></td>
<?php
}
// VAT Rate
?>
<td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php
//var_dump($line);
$positiverates='';
if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
Expand Down
1 change: 1 addition & 0 deletions htdocs/product/class/product.class.php
Expand Up @@ -3463,6 +3463,7 @@ function getNomUrl($withpicto=0, $option='', $maxlength=0, $save_lastsearch_valu
if ($this->volume) $label.="<br><b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuring_units_string($this->volume_units,'volume');
if (! empty($conf->productbatch->enabled))
{
$langs->load("productbatch");
$label.="<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0,2);
}
}
Expand Down
9 changes: 8 additions & 1 deletion htdocs/theme/eldy/style.css.php
Expand Up @@ -1083,7 +1083,14 @@
padding-right: 10px !important;
}


/* Try responsive even not on smartphone
#id-container {
width: 100%;
}
#id-right {
width: calc(100% - 200px) !important;
}
*/

/* For smartphone (testmenuhider is on) */
<?php if ($conf->browser->layout == 'phone' && ((GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
Expand Down

0 comments on commit 955ed7d

Please sign in to comment.