-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Work Order Review Resources view
Show correct Time Required and Time Used on Time based operations
- Loading branch information
1 parent
e3dfba4
commit 5e93fd4
Showing
3 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
schema/phinx/migrations/20180611104830_mfoperation_overview_column_changes.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
|
||
use UzerpPhinx\UzerpMigration; | ||
|
||
class MfoperationOverviewColumnChanges extends UzerpMigration | ||
{ | ||
/** | ||
* Add batch_op flag | ||
*/ | ||
public function up() | ||
{ | ||
$view_name = 'mf_operationsoverview'; | ||
$view_owner = 'www-data'; | ||
$view = <<<'VIEW' | ||
CREATE OR REPLACE VIEW mf_operationsoverview AS | ||
SELECT o.id, | ||
o.op_no, | ||
o.start_date, | ||
o.end_date, | ||
o.remarks, | ||
o.stitem_id, | ||
o.mfcentre_id, | ||
o.mfresource_id, | ||
o.usercompanyid, | ||
o.volume_period, | ||
o.volume_uom_id, | ||
o.quality_target, | ||
o.uptime_target, | ||
o.volume_target, | ||
o.resource_qty, | ||
o.batch_op, | ||
o.std_cost, | ||
o.std_lab, | ||
o.std_ohd, | ||
o.latest_cost, | ||
o.latest_lab, | ||
o.latest_ohd, | ||
o.created, | ||
o.createdby, | ||
o.alteredby, | ||
o.lastupdated, | ||
(s.item_code::text || ' - '::text) || s.description::text AS stitem, | ||
s.obsolete_date, | ||
u.uom_name AS volume_uom, | ||
c.centre, | ||
r.description AS resource | ||
FROM mf_operations o | ||
JOIN st_items s ON o.stitem_id = s.id | ||
JOIN st_uoms u ON o.volume_uom_id = u.id | ||
JOIN mf_centres c ON o.mfcentre_id = c.id | ||
JOIN mf_resources r ON o.mfresource_id = r.id; | ||
VIEW; | ||
|
||
$this->query("DROP VIEW {$view_name}"); | ||
$this->query($view); | ||
$this->query("ALTER TABLE {$view_name} OWNER TO \"{$view_owner}\""); | ||
} | ||
} |