diff --git a/REST/functions.php b/REST/functions.php
index b8f0c774..325a428d 100644
--- a/REST/functions.php
+++ b/REST/functions.php
@@ -86,8 +86,14 @@ function copySaleFromTwinpol($record) {
if (!isset($fvPrice)) {
$price_start = 0;
echo " Brak ceny
";
+ $vat_id = $product->ecmvat_id;
+ $vat_name = $product->ecmvat_name;
+ $vat_value = $product->ecmvat_value;
} else {
$price_start = $fvPrice['price_start'];
+ $vat_id = $fvPrice['ecmvat_id'];
+ $vat_name = $fvPrice['ecmvat_name'];
+ $vat_value = $fvPrice['ecmvat_value'];
echo " Cena: ".$price_start." (".$fvPrice['document_no'].")
";
}
}
@@ -101,9 +107,9 @@ function copySaleFromTwinpol($record) {
$prod['discount'] = $product->discount;
$prod['price_start'] = $price_start;
$prod['price_netto'] = round($price_start - ($price_start * ($product->discount / 100)),2);
- $prod['ecmvat_id'] = $fvPrice['ecmvat_id'];
- $prod['ecmvat_value'] = $fvPrice['ecmvat_value'];
- $prod['ecmvat_name'] = $fvPrice['ecmvat_name'];
+ $prod['ecmvat_id'] = $vat_id;
+ $prod['ecmvat_value'] = $vat_value;
+ $prod['ecmvat_name'] = $vat_name;
$prod['price_brutto'] = round($prod['price_netto']+($prod['price_netto']*($prod['ecmvat_value']/100)),2);
$prod['total_netto'] = round($prod['price_netto'] * $prod['quantity'], 2);
$prod['total_brutto'] = round($prod['total_netto']+($prod['total_netto']*($prod['ecmvat_value']/100)),2);
diff --git a/modules/EcmReports/BimIT-Reports/productionSchedule/productionSchedule.js b/modules/EcmReports/BimIT-Reports/productionSchedule/productionSchedule.js
index 00410506..4c83cbdb 100644
--- a/modules/EcmReports/BimIT-Reports/productionSchedule/productionSchedule.js
+++ b/modules/EcmReports/BimIT-Reports/productionSchedule/productionSchedule.js
@@ -64,6 +64,8 @@ $(document).ready(function () {
},
});
$("#allTable").bind('filterEnd', function () {
+ $("#selectAll").attr('checked', false);
+ $(".allCheck").prop('checked', false);
localStorage.setItem("productionSchedule_filter", $.tablesorter.getFilters($("#allTable")));
});
$("#allTable").bind("sortEnd", function () {
@@ -88,7 +90,11 @@ $(document).ready(function () {
}, 500);
$("#selectAll").click(function () {
if (this.checked) {
- $(".allCheck").prop("checked", true);
+ $(".allCheck").each(function() {
+ if ($(this).closest('tr').is(':visible')) {
+ $(this).prop('checked', true);
+ }
+ });
} else {
$(".allCheck").prop("checked", false);
}
@@ -190,6 +196,8 @@ function drawRawMaterials(data) {
sortList: [[2, 0]],
});
$("#rawMaterialsTable").bind("filterEnd", function (event, config) {
+ $("#selectAllRawMaterials").attr('checked', false);
+ $(".rawMaterialCheck").prop('checked', false);
updateRawMaterialsPositions();
});
$("#rawMaterialsTable").bind("sortEnd", function (event, config) {
@@ -201,7 +209,11 @@ function drawRawMaterials(data) {
$("#selectAllRawMaterials").attr('checked', false);
$("#selectAllRawMaterials").click(function () {
if (this.checked) {
- $(".rawMaterialCheck").prop('checked', true);
+ $(".rawMaterialCheck").each(function() {
+ if ($(this).closest('tr').is(':visible')) {
+ $(this).prop('checked', true);
+ }
+ });
} else {
$(".rawMaterialCheck").prop('checked', false);
}
diff --git a/modules/EcmReports/BimIT-Reports/productsBySales/productsBySales.js b/modules/EcmReports/BimIT-Reports/productsBySales/productsBySales.js
index c0c358c5..7d96cd88 100644
--- a/modules/EcmReports/BimIT-Reports/productsBySales/productsBySales.js
+++ b/modules/EcmReports/BimIT-Reports/productsBySales/productsBySales.js
@@ -42,6 +42,8 @@ $(document).ready(function () {
},
});
$("#allTable").bind('filterEnd', function (event, config) {
+ $("#selectAll").attr('checked', false);
+ $(".allCheck").prop('checked', false);
updateAllPositions();
localStorage.setItem('productBySales_filters', $.tablesorter.getFilters($('#allTable')));
});
@@ -70,7 +72,11 @@ $(document).ready(function () {
$("#selectAll").click(function () {
if (this.checked) {
- $(".allCheck").prop("checked", true);
+ $(".allCheck").each(function() {
+ if ($(this).closest('tr').is(':visible')) {
+ $(this).prop('checked', true);
+ }
+ });
} else {
$(".allCheck").prop("checked", false);
}
@@ -221,6 +227,8 @@ function drawComponents(data) {
widgets: ['filter', 'stickyHeaders'],
});
$("#componentsTable").bind('filterEnd', function (event, config) {
+ $("#selectAllComponents").attr('checked', false);
+ $(".componentCheck").prop('checked', false);
updateComponentsPositions();
});
$("#componentsTable").bind('sortEnd', function (event, config) {
@@ -230,9 +238,14 @@ function drawComponents(data) {
})
});
$("#selectAllComponents").attr('checked', false);
+ $("#selectAllComponents").attr('checked', false);
$("#selectAllComponents").click(function () {
if (this.checked) {
- $(".componentCheck").prop('checked', true);
+ $(".componentCheck").each(function() {
+ if ($(this).closest('tr').is(':visible')) {
+ $(this).prop('checked', true);
+ }
+ });
} else {
$(".componentCheck").prop('checked', false);
}
@@ -322,6 +335,8 @@ function drawRawMaterials(data) {
widgets: ['filter', 'stickyHeaders'],
});
$("#rawMaterialsTable").bind('filterEnd', function (event, config) {
+ $("#selectAllRawMaterials").attr('checked', false);
+ $(".rawMaterialCheck").prop('checked', false);
updateRawMaterialsPositions();
});
$("#rawMaterialsTable").bind('sortEnd', function (event, config) {
@@ -333,7 +348,11 @@ function drawRawMaterials(data) {
$("#selectAllRawMaterials").attr('checked', false);
$("#selectAllRawMaterials").click(function () {
if (this.checked) {
- $(".rawMaterialCheck").prop('checked', true);
+ $(".rawMaterialCheck").each(function() {
+ if ($(this).closest('tr').is(':visible')) {
+ $(this).prop('checked', true);
+ }
+ });
} else {
$(".rawMaterialCheck").prop('checked', false);
}