Skip to content

Update bill.class.php #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions inc/bill.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,13 @@ public function rawSearchOptions()

$tab[] = [
'id' => 8,
'table' => PluginOrderOrder::getTable(),
'field' => 'name',
'name' => __('Order', 'order'),
'datatype' => 'itemlink',
'itemlink_type' => 'PluginOrderOrder',
'table' => 'glpi_plugin_order_bills',
'field' => 'order_name',
'name' => __('Order', 'order'),
'datatype' => 'string',
'nosearch' => true,
'massiveaction' => false,
'computation' => '(SELECT name FROM glpi_plugin_order_orders WHERE glpi_plugin_order_orders.id = glpi_plugin_order_bills.plugin_order_orders_id)',
Comment on lines +203 to +209
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should allow searching to list all bills associated with a specific order.

There is no need to use computation; refer to the previous search option that uses the 'dropdown' data type.

];

$tab[] = [
Expand All @@ -214,7 +216,26 @@ public function rawSearchOptions()
'name' => __('Name'),
'datatype' => 'itemlink',
];

$tab[] = [
'id' => 10,
'table' => self::getTable(),
'field' => 'value',
'name' => __('Value'),
'datatype' => 'decimal',
];

$tab[] = [
'id' => '11',
'table' => 'glpi_plugin_order_bills',
'field' => 'order_name',
'name' => __('Order ID', 'order'),
'datatype' => 'string',
'nosearch' => true,
'massiveaction' => false,
'computation' => '(SELECT num_order FROM glpi_plugin_order_orders WHERE glpi_plugin_order_orders.id = glpi_plugin_order_bills.plugin_order_orders_id)',
];
Comment on lines +228 to +237
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant search option with search option 8

Suggested change
$tab[] = [
'id' => '11',
'table' => 'glpi_plugin_order_bills',
'field' => 'order_name',
'name' => __('Order ID', 'order'),
'datatype' => 'string',
'nosearch' => true,
'massiveaction' => false,
'computation' => '(SELECT num_order FROM glpi_plugin_order_orders WHERE glpi_plugin_order_orders.id = glpi_plugin_order_bills.plugin_order_orders_id)',
];


$tab[] = [
'id' => 16,
'table' => self::getTable(),
Expand Down