Create IO from ProductsSummary
This commit is contained in:
@@ -15,100 +15,15 @@ function getList() {
|
|||||||
|
|
||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
|
$("#createInsideOrder").click(createInsideOrder);
|
||||||
|
|
||||||
// by document no
|
|
||||||
$.tablesorter.addParser({
|
|
||||||
// set a unique id
|
|
||||||
id: 'rangesort',
|
|
||||||
is: function (s) {
|
|
||||||
// return false so this parser is not auto detected
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
format: function (s, table, cell, cellIndex) {
|
|
||||||
// get data attributes from $(cell).attr('data-something');
|
|
||||||
// check specific column using cellIndex
|
|
||||||
|
|
||||||
return $(cell).attr('data-price');
|
|
||||||
},
|
|
||||||
// set type, either numeric or text
|
|
||||||
type: 'numeric'
|
|
||||||
});
|
|
||||||
// by total netto
|
|
||||||
$.tablesorter.addParser({
|
|
||||||
// set a unique id
|
|
||||||
id: 'rangesorttota',
|
|
||||||
is: function (s) {
|
|
||||||
// return false so this parser is not auto detected
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
format: function (s, table, cell, cellIndex) {
|
|
||||||
// get data attributes from $(cell).attr('data-something');
|
|
||||||
// check specific column using cellIndex
|
|
||||||
|
|
||||||
return $(cell).attr('data-total');
|
|
||||||
},
|
|
||||||
// set type, either numeric or text
|
|
||||||
type: 'numeric'
|
|
||||||
});
|
|
||||||
// by vat
|
|
||||||
|
|
||||||
$.tablesorter.addParser({
|
|
||||||
// set a unique id
|
|
||||||
id: 'rangesorttotav',
|
|
||||||
is: function (s) {
|
|
||||||
// return false so this parser is not auto detected
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
format: function (s, table, cell, cellIndex) {
|
|
||||||
// get data attributes from $(cell).attr('data-something');
|
|
||||||
// check specific column using cellIndex
|
|
||||||
|
|
||||||
return $(cell).attr('data-total');
|
|
||||||
},
|
|
||||||
// set type, either numeric or text
|
|
||||||
type: 'numeric'
|
|
||||||
});
|
|
||||||
// by total brutto
|
|
||||||
$.tablesorter.addParser({
|
|
||||||
// set a unique id
|
|
||||||
id: 'rangesorttotan',
|
|
||||||
is: function (s) {
|
|
||||||
// return false so this parser is not auto detected
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
format: function (s, table, cell, cellIndex) {
|
|
||||||
// get data attributes from $(cell).attr('data-something');
|
|
||||||
// check specific column using cellIndex
|
|
||||||
|
|
||||||
return $(cell).attr('data-total');
|
|
||||||
},
|
|
||||||
// set type, either numeric or text
|
|
||||||
type: 'numeric'
|
|
||||||
});
|
|
||||||
// by total invoice
|
|
||||||
$.tablesorter.addParser({
|
|
||||||
// set a unique id
|
|
||||||
id: 'rangesorttotai',
|
|
||||||
is: function (s) {
|
|
||||||
// return false so this parser is not auto detected
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
format: function (s, table, cell, cellIndex) {
|
|
||||||
// get data attributes from $(cell).attr('data-something');
|
|
||||||
// check specific column using cellIndex
|
|
||||||
|
|
||||||
return $(cell).attr('data-total');
|
|
||||||
},
|
|
||||||
// set type, either numeric or text
|
|
||||||
type: 'numeric'
|
|
||||||
});
|
|
||||||
$('#selectall').click(function(event) { //on click
|
$('#selectall').click(function(event) { //on click
|
||||||
if(this.checked) { // check select status
|
if(this.checked) { // check select status
|
||||||
$('.make_pdf').each(function() { //loop through each checkbox
|
$('.allCheck').each(function() { //loop through each checkbox
|
||||||
this.checked = true; //select all checkboxes with class "checkbox1"
|
this.checked = true; //select all checkboxes with class "checkbox1"
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$('.make_pdf').each(function() { //loop through each checkbox
|
$('.allCheck').each(function() { //loop through each checkbox
|
||||||
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -140,32 +55,24 @@ $(document).ready(function()
|
|||||||
$('#myTable tr').removeClass('highlighted');
|
$('#myTable tr').removeClass('highlighted');
|
||||||
$(this).addClass('highlighted');
|
$(this).addClass('highlighted');
|
||||||
});
|
});
|
||||||
$("#myTable").tablesorter({
|
});
|
||||||
headers: {
|
|
||||||
0: {
|
|
||||||
// disable it by setting the property sorter to false
|
|
||||||
sorter: false
|
|
||||||
},
|
|
||||||
|
|
||||||
|
function createInsideOrder() {
|
||||||
|
console.log('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());
|
||||||
|
console.log(qty);
|
||||||
|
products.push(el + "|" + qty);
|
||||||
});
|
});
|
||||||
|
$("#insideOrderProducts").val(products.join('*'));
|
||||||
$("#myTable2").tablesorter({
|
$("#createInsideOrderForm").submit();
|
||||||
headers: {
|
|
||||||
0: {
|
|
||||||
// disable it by setting the property sorter to false
|
|
||||||
sorter: false
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
$("#myTable3").tablesorter({
|
|
||||||
headers: {
|
|
||||||
0: {
|
|
||||||
// disable it by setting the property sorter to false
|
|
||||||
sorter: false
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<form style="display:none;" action="index.php?module=EcmSales&action=ProductSummary" method="post"
|
<form style="display:none;" action="index.php?module=EcmSales&action=ProductSummary" method="post"
|
||||||
name="SearchFormListNewSales">
|
name="SearchFormListNewSales">
|
||||||
<ul class="tablist" style="width:100%;">
|
<ul class="tablist" style="width:100%;">
|
||||||
@@ -166,7 +167,11 @@
|
|||||||
<input type="hidden" value="{$IDS}" name='ids' id='ids'>
|
<input type="hidden" value="{$IDS}" name='ids' id='ids'>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductionScheduler=true" method="post"
|
||||||
|
target="_blank" id="createInsideOrderForm">
|
||||||
|
<input id="insideOrderProducts" name="insideOrderProducts" type="hidden" value=""/>
|
||||||
|
</form>
|
||||||
|
<input class="button" value="Utwórz przyjęcie produkcyjne" type="button" id="createInsideOrder"/>
|
||||||
<table cellspacing="0" cellpadding="0" style="width:100%;" id="myTable" class="tablesorter">
|
<table cellspacing="0" cellpadding="0" style="width:100%;" id="myTable" class="tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -184,8 +189,11 @@
|
|||||||
{foreach from=$POSITION_LIST key="key" item="item" name="components"}
|
{foreach from=$POSITION_LIST key="key" item="item" name="components"}
|
||||||
{if $item.id!=''}
|
{if $item.id!=''}
|
||||||
<tr style="vertical-align:top;">
|
<tr style="vertical-align:top;">
|
||||||
<td style="text-align:center;"><input type="checkbox" value="{$item.id}" class="make_pdf"
|
<td style="text-align:center;"><input type="checkbox" value="{$item.id}"
|
||||||
id="make_pdf_{$item.position}" name="selectedid[]"></td>
|
id="make_pdf_{$item.position}" name="selectedid[]" class="allCheck">
|
||||||
|
<input id="qtyInput-{$item.id}" value="{$item.quantity-$item.stock}" style="width: 50px; display: none;"
|
||||||
|
type="number"/>
|
||||||
|
</td>
|
||||||
<td>{$item.code}</td>
|
<td>{$item.code}</td>
|
||||||
<td>{$item.name}</td>
|
<td>{$item.name}</td>
|
||||||
<td>{$item.product_category_name}</td>
|
<td>{$item.product_category_name}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user