Works on canvas capability
Works on custom list
This commit is contained in:
parent
42df48f5a5
commit
3bc4dadc7f
@ -133,6 +133,7 @@ ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity;
|
||||
ALTER TABLE llx_deplacement ADD COLUMN fk_projet integer DEFAULT 0 after fk_soc;
|
||||
|
||||
-- custom list
|
||||
DROP TABLE llx_c_field_list;
|
||||
create table llx_c_field_list
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -154,6 +155,8 @@ INSERT INTO `llx_c_field_list` (`rowid`, `element`, `entity`, `name`, `alias`, `
|
||||
(2, 'product_default', 1, 'label', NULL, 'Label', 'left', 1, 1, '1', 2),
|
||||
(3, 'product_default', 1, 'barcode', NULL, 'BarCode', 'center', 1, 1, '$conf->barcode->enabled', 3),
|
||||
(4, 'product_default', 1, 'tms', 'datem', 'DateModification', 'center', 1, 0, '1', 4),
|
||||
(5, 'product_default', 1, 'price', 'sellingprice', 'SellingPrice', 'right', 1, 0, '1', 5),
|
||||
(6, 'product_default', 1, 'stock', NULL, 'Stock', 'right', 0, 0, '$conf->stock->enabled', 6),
|
||||
(7, 'product_default', 1, 'envente', 'status', 'Status', 'right', 1, 0, '1', 7);
|
||||
(5, 'product_default', 1, 'price', NULL, 'SellingPriceHT', 'right', 1, 0, '1', 5),
|
||||
(6, 'product_default', 1, 'price_ttc', NULL, 'SellingPriceTTC', 'right', 1, 0, '1', 6),
|
||||
(7, 'product_default', 1, 'stock', NULL, 'Stock', 'right', 0, 0, '$conf->stock->enabled', 7),
|
||||
(8, 'product_default', 1, 'envente', 'status', 'Status', 'right', 1, 0, '1', 8);
|
||||
|
||||
|
||||
@ -171,17 +171,14 @@ class ProductDefault extends Product
|
||||
$this->type = $obj->fk_product_type;
|
||||
$datas[$alias] = $this->getNomUrl(1,'',24);
|
||||
}
|
||||
else if ($alias == 'sellingprice')
|
||||
{
|
||||
if ($obj->price_base_type == 'TTC') $datas[$alias] = price($obj->price_ttc).' '.$langs->trans("TTC");
|
||||
else $datas[$alias] = price($obj->$alias).' '.$langs->trans("HT");
|
||||
}
|
||||
else if ($alias == 'stock')
|
||||
{
|
||||
$this->load_stock();
|
||||
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas[$alias] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
|
||||
else $datas[$alias] = $this->stock_reel;
|
||||
}
|
||||
else if ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias,40);
|
||||
else if (preg_match('/price/i',$alias)) $datas[$alias] = price($obj->$alias);
|
||||
else if ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias),'day');
|
||||
else if ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias,5);
|
||||
else $datas[$alias] = $obj->$alias;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user