Works on canvas capability
Works on custom list
This commit is contained in:
parent
2a6781a552
commit
c31514a2c4
@ -129,7 +129,7 @@ class ProductDefault extends Product
|
|||||||
$sql = 'SELECT DISTINCT ';
|
$sql = 'SELECT DISTINCT ';
|
||||||
|
|
||||||
// Fields requiered
|
// Fields requiered
|
||||||
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte';
|
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte, p.price_ttc';
|
||||||
|
|
||||||
// Fields not requiered
|
// Fields not requiered
|
||||||
foreach($this->field_list as $field)
|
foreach($this->field_list as $field)
|
||||||
@ -179,7 +179,7 @@ class ProductDefault extends Product
|
|||||||
}
|
}
|
||||||
$sql.= $this->db->order($sortfield,$sortorder);
|
$sql.= $this->db->order($sortfield,$sortorder);
|
||||||
$sql.= $this->db->plimit($limit + 1 ,$offset);
|
$sql.= $this->db->plimit($limit + 1 ,$offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -194,32 +194,35 @@ class ProductDefault extends Product
|
|||||||
|
|
||||||
$datas["id"] = $obj->rowid;
|
$datas["id"] = $obj->rowid;
|
||||||
|
|
||||||
// Ref
|
foreach($this->field_list as $field)
|
||||||
$this->id = $obj->rowid;
|
{
|
||||||
$this->ref = $obj->ref;
|
if ($field['enabled'])
|
||||||
$this->type = $obj->fk_product_type;
|
{
|
||||||
$datas["ref"] = $this->getNomUrl(1,'',24);
|
$alias = $field['alias'];
|
||||||
|
|
||||||
// Label
|
if ($alias == 'ref')
|
||||||
$datas["label"] = $obj->label;
|
{
|
||||||
|
$this->id = $obj->rowid;
|
||||||
// Barcode
|
$this->ref = $obj->$alias;
|
||||||
$datas["barcode"] = $obj->barcode;
|
$this->type = $obj->fk_product_type;
|
||||||
|
$datas[$alias] = $this->getNomUrl(1,'',24);
|
||||||
// Date modification
|
}
|
||||||
$datas["datem"] = dol_print_date($this->db->jdate($obj->datem),'day');
|
else if ($alias == 'sellingprice')
|
||||||
|
{
|
||||||
// Selling price
|
if ($obj->price_base_type == 'TTC') $datas[$alias] = price($obj->price_ttc).' '.$langs->trans("TTC");
|
||||||
if ($obj->price_base_type == 'TTC') $datas["sellingprice"] = price($obj->price_ttc).' '.$langs->trans("TTC");
|
else $datas[$alias] = price($obj->$alias).' '.$langs->trans("HT");
|
||||||
else $datas["sellingprice"] = price($obj->price).' '.$langs->trans("HT");
|
}
|
||||||
|
else if ($alias == 'stock')
|
||||||
// Stock
|
{
|
||||||
$this->load_stock();
|
$this->load_stock();
|
||||||
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas["stock"] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
|
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas[$alias] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
|
||||||
else $datas["stock"] = $this->stock_reel;
|
else $datas[$alias] = $this->stock_reel;
|
||||||
|
}
|
||||||
// Status
|
else if ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias),'day');
|
||||||
$datas["status"] = $this->LibStatut($obj->statut,5);
|
else if ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias,5);
|
||||||
|
else $datas[$alias] = $obj->$alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
array_push($this->list_datas,$datas);
|
array_push($this->list_datas,$datas);
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@
|
|||||||
<tr class="{cycle values="pair,impair"}">
|
<tr class="{cycle values="pair,impair"}">
|
||||||
{foreach name=valueline key=key item=value from=$line}
|
{foreach name=valueline key=key item=value from=$line}
|
||||||
{foreach name=fieldline item=field from=$fieldlist}
|
{foreach name=fieldline item=field from=$fieldlist}
|
||||||
{if $field.name == $key}
|
{if $field.alias == $key}
|
||||||
<td align="{$field.align}">{$value}</td>
|
<td align="{$field.align}">{$value}</td>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user