diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:03:17 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:03:17 +0100 |
| commit | ce6c275381aa5d270b3816fc25e833b546d0443a (patch) | |
| tree | e6517dfa6772606b775ed33a96b5bdb49cb46ed2 /admin | |
| parent | e5f051c2b27424acd773a51d45fd775fbf4c0547 (diff) | |
| download | stock-ce6c275381aa5d270b3816fc25e833b546d0443a.tar.gz stock-ce6c275381aa5d270b3816fc25e833b546d0443a.tar.bz2 stock-ce6c275381aa5d270b3816fc25e833b546d0443a.zip | |
Reorganise BOM xref templates into content-type subdirectories
- Move BOM templates into templates/stockassembly/ subdir
- Move PCK component templates into templates/stockcomponent/ subdir
- schema_inc.php: PCK on stockcomponent uses 'value' template;
PCK on stockassembly uses 'bompck'; SGL/SHT/VOL on assembly use 'bom'
- Remove old flat templates superseded by subdir structure
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'admin')
| -rwxr-xr-x | admin/schema_inc.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 3dcb9b4..96c3be4 100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -151,11 +151,12 @@ foreach( [ 'stockcomponent', 'stockassembly' ] as $guid ) { // Quantity sources — selectable types multi=0, movement multi=1 // entry_date on liberty_xref timestamps each MOV row automatically // stockassembly uses 'bom' template (stock package override); stockcomponent uses 'text' - $qtyTpl = ( $guid === 'stockassembly' ) ? 'bom' : 'text'; - $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('SGL','{$guid}','quantity','Single unit', 0,3,'','{$qtyTpl}',NULL)"; - $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('PCK','{$guid}','quantity','Pack', 0,3,'','{$qtyTpl}',NULL)"; - $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('SHT','{$guid}','quantity','Sheet (H x W)', 0,3,'','{$qtyTpl}',NULL)"; - $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('VOL','{$guid}','quantity','Volume', 0,3,'','{$qtyTpl}',NULL)"; + $sglTpl = ( $guid === 'stockassembly' ) ? 'bom' : 'text'; + $pckTpl = ( $guid === 'stockassembly' ) ? 'bompck' : 'value'; + $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('SGL','{$guid}','quantity','Single unit', 0,3,'','{$sglTpl}',NULL)"; + $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('PCK','{$guid}','quantity','Pack', 0,3,'','{$pckTpl}',NULL)"; + $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('SHT','{$guid}','quantity','Sheet (H x W)', 0,3,'','{$sglTpl}',NULL)"; + $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('VOL','{$guid}','quantity','Volume', 0,3,'','{$sglTpl}',NULL)"; $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('MOV','{$guid}','quantity','Stock movement', 1,3,'','text',NULL)"; // Values sources — starter catalogue, all multi=0, add more via admin |
