This commit is contained in:
2025-01-23 16:10:25 +00:00
parent a4a65d5b4f
commit 8ecc410394
9 changed files with 52 additions and 21 deletions

View File

@@ -64,7 +64,7 @@ else {
SELECT name, code, unit_id, product_category_id
FROM ecmproducts WHERE id='".$row['product_id']."'"));
$row['name'] = $res['name'];
$row['name'] = str_replace('"', "'", $res['name']);
$row['product_code'] = $res['code'];
$row['ecmproductcategory_id'] = $res['product_category_id'];
$row['unit_id'] = $res['unit_id'];
@@ -87,7 +87,7 @@ else {
SELECT name, code, unit_id, product_category_id
FROM ecmproducts WHERE id='".$row['product_id']."'"));
$row['name'] = $res['name'];
$row['name'] = str_replace('"', "", $res['name']);
$row['product_code'] = $res['code'];
$row['ecmproductcategory_id'] = $res['product_category_id'];
$row['unit_id'] = $res['unit_id'];

View File

@@ -98,9 +98,9 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $mod_strings, $current_user;
if(ACLController::checkAccess('EcmInsideOrders', "edit", true)) $module_menu [] = Array("index.php?module=".'EcmInsideOrders'."&action=EditView&return_module=".'EcmInsideOrders'."&return_action=DetailView", translate('LNK_NEW_'.'ECMNEWINSIDEORDERS', 'EcmInsideOrders'),"CreateEcmInsideOrders", 'EcmInsideOrders');
$module_menu [] = Array("index.php?module=".'EcmInsideOrders'."&action=EditView&return_module=".'EcmInsideOrders'."&return_action=DetailView", translate('LNK_NEW_'.'ECMNEWINSIDEORDERS', 'EcmInsideOrders'),"CreateEcmInsideOrders", 'EcmInsideOrders');
if(ACLController::checkAccess('EcmInsideOrders', "list", true)) $module_menu [] = Array("index.php?module=EcmInsideOrders&action=index&return_module=EcmInsideOrders&return_action=DetailView", translate('LNK_ECMNEWINSIDEORDERS_LIST','EcmInsideOrders'),"EcmInsideOrders", 'EcmInsideOrders');
$module_menu [] = Array("index.php?module=EcmInsideOrders&action=index&return_module=EcmInsideOrders&return_action=DetailView", translate('LNK_ECMNEWINSIDEORDERS_LIST','EcmInsideOrders'),"EcmInsideOrders", 'EcmInsideOrders');
?>

View File

@@ -5,7 +5,7 @@ $content = '
<table style="width: 100%; font-size: 8pt;">
<tr>
<td style="width: ' . $w . '%">
<b><h1>Zamówienie wewnętrzne</h1></b>
<b><h1>Przyjęcie produkcyjne</h1></b>
</td>
<td style="width: ' . $w2 . '%">
Numer:

View File

@@ -153,11 +153,11 @@ $mod_strings = array (
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie',
'LBL_LIST_FORM_TITLE' => 'Lista Ofert',
'LBL_LIST_FORM_TITLE' => 'Lista ',
'LBL_NEW_FORM_TITLE' => 'Nowa Oferta',
'LBL_NEW_FORM_TITLE' => 'Nowa dokument PP',
'LBL_DETAILS' => 'Szczególy Oferty',
'LBL_DETAILS' => 'Szczególy',
'LBL_ITEMS' => 'Zalaczone Produkty:',
@@ -182,8 +182,8 @@ $mod_strings = array (
'LBL_ID' => 'Id',
'LBL_NAME' => 'Nazwa',
'LNK_ECMNEWINSIDEORDERS_LIST'=> 'Lista zamówień towaru',
'LNK_NEW_ECMNEWINSIDEORDERS'=>'Utwórz zamówienie towaru',
'LNK_ECMNEWINSIDEORDERS_LIST'=> 'Lista dokumentów PP',
'LNK_NEW_ECMNEWINSIDEORDERS'=>'Utwórz dokument PP',
'LBL_DESCRIPTION' => 'Opis',

View File

@@ -90,6 +90,7 @@ $(document).ready(function () {
$("#excelBtn").click(() => { exportExcel(); });
$("#pdfBtn").click(() => { window.alert("In progress."); });
$("#productionBtn").click(() => { window.alert("In progress."); });
$("#createInsideOrder").click(createInsideOrder);
});
function editQty(id) {
@@ -210,4 +211,23 @@ function exportExcel() {
window.console.log(data);
},
});
}
}
function createInsideOrder() {
var ids = [];
$('input.allCheck:checkbox:checked').each(function () {
ids.push($(this).val());
});
if (ids.length === 0) {
alert('Wybierz pozycje.');
return;
}
var products = [];
ids.forEach(el => {
const qty = parseFloat($("#qtyInput-" + el).val().trim());
const id = $("#productId-" + el).val();
products.push(id + "|" + qty);
});
$("#insideOrderProducts").val(products.join('*'));
$("#createInsideOrderForm").submit();
}

View File

@@ -80,7 +80,11 @@
<input class="button" id="deleteBtn" value="Usuń" type="button">&nbsp;&nbsp;&nbsp;
<input class="button" id="excelBtn" value="Excel" type="button">
<input class="button" id="pdfBtn" value="PDF" type="button">
<input class="button" id="productionBtn" value="RW/PW" type="button">
<input class="button" value="Utwórz zamówienie wewnętrzne" type="button" id="createInsideOrder"/>
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductsBySalesReport=true" method="post"
target="_blank" id="createInsideOrderForm">
<input id="insideOrderProducts" name="insideOrderProducts" type="hidden" value=""/>
</form>
<div id="1">
<table id="allTable">
@@ -110,6 +114,7 @@
<tr>
<td>
<input type="checkbox" value="{$ROW.id}" class="allCheck"/>
<input type="hidden" id="productId-{$ROW.id}" value="{$ROW.productId}">
<!--
<img src="modules/EcmQuotes/images/add_position.gif" style="margin-top: 3px; margin-right: 3px; cursor: pointer" width="12" alt="Duplikuj" onclick="duplicatePosition('{$ROW.id}')">
<img src="modules/EcmQuotes/images/deleterow.gif" style="margin-top: 3px; margin-right: 3px; cursor: pointer" width="12" alt="Usuń" onclick="removePosition('{$ROW.id}')">