forked from timschofield/webERP
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Z_MakeStockLocns.php
26 lines (20 loc) · 941 Bytes
/
Z_MakeStockLocns.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/* Script to make stock locations for all parts that do not have stock location records set up*/
include ('includes/session.php');
$Title = _('Make LocStock Records');
include('includes/header.php');
echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist');
$sql = "INSERT INTO locstock (stockid, loccode)
SELECT stockmaster.stockid,
locations.loccode
FROM stockmaster CROSS JOIN locations
LEFT JOIN locstock
ON stockmaster.stockid = locstock.stockid
AND locations.loccode = locstock.loccode
WHERE locstock.stockid IS NULL";
$ErrMsg = _('The items/locations that need stock location records created cannot be retrieved because');
$Result = DB_query($sql,$ErrMsg);
echo '<p />';
prnMsg(_('Any stock items that may not have had stock location records have now been given new location stock records'),'info');
include('includes/footer.php');
?>