ProductionPlanning - few fixes
This commit is contained in:
@@ -210,8 +210,9 @@ function drawComponents(data) {
|
||||
tr.append("<td><a target=\"_blank\" href=\"index.php?module=EcmSales&action=DetailView&record=" + el.orderId + "\">" + el.orderNo + "</a></td>");
|
||||
tr.append("<td>" + el.orderType + "</td>");
|
||||
tr.append("<td>" + el.orderStatus + "</td>");
|
||||
tr.append("<td><a target=\"_blank\" href=\"index.php?module=Accounts&action=DetailView&record=" + el.orderParentId + "\">" + el.orderParent + "</a></td>");
|
||||
tr.append("<td>" + el.productKind + "</td>");
|
||||
tr.append("<td><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.mainProductId + "\">" + el.mainProductCode + "</a></td>");
|
||||
tr.append("<td><a target=\"_blank\" href=\"index.php?module=EcmSales&action=DetailView&record=" + el.orderId + "\">" + el.orderNo + "</a></td>");
|
||||
tr.append("<td>" + el.productShape + "</td>");
|
||||
tr.append("<td>" + el.productBrand + "</td>");
|
||||
tr.append("<td>" + el.orderSendDate + "</td>");
|
||||
$("#componentsTable > tbody").append(tr);
|
||||
@@ -479,7 +480,7 @@ function updateRawMaterialsPositions() {
|
||||
$("#rawMaterialsTableSum").html(Math.ceil(sum));
|
||||
}
|
||||
function componentsTablePrototype() {
|
||||
return '<table id="componentsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllComponents" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>Stan</th><th>ZS E5</th><th>Typ</th><th>Status</th><th>Odbiorca</th><th>Forma</th><th>Marka</th><th>Data wysyłki</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody><tfoot><tr><td colspan=4></td><td id="componentsTableSum">0</td><td colspan="8"></td></tr></tfoot></table>'
|
||||
return '<table id="componentsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllComponents" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>Stan</th><th>ZS E5</th><th>Typ</th><th>Status</th><th>Produkt główny</th><th>Zamawiający</th><th>Forma</th><th>Marka</th><th>Data wysyłki</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody><tfoot><tr><td colspan=4></td><td id="componentsTableSum">0</td><td colspan="9"></td></tr></tfoot></table>'
|
||||
}
|
||||
function rawMaterialsTablePrototype() {
|
||||
return '<table id="rawMaterialsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllRawMaterials" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>JM.</th><th>Stan</th><th>Zamówiono</th><th>Dostawca</th><th>Zamówienie</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody><tfoot><tr><td colspan=4></td><td id="rawMaterialsTableSum">0</td><td colspan="5"></td></tr></tfoot></table>'
|
||||
|
||||
@@ -381,6 +381,7 @@ function getComponents2($ids) {
|
||||
$db = $GLOBALS['db'];
|
||||
global $app_list_strings;
|
||||
$idsString = join("','", $ids);
|
||||
$mainProduct = $db->fetchByAssoc($db->query(sprintf("SELECT name FROM ecmproducts WHERE id IN ('%s')", $idsString)));;
|
||||
$productsQuery = "SELECT si.ecmproduct_id, SUM(si.quantity) as quantity, s.document_no, s.parent_id, s.parent_name,
|
||||
s.id, s.type, s.status, s.send_date
|
||||
FROM ecmsaleitems AS si
|
||||
@@ -392,6 +393,7 @@ function getComponents2($ids) {
|
||||
|
||||
$componentsData = array();
|
||||
while ($r = $db->fetchByAssoc($rows)) {
|
||||
$mainProduct = $db->fetchByAssoc($db->query(sprintf("SELECT code FROM ecmproducts WHERE id IN ('%s')", $r['ecmproduct_id'])));;
|
||||
$products = getProductComponents($r['ecmproduct_id'], $r['quantity']);
|
||||
foreach ($products as $product) {
|
||||
$prodQuery = sprintf("SELECT p.id, p.code, p.name, p.shape, p.brand, p.ems_qty_in_stock,
|
||||
@@ -399,6 +401,8 @@ function getComponents2($ids) {
|
||||
FROM ecmproducts AS p WHERE p.id = '%s' AND p.deleted = 0", $product['ecmproduct_id']);
|
||||
$p = $db->fetchByAssoc($db->query($prodQuery));
|
||||
$row = array();
|
||||
$row['mainProductId'] = $r['ecmproduct_id'];
|
||||
$row['mainProductCode'] = $mainProduct['code'];
|
||||
$row['productId'] = $p['id'];
|
||||
$row['productName'] = strlen($p['name']) > 55 ? substr($p['name'], 0, 55) . "..." : $p['name'];
|
||||
$row['productFullName'] = $p['name'];
|
||||
|
||||
Reference in New Issue
Block a user