Production improvements
This commit is contained in:
@@ -57,26 +57,33 @@ function loadSchedulers($dateFrom = null, $dateTo = null, $ids = null)
|
||||
$db = $GLOBALS['db'];
|
||||
global $app_list_strings;
|
||||
|
||||
$query = "SELECT s.id as orderId, s.document_no, s.status, s.parent_name, s.parent_id, s.send_date, s.type,
|
||||
p.code, p.name, ps.ecmproduct_id, ps.description,
|
||||
si.quantity, p.vendor_part_no as kind, p.brand, p.part_no as size, p.shape,
|
||||
p.ems_qty_in_stock as stockState, si.id as item_id, s.shipping_address_name, ps.production_date,
|
||||
ps.quantity as scheduledQuantity, ps.id as id,
|
||||
ps.main_id,
|
||||
ps_main.ecmproduct_id as main_product_id,
|
||||
p_main.code as main_product_code
|
||||
FROM productionScheduler AS ps
|
||||
LEFT JOIN ecmsaleitems AS si
|
||||
ON ps.ecmsaleitem_id = si.id
|
||||
LEFT JOIN ecmsales AS s
|
||||
ON ps.ecmsale_id = s.id
|
||||
INNER JOIN ecmproducts AS p
|
||||
ON ps.ecmproduct_id = p.id
|
||||
LEFT JOIN productionScheduler AS ps_main
|
||||
ON ps.main_id = ps_main.id
|
||||
LEFT JOIN ecmproducts AS p_main
|
||||
ON ps_main.ecmproduct_id = p_main.id
|
||||
WHERE ps.deleted = 0 ";
|
||||
$query = "
|
||||
SELECT s.id as orderId, s.document_no, s.status, s.parent_name, s.parent_id, s.send_date, s.type,
|
||||
p.code, p.name, ps.ecmproduct_id, ps.description,
|
||||
si.quantity, p.vendor_part_no as kind, p.brand, p.part_no as size, p.shape,
|
||||
p.ems_qty_in_stock as stockState, si.id as item_id, s.shipping_address_name, ps.production_date,
|
||||
ps.quantity as scheduledQuantity, ps.id as id,
|
||||
ps.main_id,
|
||||
ps_main.ecmproduct_id as main_product_id,
|
||||
p_main.code as main_product_code,
|
||||
GROUP_CONCAT(a.name SEPARATOR ', ') as actions
|
||||
FROM productionScheduler AS ps
|
||||
LEFT JOIN ecmsaleitems AS si
|
||||
ON ps.ecmsaleitem_id = si.id
|
||||
LEFT JOIN ecmsales AS s
|
||||
ON ps.ecmsale_id = s.id
|
||||
INNER JOIN ecmproducts AS p
|
||||
ON ps.ecmproduct_id = p.id
|
||||
LEFT JOIN productionScheduler AS ps_main
|
||||
ON ps.main_id = ps_main.id
|
||||
LEFT JOIN ecmproducts AS p_main
|
||||
ON ps_main.ecmproduct_id = p_main.id
|
||||
LEFT JOIN ecmproductactions pa
|
||||
ON p.id = pa.ecmproduct_id
|
||||
LEFT JOIN ecmactions a
|
||||
ON pa.ecmaction_id = a.id
|
||||
WHERE ps.deleted = 0
|
||||
GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id";
|
||||
|
||||
if ($dateFrom != null && $dateTo != null) {
|
||||
$query .= " AND (
|
||||
@@ -123,8 +130,9 @@ function loadSchedulers($dateFrom = null, $dateTo = null, $ids = null)
|
||||
$row['productionDate'] = $r['production_date'] == '0000-00-00' ? '' : $r['production_date'];
|
||||
$row['productStockState'] = $r['stockState'] | 0;
|
||||
$row['mainProductId'] = $r['main_product_id'];
|
||||
$row['mainProductCode'] = $r['main_product_code'];
|
||||
|
||||
$row['mainProductCode'] = strlen($r['main_product_code']) > 20 ? substr($r['main_product_code'], 0, 20) . "..." : $r['main_product_code'];
|
||||
$row['mainProductFullCode'] = $r['main_product_code'];
|
||||
$row['actions'] = $r['actions'];
|
||||
$data[] = $row;
|
||||
}
|
||||
return $data;
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
<th>Forma</th>
|
||||
<th>Marka</th>
|
||||
<th>Data wysyłki</th>
|
||||
<th>Czynność</th>
|
||||
<th>Uwagi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -166,18 +167,19 @@
|
||||
<img src="modules/EcmQuotes/images/deleterow.gif" style="margin-top: 3px; margin-right: 3px; cursor: pointer" width="12" alt="Usuń" onclick="removePosition('{$ROW.id}')">
|
||||
-->
|
||||
</td>
|
||||
<td>
|
||||
<a title="{$ROW.productFullCode}" target="_blank"
|
||||
href="index.php?module=EcmProducts&action=DetailView&record={$ROW.productId}">
|
||||
{$ROW.productCode}
|
||||
</a>
|
||||
</td>
|
||||
<td title="{$ROW.productFullName}">
|
||||
{$ROW.productName}
|
||||
</td>
|
||||
<td>
|
||||
<a title="{$ROW.productFullCode}" target="_blank"
|
||||
href="index.php?module=EcmProducts&action=DetailView&record={$ROW.productId}">
|
||||
{$ROW.productCode}
|
||||
</a>
|
||||
</td>
|
||||
<td title="{$ROW.productFullName}">
|
||||
{$ROW.productName}
|
||||
</td>
|
||||
<td>
|
||||
<input id="production-date-{$ROW.id}" name="production-date-{$ROW.id}" type="text"
|
||||
maxlength="10" size="11" tabindex="" title="" value="{$ROW.productionDate}" autocomplete="off"
|
||||
maxlength="10" size="11" tabindex="" title="" value="{$ROW.productionDate}"
|
||||
autocomplete="off"
|
||||
id="production-date-{$ROW.id}" onchange="saveProductionDate('{$ROW.id}')">
|
||||
<img id="production-date-trigger-{$ROW.id}" src="themes/default/images/jscalendar.gif"
|
||||
style="width: 13px;">
|
||||
@@ -193,59 +195,64 @@
|
||||
);
|
||||
</script>
|
||||
</td>
|
||||
<td style="white-space: nowrap;">
|
||||
<div id="edit-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||
onclick="editQty('{$ROW.id}')" style="display: inline-block;"></div>
|
||||
<div id="save-{$ROW.id}" class="ui-icon ui-icon-check"
|
||||
onclick="saveQty('{$ROW.id}')" style="display: none;"></div>
|
||||
<div id="qty-{$ROW.id}" style="display: inline; width: 300px;">{$ROW.qty}
|
||||
</div>
|
||||
<input id="qtyInput-{$ROW.id}" value="{$ROW.qty}" style="width: 50px; display: none;" type="number"/>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productQty}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productStockState}
|
||||
</td>
|
||||
<td>
|
||||
<a target="_blank" href="index.php?module=EcmSales&action=DetailView&record={$ROW.orderId}">
|
||||
{$ROW.orderNo}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderType}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderStatus}
|
||||
</td>
|
||||
<td>
|
||||
<a target="_blank" href="index.php?module=EcmProducts&action=DetailView&record={$ROW.mainProductId}">
|
||||
{$ROW.mainProductCode}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.shippingTo}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productShape}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productBrand}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderSendDate}
|
||||
</td>
|
||||
<td>
|
||||
<div id="edit-description-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||
onclick="editDescription('{$ROW.id}')" style="display: inline-block;"></div>
|
||||
<div id="save-description-{$ROW.id}" class="ui-icon ui-icon-check"
|
||||
onclick="saveDescription('{$ROW.id}')" style="display: none;"></div>
|
||||
<div id="description-{$ROW.id}" style="display: inline; width: 300px;">{$ROW.description}
|
||||
</div>
|
||||
<textarea id="descriptionInput-{$ROW.id}"
|
||||
style="display: none;">{$ROW.fullDescription}</textarea>
|
||||
</td>
|
||||
<td style="white-space: nowrap;">
|
||||
<div id="edit-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||
onclick="editQty('{$ROW.id}')" style="display: inline-block;"></div>
|
||||
<div id="save-{$ROW.id}" class="ui-icon ui-icon-check"
|
||||
onclick="saveQty('{$ROW.id}')" style="display: none;"></div>
|
||||
<div id="qty-{$ROW.id}" style="display: inline; width: 300px;">{$ROW.qty}
|
||||
</div>
|
||||
<input id="qtyInput-{$ROW.id}" value="{$ROW.qty}" style="width: 50px; display: none;"
|
||||
type="number"/>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productQty}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productStockState}
|
||||
</td>
|
||||
<td>
|
||||
<a target="_blank" href="index.php?module=EcmSales&action=DetailView&record={$ROW.orderId}">
|
||||
{$ROW.orderNo}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderType}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderStatus}
|
||||
</td>
|
||||
<td>
|
||||
<a target="_blank" href="index.php?module=EcmProducts&action=DetailView&record={$ROW.mainProductId}"
|
||||
title="{$ROW.mainProductFullCode}">
|
||||
{$ROW.mainProductCode}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.shippingTo}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productShape}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.productBrand}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.orderSendDate}
|
||||
</td>
|
||||
<td>
|
||||
{$ROW.actions}
|
||||
</td>
|
||||
<td>
|
||||
<div id="edit-description-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||
onclick="editDescription('{$ROW.id}')" style="display: inline-block;"></div>
|
||||
<div id="save-description-{$ROW.id}" class="ui-icon ui-icon-check"
|
||||
onclick="saveDescription('{$ROW.id}')" style="display: none;"></div>
|
||||
<div id="description-{$ROW.id}" style="display: inline; width: 300px;">{$ROW.description}
|
||||
</div>
|
||||
<textarea id="descriptionInput-{$ROW.id}"
|
||||
style="display: none;">{$ROW.fullDescription}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user