production scheduler fix
This commit is contained in:
@@ -478,6 +478,7 @@ function addToProductionScheduler(orderItemId) {
|
||||
success: function ()
|
||||
{
|
||||
hideLoader();
|
||||
$("#productScheduled-"+orderItemId).css('visibility', 'visible');
|
||||
window.alert("Dodano do harmonogramu produkcji.");
|
||||
},
|
||||
});
|
||||
|
||||
@@ -353,9 +353,9 @@ function getProductRawMaterials($productId, $quantity)
|
||||
function addToProductionScheduler($orderItemId) {
|
||||
$db = $GLOBALS['db'];
|
||||
global $current_user;
|
||||
$res = $db->fetchByAssoc($db->query("SELECT quantity, ecmproduct_id, production_date, description, ecmsale_id FROM ecmsaleitems WHERE id ='$orderItemId'"));
|
||||
$query = sprintf("INSERT INTO productionScheduler VALUES ('%s', '%s', '%s', '%d', NOW(), NOW(), '%s', '%s', 0, '%s', 0, '%s', '%s');",
|
||||
generateUuidV4(), $orderItemId, $res['ecmsale_id'], $res['quantity'], $current_user->id, $current_user->id, $res['ecmproduct_id'], $res['production_date'], $res['description']);
|
||||
$res = $db->fetchByAssoc($db->query("SELECT quantity, ecmproduct_id, description, ecmsale_id FROM ecmsaleitems WHERE id ='$orderItemId'"));
|
||||
$query = sprintf("INSERT INTO productionScheduler VALUES ('%s', '%s', '%s', '%d', NOW(), NOW(), '%s', '%s', 0, '%s', 0, '','%s');",
|
||||
generateUuidV4(), $orderItemId, $res['ecmsale_id'], $res['quantity'], $current_user->id, $current_user->id, $res['ecmproduct_id'], $res['description']);
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,9 +178,7 @@
|
||||
<td>
|
||||
<input type="checkbox" value="{$ROW.orderItemId}" class="allCheck"/>
|
||||
<br><img src="modules/EcmQuotes/images/add_position.gif" style="margin-top: 3px; margin-right: 3px; cursor: pointer" width="12" alt="" onclick="addToProductionScheduler('{$ROW.orderItemId}')">
|
||||
{if $ROW.scheduled > 0}
|
||||
<div style="background-color: green; width: 8px; height: 8px; border-radius: 50%; margin-top: 2px; margin-left: 2px;"></div>
|
||||
{/if}
|
||||
<div id="productScheduled-{$ROW.orderItemId}" style="background-color: green; width: 8px; height: 8px; border-radius: 50%; margin-top: 2px; margin-left: 2px; visibility: {if $ROW.scheduled > 0}visible{else}hidden{/if};"></div>
|
||||
<input type="hidden" id="productId-{$ROW.orderItemId}" value="{$ROW.productId}"/>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user