Compare commits
51 Commits
9a8acbe6a9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 300aa5381a | |||
| 292748248b | |||
| 2424bb76a3 | |||
| 7312918962 | |||
| f2c24967df | |||
| 469e254d9c | |||
| a7339e01f4 | |||
| fbc3c112a2 | |||
| 4e4a556e59 | |||
| 0a4745366b | |||
| 0caa2351d8 | |||
|
|
a3bd40889a | ||
|
|
a39ebfd84c | ||
|
|
ef6b3e0f7c | ||
| ec0ada2f7f | |||
|
|
d5c4261b23 | ||
|
|
07100c8f12 | ||
| c02009ad63 | |||
|
|
e52fb4e039 | ||
|
|
7e0d56c670 | ||
| 2fac64346e | |||
|
|
4374f2cd65 | ||
|
|
0e8227fc82 | ||
|
|
aae6334793 | ||
| fc4268def0 | |||
| 55f0a2e88d | |||
|
|
76dd05d591 | ||
|
|
d5d1d1ac28 | ||
|
|
5ae9391a70 | ||
|
|
204edb231f | ||
|
|
34113a5619 | ||
|
|
f6e5959027 | ||
|
|
c447558d2a | ||
| 21bd1807f3 | |||
| e759b6eb46 | |||
|
|
52f306cef9 | ||
|
|
980180adb1 | ||
| 4fc4fa05be | |||
|
|
91e6a206cb | ||
|
|
f9b7c2462b | ||
|
|
64a63d5748 | ||
|
|
cbf5645912 | ||
|
|
c70ab619e6 | ||
|
|
b8b076ebe7 | ||
| ea46083637 | |||
| 66e000879d | |||
|
|
7a3f58a551 | ||
|
|
e76b3fb61c | ||
|
|
fb866fb386 | ||
|
|
75dc09ca26 | ||
|
|
29fa933cb8 |
File diff suppressed because it is too large
Load Diff
@@ -655,8 +655,9 @@ $viewdefs['EcmProducts']['DetailView'] = array(
|
|||||||
'name' => 'production_panel',
|
'name' => 'production_panel',
|
||||||
'allCols' => true,
|
'allCols' => true,
|
||||||
'hideLabel' => true,
|
'hideLabel' => true,
|
||||||
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
||||||
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>'
|
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>
|
||||||
|
<br><b>Receptura:</b> {$PRODUCTION_DESCRIPTION}'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -59,28 +59,29 @@ var EcmDropdownEditor_save = function(dom, container) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var doms = EcmDropdownEditor_parseArrays(dom);
|
var doms = EcmDropdownEditor_parseArrays(dom);
|
||||||
var params = new Array;
|
var params = [];
|
||||||
params[0] = dom; //name of list
|
params[0] = dom; //name of list
|
||||||
params[1] = doms;//list of values
|
params[1] = doms;//list of values
|
||||||
// AJAX call
|
// AJAX call
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type : 'POST',
|
type : "POST",
|
||||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
url : "index.php?entryPoint=HandleEcmAjax",
|
||||||
data : {
|
data : {
|
||||||
ecmclass : 'EcmDropdownEditor',
|
ecmclass : "EcmDropdownEditor",
|
||||||
job : 'saveDom',
|
job : "saveDom",
|
||||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||||
},
|
},
|
||||||
dataType : 'json',
|
dataType : "json",
|
||||||
async : false,
|
async : false,
|
||||||
success : function(response) {
|
success : function() {
|
||||||
var div = $('[name='+container+']');
|
setTimeout(function() {
|
||||||
div.hide();
|
EcmDropdownEditor_refreshField(container);
|
||||||
EcmDropdownEditor_refreshField(container);
|
var div = $("[name="+container+"]");
|
||||||
return;
|
div.hide();
|
||||||
|
}, 3000);
|
||||||
},
|
},
|
||||||
error : function(xhr, ajaxOptions, thrownError) {
|
error : function(xhr, ajaxOptions, thrownError) {
|
||||||
console.log(thrownError);
|
window.console.log(thrownError);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -94,16 +95,17 @@ var EcmDropdownEditor_refreshField = function(container) {
|
|||||||
params[1] = container;//list of values
|
params[1] = container;//list of values
|
||||||
// AJAX call
|
// AJAX call
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
type : 'POST',
|
type : "POST",
|
||||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
url : "index.php?entryPoint=HandleEcmAjax",
|
||||||
data : {
|
data : {
|
||||||
ecmclass : 'EcmDropdownEditor',
|
ecmclass : "EcmDropdownEditor",
|
||||||
job : 'refreshField',
|
job : "refreshField",
|
||||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||||
},
|
},
|
||||||
dataType : 'json',
|
dataType : "json",
|
||||||
async : false,
|
async : false,
|
||||||
success : function(response) {
|
success : function(response) {
|
||||||
|
console.log('EditedDropdown', response);
|
||||||
var tmp = container.split("___");
|
var tmp = container.split("___");
|
||||||
$('form[name=EditView]').find('select[name='+tmp[0]+']').html(response[0]);
|
$('form[name=EditView]').find('select[name='+tmp[0]+']').html(response[0]);
|
||||||
return;
|
return;
|
||||||
|
|||||||
125
include/language/en_us.EcmDropdownEditor.php
Normal file → Executable file
125
include/language/en_us.EcmDropdownEditor.php
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// created: 2025-08-13 12:56:45
|
// created: 2025-11-06 11:08:29
|
||||||
$customDoms = array (
|
$customDoms = array (
|
||||||
'ecmproducts_attribute_dom' =>
|
'ecmproducts_attribute_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -10,9 +10,8 @@ $customDoms = array (
|
|||||||
'ecmproducts_shape_dom' =>
|
'ecmproducts_shape_dom' =>
|
||||||
array (
|
array (
|
||||||
'8bc92e86-d956-0df2-e34c-656e0bc9da04' => 'None',
|
'8bc92e86-d956-0df2-e34c-656e0bc9da04' => 'None',
|
||||||
'6db335cc-96d5-5185-6118-65761ec65583' => 'Liquid',
|
'8112d0d3-baca-cd8a-3b00-6576321030cb' => 'Butelka IT_100 B1_100 ml',
|
||||||
'8112d0d3-baca-cd8a-3b00-6576321030cb' => 'Bottle B1_100ml',
|
'1441313f-245d-dfe7-92dd-6576255579fb' => 'Butelka IT_250 B1_250 ml',
|
||||||
'1441313f-245d-dfe7-92dd-6576255579fb' => 'Bottle B1_250ml',
|
|
||||||
'c2beb683-dd0a-c76f-fd2f-6576252c68de' => 'Bottle B1_500ml',
|
'c2beb683-dd0a-c76f-fd2f-6576252c68de' => 'Bottle B1_500ml',
|
||||||
'8a4c1e7b-fb17-681d-a9dd-65762566ca64' => 'Bottle B1_1000ml',
|
'8a4c1e7b-fb17-681d-a9dd-65762566ca64' => 'Bottle B1_1000ml',
|
||||||
'4d063e6a-9cf1-28f4-2e98-6576251a3e7f' => 'Tube standard',
|
'4d063e6a-9cf1-28f4-2e98-6576251a3e7f' => 'Tube standard',
|
||||||
@@ -29,27 +28,29 @@ $customDoms = array (
|
|||||||
'5048d070-7da8-a160-d0bd-659c6af595b4' => 'Kit 3in1',
|
'5048d070-7da8-a160-d0bd-659c6af595b4' => 'Kit 3in1',
|
||||||
'a1d41637-21c8-60e7-dfeb-65973bb8bc04' => 'Kit 4in1',
|
'a1d41637-21c8-60e7-dfeb-65973bb8bc04' => 'Kit 4in1',
|
||||||
'e47359f6-5f25-4d4b-c472-65b77152ae8a' => 'Kit 5in1',
|
'e47359f6-5f25-4d4b-c472-65b77152ae8a' => 'Kit 5in1',
|
||||||
'cd43ef35-031a-ce97-3d1c-65f41563046f' => 'Bottle D11_50ml (RPET)',
|
'58664d9d-0295-3539-4662-659f18dc4b80' => 'Butelka OD_1000 D21_1000 ml',
|
||||||
'b78c2842-b4f8-ad77-e7ea-65f41571c57e' => 'Bottle D11_250ml (RPET)',
|
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'Butelka OD 500 ml',
|
||||||
'901babfa-3d95-3a98-8dbf-659f00f4f91e' => 'Bottle D21_250ml',
|
'901babfa-3d95-3a98-8dbf-659f00f4f91e' => 'Butelka OD 250 ml',
|
||||||
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'Bottle D21_250ml ',
|
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'Butelka OD 250 ml NW',
|
||||||
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'B D22_250ml (szyjka)',
|
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'Butelka ZMW_250 ml (zmywarka)',
|
||||||
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'Bottle D23_250ml',
|
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'Butelka DYW_500 ml',
|
||||||
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'Bottle D24 250 ml (Ula)',
|
'307f61db-5fd9-3aa6-e701-65a04f4bba88' => 'Butelka NAB 500 ml (nabłyszczacz)',
|
||||||
'359d7556-f107-92de-4121-659f1eafeb90' => 'B D11_500ml (RPET)',
|
'cd43ef35-031a-ce97-3d1c-65f41563046f' => 'Butelka Boston 50 ml ',
|
||||||
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'Bottle D12_500ml',
|
'b78c2842-b4f8-ad77-e7ea-65f41571c57e' => 'Butelka Boston 250ml ',
|
||||||
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'Bottle D21_500ml',
|
'359d7556-f107-92de-4121-659f1eafeb90' => 'Butelka Boston 500ml ',
|
||||||
'8f4fdd3c-44f9-103b-3f40-659f1c128319' => 'Bottle D22_500ml',
|
'd7c10cb9-7459-1174-6315-661cdae38a39' => 'Butelka Boston 1000 ml',
|
||||||
'307f61db-5fd9-3aa6-e701-65a04f4bba88' => 'B D23_500ml (nabłyszczacz)',
|
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'Butelka DET 250 ml',
|
||||||
'5df47246-d0cd-4151-9bdd-65eede53aba5' => 'B D24_500ml (systemy mleczne)',
|
'8f4fdd3c-44f9-103b-3f40-659f1c128319' => 'Butelka DET_500 (szyjka) ',
|
||||||
'ab74cd2c-7720-5875-7ca5-66bb55a3e075' => 'Bottle D25_500ml (Ula)',
|
'92a7ee9b-d953-fd7e-5c88-65c9bf1e144d' => 'Butelka DET 1000 ml (szyjka)',
|
||||||
'd7c10cb9-7459-1174-6315-661cdae38a39' => 'D11_1000ml',
|
'5df47246-d0cd-4151-9bdd-65eede53aba5' => 'Butelka SML_500 ml (systemy mleczne)',
|
||||||
'58664d9d-0295-3539-4662-659f18dc4b80' => 'Bottle',
|
'87a2b609-9b67-de82-8f41-65eedd4613c9' => 'Butelka SML_1000 ml (systemy mleczne)',
|
||||||
'92a7ee9b-d953-fd7e-5c88-65c9bf1e144d' => 'B D22_1000ml (szyjka)',
|
'75980ea5-d89e-3923-2662-66bb55202244' => 'Butelka ULA 1000 ml',
|
||||||
'87a2b609-9b67-de82-8f41-65eedd4613c9' => 'D23_1000ml (systemy mleczne)',
|
'ab74cd2c-7720-5875-7ca5-66bb55a3e075' => 'Butelka ULA 500 ml',
|
||||||
'75980ea5-d89e-3923-2662-66bb55202244' => 'D24_1000ml (Ula)',
|
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'Butelka ULA 250 ml ',
|
||||||
'ba4f06a8-f6fb-4969-d4b9-6683e6b6b372' => 'D11_2000ml ',
|
'881d099d-36ee-3b45-b1ab-68dd2becfe84' => 'Butelka Irys 150 ml',
|
||||||
'cb8f5e45-43e1-b62d-05d7-669646b4eb10' => 'Bottle D12_5000ml (kanister)',
|
'ba4f06a8-f6fb-4969-d4b9-6683e6b6b372' => 'Butelka PDP_2000 ml ',
|
||||||
|
'a2ba9b76-8e2e-32c4-e9c8-689c6ac2dbb9' => 'Bottle 30 ml N-34B plastan',
|
||||||
|
'cb8f5e45-43e1-b62d-05d7-669646b4eb10' => 'Kanister 5000 ml',
|
||||||
'820341fa-0db5-9d74-7544-659f17560658' => 'Kit ',
|
'820341fa-0db5-9d74-7544-659f17560658' => 'Kit ',
|
||||||
'567da064-cd31-0416-2ad3-6581cc870e96' => 'Doypack 110x180mm',
|
'567da064-cd31-0416-2ad3-6581cc870e96' => 'Doypack 110x180mm',
|
||||||
'edf38614-90c3-50a7-56e8-65dda2d891c2' => 'Doypack 130x220mm',
|
'edf38614-90c3-50a7-56e8-65dda2d891c2' => 'Doypack 130x220mm',
|
||||||
@@ -57,32 +58,33 @@ $customDoms = array (
|
|||||||
'2e060602-334b-d053-6bd4-65a9a3d7a99b' => 'Doypack 180x290mm',
|
'2e060602-334b-d053-6bd4-65a9a3d7a99b' => 'Doypack 180x290mm',
|
||||||
'eb0cb757-d39b-9677-b422-65eec426d4fe' => 'Blister tablets 6pcs 2,5g',
|
'eb0cb757-d39b-9677-b422-65eec426d4fe' => 'Blister tablets 6pcs 2,5g',
|
||||||
'64716544-e41f-3dfc-d021-657630c2bafe' => 'Blister tablets 10pcs 3g',
|
'64716544-e41f-3dfc-d021-657630c2bafe' => 'Blister tablets 10pcs 3g',
|
||||||
'32d6dac9-321d-a935-6e1b-659f012eabd1' => 'Blister tablets 10pcs 1,3g',
|
'32d6dac9-321d-a935-6e1b-659f012eabd1' => 'Blister tablets 16 mm 10pcs 1,3g',
|
||||||
|
'225115e4-1ce2-9a98-b7a0-672930e3318c' => 'Blister tabletki 10szt. 2 g',
|
||||||
|
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'Blister tablets 6pcs 25 mm 6,5g',
|
||||||
'ce7793b9-3f5a-3f5f-13dc-66013c397db1' => 'Blister microfiber 20x20cm',
|
'ce7793b9-3f5a-3f5f-13dc-66013c397db1' => 'Blister microfiber 20x20cm',
|
||||||
'48369f61-18bd-53e6-070a-659f026773ac' => 'Box',
|
|
||||||
'37dbeaa1-f183-3b3e-1b54-65aa78a662a2' => 'Jar 500 ml',
|
|
||||||
'f13d7541-494d-75c7-2a35-65aa784b42a5' => 'Jar 1000 ml',
|
|
||||||
'e703a7f9-d27d-b445-d946-66727a3940d9' => 'Jar 1500 ml',
|
|
||||||
'da8d7be4-58dc-4f75-f547-65c310cd97dd' => 'Jar 65 ml',
|
'da8d7be4-58dc-4f75-f547-65c310cd97dd' => 'Jar 65 ml',
|
||||||
'e1a16dbf-7216-d184-b9ed-65c310aff4d4' => 'Jar 150 ml',
|
'e1a16dbf-7216-d184-b9ed-65c310aff4d4' => 'Jar 150 ml',
|
||||||
'2a9454a6-b2a1-150f-c307-65c31102cb28' => 'Jar 250 ml',
|
'2a9454a6-b2a1-150f-c307-65c31102cb28' => 'Jar 250 ml',
|
||||||
'3acd80de-8dcc-ced9-c2fa-65eee6ae9949' => 'Spray 100 ml',
|
|
||||||
'6014bd30-9be6-4348-5b3a-6603f015f392' => 'Bucket 2,75l',
|
|
||||||
'786f48d6-16e7-a0a4-4aec-6628a16a0f89' => 'Foam 100ml',
|
|
||||||
'349b50d1-0a7b-b3bd-e72e-662b42ca98ae' => 'Foam 400ml',
|
|
||||||
'cb66a685-53e1-5f87-0a25-66967c7cb63b' => 'Doypack 210x285mm',
|
|
||||||
'75f4bd2a-51a8-0767-635e-66dde15af79e' => 'Foam 200ml',
|
|
||||||
'225115e4-1ce2-9a98-b7a0-672930e3318c' => 'Blister tabletki 10szt. 2 g',
|
|
||||||
'e6900d92-6fde-90e6-b872-67d1938745e6' => 'Słoik 400 ml',
|
'e6900d92-6fde-90e6-b872-67d1938745e6' => 'Słoik 400 ml',
|
||||||
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Bottle B1_30ml',
|
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Bottle B1_30ml',
|
||||||
|
'37dbeaa1-f183-3b3e-1b54-65aa78a662a2' => 'Jar 500 ml',
|
||||||
|
'f13d7541-494d-75c7-2a35-65aa784b42a5' => 'Słoik 1000 ml',
|
||||||
|
'e703a7f9-d27d-b445-d946-66727a3940d9' => 'Słoik 1500 ml',
|
||||||
|
'3acd80de-8dcc-ced9-c2fa-65eee6ae9949' => 'Spray 100 ml',
|
||||||
|
'786f48d6-16e7-a0a4-4aec-6628a16a0f89' => 'Foam 100ml',
|
||||||
|
'75f4bd2a-51a8-0767-635e-66dde15af79e' => 'Foam 200ml',
|
||||||
|
'349b50d1-0a7b-b3bd-e72e-662b42ca98ae' => 'Foam 400ml',
|
||||||
|
'cb66a685-53e1-5f87-0a25-66967c7cb63b' => 'Doypack 210x285mm',
|
||||||
|
'6014bd30-9be6-4348-5b3a-6603f015f392' => 'Bucket 2,75l',
|
||||||
|
'48369f61-18bd-53e6-070a-659f026773ac' => 'Box',
|
||||||
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
||||||
|
'6db335cc-96d5-5185-6118-65761ec65583' => 'Liquid',
|
||||||
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'LCD Liquid',
|
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'LCD Liquid',
|
||||||
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Cellophane Bag',
|
|
||||||
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tablet',
|
|
||||||
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'Blister tablets 6pcs 6,5g',
|
|
||||||
'31bf91c9-6176-a27a-9a4e-686f6b2597ee' => 'Liquid',
|
'31bf91c9-6176-a27a-9a4e-686f6b2597ee' => 'Liquid',
|
||||||
|
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tablet',
|
||||||
'27c00505-f6cf-3ef1-3c1d-6880847a5893' => 'Powder',
|
'27c00505-f6cf-3ef1-3c1d-6880847a5893' => 'Powder',
|
||||||
'a2ba9b76-8e2e-32c4-e9c8-689c6ac2dbb9' => 'Bottle 30 ml N-34B plastan',
|
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Cellophane Bag',
|
||||||
|
'40eb0d63-517e-345c-532d-68d37d215372' => 'Sachet',
|
||||||
),
|
),
|
||||||
'ecmproducts_brand_dom' =>
|
'ecmproducts_brand_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -177,6 +179,12 @@ $customDoms = array (
|
|||||||
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
||||||
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
||||||
'c709e4cf-9ca7-c946-f5e3-688202ec4c24' => 'Aspico',
|
'c709e4cf-9ca7-c946-f5e3-688202ec4c24' => 'Aspico',
|
||||||
|
'8bf5f833-51a9-3913-aa0a-68b6d539a1b5' => 'MediaShop',
|
||||||
|
'973ff617-4696-1a21-1ba3-68c2c008e079' => 'Severno',
|
||||||
|
'd6f1a2c9-58ea-707f-112f-68cba0dcf990' => 'Safelt',
|
||||||
|
'2f1cc2a6-7fe7-4848-b7e9-68cd307ec67f' => 'CleanFix',
|
||||||
|
'261451a0-d1fb-546b-28e4-68e3bb7fdde9' => 'Alarsa',
|
||||||
|
'd3f20145-cd52-0c92-bb81-690c81cba13e' => 'Hisense',
|
||||||
),
|
),
|
||||||
'ecmproducts_category_dom' =>
|
'ecmproducts_category_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -228,13 +236,33 @@ $customDoms = array (
|
|||||||
),
|
),
|
||||||
'ecmactions_category_dom' =>
|
'ecmactions_category_dom' =>
|
||||||
array (
|
array (
|
||||||
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'Filling Capping Labeling',
|
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'None',
|
||||||
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'Sets',
|
'5d843f39-893f-51f8-3df5-68c86f1d41c3' => 'HP1',
|
||||||
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'Liquid Mixing',
|
'31174829-986e-4d7f-4262-68b2e73742e9' => 'HP2',
|
||||||
'9bc2bafc-0608-7bc7-468b-686a94772424' => 'Bisters',
|
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'Pakowalnia 1 Hala 1',
|
||||||
'be37016b-0aa4-678c-9c4a-689c3673af3e' => 'Packing Blisters Into Packaging',
|
'2bdf9315-5c31-778d-4922-68c86f4af827' => 'Pakowalnia 2 Hala 1',
|
||||||
'e3e16e03-8e62-624e-f954-689c37059997' => 'Packing Tablets Into Jars',
|
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'Mieszalnia Hala 1',
|
||||||
'416a2b50-4979-bc35-c83c-689c8a6640ae' => 'Packing into tubes',
|
'de2448f8-45ac-6b2a-f2b1-68b2e7e40a6f' => 'Mieszalnik1 Hala 2',
|
||||||
|
'9bc2bafc-0608-7bc7-468b-686a94772424' => 'BL1',
|
||||||
|
'347509e3-fff6-4db9-761e-68b2e36436c6' => 'LNE1',
|
||||||
|
'26c3b7fa-e1ac-66d9-517b-68b2e4c6cae8' => 'LNE2',
|
||||||
|
'5664a1b1-42dc-2bb8-ad24-68b2e52df143' => 'LNE3',
|
||||||
|
'307b8935-5235-628f-aac1-68b2e56d3f4d' => 'LNE4',
|
||||||
|
'8d68df07-0779-5a23-aaf3-68b2e5d72a46' => 'LNE5',
|
||||||
|
'53d9cae1-1ec5-71e4-5a3c-68b2e77b6d92' => 'MDC5',
|
||||||
|
'3fea0360-a9d8-93fc-1984-68b2e89e4ec8' => 'FPH9',
|
||||||
|
'6159a89b-219c-bb4e-1505-68b2e9da1b7c' => 'LNEZ7',
|
||||||
|
'9bc005d7-5222-3d65-b754-68b2e9854af7' => 'LE10',
|
||||||
|
'b1176c04-4fe3-d347-9e3a-68b2e945b5c3' => 'FPH1',
|
||||||
|
'bc4422dc-8f80-4f54-26a6-68b2ea0cd2c0' => 'LNEZ8',
|
||||||
|
'd8208a7e-b810-91e5-ccfa-68b2eaa73abb' => 'LNAS1',
|
||||||
|
'a87e1b10-771d-2f24-e795-68d385f0cd35' => 'LNAS2',
|
||||||
|
'f2364990-b244-064d-b5d1-68b2ebcd0ded' => 'MDC6',
|
||||||
|
'cc4905b6-a791-5c57-4721-68b2eb29e0fe' => 'TAB1',
|
||||||
|
'40e8149a-40ec-aeb0-4cdd-68b2eb52634b' => 'TAB2',
|
||||||
|
'b64ca8db-ff88-082c-887c-68b2ec98c15d' => 'TAB3',
|
||||||
|
'dab10a8b-295a-8eeb-be7c-68c67ec66ff7' => 'TAB4',
|
||||||
|
'640aea22-b0c0-fd36-1ed4-68cac4262fe8' => 'LT1',
|
||||||
),
|
),
|
||||||
'payment_method_dom' =>
|
'payment_method_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -321,6 +349,7 @@ $customDoms = array (
|
|||||||
'end_of_line' => 'Non Active',
|
'end_of_line' => 'Non Active',
|
||||||
'active' => 'Active',
|
'active' => 'Active',
|
||||||
'new' => 'New',
|
'new' => 'New',
|
||||||
|
'e8d1191e-2c7b-c24d-88e2-68b2bd076498' => 'test',
|
||||||
),
|
),
|
||||||
'ecmsales_status_dom' =>
|
'ecmsales_status_dom' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
153
include/language/pl_pl.EcmDropdownEditor.php
Normal file → Executable file
153
include/language/pl_pl.EcmDropdownEditor.php
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// created: 2025-08-13 12:56:45
|
// created: 2025-11-06 11:08:29
|
||||||
$customDoms = array (
|
$customDoms = array (
|
||||||
'ecmproducts_attribute_dom' =>
|
'ecmproducts_attribute_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -10,79 +10,81 @@ $customDoms = array (
|
|||||||
'ecmproducts_shape_dom' =>
|
'ecmproducts_shape_dom' =>
|
||||||
array (
|
array (
|
||||||
'8bc92e86-d956-0df2-e34c-656e0bc9da04' => 'None',
|
'8bc92e86-d956-0df2-e34c-656e0bc9da04' => 'None',
|
||||||
'6db335cc-96d5-5185-6118-65761ec65583' => 'Płyn',
|
'8112d0d3-baca-cd8a-3b00-6576321030cb' => 'BT_IT_100',
|
||||||
'8112d0d3-baca-cd8a-3b00-6576321030cb' => 'Butelka B1_100ml',
|
'1441313f-245d-dfe7-92dd-6576255579fb' => 'BT_IT_250',
|
||||||
'1441313f-245d-dfe7-92dd-6576255579fb' => 'Butelka B1_250ml',
|
'c2beb683-dd0a-c76f-fd2f-6576252c68de' => 'BT_IT_500',
|
||||||
'c2beb683-dd0a-c76f-fd2f-6576252c68de' => 'Butelka B1_500ml',
|
'8a4c1e7b-fb17-681d-a9dd-65762566ca64' => 'BT_IT_1000',
|
||||||
'8a4c1e7b-fb17-681d-a9dd-65762566ca64' => 'Butelka B1_1000ml',
|
'4d063e6a-9cf1-28f4-2e98-6576251a3e7f' => 'TUBA_STD',
|
||||||
'4d063e6a-9cf1-28f4-2e98-6576251a3e7f' => 'Tuba standardowa',
|
'be48f1f6-5b67-2c78-cbdf-657625fe8bb1' => 'TUBA_MALA',
|
||||||
'be48f1f6-5b67-2c78-cbdf-657625fe8bb1' => 'Tuba mała',
|
'dfc6637e-c6d5-a435-1d41-657625555443' => 'TUBA_MEGA',
|
||||||
'dfc6637e-c6d5-a435-1d41-657625555443' => 'Tuba mega',
|
'770e7d85-03ee-0052-6098-6576258cbe49' => 'TUBA_WYS',
|
||||||
'770e7d85-03ee-0052-6098-6576258cbe49' => 'Tuba wysoka',
|
|
||||||
'81dcdf2f-a598-a18c-0a3c-65a8b1cd5a9f' => 'Gaz 200 ml',
|
'81dcdf2f-a598-a18c-0a3c-65a8b1cd5a9f' => 'Gaz 200 ml',
|
||||||
'796e726e-3e33-3481-5b09-6576331c5014' => 'Gaz 400ml',
|
'796e726e-3e33-3481-5b09-6576331c5014' => 'Gaz 400ml',
|
||||||
'64e3dd7a-306d-a31d-c060-658532cbb2b4' => 'Gaz 600ml',
|
'64e3dd7a-306d-a31d-c060-658532cbb2b4' => 'Gaz 600ml',
|
||||||
'905ceee4-8ef5-aa39-2a8b-659f0dcffa8b' => 'Zestaw 2w1 B1_100ml + m20x20 ',
|
'905ceee4-8ef5-aa39-2a8b-659f0dcffa8b' => 'Zestaw 2w1 B1_100ml + m20x20 ',
|
||||||
'6dd408f0-129f-96de-b745-659f1009426c' => 'Zestaw 2w1 B1_250ml+m20x20 ',
|
'6dd408f0-129f-96de-b745-659f1009426c' => 'Zestaw 2w1 B1_250ml+m20x20 ',
|
||||||
'be0f875a-3f01-f042-0eba-6576337e17bd' => 'Zestaw 2w1 B1_500ml+m30x30',
|
'be0f875a-3f01-f042-0eba-6576337e17bd' => 'Zestaw 2w1 B1_500ml+m30x30',
|
||||||
'5f76c0b4-261f-8883-4b88-662238c487e0' => 'Zestaw 2w1',
|
'5f76c0b4-261f-8883-4b88-662238c487e0' => 'ZES_2_1',
|
||||||
'5048d070-7da8-a160-d0bd-659c6af595b4' => 'Zestaw 3w1',
|
'5048d070-7da8-a160-d0bd-659c6af595b4' => 'ZES_3_1',
|
||||||
'a1d41637-21c8-60e7-dfeb-65973bb8bc04' => 'Zestaw 4w1',
|
'a1d41637-21c8-60e7-dfeb-65973bb8bc04' => 'ZES_4_1',
|
||||||
'e47359f6-5f25-4d4b-c472-65b77152ae8a' => 'Zestaw 5w1',
|
'e47359f6-5f25-4d4b-c472-65b77152ae8a' => 'ZES_5_1',
|
||||||
'cd43ef35-031a-ce97-3d1c-65f41563046f' => 'Butelka D11_50ml (RPET)',
|
'58664d9d-0295-3539-4662-659f18dc4b80' => 'BT_OD_1000 (Odkamieniacz)',
|
||||||
'b78c2842-b4f8-ad77-e7ea-65f41571c57e' => 'Butelka D11_250ml (RPET)',
|
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'BT_OD_500 (Odkamieniacz)',
|
||||||
'901babfa-3d95-3a98-8dbf-659f00f4f91e' => 'Butelka D21_250ml (Odkamieniacz)',
|
'901babfa-3d95-3a98-8dbf-659f00f4f91e' => 'BT_OD_250 (Odkamieniacz)',
|
||||||
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'Butelka D21_250ml_new (Odkamieniacz)',
|
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'BT_OD_250_NW (Odkamieniacz)',
|
||||||
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'Butelka D22_250ml (szyjka)',
|
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'BT_ZMW_250 (zmywarka)',
|
||||||
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'Butelka D23_250ml (Zmywarka)',
|
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'BT_DYW_500 (Dywan)',
|
||||||
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'Butelka D24 250 ml (Ula)',
|
'307f61db-5fd9-3aa6-e701-65a04f4bba88' => 'BT_NAB_500 (nabłyszczacz)',
|
||||||
'359d7556-f107-92de-4121-659f1eafeb90' => 'Butelka D11_500ml (RPET)',
|
'cd43ef35-031a-ce97-3d1c-65f41563046f' => 'BT_BOS_050',
|
||||||
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'Butelka D12_500ml (Dywan)',
|
'b78c2842-b4f8-ad77-e7ea-65f41571c57e' => 'BT_BOS_250',
|
||||||
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'Butelka D21_500ml (Odkamieniacz)',
|
'359d7556-f107-92de-4121-659f1eafeb90' => 'BT_BOS_500 ',
|
||||||
'8f4fdd3c-44f9-103b-3f40-659f1c128319' => 'Butelka D22_500ml (szyjka)',
|
'd7c10cb9-7459-1174-6315-661cdae38a39' => 'BT_BOS_1000 ',
|
||||||
'307f61db-5fd9-3aa6-e701-65a04f4bba88' => 'Butelka D23_500ml (nabłyszczacz)',
|
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'BT_DET_250 (szyjka)',
|
||||||
'5df47246-d0cd-4151-9bdd-65eede53aba5' => 'Butelka D24_500ml (systemy mleczne)',
|
'8f4fdd3c-44f9-103b-3f40-659f1c128319' => 'BT_DET_500 (szyjka)',
|
||||||
'ab74cd2c-7720-5875-7ca5-66bb55a3e075' => 'Butelka D25_500ml (Ula)',
|
'92a7ee9b-d953-fd7e-5c88-65c9bf1e144d' => 'BT_DET_1000 (szyjka)',
|
||||||
'd7c10cb9-7459-1174-6315-661cdae38a39' => 'Butelka D11_1000ml (RPET)',
|
'5df47246-d0cd-4151-9bdd-65eede53aba5' => 'BT_SML_500 (sys. mleczne)',
|
||||||
'58664d9d-0295-3539-4662-659f18dc4b80' => 'Butelka D21_1000ml (Odkamieniacz)',
|
'87a2b609-9b67-de82-8f41-65eedd4613c9' => 'BT_SML_1000 (sys. mleczne)',
|
||||||
'92a7ee9b-d953-fd7e-5c88-65c9bf1e144d' => 'Butelka D22_1000ml (szyjka)',
|
'75980ea5-d89e-3923-2662-66bb55202244' => 'BT_ULA_1000',
|
||||||
'87a2b609-9b67-de82-8f41-65eedd4613c9' => 'Butelka D23_1000ml (systemy mleczne)',
|
'ab74cd2c-7720-5875-7ca5-66bb55a3e075' => 'BT_ULA_500',
|
||||||
'75980ea5-d89e-3923-2662-66bb55202244' => 'Butelka D24_1000ml (Ula)',
|
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'BT_ULA_250',
|
||||||
'ba4f06a8-f6fb-4969-d4b9-6683e6b6b372' => 'Butelka D11_2000ml (płyn do prania)',
|
'881d099d-36ee-3b45-b1ab-68dd2becfe84' => 'BT_IRYS_150',
|
||||||
'cb8f5e45-43e1-b62d-05d7-669646b4eb10' => 'Butelka D12_5000ml (kanister)',
|
'ba4f06a8-f6fb-4969-d4b9-6683e6b6b372' => 'BT_PDP_2000ml (płyn do prania)',
|
||||||
|
'a2ba9b76-8e2e-32c4-e9c8-689c6ac2dbb9' => 'Butelka 30 ml N-34B plastan',
|
||||||
|
'cb8f5e45-43e1-b62d-05d7-669646b4eb10' => 'KAN_5000 (kanister)',
|
||||||
'820341fa-0db5-9d74-7544-659f17560658' => 'Zestaw D1_500ml+zapas',
|
'820341fa-0db5-9d74-7544-659f17560658' => 'Zestaw D1_500ml+zapas',
|
||||||
'567da064-cd31-0416-2ad3-6581cc870e96' => 'Doypack 110x180mm',
|
'567da064-cd31-0416-2ad3-6581cc870e96' => 'Doypack 110x180mm',
|
||||||
'edf38614-90c3-50a7-56e8-65dda2d891c2' => 'Doypack 130x220mm',
|
'edf38614-90c3-50a7-56e8-65dda2d891c2' => 'Doypack 130x220mm',
|
||||||
'1ba1af85-97c7-a0a9-82e4-65a9a265358a' => 'Doypack 160x270mm',
|
'1ba1af85-97c7-a0a9-82e4-65a9a265358a' => 'Doypack 160x270mm',
|
||||||
'2e060602-334b-d053-6bd4-65a9a3d7a99b' => 'Doypack 180x290mm',
|
'2e060602-334b-d053-6bd4-65a9a3d7a99b' => 'Doypack 180x290mm',
|
||||||
'eb0cb757-d39b-9677-b422-65eec426d4fe' => 'Blister, tabletki 6szt. 2,5g',
|
'eb0cb757-d39b-9677-b422-65eec426d4fe' => 'BLIS_6 (2,5g)',
|
||||||
'64716544-e41f-3dfc-d021-657630c2bafe' => 'Blister tabletki 10szt. 3g',
|
'64716544-e41f-3dfc-d021-657630c2bafe' => 'BLIS_10 (3g)',
|
||||||
'32d6dac9-321d-a935-6e1b-659f012eabd1' => 'Blister tabletki 10szt. 1,3g',
|
'32d6dac9-321d-a935-6e1b-659f012eabd1' => 'BLIS_10 (1,3g)',
|
||||||
'ce7793b9-3f5a-3f5f-13dc-66013c397db1' => 'Blister mikrofibra 20x20cm',
|
'225115e4-1ce2-9a98-b7a0-672930e3318c' => 'BLIS_10 (2g)',
|
||||||
'48369f61-18bd-53e6-070a-659f026773ac' => 'Kartonik ',
|
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'BLIS_6 (6,5g)',
|
||||||
'37dbeaa1-f183-3b3e-1b54-65aa78a662a2' => 'Słoik 500 ml',
|
'ce7793b9-3f5a-3f5f-13dc-66013c397db1' => 'BLIS_mikrofibra (20x20cm)',
|
||||||
'f13d7541-494d-75c7-2a35-65aa784b42a5' => 'Słoik 1000 ml',
|
'da8d7be4-58dc-4f75-f547-65c310cd97dd' => 'SLO_65',
|
||||||
'e703a7f9-d27d-b445-d946-66727a3940d9' => 'Słoik 1500 ml',
|
'e1a16dbf-7216-d184-b9ed-65c310aff4d4' => 'SLO_150',
|
||||||
'da8d7be4-58dc-4f75-f547-65c310cd97dd' => 'Słoik 65 ml',
|
'2a9454a6-b2a1-150f-c307-65c31102cb28' => 'SLO_250',
|
||||||
'e1a16dbf-7216-d184-b9ed-65c310aff4d4' => 'Słoik 150 ml',
|
'e6900d92-6fde-90e6-b872-67d1938745e6' => 'SLO_400',
|
||||||
'2a9454a6-b2a1-150f-c307-65c31102cb28' => 'Słoik 250 ml',
|
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'BT_IT_30',
|
||||||
|
'37dbeaa1-f183-3b3e-1b54-65aa78a662a2' => 'SLO_500',
|
||||||
|
'f13d7541-494d-75c7-2a35-65aa784b42a5' => 'SLO_1000 ml ',
|
||||||
|
'e703a7f9-d27d-b445-d946-66727a3940d9' => 'SLO_1500',
|
||||||
'3acd80de-8dcc-ced9-c2fa-65eee6ae9949' => 'Spray 100 ml',
|
'3acd80de-8dcc-ced9-c2fa-65eee6ae9949' => 'Spray 100 ml',
|
||||||
'6014bd30-9be6-4348-5b3a-6603f015f392' => 'Wiadro 2,75l',
|
|
||||||
'786f48d6-16e7-a0a4-4aec-6628a16a0f89' => 'Pianka 100ml',
|
'786f48d6-16e7-a0a4-4aec-6628a16a0f89' => 'Pianka 100ml',
|
||||||
|
'75f4bd2a-51a8-0767-635e-66dde15af79e' => 'Pianka 200ml',
|
||||||
'349b50d1-0a7b-b3bd-e72e-662b42ca98ae' => 'Pianka 400ml',
|
'349b50d1-0a7b-b3bd-e72e-662b42ca98ae' => 'Pianka 400ml',
|
||||||
'cb66a685-53e1-5f87-0a25-66967c7cb63b' => 'Doypack 210x285mm',
|
'cb66a685-53e1-5f87-0a25-66967c7cb63b' => 'Doypack 210x285mm',
|
||||||
'75f4bd2a-51a8-0767-635e-66dde15af79e' => 'Pianka 200ml',
|
'6014bd30-9be6-4348-5b3a-6603f015f392' => 'Wiadro 2,75l',
|
||||||
'225115e4-1ce2-9a98-b7a0-672930e3318c' => 'Blister tabletki 10szt. 2 g',
|
'48369f61-18bd-53e6-070a-659f026773ac' => 'Kartonik ',
|
||||||
'e6900d92-6fde-90e6-b872-67d1938745e6' => 'Słoik 400 ml',
|
|
||||||
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Butelka B1_30ml',
|
|
||||||
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
||||||
|
'6db335cc-96d5-5185-6118-65761ec65583' => 'Płyn',
|
||||||
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'Płyn LCD',
|
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'Płyn LCD',
|
||||||
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Woreczek celofanowy',
|
|
||||||
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tabletka',
|
|
||||||
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'Blister, tabletki 6szt. 6,5g',
|
|
||||||
'31bf91c9-6176-a27a-9a4e-686f6b2597ee' => 'Płyn_WOD',
|
'31bf91c9-6176-a27a-9a4e-686f6b2597ee' => 'Płyn_WOD',
|
||||||
|
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tabletka',
|
||||||
'27c00505-f6cf-3ef1-3c1d-6880847a5893' => 'Proszek',
|
'27c00505-f6cf-3ef1-3c1d-6880847a5893' => 'Proszek',
|
||||||
'a2ba9b76-8e2e-32c4-e9c8-689c6ac2dbb9' => 'Butelka 30 ml N-34B plastan',
|
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Woreczek celofanowy',
|
||||||
|
'40eb0d63-517e-345c-532d-68d37d215372' => 'Sachet',
|
||||||
),
|
),
|
||||||
'ecmproducts_brand_dom' =>
|
'ecmproducts_brand_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -177,6 +179,12 @@ $customDoms = array (
|
|||||||
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
||||||
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
||||||
'c709e4cf-9ca7-c946-f5e3-688202ec4c24' => 'Aspico',
|
'c709e4cf-9ca7-c946-f5e3-688202ec4c24' => 'Aspico',
|
||||||
|
'8bf5f833-51a9-3913-aa0a-68b6d539a1b5' => 'MediaShop',
|
||||||
|
'973ff617-4696-1a21-1ba3-68c2c008e079' => 'Severno',
|
||||||
|
'd6f1a2c9-58ea-707f-112f-68cba0dcf990' => 'Safelt',
|
||||||
|
'2f1cc2a6-7fe7-4848-b7e9-68cd307ec67f' => 'CleanFix',
|
||||||
|
'261451a0-d1fb-546b-28e4-68e3bb7fdde9' => 'Alarsa',
|
||||||
|
'd3f20145-cd52-0c92-bb81-690c81cba13e' => 'Hisense',
|
||||||
),
|
),
|
||||||
'ecmproducts_category_dom' =>
|
'ecmproducts_category_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -228,13 +236,33 @@ $customDoms = array (
|
|||||||
),
|
),
|
||||||
'ecmactions_category_dom' =>
|
'ecmactions_category_dom' =>
|
||||||
array (
|
array (
|
||||||
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'NZE',
|
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'None',
|
||||||
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'Zestawy',
|
'5d843f39-893f-51f8-3df5-68c86f1d41c3' => 'HP1',
|
||||||
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'Mieszanie',
|
'31174829-986e-4d7f-4262-68b2e73742e9' => 'HP2',
|
||||||
'9bc2bafc-0608-7bc7-468b-686a94772424' => 'Blistrowanie',
|
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'PAK1',
|
||||||
'be37016b-0aa4-678c-9c4a-689c3673af3e' => 'PBDO',
|
'2bdf9315-5c31-778d-4922-68c86f4af827' => 'PAK2',
|
||||||
'e3e16e03-8e62-624e-f954-689c37059997' => 'PTDS',
|
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'MIE_HP1',
|
||||||
'416a2b50-4979-bc35-c83c-689c8a6640ae' => 'PWT',
|
'de2448f8-45ac-6b2a-f2b1-68b2e7e40a6f' => 'M1_HP2',
|
||||||
|
'9bc2bafc-0608-7bc7-468b-686a94772424' => 'BL1',
|
||||||
|
'347509e3-fff6-4db9-761e-68b2e36436c6' => 'LNE1',
|
||||||
|
'26c3b7fa-e1ac-66d9-517b-68b2e4c6cae8' => 'LNE2',
|
||||||
|
'5664a1b1-42dc-2bb8-ad24-68b2e52df143' => 'LNE3',
|
||||||
|
'307b8935-5235-628f-aac1-68b2e56d3f4d' => 'LNE4',
|
||||||
|
'8d68df07-0779-5a23-aaf3-68b2e5d72a46' => 'LNE5',
|
||||||
|
'53d9cae1-1ec5-71e4-5a3c-68b2e77b6d92' => 'MDC5',
|
||||||
|
'3fea0360-a9d8-93fc-1984-68b2e89e4ec8' => 'FPH9',
|
||||||
|
'6159a89b-219c-bb4e-1505-68b2e9da1b7c' => 'LNEZ7',
|
||||||
|
'9bc005d7-5222-3d65-b754-68b2e9854af7' => 'LE10',
|
||||||
|
'b1176c04-4fe3-d347-9e3a-68b2e945b5c3' => 'FPH1',
|
||||||
|
'bc4422dc-8f80-4f54-26a6-68b2ea0cd2c0' => 'LNEZ8',
|
||||||
|
'd8208a7e-b810-91e5-ccfa-68b2eaa73abb' => 'LNAS1',
|
||||||
|
'a87e1b10-771d-2f24-e795-68d385f0cd35' => 'LNAS2',
|
||||||
|
'f2364990-b244-064d-b5d1-68b2ebcd0ded' => 'MDC6',
|
||||||
|
'cc4905b6-a791-5c57-4721-68b2eb29e0fe' => 'TAB1',
|
||||||
|
'40e8149a-40ec-aeb0-4cdd-68b2eb52634b' => 'TAB2',
|
||||||
|
'b64ca8db-ff88-082c-887c-68b2ec98c15d' => 'TAB3',
|
||||||
|
'dab10a8b-295a-8eeb-be7c-68c67ec66ff7' => 'TAB4',
|
||||||
|
'640aea22-b0c0-fd36-1ed4-68cac4262fe8' => 'LT1',
|
||||||
),
|
),
|
||||||
'payment_method_dom' =>
|
'payment_method_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -322,6 +350,7 @@ $customDoms = array (
|
|||||||
'end_of_line' => 'Nieaktywny',
|
'end_of_line' => 'Nieaktywny',
|
||||||
'active' => 'Aktywny',
|
'active' => 'Aktywny',
|
||||||
'new' => 'Nowość',
|
'new' => 'Nowość',
|
||||||
|
'e8d1191e-2c7b-c24d-88e2-68b2bd076498' => 'test',
|
||||||
),
|
),
|
||||||
'ecmsales_status_dom' =>
|
'ecmsales_status_dom' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ $viewdefs [$module_name] = array (
|
|||||||
1 => array (
|
1 => array (
|
||||||
0 => array (
|
0 => array (
|
||||||
'name' => 'category',
|
'name' => 'category',
|
||||||
'label' => 'LBL_CATEGORY'
|
'label' => 'Linia'
|
||||||
),
|
),
|
||||||
1 => array (
|
1 => array (
|
||||||
'name' => 'shape',
|
'name' => 'shape',
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ $viewdefs [$module_name] = array(
|
|||||||
1 => array(
|
1 => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
'name' => 'category',
|
'name' => 'category',
|
||||||
'label' => 'LBL_CATEGORY',
|
'label' => 'Linia',
|
||||||
'tabIndex' => '101',
|
'tabIndex' => '101',
|
||||||
),
|
),
|
||||||
1 => array(
|
1 => array(
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ $listViewDefs [$module_name] = array (
|
|||||||
),
|
),
|
||||||
'CATEGORY' => array (
|
'CATEGORY' => array (
|
||||||
'type' => 'varchar',
|
'type' => 'varchar',
|
||||||
'label' => 'LBL_CATEGORY',
|
'label' => 'Linia',
|
||||||
'width' => '10%',
|
'width' => '10%',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'align' => 'left',
|
'align' => 'left',
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ $searchdefs ['EcmActions'] = array (
|
|||||||
),
|
),
|
||||||
'category' => array(
|
'category' => array(
|
||||||
'type' => 'enum',
|
'type' => 'enum',
|
||||||
'label' => 'LBL_CATEGORY',
|
'label' => 'Linia',
|
||||||
'width' => '10%',
|
'width' => '10%',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'name' => 'category'
|
'name' => 'category'
|
||||||
@@ -37,7 +37,7 @@ $searchdefs ['EcmActions'] = array (
|
|||||||
),
|
),
|
||||||
'category' => array(
|
'category' => array(
|
||||||
'type' => 'enum',
|
'type' => 'enum',
|
||||||
'label' => 'LBL_CATEGORY',
|
'label' => 'Linia',
|
||||||
'width' => '10%',
|
'width' => '10%',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'name' => 'category'
|
'name' => 'category'
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ $dictionary ['EcmAction'] = array (
|
|||||||
'category' => array (
|
'category' => array (
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'name' => 'category',
|
'name' => 'category',
|
||||||
'vname' => 'LBL_CATEGORY',
|
'vname' => 'Linia',
|
||||||
'options' => 'ecmactions_category_dom',
|
'options' => 'ecmactions_category_dom',
|
||||||
'type' => 'enum',
|
'type' => 'enum',
|
||||||
'len' => '255',
|
'len' => '255',
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ else if ($_REQUEST['isDuplicate']=="true") {
|
|||||||
$row = [];
|
$row = [];
|
||||||
$row['id'] = create_guid();
|
$row['id'] = create_guid();
|
||||||
$row['product_component'] = 1;
|
$row['product_component'] = 1;
|
||||||
$tmp = explode('|',$p);
|
$row['product_product_id'] = $tmp[0];
|
||||||
$row['product_id'] = $c['ecmcomponent_id'];
|
$row['product_id'] = $c['ecmcomponent_id'];
|
||||||
$row['position'] = $position;
|
$row['position'] = $position;
|
||||||
$position++;
|
$position++;
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ function deleteRow(index) {
|
|||||||
var error = false; // hope :)
|
var error = false; // hope :)
|
||||||
var id = $("#product_id_" + index).val();
|
var id = $("#product_id_" + index).val();
|
||||||
var howmany = 1;
|
var howmany = 1;
|
||||||
for (var row = 0; row != count; row++) {
|
for (var row = index+1; row != count; row++) {
|
||||||
comp_id = $("#product_product_id_" + row).val();
|
comp_id = $("#product_product_id_" + row).val();
|
||||||
if (comp_id == id) howmany++;
|
if (comp_id == id) howmany++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,21 @@ if(isset($_REQUEST['record'])){
|
|||||||
$focus->retrieve($_REQUEST['record']);
|
$focus->retrieve($_REQUEST['record']);
|
||||||
//if(isset($focus->id) && $focus->id != '')$focus->format_all_fields();
|
//if(isset($focus->id) && $focus->id != '')$focus->format_all_fields();
|
||||||
}
|
}
|
||||||
|
if(isset($focus->url5)){
|
||||||
|
$focus->url5 = '<a target="new" href="' .$focus->url5 . '">' . $focus->url5. '</a>';
|
||||||
|
}
|
||||||
|
if(isset($focus->url6)){
|
||||||
|
$focus->url6 = '<a target="new" href="' .$focus->url6 . '">' . $focus->url6. '</a>';
|
||||||
|
}
|
||||||
|
if(isset($focus->url7)){
|
||||||
|
$focus->url7 = '<a target="new" href="' .$focus->url7 . '">' . $focus->url7. '</a>';
|
||||||
|
}
|
||||||
|
if(isset($focus->url8)){
|
||||||
|
$focus->url8 = '<a target="new" href="' .$focus->url8 . '">' . $focus->url8. '</a>';
|
||||||
|
}
|
||||||
|
if(isset($focus->url9)){
|
||||||
|
$focus->url9 = '<a target="new" href="' .$focus->url9 . '">' . $focus->url9. '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
$json = getJSONobj();
|
$json = getJSONobj();
|
||||||
|
|
||||||
@@ -41,7 +56,9 @@ $detail->preDisplay();
|
|||||||
$uunit.='>'.$row['name'].'</option>';
|
$uunit.='>'.$row['name'].'</option>';
|
||||||
$uunit_array[$row['id']] = $row['name'];
|
$uunit_array[$row['id']] = $row['name'];
|
||||||
}
|
}
|
||||||
$detail->ss->assign("USAGE_UNIT_ID",$uunit);
|
$detail->ss->assign("USAGE_UNIT_ID",$uunit);
|
||||||
|
|
||||||
|
$detail->ss->assign("PRODUCTION_DESCRIPTION",$focus->production_description);
|
||||||
|
|
||||||
$tax='';
|
$tax='';
|
||||||
$result = $db->query("select id,name from ecmvats where deleted='0' order by name asc");
|
$result = $db->query("select id,name from ecmvats where deleted='0' order by name asc");
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ class EcmProduct extends SugarBean
|
|||||||
var $url8;
|
var $url8;
|
||||||
var $url9;
|
var $url9;
|
||||||
var $ean;
|
var $ean;
|
||||||
|
var $production_description;
|
||||||
|
|
||||||
// RELATED FIELDS
|
// RELATED FIELDS
|
||||||
var $created_by;
|
var $created_by;
|
||||||
|
|||||||
@@ -134,6 +134,23 @@ function isProductValid(id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function exportFile() {
|
||||||
|
$("#loader").show();
|
||||||
|
$.ajax({
|
||||||
|
url: "index.php?module=EcmProducts&action=&action=stockAddress&ajax=export&to_pdf=1",
|
||||||
|
}).done(function (data) {
|
||||||
|
$("#loader").hide();
|
||||||
|
if (data.status === 'Error') {
|
||||||
|
alert('Błąd: ' + data.msg);
|
||||||
|
} else {
|
||||||
|
console.log(data);
|
||||||
|
downloadFile(data.fileContent, data.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
|
}
|
||||||
|
}).fail(() => {
|
||||||
|
$("#loader").hide();
|
||||||
|
alert('Błąd serwera.');
|
||||||
|
});
|
||||||
|
}
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#address").mask("AB.CD.E.F", {
|
$("#address").mask("AB.CD.E.F", {
|
||||||
placeholder: "__.__._._",
|
placeholder: "__.__._._",
|
||||||
@@ -189,12 +206,49 @@ $(document).ready(function () {
|
|||||||
$("#searchByIndexForm").submit();
|
$("#searchByIndexForm").submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("#exportTrigger").click(() => {
|
||||||
|
exportFile();
|
||||||
|
});
|
||||||
$('[name^="showAddress').click((event) => {
|
$('[name^="showAddress').click((event) => {
|
||||||
$("#address").val(event.target.name.split('-')[1]);
|
$("#address").val(event.target.name.split('-')[1]);
|
||||||
if (isAddressValid()) {
|
if (isAddressValid()) {
|
||||||
$("#searchByAddressForm").submit();
|
$("#searchByAddressForm").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
//bind buttons
|
//bind buttons
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function downloadFile(base64Data, fileName, mimeType) {
|
||||||
|
// Stwórz blob z danych base64
|
||||||
|
const byteCharacters = atob(base64Data);
|
||||||
|
const byteArrays = [];
|
||||||
|
|
||||||
|
for (let offset = 0; offset < byteCharacters.length; offset += 512) {
|
||||||
|
const slice = byteCharacters.slice(offset, offset + 512);
|
||||||
|
|
||||||
|
const byteNumbers = new Array(slice.length);
|
||||||
|
for (let i = 0; i < slice.length; i++) {
|
||||||
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
const byteArray = new Uint8Array(byteNumbers);
|
||||||
|
byteArrays.push(byteArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob(byteArrays, {type: mimeType});
|
||||||
|
|
||||||
|
// Stwórz link do pobrania
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = window.URL.createObjectURL(blob);
|
||||||
|
link.download = fileName;
|
||||||
|
|
||||||
|
// Dodaj link do dokumentu i kliknij go
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// Usuń link z dokumentu
|
||||||
|
setTimeout(function () {
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(link.href);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|||||||
@@ -531,8 +531,6 @@ $viewdefs['EcmProducts']['DetailView'] = array(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
'LBL_PANEL_CATEGORIES' => array(
|
'LBL_PANEL_CATEGORIES' => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
@@ -569,7 +567,8 @@ $viewdefs['EcmProducts']['DetailView'] = array(
|
|||||||
'allCols' => true,
|
'allCols' => true,
|
||||||
'hideLabel' => true,
|
'hideLabel' => true,
|
||||||
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
||||||
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>'
|
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>
|
||||||
|
<br>Receptura: {$PRODUCTION_DESCRIPTION}'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -566,7 +566,8 @@ $viewdefs['EcmProducts']['EditView'] = array(
|
|||||||
'allCols' => true,
|
'allCols' => true,
|
||||||
'hideLabel' => true,
|
'hideLabel' => true,
|
||||||
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
|
||||||
<br><br><div style="width: 17%;" id="copyProduct"></div><div style="width: 17%" id="copyButtons"></div>'
|
<br><br><div style="width: 17%;" id="copyProduct"></div><div style="width: 17%" id="copyButtons"></div><br>
|
||||||
|
Receptura:<br><textarea name="production_description" id="production_description" cols="80" rows="10">{$fields.production_description.value}</textarea>'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,151 +1,203 @@
|
|||||||
<?php
|
<?php
|
||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
//ini_set('display_errors', 1);
|
//ini_set('display_errors', 1);
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
if ($_GET['ajax']) {
|
if ($_GET['ajax']) {
|
||||||
switch ($_GET['ajax']) {
|
switch ($_GET['ajax']) {
|
||||||
case 'addAddress':
|
case 'addAddress':
|
||||||
$productId = $_GET['productId'];
|
$productId = $_GET['productId'];
|
||||||
$address = $_GET['address'];
|
|
||||||
$isNotFull = $_GET['isNotFull'];
|
|
||||||
// check if product exists
|
|
||||||
$productId = $db->fetchByAssoc($db->query("SELECT id FROM ecmproducts WHERE id = '$productId'"))['id'];
|
|
||||||
if ($productId == null) {
|
|
||||||
echo json_encode(array('status' => 'Error', 'msg' => 'Nie znalaziono produktu w bazie: '.$index ));
|
|
||||||
}
|
|
||||||
// check if location is empty
|
|
||||||
$location = $db->fetchByAssoc($db->query("SELECT stock_address FROM ecmproducts_stock_addresses WHERE stock_address = '$address'"));
|
|
||||||
if ($location != null) {
|
|
||||||
echo json_encode(array('status' => 'Error', 'msg' => 'Wskazana lokalizacja jest zajęta: '.$address ));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$db->query("INSERT INTO ecmproducts_stock_addresses (ecmproduct_id, stock_address, is_not_full) VALUES ('$productId','$address', $isNotFull)");
|
|
||||||
echo json_encode(array('status' => 'Success', 'msg' => 'addAddress' ));
|
|
||||||
break;
|
|
||||||
case 'removeAddress':
|
|
||||||
$address = $_GET['address'];
|
|
||||||
$db->query("DELETE FROM ecmproducts_stock_addresses WHERE stock_address='$address'");
|
|
||||||
echo json_encode(array('status' => 'Success', 'msg' => 'removeAddress' ));
|
|
||||||
break;
|
|
||||||
case 'setIsNotFull':
|
|
||||||
$address = $_GET['address'];
|
|
||||||
$isNotFull = $_GET['isNotFull'] == 'true' ? 1 : 0;
|
|
||||||
$db->query("UPDATE ecmproducts_stock_addresses SET is_not_full=$isNotFull WHERE stock_address='$address'");
|
|
||||||
echo json_encode(array('status' => 'Success', 'msg' => 'setIsNotFull'));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$pRes = $db->query("SELECT DISTINCT id, code FROM ecmproducts WHERE deleted=0;");
|
|
||||||
$codes = array();
|
|
||||||
while ($p = $db -> fetchByAssoc($pRes)) {
|
|
||||||
$index = str_replace("'", "'", $p['code']);
|
|
||||||
array_push($codes, ['id' => $p['id'], 'code' => $index]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$smarty = new Sugar_Smarty ();
|
|
||||||
|
|
||||||
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'address')
|
|
||||||
{
|
|
||||||
$address = $_GET['address'];
|
$address = $_GET['address'];
|
||||||
$product = $db->fetchByAssoc($db->query("
|
$isNotFull = $_GET['isNotFull'];
|
||||||
|
// check if product exists
|
||||||
|
$productId = $db->fetchByAssoc($db->query("SELECT id FROM ecmproducts WHERE id = '$productId'"))['id'];
|
||||||
|
if ($productId == null) {
|
||||||
|
echo json_encode(array('status' => 'Error', 'msg' => 'Nie znalaziono produktu w bazie: ' . $index));
|
||||||
|
}
|
||||||
|
// check if location is empty
|
||||||
|
$location = $db->fetchByAssoc($db->query("SELECT stock_address FROM ecmproducts_stock_addresses WHERE stock_address = '$address'"));
|
||||||
|
if ($location != null) {
|
||||||
|
echo json_encode(array('status' => 'Error', 'msg' => 'Wskazana lokalizacja jest zajęta: ' . $address));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$db->query("INSERT INTO ecmproducts_stock_addresses (ecmproduct_id, stock_address, is_not_full) VALUES ('$productId','$address', $isNotFull)");
|
||||||
|
echo json_encode(array('status' => 'Success', 'msg' => 'addAddress'));
|
||||||
|
break;
|
||||||
|
case 'removeAddress':
|
||||||
|
$address = $_GET['address'];
|
||||||
|
$db->query("DELETE FROM ecmproducts_stock_addresses WHERE stock_address='$address'");
|
||||||
|
echo json_encode(array('status' => 'Success', 'msg' => 'removeAddress'));
|
||||||
|
break;
|
||||||
|
case 'setIsNotFull':
|
||||||
|
$address = $_GET['address'];
|
||||||
|
$isNotFull = $_GET['isNotFull'] == 'true' ? 1 : 0;
|
||||||
|
$db->query("UPDATE ecmproducts_stock_addresses SET is_not_full=$isNotFull WHERE stock_address='$address'");
|
||||||
|
echo json_encode(array('status' => 'Success', 'msg' => 'setIsNotFull'));
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
exportExcel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$pRes = $db->query("SELECT DISTINCT id, code FROM ecmproducts WHERE deleted=0;");
|
||||||
|
$codes = array();
|
||||||
|
while ($p = $db->fetchByAssoc($pRes)) {
|
||||||
|
$index = str_replace("'", "'", $p['code']);
|
||||||
|
array_push($codes, ['id' => $p['id'], 'code' => $index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$smarty = new Sugar_Smarty();
|
||||||
|
|
||||||
|
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'address') {
|
||||||
|
$address = $_GET['address'];
|
||||||
|
$product = $db->fetchByAssoc($db->query("
|
||||||
SELECT a.ecmproduct_id, p.name, p.code, p.ems_qty_in_stock AS stock_state, a.is_not_full FROM ecmproducts_stock_addresses AS a
|
SELECT a.ecmproduct_id, p.name, p.code, p.ems_qty_in_stock AS stock_state, a.is_not_full FROM ecmproducts_stock_addresses AS a
|
||||||
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
||||||
WHERE stock_address='$address';"));
|
WHERE stock_address='$address';"));
|
||||||
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='".$product['ecmproduct_id']."'"));
|
if ($product) {
|
||||||
|
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='" . $product['ecmproduct_id'] . "'"));
|
||||||
$product['stock_state'] = $state['qty'];
|
$product['stock_state'] = $state['qty'];
|
||||||
$smarty->assign("PROCESS", "ADDRESS");
|
|
||||||
$smarty->assign("PRODUCT", $product);
|
|
||||||
}
|
}
|
||||||
|
$smarty->assign("PROCESS", "ADDRESS");
|
||||||
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'index')
|
$smarty->assign("PRODUCT", $product);
|
||||||
{
|
}
|
||||||
$id = $_GET['productId'];
|
|
||||||
$res = $db->query("
|
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'address') {
|
||||||
|
$address = $_GET['address'];
|
||||||
|
$product = $db->fetchByAssoc($db->query("
|
||||||
|
SELECT a.ecmproduct_id, p.name, p.code, p.ems_qty_in_stock AS stock_state, a.is_not_full FROM ecmproducts_stock_addresses AS a
|
||||||
|
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
||||||
|
WHERE stock_address='$address';"));
|
||||||
|
if ($product) {
|
||||||
|
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='" . $product['ecmproduct_id'] . "'"));
|
||||||
|
$product['stock_state'] = $state['qty'];
|
||||||
|
}
|
||||||
|
$smarty->assign("PROCESS", "ADDRESS");
|
||||||
|
$smarty->assign("PRODUCT", $product);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'index') {
|
||||||
|
$id = $_GET['productId'];
|
||||||
|
$res = $db->query("
|
||||||
SELECT a.ecmproduct_id, a.stock_address, a.is_not_full, p.name, p.code FROM ecmproducts_stock_addresses AS a
|
SELECT a.ecmproduct_id, a.stock_address, a.is_not_full, p.name, p.code FROM ecmproducts_stock_addresses AS a
|
||||||
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id
|
||||||
WHERE p.id='$id' AND p.deleted=0;");
|
WHERE p.id='$id' AND p.deleted=0;");
|
||||||
$addresses = array();
|
$addresses = array();
|
||||||
while ($r = $db -> fetchByAssoc($res)) {
|
while ($r = $db->fetchByAssoc($res)) {
|
||||||
array_push($addresses, $r);
|
array_push($addresses, $r);
|
||||||
}
|
|
||||||
$product = $db->fetchByAssoc($db->query("SELECT id, name, code, ems_qty_in_stock FROM ecmproducts WHERE id = '$id';"));
|
|
||||||
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='$id'"));
|
|
||||||
$product['ems_qty_in_stock'] = $state['qty'];
|
|
||||||
$smarty->assign("PROCESS", "PRODUCT");
|
|
||||||
$smarty->assign("PRODUCT", $product);
|
|
||||||
$smarty->assign("ADDRESSES", $addresses);
|
|
||||||
}
|
}
|
||||||
|
$product = $db->fetchByAssoc($db->query("SELECT id, name, code, ems_qty_in_stock FROM ecmproducts WHERE id = '$id';"));
|
||||||
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'allAddresses')
|
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='$id'"));
|
||||||
{
|
$product['ems_qty_in_stock'] = $state['qty'];
|
||||||
if ($_GET['onlyFull'] == "on") {
|
$smarty->assign("PROCESS", "PRODUCT");
|
||||||
$allAddresses = getAllAddresses(true);
|
$smarty->assign("PRODUCT", $product);
|
||||||
} else {
|
$smarty->assign("ADDRESSES", $addresses);
|
||||||
$allAddresses = getAllAddresses(false);
|
|
||||||
}
|
|
||||||
$res = $db->query("
|
|
||||||
SELECT a.ecmproduct_id, a.stock_address, a.is_not_full, p.name, p.code, p.ems_qty_in_stock FROM ecmproducts_stock_addresses AS a
|
|
||||||
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id");
|
|
||||||
$used = array();
|
|
||||||
while ($r = $db -> fetchByAssoc($res)) {
|
|
||||||
array_push($used, $r);
|
|
||||||
}
|
|
||||||
$addresses = array();
|
|
||||||
$sum = 0;
|
|
||||||
foreach ($allAddresses as $a ) {
|
|
||||||
$i = array_search($a, array_column($used, 'stock_address'));
|
|
||||||
$element = ($i !== false ? $used[$i] : null);
|
|
||||||
$row = array();
|
|
||||||
$row['stock_address'] = $a;
|
|
||||||
$row['is_not_full'] = $element['is_not_full'];
|
|
||||||
if ($element) {
|
|
||||||
$row['name'] = $element['name'];
|
|
||||||
$row['code'] = $element['code'];
|
|
||||||
$row['ecmproduct_id'] = $element['ecmproduct_id'];
|
|
||||||
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='".$element['ecmproduct_id']."'"));
|
|
||||||
$row['stock_state'] = $state['qty'];
|
|
||||||
}
|
|
||||||
if ($_GET['allType'] == 'used' && $element) {
|
|
||||||
array_push($addresses, $row);
|
|
||||||
$sum++;
|
|
||||||
} else if ($_GET['allType'] == 'empty' && !$element) {
|
|
||||||
array_push($addresses, $row);
|
|
||||||
$sum++;
|
|
||||||
} else if ($_GET['allType'] == 'all') {
|
|
||||||
array_push($addresses, $row);
|
|
||||||
$sum++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$smarty->assign("SUM", $sum);
|
|
||||||
$smarty->assign("ALL_TYPE", $_GET['allType']);
|
|
||||||
$smarty->assign("ONLY_FULL", $_GET['onlyFull']);
|
|
||||||
$smarty->assign("PROCESS", "ALL_ADDRESSES");
|
|
||||||
$smarty->assign("ADDRESSES", $addresses);
|
|
||||||
}
|
|
||||||
|
|
||||||
$smarty->assign("CODES", json_encode($codes));
|
|
||||||
$smarty->assign("CURRENT_ADDRESS", $_GET['address']);
|
|
||||||
$smarty->assign("CURRENT_INDEX", $_GET['index']);
|
|
||||||
echo $smarty->display ( 'modules/EcmProducts/tpls/stockAddress.tpl' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllAddresses($onlyFull) {
|
if (strlen($_GET['searchType']) > 0 && $_GET['searchType'] == 'allAddresses') {
|
||||||
|
if ($_GET['onlyFull'] == "on") {
|
||||||
|
$allAddresses = getAllAddresses(true);
|
||||||
|
} else {
|
||||||
|
$allAddresses = getAllAddresses(false);
|
||||||
|
}
|
||||||
|
$res = $db->query("
|
||||||
|
SELECT a.ecmproduct_id, a.stock_address, a.is_not_full, p.name, p.code, p.ems_qty_in_stock FROM ecmproducts_stock_addresses AS a
|
||||||
|
INNER JOIN ecmproducts as p ON p.id=a.ecmproduct_id");
|
||||||
|
$used = array();
|
||||||
|
while ($r = $db->fetchByAssoc($res)) {
|
||||||
|
array_push($used, $r);
|
||||||
|
}
|
||||||
$addresses = array();
|
$addresses = array();
|
||||||
for ($i = 1; $i <= 17; $i++) {
|
$sum = 0;
|
||||||
$s1 = (strlen($i) == 1) ? '0'.$i : $i;
|
foreach ($allAddresses as $a) {
|
||||||
for ($j = 1; $j <= 15; $j++) {
|
$i = array_search($a, array_column($used, 'stock_address'));
|
||||||
$s2 = (strlen($j) == 1) ? '0'.$j : $j;
|
$element = ($i !== false ? $used[$i] : null);
|
||||||
for ($k = 1; $k <=3; $k++) {
|
$row = array();
|
||||||
if ($onlyFull) {
|
$row['stock_address'] = $a;
|
||||||
array_push($addresses, $s1.'.'.$s2.'.'.$k.'.0');
|
$row['is_not_full'] = $element['is_not_full'];
|
||||||
} else {
|
if ($element) {
|
||||||
for ($l = 0; $l <=2; $l++) {
|
$row['name'] = $element['name'];
|
||||||
array_push($addresses, $s1.'.'.$s2.'.'.$k.'.'.$l);
|
$row['code'] = $element['code'];
|
||||||
}
|
$row['ecmproduct_id'] = $element['ecmproduct_id'];
|
||||||
}
|
$state = $db->fetchByAssoc($db->query("SELECT SUM(quantity) as qty FROM ecmstockstates WHERE product_id='" . $element['ecmproduct_id'] . "'"));
|
||||||
|
$row['stock_state'] = $state['qty'];
|
||||||
|
}
|
||||||
|
if ($_GET['allType'] == 'used' && $element) {
|
||||||
|
array_push($addresses, $row);
|
||||||
|
$sum++;
|
||||||
|
} else if ($_GET['allType'] == 'empty' && !$element) {
|
||||||
|
array_push($addresses, $row);
|
||||||
|
$sum++;
|
||||||
|
} else if ($_GET['allType'] == 'all') {
|
||||||
|
array_push($addresses, $row);
|
||||||
|
$sum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$smarty->assign("SUM", $sum);
|
||||||
|
$smarty->assign("ALL_TYPE", $_GET['allType']);
|
||||||
|
$smarty->assign("ONLY_FULL", $_GET['onlyFull']);
|
||||||
|
$smarty->assign("PROCESS", "ALL_ADDRESSES");
|
||||||
|
$smarty->assign("ADDRESSES", $addresses);
|
||||||
|
}
|
||||||
|
|
||||||
|
$smarty->assign("CODES", json_encode($codes));
|
||||||
|
$smarty->assign("CURRENT_ADDRESS", $_GET['address']);
|
||||||
|
$smarty->assign("CURRENT_INDEX", $_GET['index']);
|
||||||
|
echo $smarty->display('modules/EcmProducts/tpls/stockAddress.tpl');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAllAddresses($onlyFull)
|
||||||
|
{
|
||||||
|
$addresses = array();
|
||||||
|
for ($i = 1; $i <= 17; $i++) {
|
||||||
|
$s1 = (strlen($i) == 1) ? '0' . $i : $i;
|
||||||
|
for ($j = 1; $j <= 15; $j++) {
|
||||||
|
$s2 = (strlen($j) == 1) ? '0' . $j : $j;
|
||||||
|
for ($k = 1; $k <= 3; $k++) {
|
||||||
|
if ($onlyFull) {
|
||||||
|
array_push($addresses, $s1 . '.' . $s2 . '.' . $k . '.0');
|
||||||
|
} else {
|
||||||
|
for ($l = 0; $l <= 2; $l++) {
|
||||||
|
array_push($addresses, $s1 . '.' . $s2 . '.' . $k . '.' . $l);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $addresses;
|
}
|
||||||
}
|
return $addresses;
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportExcel()
|
||||||
|
{
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
|
||||||
|
$address = $_GET['address'];
|
||||||
|
$res = $db->query("SELECT p.code, s.stock_address
|
||||||
|
FROM ecmproducts_stock_addresses AS s
|
||||||
|
INNER JOIN ecmproducts AS p
|
||||||
|
ON p.id = s.ecmproduct_id
|
||||||
|
ORDER BY s.stock_address;");
|
||||||
|
$result = array();
|
||||||
|
while ($row = $db->fetchByAssoc($res)) {
|
||||||
|
array_push($result, $row);
|
||||||
|
}
|
||||||
|
|
||||||
|
$headers = [
|
||||||
|
'Indeks',
|
||||||
|
'Adres'
|
||||||
|
];
|
||||||
|
|
||||||
|
$sheetData = array_merge([$headers], $result);
|
||||||
|
|
||||||
|
require_once 'modules/EcmReports/BimIT-Reports/lib/xlsxGenerator.php';
|
||||||
|
|
||||||
|
$xlsx = Shuchkin\SimpleXLSXGen::fromArray($sheetData);
|
||||||
|
$xlsx_content = (string)$xlsx;
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode([
|
||||||
|
'success' => true,
|
||||||
|
'fileContent' => base64_encode($xlsx_content),
|
||||||
|
'fileName' => 'adresy_magazynowe.xlsx'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="loader" id="loader">
|
<div class="loader" id="loader">
|
||||||
<img src="themes/default/images/loading.gif" />
|
<img src="themes/default/images/loading.gif"/>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var CODES = {$CODES};
|
var CODES = {$CODES};
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
<input type="text" name="address" id="address" size="30" value="{$CURRENT_ADDRESS}">
|
<input type="text" name="address" id="address" size="30" value="{$CURRENT_ADDRESS}">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="module" value="EcmProducts" />
|
<input type="hidden" name="module" value="EcmProducts"/>
|
||||||
<input type="hidden" name="action" value="stockAddress" />
|
<input type="hidden" name="action" value="stockAddress"/>
|
||||||
<input type="hidden" name="searchType" value="address" />
|
<input type="hidden" name="searchType" value="address"/>
|
||||||
<input type="button" id="searchByAddressTrigger" value="Szukaj adresu " class="button" />
|
<input type="button" id="searchByAddressTrigger" value="Szukaj adresu " class="button"/>
|
||||||
<span style="color: red;" id="addressError"></span>
|
<span style="color: red;" id="addressError"></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
<input type='text' name="index" id="index" size="30" value="{$CURRENT_INDEX}">
|
<input type='text' name="index" id="index" size="30" value="{$CURRENT_INDEX}">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="module" value="EcmProducts" />
|
<input type="hidden" name="module" value="EcmProducts"/>
|
||||||
<input type="hidden" name="action" value="stockAddress" />
|
<input type="hidden" name="action" value="stockAddress"/>
|
||||||
<input type="hidden" name="searchType" value="index" />
|
<input type="hidden" name="searchType" value="index"/>
|
||||||
<input type="hidden" name="productId" id="productId" value="" />
|
<input type="hidden" name="productId" id="productId" value=""/>
|
||||||
<input type="button" id="searchByIndexTrigger" value="Szukaj indeksu" class="button" />
|
<input type="button" id="searchByIndexTrigger" value="Szukaj indeksu" class="button"/>
|
||||||
<span style="color: red;" id="indexError"></span>
|
<span style="color: red;" id="indexError"></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -57,13 +57,23 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="module" value="EcmProducts" />
|
<input type="hidden" name="module" value="EcmProducts"/>
|
||||||
<input type="hidden" name="action" value="stockAddress" />
|
<input type="hidden" name="action" value="stockAddress"/>
|
||||||
<input type="hidden" name="searchType" value="allAddresses" />
|
<input type="hidden" name="searchType" value="allAddresses"/>
|
||||||
<input type="submit" id="searchByIndexTrigger" value="Pokaż adresy" class="button" />
|
<input type="submit" id="searchByIndexTrigger" value="Pokaż adresy" class="button"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
|
<tr>
|
||||||
|
<td scope="row" nowrap="nowrap" width="1%">
|
||||||
|
<input type="hidden" name="module" value="EcmProducts"/>
|
||||||
|
<input type="hidden" name="action" value="stockAddress"/>
|
||||||
|
<input type="hidden" name="searchType" value="export"/>
|
||||||
|
<input type="button" id="exportTrigger" value="Eksport Excel" class="button"/>
|
||||||
|
</td>
|
||||||
|
<td nowrap="nowrap" width="1%"> </td>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{if $PROCESS && $PROCESS=='ADDRESS'}
|
{if $PROCESS && $PROCESS=='ADDRESS'}
|
||||||
@@ -92,10 +102,11 @@
|
|||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="button" value="Karta produktu" class="button"
|
<input type="button" value="Karta produktu" class="button"
|
||||||
onclick="openProductCard('{$PRODUCT.ecmproduct_id}');" />
|
onclick="openProductCard('{$PRODUCT.ecmproduct_id}');"/>
|
||||||
<input type="button" value="Wyszukaj wszystkie adresy" class="button"
|
<input type="button" value="Wyszukaj wszystkie adresy" class="button"
|
||||||
onclick="searchByIndex('{$PRODUCT.code}')" />
|
onclick="searchByIndex('{$PRODUCT.code}')"/>
|
||||||
<input type="button" value="Usuń produkt z adresu" class="button" onclick="removeProductFromAddress()" />
|
<input type="button" value="Usuń produkt z adresu" class="button"
|
||||||
|
onclick="removeProductFromAddress()"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -118,7 +129,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="button" value="Dodaj produkt" class="button" onclick="addProductToAddress()" />
|
<input type="button" value="Dodaj produkt" class="button" onclick="addProductToAddress()"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -126,7 +137,10 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{if $PROCESS && $PROCESS=='PRODUCT'}
|
{if $PROCESS && $PROCESS=='PRODUCT'}
|
||||||
<h2>{$PRODUCT.code} {$PRODUCT.name} ( Stan: {$PRODUCT.ems_qty_in_stock} ) <input type="button"
|
<h2>{$PRODUCT.code} {$PRODUCT.name} ( Stan: {$PRODUCT.ems_qty_in_stock} ) <input type="button"
|
||||||
value="Karta produktu" class="button" onclick="openProductCard('{$PRODUCT.id}');" /></h2>
|
value="Karta produktu"
|
||||||
|
class="button"
|
||||||
|
onclick="openProductCard('{$PRODUCT.id}');"/>
|
||||||
|
</h2>
|
||||||
<table cellpadding="0" cellspacing="0" class="list view">
|
<table cellpadding="0" cellspacing="0" class="list view">
|
||||||
<tr class="oddListRowS1">
|
<tr class="oddListRowS1">
|
||||||
<th style="width: 15%;"><b>Adres</b></td>
|
<th style="width: 15%;"><b>Adres</b></td>
|
||||||
@@ -141,29 +155,29 @@
|
|||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="checkbox" {if $item.is_not_full}checked{/if}
|
<input type="checkbox" {if $item.is_not_full}checked{/if}
|
||||||
onclick="setAddressIsNotFull('{$item.stock_address}', this)" />
|
onclick="setAddressIsNotFull('{$item.stock_address}', this)"/>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="button" value="Usuń lokalizację" class="button"
|
<input type="button" value="Usuń lokalizację" class="button"
|
||||||
onclick="removeAddressFromProduct('{$item.stock_address}')" />
|
onclick="removeAddressFromProduct('{$item.stock_address}')"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr class="oddListRowS1">
|
<tr class="oddListRowS1">
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="text" size="10" id="newAddress" />
|
<input type="text" size="10" id="newAddress"/>
|
||||||
<span style="color: red;" id="newAddressError"></span>
|
<span style="color: red;" id="newAddressError"></span>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="checkbox" id="isNotFull" />
|
<input type="checkbox" id="isNotFull"/>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="button" value="Dodaj lokalizację" class="button" onclick="addAddressToProduct();" />
|
<input type="button" value="Dodaj lokalizację" class="button" onclick="addAddressToProduct();"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -186,11 +200,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="checkbox" {if $item.is_not_full}checked{/if} disabled />
|
<input type="checkbox" {if $item.is_not_full}checked{/if} disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
<input type="button" value="Pokaż adres" class="button" name="showAddress-{$item.stock_address}" />
|
<input type="button" value="Pokaż adres" class="button" name="showAddress-{$item.stock_address}"/>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" class="oddListRowS1"
|
<td valign="top" class="oddListRowS1"
|
||||||
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
|
||||||
@@ -212,31 +226,32 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<style>
|
<style>
|
||||||
{literal}
|
{literal}
|
||||||
.ui-autocomplete {
|
.ui-autocomplete {
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-corner-all {
|
.ui-corner-all {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loader {
|
.loader {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 50vh;
|
padding-top: 50vh;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: rgba(16, 16, 16, 0.5);
|
background-color: rgba(16, 16, 16, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.loader>img {}
|
.loader > img {
|
||||||
|
}
|
||||||
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</style>
|
</style>
|
||||||
@@ -1459,6 +1459,11 @@ $dictionary['EcmProduct'] = array(
|
|||||||
'vname' => 'LBL_DESCRIPTION',
|
'vname' => 'LBL_DESCRIPTION',
|
||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
),
|
),
|
||||||
|
'production_description' => array(
|
||||||
|
'name' => 'description',
|
||||||
|
'vname' => 'LBL_DESCRIPTION',
|
||||||
|
'type' => 'text'
|
||||||
|
),
|
||||||
'models' => array(
|
'models' => array(
|
||||||
'name' => 'models',
|
'name' => 'models',
|
||||||
'vname' => 'LBL_MODELS',
|
'vname' => 'LBL_MODELS',
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ $(document).ready(function () {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
format: function (s, table, cell) {
|
format: function (s, table, cell) {
|
||||||
return $(cell).find("input[id^=production-date]").val() || "2222-01-01";
|
if ($(cell).find("input[id^=production-date]").val() === '') {
|
||||||
|
return "2222-01-01";
|
||||||
|
}
|
||||||
|
return $(cell).find("input[id^=production-date]").val() + " " + $(cell).find("input[id^=production-time]").val();
|
||||||
},
|
},
|
||||||
parsed: false,
|
parsed: false,
|
||||||
type: "text"
|
type: "text"
|
||||||
@@ -60,19 +63,22 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
3: { sorter: "production_date" },
|
3: {sorter: "production_date"},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
$("#allTable").bind('filterEnd', function () {
|
$("#allTable").bind('filterEnd', function () {
|
||||||
$("#selectAll").attr('checked', false);
|
$("#selectAll").attr('checked', false);
|
||||||
$(".allCheck").prop('checked', false);
|
$(".allCheck").prop('checked', false);
|
||||||
localStorage.setItem("productionSchedule_filter", $.tablesorter.getFilters($("#allTable")));
|
localStorage.setItem("productionSchedule_filter", $.tablesorter.getFilters($("#allTable")));
|
||||||
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
$("#allTable").bind("sortEnd", function () {
|
$("#allTable").bind("sortEnd", function () {
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('productionSchedule_sort',
|
localStorage.setItem('productionSchedule_sort',
|
||||||
$("#allTable")[0].config.sortList[0][0] + "|" + $("#allTable")[0].config.sortList[0][1]);
|
$("#allTable")[0].config.sortList[0][0] + "|" + $("#allTable")[0].config.sortList[0][1]);
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
}
|
||||||
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const filters = localStorage.getItem("productionSchedule_filter");
|
const filters = localStorage.getItem("productionSchedule_filter");
|
||||||
@@ -85,12 +91,13 @@ $(document).ready(function () {
|
|||||||
var tmp = sort.split("|");
|
var tmp = sort.split("|");
|
||||||
$("#allTable")[0].config.sortList = [[parseInt(tmp[0]), parseInt(tmp[1])]];
|
$("#allTable")[0].config.sortList = [[parseInt(tmp[0]), parseInt(tmp[1])]];
|
||||||
$.tablesorter.sortOn($("#allTable")[0].config, [[parseInt(tmp[0]), parseInt(tmp[1])]]);
|
$.tablesorter.sortOn($("#allTable")[0].config, [[parseInt(tmp[0]), parseInt(tmp[1])]]);
|
||||||
} catch (e) { }
|
} catch (e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
$("#selectAll").click(function () {
|
$("#selectAll").click(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$(".allCheck").each(function() {
|
$(".allCheck").each(function () {
|
||||||
if ($(this).closest('tr').is(':visible')) {
|
if ($(this).closest('tr').is(':visible')) {
|
||||||
$(this).prop('checked', true);
|
$(this).prop('checked', true);
|
||||||
}
|
}
|
||||||
@@ -98,17 +105,38 @@ $(document).ready(function () {
|
|||||||
} else {
|
} else {
|
||||||
$(".allCheck").prop("checked", false);
|
$(".allCheck").prop("checked", false);
|
||||||
}
|
}
|
||||||
|
updateTimeSummary();
|
||||||
});
|
});
|
||||||
$("#duplicateBtn").click(() => duplicatePositions());
|
$("#duplicateBtn").click(() => duplicatePositions());
|
||||||
$("#deleteBtn").click(() => { removePositions(); });
|
$("#deleteBtn").click(() => {
|
||||||
$("#excelBtn").click(() => { exportExcel(); });
|
removePositions();
|
||||||
$("#pdfBtn").click(() => { exportPDF(); });
|
});
|
||||||
$("#productionBtn").click(() => { window.alert("In progress."); });
|
$("#excelBtn").click(() => {
|
||||||
|
exportExcel();
|
||||||
|
});
|
||||||
|
$("#pdfBtn").click(() => {
|
||||||
|
exportPDF();
|
||||||
|
});
|
||||||
|
$("#changeDateBtn").click(() => {
|
||||||
|
changeDate();
|
||||||
|
});
|
||||||
|
$("#rawMaterialsExcelBtn").click(() => {
|
||||||
|
exportRawMaterialsExcel();
|
||||||
|
});
|
||||||
|
$("#productionBtn").click(() => {
|
||||||
|
window.alert("In progress.");
|
||||||
|
});
|
||||||
$("#createInsideOrder").click(createInsideOrder);
|
$("#createInsideOrder").click(createInsideOrder);
|
||||||
|
$(document).on('change', '.allCheck', function () {
|
||||||
|
updateTimeSummary();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function SetTab(tab_name) {
|
function SetTab(tab_name) {
|
||||||
if (TabsMainBlock) { return; }
|
if (TabsMainBlock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var TabMenu = document.getElementById("groupTabsPanels");
|
var TabMenu = document.getElementById("groupTabsPanels");
|
||||||
var tabs = TabMenu.getElementsByTagName("li");
|
var tabs = TabMenu.getElementsByTagName("li");
|
||||||
for (var i = 0; i < tabs.length; i++) {
|
for (var i = 0; i < tabs.length; i++) {
|
||||||
@@ -134,6 +162,7 @@ function SetTab(tab_name) {
|
|||||||
if (SelectedTab === "1") {
|
if (SelectedTab === "1") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRawMaterials() {
|
function getRawMaterials() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -169,8 +198,10 @@ function getRawMaterials() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawRawMaterials(data) {
|
function drawRawMaterials(data) {
|
||||||
$("#rawMaterialsTableContainer").html(rawMaterialsTablePrototype());
|
$("#rawMaterialsTableContainer").html(rawMaterialsTablePrototype());
|
||||||
|
// TODO: tutraj czasami się wiesza
|
||||||
data.forEach((el, index) => {
|
data.forEach((el, index) => {
|
||||||
var tr = $("<tr></tr>");
|
var tr = $("<tr></tr>");
|
||||||
tr.append("<td><input type=\"checkbox\" value=" + el.id + " class=\"rawMaterialCheck\" /></td>");
|
tr.append("<td><input type=\"checkbox\" value=" + el.id + " class=\"rawMaterialCheck\" /></td>");
|
||||||
@@ -181,7 +212,7 @@ function drawRawMaterials(data) {
|
|||||||
}
|
}
|
||||||
code += "><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.id + "\">" + el.code + "</a></td>";
|
code += "><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.id + "\">" + el.code + "</a></td>";
|
||||||
tr.append(code);
|
tr.append(code);
|
||||||
tr.append("<td title=\""+ el.fullName +"\">" + el.name + "</td>");
|
tr.append("<td title=\"" + el.fullName + "\">" + el.name + "</td>");
|
||||||
tr.append("<td id=\"qty-" + el.id + "\">" + el.quantity + "</td>");
|
tr.append("<td id=\"qty-" + el.id + "\">" + el.quantity + "</td>");
|
||||||
tr.append("<td>" + el.unit + "</td>");
|
tr.append("<td>" + el.unit + "</td>");
|
||||||
tr.append("<td id=\"state-" + el.id + "\">" + el.stockState + "</td>");
|
tr.append("<td id=\"state-" + el.id + "\">" + el.stockState + "</td>");
|
||||||
@@ -209,7 +240,7 @@ function drawRawMaterials(data) {
|
|||||||
$("#selectAllRawMaterials").attr('checked', false);
|
$("#selectAllRawMaterials").attr('checked', false);
|
||||||
$("#selectAllRawMaterials").click(function () {
|
$("#selectAllRawMaterials").click(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$(".rawMaterialCheck").each(function() {
|
$(".rawMaterialCheck").each(function () {
|
||||||
if ($(this).closest('tr').is(':visible')) {
|
if ($(this).closest('tr').is(':visible')) {
|
||||||
$(this).prop('checked', true);
|
$(this).prop('checked', true);
|
||||||
}
|
}
|
||||||
@@ -220,9 +251,11 @@ function drawRawMaterials(data) {
|
|||||||
});
|
});
|
||||||
updateRawMaterialsPositions();
|
updateRawMaterialsPositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
function rawMaterialsTablePrototype() {
|
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>Adres magazynowy</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody></table>';
|
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>Adres magazynowy</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRawMaterialsPositions() {
|
function updateRawMaterialsPositions() {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$("#rawMaterialsTable").find("tr").each(function (index) {
|
$("#rawMaterialsTable").find("tr").each(function (index) {
|
||||||
@@ -232,6 +265,7 @@ function updateRawMaterialsPositions() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function editQty(id) {
|
function editQty(id) {
|
||||||
$("#edit-" + id).css("display", "none");
|
$("#edit-" + id).css("display", "none");
|
||||||
$("#qty-" + id).css("display", "none");
|
$("#qty-" + id).css("display", "none");
|
||||||
@@ -239,6 +273,7 @@ function editQty(id) {
|
|||||||
$("#qtyInput-" + id).select();
|
$("#qtyInput-" + id).select();
|
||||||
$("#save-" + id).css("display", "inline-block");
|
$("#save-" + id).css("display", "inline-block");
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveQty(id) {
|
function saveQty(id) {
|
||||||
showLoader("Trwa aktualizacja...");
|
showLoader("Trwa aktualizacja...");
|
||||||
$("#edit-" + id).css("display", "inline-block");
|
$("#edit-" + id).css("display", "inline-block");
|
||||||
@@ -254,6 +289,7 @@ function saveQty(id) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function duplicatePositions() {
|
function duplicatePositions() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -264,7 +300,9 @@ function duplicatePositions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var userResponse = window.confirm("Zduplikować pozycje?");
|
var userResponse = window.confirm("Zduplikować pozycje?");
|
||||||
if (!userResponse) { return; }
|
if (!userResponse) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showLoader("Duplikowanie...");
|
showLoader("Duplikowanie...");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
@@ -274,6 +312,7 @@ function duplicatePositions() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePositions() {
|
function removePositions() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -284,23 +323,68 @@ function removePositions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var userResponse = window.confirm("Usunąć pozycje?");
|
var userResponse = window.confirm("Usunąć pozycje?");
|
||||||
if (!userResponse) { return; }
|
if (!userResponse) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showLoader("Usuwanie...");
|
showLoader("Usuwanie...");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=removePositions&ids=" + ids.join("|"),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=removePositions&ids=" + ids.join("|"),
|
||||||
success: function ()
|
success: function () {
|
||||||
{
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveProductionDate(id) {
|
function saveProductionDate(id) {
|
||||||
|
let date = $("#production-date-" + id).val();
|
||||||
|
let time = $("#production-time-" + id).val();
|
||||||
|
|
||||||
|
if (date.length !== 10) {
|
||||||
|
$("#production-date-" + id).val('');
|
||||||
|
$("#production-time-" + id).val('');
|
||||||
|
date = '';
|
||||||
|
time = '';
|
||||||
|
} else {
|
||||||
|
if (time.length === 5) {
|
||||||
|
const timeRegex = /^([0-5]?[0-9]|1[0-3]):[0-5][0-9]$|^14:[0-2][0-9]$|^14:30$/;
|
||||||
|
if (!timeRegex.test(time)) {
|
||||||
|
time = "06:00";
|
||||||
|
} else {
|
||||||
|
const timeParts = time.split(':');
|
||||||
|
const hours = parseInt(timeParts[0], 10);
|
||||||
|
const minutes = parseInt(timeParts[1], 10);
|
||||||
|
|
||||||
|
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
||||||
|
time = "06:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (time.length === 4) {
|
||||||
|
time = time.substring(0, 2) + ":" + time.substring(2);
|
||||||
|
const timeRegex = /^([0-5]?[0-9]|1[0-3]):[0-5][0-9]$|^14:[0-2][0-9]$|^14:30$/;
|
||||||
|
if (!timeRegex.test(time)) {
|
||||||
|
time = "06:00";
|
||||||
|
} else {
|
||||||
|
const timeParts = time.split(':');
|
||||||
|
const hours = parseInt(timeParts[0], 10);
|
||||||
|
const minutes = parseInt(timeParts[1], 10);
|
||||||
|
|
||||||
|
if (hours < 6 || (hours === 14 && minutes > 30) || hours > 14) {
|
||||||
|
time = "06:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
time = "06:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#production-time-" + id).val(time);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=saveProductionDate&id=" + id + "&date=" + $("#production-date-" + id).val(),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=saveProductionDate&id=" + id + "&date=" + encodeURIComponent(date) + "&time=" + encodeURIComponent(time),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function editDescription(id) {
|
function editDescription(id) {
|
||||||
$("#edit-description-" + id).css("display", "none");
|
$("#edit-description-" + id).css("display", "none");
|
||||||
$("#description-" + id).css("display", "none");
|
$("#description-" + id).css("display", "none");
|
||||||
@@ -308,6 +392,7 @@ function editDescription(id) {
|
|||||||
$("#descriptionInput-" + id).select();
|
$("#descriptionInput-" + id).select();
|
||||||
$("#save-description-" + id).css("display", "inline-block");
|
$("#save-description-" + id).css("display", "inline-block");
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveDescription(id) {
|
function saveDescription(id) {
|
||||||
$("#edit-description-" + id).css("display", "inline-block");
|
$("#edit-description-" + id).css("display", "inline-block");
|
||||||
$("#description-" + id).css("display", "inline");
|
$("#description-" + id).css("display", "inline");
|
||||||
@@ -321,6 +406,7 @@ function saveDescription(id) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoader(msg = "Pobieranie danych") {
|
function showLoader(msg = "Pobieranie danych") {
|
||||||
$.blockUI({
|
$.blockUI({
|
||||||
css: {
|
css: {
|
||||||
@@ -337,30 +423,83 @@ function showLoader(msg = "Pobieranie danych") {
|
|||||||
message: msg
|
message: msg
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideLoader() {
|
function hideLoader() {
|
||||||
$.unblockUI();
|
$.unblockUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportExcel() {
|
function exportExcel() {
|
||||||
var ids = [];
|
// Check if any rows are selected
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
var checkedRows = $("input.allCheck:checkbox:checked").closest('tr:visible');
|
||||||
ids.push($(this).val());
|
if (checkedRows.length === 0) {
|
||||||
});
|
window.alert("Wybierz pozycje do eksportu");
|
||||||
if (ids.length === 0) {
|
return;
|
||||||
$("input.allCheck:checkbox").each(function () {
|
|
||||||
ids.push($(this).val());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get table data from selected rows only
|
||||||
|
var tableData = [];
|
||||||
|
|
||||||
|
// Get headers (skip first checkbox column)
|
||||||
|
var headers = [];
|
||||||
|
$("#allTable thead tr th").each(function (index) {
|
||||||
|
if (index > 0) {
|
||||||
|
headers.push($(this).text().trim());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tableData.push(headers);
|
||||||
|
|
||||||
|
// Get data from checked and visible rows
|
||||||
|
checkedRows.each(function () {
|
||||||
|
var rowData = [];
|
||||||
|
var $row = $(this);
|
||||||
|
|
||||||
|
$row.find('td').each(function (index) {
|
||||||
|
if (index > 0) { // Skip first checkbox column
|
||||||
|
var $cell = $(this);
|
||||||
|
var cellValue = '';
|
||||||
|
|
||||||
|
// Check for input fields (like production date)
|
||||||
|
var $input = $cell.find('input[type="text"], input[type="number"]');
|
||||||
|
if ($input.length > 0) {
|
||||||
|
cellValue = $input.val() || '';
|
||||||
|
} else {
|
||||||
|
// Check for editable divs (like qty, description)
|
||||||
|
var $editableDiv = $cell.find('div[id^="qty-"], div[id^="description-"]');
|
||||||
|
if ($editableDiv.length > 0) {
|
||||||
|
cellValue = $editableDiv.text().trim();
|
||||||
|
} else {
|
||||||
|
// Regular cell text
|
||||||
|
cellValue = $cell.text().trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rowData.push(cellValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (rowData.length > 0) {
|
||||||
|
tableData.push(rowData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
showLoader("Generowanie pliku...");
|
showLoader("Generowanie pliku...");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "post",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportExcel&ids=" + ids.join("|"),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportExcelWYSIWYG",
|
||||||
success: function (response)
|
data: {
|
||||||
{
|
tableData: JSON.stringify(tableData)
|
||||||
downloadFile(response.fileContent, response.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
},
|
},
|
||||||
|
error: function () {
|
||||||
|
window.alert("Błąd podczas generowania pliku");
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportPDF() {
|
function exportPDF() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("input.allCheck:checkbox:checked").each(function () {
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
@@ -375,31 +514,107 @@ function exportPDF() {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
method: "get",
|
method: "get",
|
||||||
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportPDF&ids=" + ids.join("|"),
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportPDF&ids=" + ids.join("|"),
|
||||||
success: function (response)
|
success: function (response) {
|
||||||
{
|
|
||||||
downloadFile(response.fileContent, response.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
downloadFile(response.fileContent, response.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportRawMaterialsExcel() {
|
||||||
|
// Check if raw materials table exists
|
||||||
|
if ($("#rawMaterialsTable").length === 0) {
|
||||||
|
window.alert("Brak tabeli surowców do eksportu");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if any rows are selected
|
||||||
|
var checkedRows = $("input.rawMaterialCheck:checkbox:checked").closest('tr:visible');
|
||||||
|
if (checkedRows.length === 0) {
|
||||||
|
// If no rows selected, export all visible rows
|
||||||
|
checkedRows = $("#rawMaterialsTable tbody tr:visible");
|
||||||
|
if (checkedRows.length === 0) {
|
||||||
|
window.alert("Brak danych do eksportu");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get table data from selected rows
|
||||||
|
var tableData = [];
|
||||||
|
|
||||||
|
// Get headers (skip first checkbox column)
|
||||||
|
var headers = [];
|
||||||
|
$("#rawMaterialsTable thead tr th").each(function (index) {
|
||||||
|
if (index > 0) {
|
||||||
|
headers.push($(this).text().trim());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tableData.push(headers);
|
||||||
|
|
||||||
|
// Get data from selected/visible rows
|
||||||
|
checkedRows.each(function () {
|
||||||
|
var rowData = [];
|
||||||
|
var $row = $(this);
|
||||||
|
|
||||||
|
$row.find('td').each(function (index) {
|
||||||
|
if (index > 0) { // Skip first checkbox column
|
||||||
|
var $cell = $(this);
|
||||||
|
var cellValue = '';
|
||||||
|
|
||||||
|
// Check for links (product codes)
|
||||||
|
var $link = $cell.find('a');
|
||||||
|
if ($link.length > 0) {
|
||||||
|
cellValue = $link.text().trim();
|
||||||
|
} else {
|
||||||
|
// Regular cell text
|
||||||
|
cellValue = $cell.text().trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
rowData.push(cellValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (rowData.length > 0) {
|
||||||
|
tableData.push(rowData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
showLoader("Generowanie pliku...");
|
||||||
|
$.ajax({
|
||||||
|
method: "post",
|
||||||
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=exportExcelWYSIWYG",
|
||||||
|
data: {
|
||||||
|
tableData: JSON.stringify(tableData)
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadFile(result.fileContent, result.fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
|
hideLoader();
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
window.alert("Błąd podczas generowania pliku");
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function createInsideOrder() {
|
function createInsideOrder() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$('input.allCheck:checkbox:checked').each(function () {
|
$('input.allCheck:checkbox:checked').each(function () {
|
||||||
ids.push($(this).val());
|
ids.push($(this).val());
|
||||||
});
|
});
|
||||||
if (ids.length === 0) {
|
if (ids.length === 0) {
|
||||||
alert('Wybierz pozycje.');
|
alert('Wybierz pozycje.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var products = [];
|
var products = [];
|
||||||
ids.forEach(el => {
|
ids.forEach(el => {
|
||||||
const qty = parseFloat($("#qtyInput-" + el).val().trim());
|
const qty = parseFloat($("#qtyInput-" + el).val().trim());
|
||||||
const id = $("#productId-" + el).val();
|
const id = $("#productId-" + el).val();
|
||||||
products.push(id + "|" + qty);
|
products.push(id + "|" + qty);
|
||||||
});
|
});
|
||||||
$("#insideOrderProducts").val(products.join('*'));
|
$("#insideOrderProducts").val(products.join('*'));
|
||||||
$("#createInsideOrderForm").submit();
|
$("#createInsideOrderForm").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFile(base64Data, fileName, mimeType) {
|
function downloadFile(base64Data, fileName, mimeType) {
|
||||||
// Stwórz blob z danych base64
|
// Stwórz blob z danych base64
|
||||||
@@ -430,8 +645,84 @@ function downloadFile(base64Data, fileName, mimeType) {
|
|||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
// Usuń link z dokumentu
|
// Usuń link z dokumentu
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
window.URL.revokeObjectURL(link.href);
|
window.URL.revokeObjectURL(link.href);
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateTimeSummary() {
|
||||||
|
var totalMinutes = 0;
|
||||||
|
var rows;
|
||||||
|
|
||||||
|
var checkedBoxes = $('.allCheck:checked');
|
||||||
|
|
||||||
|
if (checkedBoxes.length > 0) {
|
||||||
|
rows = checkedBoxes.closest('tr');
|
||||||
|
} else {
|
||||||
|
rows = $('#allTable tbody tr:visible');
|
||||||
|
}
|
||||||
|
|
||||||
|
rows.each(function () {
|
||||||
|
var actionTimeCell = $(this).find('td').eq(17);
|
||||||
|
var timeText = actionTimeCell.text().trim();
|
||||||
|
|
||||||
|
if (timeText && timeText.includes(':')) {
|
||||||
|
var timeParts = timeText.split(':');
|
||||||
|
if (timeParts.length === 2) {
|
||||||
|
var hours = parseInt(timeParts[0], 10) || 0;
|
||||||
|
var minutes = parseInt(timeParts[1], 10) || 0;
|
||||||
|
totalMinutes += (hours * 60) + minutes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var totalHours = Math.floor(totalMinutes / 60);
|
||||||
|
var remainingMinutes = totalMinutes % 60;
|
||||||
|
|
||||||
|
var formattedTime = String(totalHours).padStart(2, '0') + ':' +
|
||||||
|
String(remainingMinutes).padStart(2, '0');
|
||||||
|
$('#timeSummary').html(formattedTime);
|
||||||
|
|
||||||
|
return formattedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeDate() {
|
||||||
|
var ids = [];
|
||||||
|
$('input.allCheck:checkbox:checked').each(function () {
|
||||||
|
ids.push($(this).val());
|
||||||
|
});
|
||||||
|
if (ids.length === 0) {
|
||||||
|
alert('Wybierz pozycje.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let hours = prompt("Podaj ilość godzin:");
|
||||||
|
if (hours === null) {
|
||||||
|
return null; // no response
|
||||||
|
}
|
||||||
|
hours = parseFloat(hours);
|
||||||
|
if (hours === "") {
|
||||||
|
window.alert("Niepoprawna wartość (-100 : 100)");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const hoursNum = parseFloat(hours);
|
||||||
|
if (isNaN(hoursNum)) {
|
||||||
|
window.alert("Niepoprawna wartość (-100 : 100)");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (hoursNum < -100 || hoursNum > 100) {
|
||||||
|
window.alert("Niepoprawna wartość (-100 : 100)");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
method: "get",
|
||||||
|
url: $(location).attr("href") + "&to_pdf=1&ajaxAction=updateProductionDate&ids=" + ids.join("|") + "&hours=" + hoursNum,
|
||||||
|
success: function () {
|
||||||
|
window.location.reload();
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
window.alert("Aktualizacja nie powiodła się.");
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
ini_set('display_errors', 1);
|
//ini_set('display_errors', 1);
|
||||||
ini_set('display_startup_errors', 1);
|
//ini_set('display_startup_errors', 1);
|
||||||
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
//error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
||||||
|
|
||||||
if (!isset($_GET['ajaxAction'])) {
|
if (!isset($_GET['ajaxAction'])) {
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ if (!isset($_GET['ajaxAction'])) {
|
|||||||
removePositions($_GET['ids']);
|
removePositions($_GET['ids']);
|
||||||
break;
|
break;
|
||||||
case 'saveProductionDate':
|
case 'saveProductionDate':
|
||||||
saveProductionDate($_GET['id'], $_GET['date']);
|
saveProductionDate($_GET['id'], $_GET['date'], $_GET['time']);
|
||||||
break;
|
break;
|
||||||
case 'saveProductDescription':
|
case 'saveProductDescription':
|
||||||
saveProductDescription($_GET['id'], $_GET['description']);
|
saveProductDescription($_GET['id'], $_GET['description']);
|
||||||
@@ -44,12 +44,18 @@ if (!isset($_GET['ajaxAction'])) {
|
|||||||
case 'exportExcel':
|
case 'exportExcel':
|
||||||
exportExcel($_GET['ids']);
|
exportExcel($_GET['ids']);
|
||||||
break;
|
break;
|
||||||
|
case 'exportExcelWYSIWYG':
|
||||||
|
exportExcelWYSIWYG($_POST['tableData']);
|
||||||
|
break;
|
||||||
case 'exportPDF':
|
case 'exportPDF':
|
||||||
exportPDF($_GET['ids']);
|
exportPDF($_GET['ids']);
|
||||||
break;
|
break;
|
||||||
case 'getRawMaterials':
|
case 'getRawMaterials':
|
||||||
getRawMaterials($_POST['ids']);
|
getRawMaterials($_POST['ids']);
|
||||||
break;
|
break;
|
||||||
|
case 'updateProductionDate':
|
||||||
|
updateProductionDate($_GET['ids'], $_GET['hours']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function loadSchedulers($dateFrom = null, $dateTo = null, $ids = null)
|
function loadSchedulers($dateFrom = null, $dateTo = null, $ids = null)
|
||||||
@@ -67,7 +73,9 @@ SELECT s.id as orderId, s.document_no, s.status, s.parent_name, s.parent_id, s.s
|
|||||||
ps_main.ecmproduct_id as main_product_id,
|
ps_main.ecmproduct_id as main_product_id,
|
||||||
p_main.code as main_product_code,
|
p_main.code as main_product_code,
|
||||||
a.id AS action_id,
|
a.id AS action_id,
|
||||||
a.indeks AS action_index
|
a.indeks AS action_index,
|
||||||
|
a.category AS action_category,
|
||||||
|
a.performance AS action_performance
|
||||||
FROM productionScheduler AS ps
|
FROM productionScheduler AS ps
|
||||||
LEFT JOIN ecmsaleitems AS si
|
LEFT JOIN ecmsaleitems AS si
|
||||||
ON ps.ecmsaleitem_id = si.id
|
ON ps.ecmsaleitem_id = si.id
|
||||||
@@ -97,8 +105,8 @@ WHERE ps.deleted = 0 ";
|
|||||||
|
|
||||||
if ($dateFrom != null && $dateTo != null) {
|
if ($dateFrom != null && $dateTo != null) {
|
||||||
$query .= " AND (
|
$query .= " AND (
|
||||||
(ps.production_date >= '$dateFrom' AND ps.production_date <= '$dateTo')
|
(DATE(ps.production_date) >= '$dateFrom' AND DATE(ps.production_date) <= '$dateTo')
|
||||||
OR ps.production_date IS NULL OR ps.production_date = '0000-00-00')";
|
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00 00:00:00')";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ids != null) {
|
if ($ids != null) {
|
||||||
@@ -106,7 +114,6 @@ WHERE ps.deleted = 0 ";
|
|||||||
}
|
}
|
||||||
|
|
||||||
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
||||||
$query .= "ORDER BY s.delivery_date, s.register_date, s.document_no;";
|
|
||||||
|
|
||||||
$rows = $db->query($query);
|
$rows = $db->query($query);
|
||||||
$data = array();
|
$data = array();
|
||||||
@@ -138,13 +145,26 @@ WHERE ps.deleted = 0 ";
|
|||||||
$row['description'] = strlen($r['description']) > 0 ? substr($r['description'], 0, 30) : '';
|
$row['description'] = strlen($r['description']) > 0 ? substr($r['description'], 0, 30) : '';
|
||||||
$row['fullDescription'] = $r['description'];
|
$row['fullDescription'] = $r['description'];
|
||||||
$row['shippingTo'] = ($r['shipping_address_name'] == 'Adres korespondencyjny' ? '' : $r['shipping_address_name']);
|
$row['shippingTo'] = ($r['shipping_address_name'] == 'Adres korespondencyjny' ? '' : $r['shipping_address_name']);
|
||||||
$row['productionDate'] = $r['production_date'] == '0000-00-00' ? '' : $r['production_date'];
|
$row['productionDate'] = $r['production_date'] == '0000-00-00 00:00:00' ? '' : substr($r['production_date'], 0, 10);
|
||||||
|
$row['productionTime'] = $r['production_date'] == '0000-00-00 00:00:00' ? '' : substr($r['production_date'], 11, 5);
|
||||||
$row['productStockState'] = $r['stockState'] | 0;
|
$row['productStockState'] = $r['stockState'] | 0;
|
||||||
$row['mainProductId'] = $r['main_product_id'];
|
$row['mainProductId'] = $r['main_product_id'];
|
||||||
$row['mainProductCode'] = strlen($r['main_product_code']) > 20 ? substr($r['main_product_code'], 0, 20) . "..." : $r['main_product_code'];
|
$row['mainProductCode'] = strlen($r['main_product_code']) > 20 ? substr($r['main_product_code'], 0, 20) . "..." : $r['main_product_code'];
|
||||||
$row['mainProductFullCode'] = $r['main_product_code'];
|
$row['mainProductFullCode'] = $r['main_product_code'];
|
||||||
$row['action_id'] = $r['action_id'];
|
$row['action_id'] = $r['action_id'];
|
||||||
$row['action_index'] = $r['action_index'];
|
$row['action_index'] = $r['action_index'];
|
||||||
|
$row['action_category'] = $app_list_strings['ecmactions_category_dom'][$r['action_category']];
|
||||||
|
|
||||||
|
// check if action_performance is number and is not 0
|
||||||
|
if (is_numeric($r['action_performance']) && $r['action_performance'] != 0) {
|
||||||
|
$timeInHours = $r['scheduledQuantity'] / $r['action_performance'];
|
||||||
|
$hours = floor($timeInHours);
|
||||||
|
$minutes = round(($timeInHours - $hours) * 60);
|
||||||
|
$row['action_time'] = sprintf('%02d:%02d', $hours, $minutes);
|
||||||
|
} else {
|
||||||
|
$row['action_time'] = '---';
|
||||||
|
}
|
||||||
|
|
||||||
$data[] = $row;
|
$data[] = $row;
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
@@ -251,8 +271,8 @@ function duplicatePositions($ids)
|
|||||||
$ids = explode("|", $ids);
|
$ids = explode("|", $ids);
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$res = $db->fetchByAssoc($db->query("SELECT * FROM productionScheduler WHERE id ='$id'"));
|
$res = $db->fetchByAssoc($db->query("SELECT * FROM productionScheduler WHERE id ='$id'"));
|
||||||
$query = sprintf("INSERT INTO productionScheduler VALUES ('%s', null, '%s', '%s', '%d', NOW(), NOW(), '%s', '%s', 0, '%s', '%d', '%s', '%s');",
|
$query = sprintf("INSERT INTO productionScheduler VALUES ('%s', '%s', '%s', '%s', '%d', NOW(), NOW(), '%s', '%s', 0, '%s', '%d', '%s', '%s');",
|
||||||
generateUuidV4(), $res['ecmsaleitem_id'], $res['ecmsale_id'], $res['quantity'], $current_user->id, $current_user->id, $res['ecmproduct_id'],
|
generateUuidV4(), $res['main_id'], $res['ecmsaleitem_id'], $res['ecmsale_id'], $res['quantity'], $current_user->id, $current_user->id, $res['ecmproduct_id'],
|
||||||
$res['is_component'], $res['production_date'], $res['description']);
|
$res['is_component'], $res['production_date'], $res['description']);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
@@ -268,14 +288,15 @@ function removePositions($ids)
|
|||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveProductionDate($id, $date)
|
function saveProductionDate($id, $date, $time)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
$date = date("Y-m-d", strtotime($date));
|
$parsedDate = date("Y-m-d", strtotime($date));
|
||||||
if ($date == '1970-01-01') {
|
if ($parsedDate == '1970-01-01') {
|
||||||
$db->query("UPDATE productionScheduler SET production_date=NULL WHERE id='$id'");
|
$db->query("UPDATE productionScheduler SET production_date=NULL WHERE id='$id'");
|
||||||
} else {
|
} else {
|
||||||
$db->query("UPDATE productionScheduler SET production_date='$date' WHERE id='$id'");
|
$parsetDateTime = date("Y-m-d H:i", strtotime($date . ' ' . $time));
|
||||||
|
$db->query("UPDATE productionScheduler SET production_date='$parsetDateTime' WHERE id='$id'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,4 +473,151 @@ function generateUuidV4()
|
|||||||
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
|
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
|
||||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
||||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportExcelWYSIWYG($tableDataJson)
|
||||||
|
{
|
||||||
|
if (function_exists('from_html')) {
|
||||||
|
$tableDataJson = from_html($tableDataJson);
|
||||||
|
}
|
||||||
|
$json = getJSONobj();
|
||||||
|
$rawData = $json->decode($tableDataJson);
|
||||||
|
|
||||||
|
if (isset($rawData['jsonObject']) && is_array($rawData['jsonObject'])) {
|
||||||
|
$tableData = $rawData['jsonObject'];
|
||||||
|
} else {
|
||||||
|
$tableData = $rawData;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($tableData) || !is_array($tableData)) {
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array(
|
||||||
|
'success' => false,
|
||||||
|
'error' => 'Failed to decode table data. Type: ' . gettype($tableData)
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'modules/EcmReports/BimIT-Reports/lib/xlsxGenerator.php';
|
||||||
|
|
||||||
|
$xlsx = Shuchkin\SimpleXLSXGen::fromArray($tableData);
|
||||||
|
$xlsx_content = (string)$xlsx;
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array(
|
||||||
|
'success' => true,
|
||||||
|
'fileContent' => base64_encode($xlsx_content),
|
||||||
|
'fileName' => 'harmonogram_produkcji.xlsx'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
function updateProductionDate($ids, $hours) {
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
$ids = explode("|", $ids);
|
||||||
|
foreach ($ids as $id) {
|
||||||
|
$res = $db->fetchByAssoc($db->query("SELECT production_date FROM productionScheduler WHERE id ='$id'"));
|
||||||
|
|
||||||
|
if ($res['production_date'] && $res['production_date'] != '0000-00-00 00:00:00') {
|
||||||
|
$newDate = calculateProductionDate($res['production_date'], $hours);
|
||||||
|
$db->query("UPDATE productionScheduler SET production_date='$newDate:00' WHERE id='$id'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function calculateProductionDate($currentDateTime, $hoursToAdd) {
|
||||||
|
$WORK_START = 6 * 60;
|
||||||
|
$WORK_END = 14 * 60 + 30;
|
||||||
|
|
||||||
|
$date = new DateTime($currentDateTime);
|
||||||
|
$totalMinutesToAdd = $hoursToAdd * 60;
|
||||||
|
|
||||||
|
if ($totalMinutesToAdd > 0) {
|
||||||
|
while ($totalMinutesToAdd > 0) {
|
||||||
|
$dayOfWeek = $date->format('w');
|
||||||
|
if ($dayOfWeek == 0 || $dayOfWeek == 6) {
|
||||||
|
$date = getNextWorkDay($date);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentMinutes = $date->format('H') * 60 + $date->format('i');
|
||||||
|
|
||||||
|
if ($currentMinutes < $WORK_START) {
|
||||||
|
$date->setTime(6, 0, 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($currentMinutes >= $WORK_END) {
|
||||||
|
$date = getNextWorkDay($date);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$remainingMinutesToday = $WORK_END - $currentMinutes;
|
||||||
|
|
||||||
|
if ($totalMinutesToAdd <= $remainingMinutesToday) {
|
||||||
|
$date->modify('+' . $totalMinutesToAdd . ' minutes');
|
||||||
|
$totalMinutesToAdd = 0;
|
||||||
|
} else {
|
||||||
|
$totalMinutesToAdd -= $remainingMinutesToday;
|
||||||
|
$date = getNextWorkDay($date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($totalMinutesToAdd < 0) {
|
||||||
|
$totalMinutesToAdd = abs($totalMinutesToAdd);
|
||||||
|
|
||||||
|
while ($totalMinutesToAdd > 0) {
|
||||||
|
$dayOfWeek = $date->format('w');
|
||||||
|
if ($dayOfWeek == 0 || $dayOfWeek == 6) {
|
||||||
|
$date = getPreviousWorkDay($date);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentMinutes = $date->format('H') * 60 + $date->format('i');
|
||||||
|
|
||||||
|
if ($currentMinutes > $WORK_END) {
|
||||||
|
$date->setTime(14, 30, 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($currentMinutes <= $WORK_START) {
|
||||||
|
$date = getPreviousWorkDay($date);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$minutesFromStart = $currentMinutes - $WORK_START;
|
||||||
|
|
||||||
|
if ($totalMinutesToAdd <= $minutesFromStart) {
|
||||||
|
$date->modify('-' . $totalMinutesToAdd . ' minutes');
|
||||||
|
$totalMinutesToAdd = 0;
|
||||||
|
} else {
|
||||||
|
$totalMinutesToAdd -= $minutesFromStart;
|
||||||
|
$date = getPreviousWorkDay($date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $date->format('Y-m-d H:i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNextWorkDay($date) {
|
||||||
|
$nextDay = clone $date;
|
||||||
|
$nextDay->modify('+1 day');
|
||||||
|
$nextDay->setTime(6, 0, 0);
|
||||||
|
|
||||||
|
while ($nextDay->format('w') == 0 || $nextDay->format('w') == 6) {
|
||||||
|
$nextDay->modify('+1 day');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $nextDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPreviousWorkDay($date) {
|
||||||
|
$prevDay = clone $date;
|
||||||
|
$prevDay->modify('-1 day');
|
||||||
|
$prevDay->setTime(14, 30, 0);
|
||||||
|
|
||||||
|
while ($prevDay->format('w') == 0 || $prevDay->format('w') == 6) {
|
||||||
|
$prevDay->modify('-1 day');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prevDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
<input class="button" id="excelBtn" value="Excel" type="button">
|
<input class="button" id="excelBtn" value="Excel" type="button">
|
||||||
<input class="button" id="pdfBtn" value="PDF" type="button">
|
<input class="button" id="pdfBtn" value="PDF" type="button">
|
||||||
<input class="button" value="Utwórz przyjęcie produkcyjne" type="button" id="createInsideOrder"/>
|
<input class="button" value="Utwórz przyjęcie produkcyjne" type="button" id="createInsideOrder"/>
|
||||||
|
<input class="button" id="changeDateBtn" value="Aktualizuj datę produkcji" type="button">
|
||||||
<table id="allTable">
|
<table id="allTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -152,6 +153,8 @@
|
|||||||
<th>Marka</th>
|
<th>Marka</th>
|
||||||
<th>Data wysyłki</th>
|
<th>Data wysyłki</th>
|
||||||
<th>Czynność</th>
|
<th>Czynność</th>
|
||||||
|
<th>Linia</th>
|
||||||
|
<th>Czas</th>
|
||||||
<th>Uwagi</th>
|
<th>Uwagi</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -177,23 +180,28 @@
|
|||||||
{$ROW.productName}
|
{$ROW.productName}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="production-date-{$ROW.id}" name="production-date-{$ROW.id}" type="text"
|
<div style="white-space: nowrap">
|
||||||
maxlength="10" size="11" tabindex="" title="" value="{$ROW.productionDate}"
|
<input id="production-date-{$ROW.id}" name="production-date-{$ROW.id}" type="text"
|
||||||
autocomplete="off"
|
maxlength="10" size="11" tabindex="" title="" value="{$ROW.productionDate}"
|
||||||
id="production-date-{$ROW.id}" onchange="saveProductionDate('{$ROW.id}')">
|
autocomplete="off"
|
||||||
<img id="production-date-trigger-{$ROW.id}" src="themes/default/images/jscalendar.gif"
|
id="production-date-{$ROW.id}" onchange="saveProductionDate('{$ROW.id}')">
|
||||||
style="width: 13px;">
|
<img id="production-date-trigger-{$ROW.id}" src="themes/default/images/jscalendar.gif"
|
||||||
<script language="JavaScript" type="text/javascript">
|
style="width: 13px;">
|
||||||
Calendar.setup({ldelim}
|
<script language="JavaScript" type="text/javascript">
|
||||||
inputField: "production-date-{$ROW.id}",
|
Calendar.setup({ldelim}
|
||||||
daFormat: "%Y-%m-%d",
|
inputField: "production-date-{$ROW.id}",
|
||||||
button: "production-date-trigger-{$ROW.id}",
|
daFormat: "%Y-%m-%d",
|
||||||
singleClick: true,
|
button: "production-date-trigger-{$ROW.id}",
|
||||||
dateStr: "",
|
singleClick: true,
|
||||||
step: 1
|
dateStr: "",
|
||||||
{rdelim}
|
step: 1
|
||||||
);
|
{rdelim}
|
||||||
</script>
|
);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<input type="text"
|
||||||
|
maxlength="10" size="11" tabindex="" title="" id="production-time-{$ROW.id}" name="production-time-{$ROW.id}"
|
||||||
|
autocomplete="off" value="{$ROW.productionTime}" onchange="saveProductionDate('{$ROW.id}')">
|
||||||
</td>
|
</td>
|
||||||
<td style="white-space: nowrap;">
|
<td style="white-space: nowrap;">
|
||||||
<div id="edit-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
<div id="edit-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||||
@@ -245,6 +253,12 @@
|
|||||||
{$ROW.action_index}
|
{$ROW.action_index}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{$ROW.action_category}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{$ROW.action_time}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="edit-description-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
<div id="edit-description-{$ROW.id}" class="ui-icon ui-icon-pencil"
|
||||||
onclick="editDescription('{$ROW.id}')" style="display: inline-block;"></div>
|
onclick="editDescription('{$ROW.id}')" style="display: inline-block;"></div>
|
||||||
@@ -258,10 +272,19 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="17" style="text-align: right;"></td>
|
||||||
|
<td id="timeSummary"></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="2" style="display: none">
|
<div id="2" style="display: none">
|
||||||
|
<br>
|
||||||
|
<input class="button" id="rawMaterialsExcelBtn" value="Excel" type="button">
|
||||||
<div id="rawMaterialsTableContainer">
|
<div id="rawMaterialsTableContainer">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 0);
|
||||||
ini_set('display_startup_errors', 1);
|
ini_set('display_startup_errors', 0);
|
||||||
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
//error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
||||||
|
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
global $app_list_strings;
|
global $app_list_strings;
|
||||||
@@ -135,10 +135,10 @@ if (!isset($_GET['ajaxAction'])) {
|
|||||||
} else {
|
} else {
|
||||||
switch ($_GET['ajaxAction']) {
|
switch ($_GET['ajaxAction']) {
|
||||||
case 'getComponents':
|
case 'getComponents':
|
||||||
echo getComponents2($_POST['ids']);
|
getComponents3($_POST['ids']);
|
||||||
break;
|
break;
|
||||||
case 'getRawMaterials':
|
case 'getRawMaterials':
|
||||||
echo getRawMaterials2($_POST['ids'], $_POST['type']);;
|
getRawMaterials2($_POST['ids'], $_POST['type']);;
|
||||||
break;
|
break;
|
||||||
case 'saveProductDescription':
|
case 'saveProductDescription':
|
||||||
saveProductDescription($_GET['itemId'], $_GET['description']);
|
saveProductDescription($_GET['itemId'], $_GET['description']);
|
||||||
@@ -162,6 +162,7 @@ function findProduct($array, $value)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComponents($ids, $dateFrom, $dateTo)
|
function getComponents($ids, $dateFrom, $dateTo)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -236,6 +237,59 @@ function getComponents($ids, $dateFrom, $dateTo)
|
|||||||
}
|
}
|
||||||
echo json_encode($componentsData);
|
echo json_encode($componentsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getComponents3($ids)
|
||||||
|
{
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
global $app_list_strings;
|
||||||
|
|
||||||
|
$componentsData = array();
|
||||||
|
|
||||||
|
foreach ($ids as $id) {
|
||||||
|
$saleInfo = $db->fetchByAssoc($db->query("SELECT quantity, ecmproduct_id, description, ecmsale_id FROM ecmsaleitems WHERE id ='$id'"));
|
||||||
|
$saleQuery = "SELECT s.document_no, s.id, s.type, s.status, s.send_date, s.shipping_address_name
|
||||||
|
FROM ecmsales AS s
|
||||||
|
WHERE s.id = '" . $saleInfo['ecmsale_id'] . "'";
|
||||||
|
$saleData = $db->fetchByAssoc($db->query($saleQuery));
|
||||||
|
|
||||||
|
$products = array();
|
||||||
|
$products = array_merge(getProductComponents($saleInfo['ecmproduct_id'], $saleInfo['quantity']), $products);
|
||||||
|
|
||||||
|
$mainProduct = $db->fetchByAssoc($db->query(sprintf("SELECT code FROM ecmproducts WHERE id = '%s'", $saleInfo['ecmproduct_id'])));
|
||||||
|
|
||||||
|
foreach ($products as $product) {
|
||||||
|
$prodQuery = sprintf("SELECT p.id, p.code, p.name, p.shape, p.brand, p.ems_qty_in_stock,
|
||||||
|
p.vendor_part_no as kind, p.part_no as size
|
||||||
|
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'] = $saleInfo['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'];
|
||||||
|
$row['productCode'] = strlen($p['code']) > 20 ? substr($p['code'], 0, 20) . "..." : $p['code'];
|
||||||
|
$row['productFullCode'] = $p['code'];
|
||||||
|
$row['productKind'] = $p['kind'] != null ? $p['kind'] : "";
|
||||||
|
$row['productSize'] = $p['size'];
|
||||||
|
$row['productShape'] = $app_list_strings['ecmproducts_shape_dom'][$p['shape']];
|
||||||
|
$row['productBrand'] = $app_list_strings['ecmproducts_brand_dom'][$p['brand']];
|
||||||
|
$row['productQty'] = $product['quantity'];
|
||||||
|
$row['productStockState'] = $p['ems_qty_in_stock'] | 0;
|
||||||
|
$row['orderNo'] = $saleData['document_no'];
|
||||||
|
$row['orderId'] = $saleData['id'];
|
||||||
|
$row['orderStatus'] = $app_list_strings['ecmsales_status_dom'][$saleData['status']];
|
||||||
|
$row['orderType'] = $app_list_strings['ecmsales_type_dom'][$saleData['type']];
|
||||||
|
$row['orderParent'] = (isset($saleData['shipping_address_name']) && $saleData['shipping_address_name'] != 'Adres korespondencyjny' ? $saleData['shipping_address_name'] : '');
|
||||||
|
$row['orderSendDate'] = $saleData['send_date'];
|
||||||
|
$componentsData[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($componentsData);
|
||||||
|
}
|
||||||
|
|
||||||
function getRawMaterials2($ids, $type)
|
function getRawMaterials2($ids, $type)
|
||||||
{
|
{
|
||||||
global $app_list_strings;
|
global $app_list_strings;
|
||||||
@@ -246,7 +300,8 @@ function getRawMaterials2($ids, $type)
|
|||||||
if ($type == 'sales') {
|
if ($type == 'sales') {
|
||||||
$productsQuery = "SELECT si.ecmproduct_id, SUM(si.quantity) as quantity
|
$productsQuery = "SELECT si.ecmproduct_id, SUM(si.quantity) as quantity
|
||||||
FROM ecmsaleitems AS si
|
FROM ecmsaleitems AS si
|
||||||
WHERE si.id IN ('" . $idsString . "')";
|
WHERE si.id IN ('" . $idsString . "')
|
||||||
|
GROUP BY si.id";
|
||||||
$prows = $db->query($productsQuery);
|
$prows = $db->query($productsQuery);
|
||||||
while ($p = $db->fetchByAssoc($prows)) {
|
while ($p = $db->fetchByAssoc($prows)) {
|
||||||
$prod = array();
|
$prod = array();
|
||||||
@@ -258,18 +313,9 @@ function getRawMaterials2($ids, $type)
|
|||||||
$products = $ids;
|
$products = $ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
$grouppedProducts = array_reduce($products, function ($carry, $item) {
|
|
||||||
if (isset($carry[$item['ecmproduct_id']])) {
|
|
||||||
$carry[$item['ecmproduct_id']]['productQty'] += $item['quantity'];
|
|
||||||
} else {
|
|
||||||
$carry[$item['ecmproduct_id']] = $item;
|
|
||||||
}
|
|
||||||
return $carry;
|
|
||||||
});
|
|
||||||
|
|
||||||
$rawMaterialsData = array();
|
$rawMaterialsData = array();
|
||||||
|
|
||||||
foreach ($grouppedProducts as $product) {
|
foreach ($products as $product) {
|
||||||
$rawMaterialsData = array_merge(
|
$rawMaterialsData = array_merge(
|
||||||
$rawMaterialsData,
|
$rawMaterialsData,
|
||||||
getProductRawMaterials($product['ecmproduct_id'], $product['quantity'])
|
getProductRawMaterials($product['ecmproduct_id'], $product['quantity'])
|
||||||
@@ -278,7 +324,7 @@ function getRawMaterials2($ids, $type)
|
|||||||
|
|
||||||
$grouppedRawMaterials = array_reduce($rawMaterialsData, function ($carry, $item) {
|
$grouppedRawMaterials = array_reduce($rawMaterialsData, function ($carry, $item) {
|
||||||
if (isset($carry[$item['ecmproduct_id']])) {
|
if (isset($carry[$item['ecmproduct_id']])) {
|
||||||
$carry[$item['ecmproduct_id']]['productQty'] += $item['quantity'];
|
$carry[$item['ecmproduct_id']]['quantity'] += $item['quantity'];
|
||||||
} else {
|
} else {
|
||||||
$carry[$item['ecmproduct_id']] = $item;
|
$carry[$item['ecmproduct_id']] = $item;
|
||||||
}
|
}
|
||||||
@@ -335,8 +381,9 @@ function getRawMaterials2($ids, $type)
|
|||||||
$row['stockAddress'] = (!empty($product['stock_addresses'])) ? $product['stock_addresses'] : "";
|
$row['stockAddress'] = (!empty($product['stock_addresses'])) ? $product['stock_addresses'] : "";
|
||||||
$response[] = $row;
|
$response[] = $row;
|
||||||
}
|
}
|
||||||
return json_encode($response);
|
echo json_encode($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRawMaterials($ids, $cids)
|
function getRawMaterials($ids, $cids)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -422,6 +469,7 @@ function getRawMaterials($ids, $cids)
|
|||||||
|
|
||||||
echo json_encode($rawMaterialsData);
|
echo json_encode($rawMaterialsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProductRawMaterials($productId, $quantity)
|
function getProductRawMaterials($productId, $quantity)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -456,6 +504,7 @@ WHERE
|
|||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToProductionScheduler($orderItemId)
|
function addToProductionScheduler($orderItemId)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -484,6 +533,7 @@ function addToProductionScheduler($orderItemId)
|
|||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addComponentToProductionScheduler($productId, $qty)
|
function addComponentToProductionScheduler($productId, $qty)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -492,6 +542,7 @@ function addComponentToProductionScheduler($productId, $qty)
|
|||||||
generateUuidV4(), $qty, $current_user->id, $current_user->id, $productId);
|
generateUuidV4(), $qty, $current_user->id, $current_user->id, $productId);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComponents2($ids)
|
function getComponents2($ids)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -538,41 +589,9 @@ function getComponents2($ids)
|
|||||||
$componentsData[] = $row;
|
$componentsData[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return json_encode($componentsData);
|
return json_encode($componentsData);
|
||||||
|
|
||||||
/*
|
|
||||||
* $row['position'] = $i;
|
|
||||||
$row['id'] = $r['id'];
|
|
||||||
$row['productName'] = strlen($r['name']) > 55 ? substr($r['name'], 0, 55) . "..." : $r['name'];
|
|
||||||
$row['productFullName'] = $r['name'];
|
|
||||||
$row['productCode'] = strlen($r['code']) > 20 ? substr($r['code'], 0, 20) . "..." : $r['code'];
|
|
||||||
$row['productFullCode'] = $r['code'];
|
|
||||||
$row['productId'] = $r['ecmproduct_id'];
|
|
||||||
$row['productQty'] = $r['quantity'];
|
|
||||||
$row['qty'] = $r['scheduledQuantity'];
|
|
||||||
$row['productKind'] = $r['kind'];
|
|
||||||
$row['productSize'] = $r['size'];
|
|
||||||
$row['productShape'] = $app_list_strings['ecmproducts_shape_dom'][$r['shape']];
|
|
||||||
$row['productBrand'] = $app_list_strings['ecmproducts_brand_dom'][$r['brand']];
|
|
||||||
$row['orderNo'] = $r['document_no'];
|
|
||||||
$row['orderId'] = $r['orderId'];
|
|
||||||
$row['orderStatus'] = $app_list_strings['ecmsales_status_dom'][$r['status']];
|
|
||||||
$row['orderType'] = $app_list_strings['ecmsales_type_dom'][$r['type']];
|
|
||||||
$row['orderParent'] = $r['parent_name'];
|
|
||||||
$row['orderParentId'] = $r['parent_id'];
|
|
||||||
$row['orderSendDate'] = $r['send_date'];
|
|
||||||
$row['orderItemId'] = $r['item_id'];
|
|
||||||
$row['description'] = strlen($r['description']) > 0 ? substr($r['description'], 0, 30) : '';
|
|
||||||
$row['fullDescription'] = $r['description'];
|
|
||||||
$row['shippingTo'] = ($r['shipping_address_name'] == 'Adres korespondencyjny' ? '' : $r['shipping_address_name']);
|
|
||||||
$row['productionDate'] = $r['production_date'] == '0000-00-00' ? '' : $r['production_date'];
|
|
||||||
$row['productStockState'] = $r['stockState'] | 0;
|
|
||||||
$row['mainProductId'] = $r['main_product_id'];
|
|
||||||
$row['mainProductCode'] = $r['main_product_code'];
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProductComponents($productId, $quantity)
|
function getProductComponents($productId, $quantity)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -612,6 +631,7 @@ HAVING
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateUuidV4()
|
function generateUuidV4()
|
||||||
{
|
{
|
||||||
$data = openssl_random_pseudo_bytes(16);
|
$data = openssl_random_pseudo_bytes(16);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
if (! defined('sugarEntry') || ! sugarEntry)
|
||||||
die ( 'Not A Valid Entry Point' );
|
die('Not A Valid Entry Point');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **************************************************
|
* **************************************************
|
||||||
@@ -11,64 +11,64 @@ if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
|||||||
/**
|
/**
|
||||||
* **************************************************
|
* **************************************************
|
||||||
*/
|
*/
|
||||||
$db = $GLOBALS ['db'];
|
$db = $GLOBALS['db'];
|
||||||
|
|
||||||
$data = array ();
|
$data = array();
|
||||||
$categoryArray = array ();
|
$categoryArray = array();
|
||||||
|
|
||||||
$sum = array ();
|
$sum = array();
|
||||||
$sumSub = array ();
|
$sumSub = array();
|
||||||
$sumSub2 = array ();
|
$sumSub2 = array();
|
||||||
|
|
||||||
$KSGROUPS=array();
|
$KSGROUPS = array();
|
||||||
|
|
||||||
$group['id']='1';
|
$group['id'] = '1';
|
||||||
$group['name']='Towar handlowy';
|
$group['name'] = 'Towar handlowy';
|
||||||
$KSGROUPS[]=$group;
|
$KSGROUPS[] = $group;
|
||||||
|
|
||||||
$group['id']='2';
|
$group['id'] = '2';
|
||||||
$group['name']='Wyrób gotowy';
|
$group['name'] = 'Wyrób gotowy';
|
||||||
$KSGROUPS[]=$group;
|
$KSGROUPS[] = $group;
|
||||||
|
|
||||||
$group['id']='3';
|
$group['id'] = '3';
|
||||||
$group['name']='Surowiec';
|
$group['name'] = 'Surowiec';
|
||||||
$KSGROUPS[]=$group;
|
$KSGROUPS[] = $group;
|
||||||
|
|
||||||
$group['id']='4';
|
$group['id'] = '4';
|
||||||
$group['name']='Transport';
|
$group['name'] = 'Transport';
|
||||||
$KSGROUPS[]=$group;
|
$KSGROUPS[] = $group;
|
||||||
|
|
||||||
if ($_GET ['selectProductActive'] != "") {
|
if ($_GET['selectProductActive'] != "") {
|
||||||
$selectProductActive = $_GET ['selectProductActive'];
|
$selectProductActive = $_GET['selectProductActive'];
|
||||||
} else {
|
} else {
|
||||||
$selectProductActive = "";
|
$selectProductActive = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET ['selectProductEol'] != "") {
|
if ($_GET['selectProductEol'] != "") {
|
||||||
$selectProductEol = $_GET ['selectProductEol'];
|
$selectProductEol = $_GET['selectProductEol'];
|
||||||
} else {
|
} else {
|
||||||
$selectProductEol = "";
|
$selectProductEol = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET ['selectStock'] != "") {
|
if ($_GET['selectStock'] != "") {
|
||||||
$selectStock = $_GET ['selectStock'];
|
$selectStock = $_GET['selectStock'];
|
||||||
} else {
|
} else {
|
||||||
$selectStock = "";
|
$selectStock = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$datastocks = array ();
|
$datastocks = array();
|
||||||
$users = array ();
|
$users = array();
|
||||||
$queryStocks = "SELECT
|
$queryStocks = "SELECT
|
||||||
name,
|
name,
|
||||||
id
|
id
|
||||||
FROM ecmstocks
|
FROM ecmstocks
|
||||||
where deleted= 0";
|
where deleted= 0";
|
||||||
$rowsStocks = $db->query ( $queryStocks );
|
$rowsStocks = $db->query($queryStocks);
|
||||||
|
|
||||||
while ( $rowStocks = $db->fetchByAssoc ( $rowsStocks ) ) {
|
while ($rowStocks = $db->fetchByAssoc($rowsStocks)) {
|
||||||
$stocks ["name"] = $rowStocks ["name"];
|
$stocks["name"] = $rowStocks["name"];
|
||||||
$stocks ["id"] = $rowStocks ["id"];
|
$stocks["id"] = $rowStocks["id"];
|
||||||
$datastocks [] = $stocks;
|
$datastocks[] = $stocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
@@ -80,20 +80,20 @@ ON ss.product_id = p.id
|
|||||||
WHERE
|
WHERE
|
||||||
p.deleted = '0' AND ss.quantity IS NOT NULL";
|
p.deleted = '0' AND ss.quantity IS NOT NULL";
|
||||||
|
|
||||||
if ($_GET ['selectStock'] != "")
|
if ($_GET['selectStock'] != "")
|
||||||
$query .= " AND ss.stock_id = '" . $_GET ["selectStock"] . "' ";
|
$query .= " AND ss.stock_id = '" . $_GET["selectStock"] . "' ";
|
||||||
|
|
||||||
if ($_GET ['selectProductActive'] != "")
|
if ($_GET['selectProductActive'] != "")
|
||||||
$query .= " AND p.product_active = '" . $_GET ["selectProductActive"] . "' ";
|
$query .= " AND p.product_active = '" . $_GET["selectProductActive"] . "' ";
|
||||||
|
|
||||||
if ($_GET ['selectProductEol'] != "") {
|
if ($_GET['selectProductEol'] != "") {
|
||||||
if ($_GET ['selectProductEol'] == "1")
|
if ($_GET['selectProductEol'] == "1")
|
||||||
$query .= " AND p.status='end_of_line' ";
|
$query .= " AND p.status='end_of_line' ";
|
||||||
if ($_GET ['selectProductEol'] == "0")
|
if ($_GET['selectProductEol'] == "0")
|
||||||
$query .= " AND p.status!='end_of_line' ";
|
$query .= " AND p.status!='end_of_line' ";
|
||||||
}
|
}
|
||||||
if($_GET['productKS']!=''){
|
if ($_GET['productKS'] != '') {
|
||||||
$query .= " AND p.group_ks = '" . $_GET ["productKS"] . "' ";
|
$query .= " AND p.group_ks = '" . $_GET["productKS"] . "' ";
|
||||||
}
|
}
|
||||||
$query .= " GROUP BY p.id";
|
$query .= " GROUP BY p.id";
|
||||||
|
|
||||||
@@ -106,86 +106,96 @@ $query .= " GROUP BY p.id";
|
|||||||
/**
|
/**
|
||||||
* **************************************************
|
* **************************************************
|
||||||
*/
|
*/
|
||||||
$rows = $db->query ( $query );
|
$rows = $db->query($query);
|
||||||
|
|
||||||
// prepare data for Smarty
|
// prepare data for Smarty
|
||||||
while ( $r = $db->fetchByAssoc ( $rows ) ) {
|
while ($r = $db->fetchByAssoc($rows)) {
|
||||||
$row = array ();
|
$row = array();
|
||||||
$row ["id"] = $r ["id"];
|
$row["id"] = $r["id"];
|
||||||
$row ["name"] = $r ["name"];
|
$row["name"] = $r["name"];
|
||||||
$row ["code"] = $r ["code"];
|
$row["code"] = $r["code"];
|
||||||
$row ["quantity"] = $r ["quantity"];
|
$row["quantity"] = $r["quantity"];
|
||||||
$row ["price"] = $r ["price"] ;
|
$row["price"] = $r["price"];
|
||||||
|
|
||||||
|
// stock addresses
|
||||||
|
$a = $db->query("SELECT stock_address FROM ecmproducts_stock_addresses WHERE ecmproduct_id='" . $r['id'] . "' ORDER BY stock_address");
|
||||||
|
$addresses = array();
|
||||||
|
while ($addr = $db->fetchByAssoc($a)) {
|
||||||
|
$addresses[] = $addr['stock_address'];
|
||||||
|
}
|
||||||
|
$row['stock_address'] = implode(", ", $addresses);
|
||||||
|
|
||||||
$querySubCategory = "SELECT category.name as 'podkategoria'
|
$querySubCategory = "SELECT category.name as 'podkategoria'
|
||||||
FROM
|
FROM
|
||||||
ecmproductcategories_bean bean
|
ecmproductcategories_bean bean
|
||||||
JOIN
|
JOIN
|
||||||
ecmproductcategories category ON bean.ecmproductcategory_id = category.id
|
ecmproductcategories category ON bean.ecmproductcategory_id = category.id
|
||||||
WHERE bean.bean_id='" . $row ["id"] . "'
|
WHERE bean.bean_id='" . $row["id"] . "'
|
||||||
and bean.position = '1'
|
and bean.position = '1'
|
||||||
and bean.deleted = '0'
|
and bean.deleted = '0'
|
||||||
and category.deleted = '0';";
|
and category.deleted = '0';";
|
||||||
$rowsSubCategory = $db->query ( $querySubCategory );
|
$rowsSubCategory = $db->query($querySubCategory);
|
||||||
$row["podkategoria"] ="";
|
$row["podkategoria"] = "";
|
||||||
while ( $rowSubCategory = $db->fetchByAssoc ( $rowsSubCategory ) ) {
|
while ($rowSubCategory = $db->fetchByAssoc($rowsSubCategory)) {
|
||||||
$row ["podkategoria"] = $rowSubCategory ["podkategoria"];
|
$row["podkategoria"] = $rowSubCategory["podkategoria"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryCategory = "SELECT category.name as 'kategoria'
|
$queryCategory = "SELECT category.name as 'kategoria'
|
||||||
FROM
|
FROM
|
||||||
ecmproductcategories_bean bean
|
ecmproductcategories_bean bean
|
||||||
JOIN
|
JOIN
|
||||||
ecmproductcategories category ON bean.ecmproductcategory_id = category.id
|
ecmproductcategories category ON bean.ecmproductcategory_id = category.id
|
||||||
WHERE bean.bean_id='" . $row ["id"] . "'
|
WHERE bean.bean_id='" . $row["id"] . "'
|
||||||
and bean.position = '0'
|
and bean.position = '0'
|
||||||
and bean.deleted = '0'
|
and bean.deleted = '0'
|
||||||
and category.deleted = '0';";
|
and category.deleted = '0';";
|
||||||
$rowscategory = $db->query ( $queryCategory );
|
$rowscategory = $db->query($queryCategory);
|
||||||
$row["kategoria"] = "";
|
$row["kategoria"] = "";
|
||||||
while ( $rowcategory = $db->fetchByAssoc ( $rowscategory ) ) {
|
while ($rowcategory = $db->fetchByAssoc($rowscategory)) {
|
||||||
$row ["kategoria"] = $rowcategory ["kategoria"];
|
$row["kategoria"] = $rowcategory["kategoria"];
|
||||||
}
|
}
|
||||||
$data [] = $row;
|
$data[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////// SUM /////////////////////////////////
|
// //////////////// SUM /////////////////////////////////
|
||||||
foreach ( $data as $key => &$element ) {
|
foreach ($data as $key => &$element) {
|
||||||
$categoryArray1 [$element ["kategoria"] == "" ? "Inne" : $element ["kategoria"]] [$element ["podkategoria"] == "" ? "Reszta" : $element ["podkategoria"]] [$key] = $element;
|
$categoryArray1[$element["kategoria"] == "" ? "Inne" : $element["kategoria"]][$element["podkategoria"] == "" ? "Reszta" : $element["podkategoria"]][$key] = $element;
|
||||||
}
|
}
|
||||||
function cmp($a, $b) {
|
function cmp($a, $b)
|
||||||
if ($a ["name"] == $b ["name"]) {
|
{
|
||||||
|
if ($a["name"] == $b["name"]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return ($a ["name"] < $b ["name"]) ? - 1 : 1;
|
return ($a["name"] < $b["name"]) ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// grupowanie po kategoriach
|
// grupowanie po kategoriach
|
||||||
foreach ( $categoryArray1 as $key1 => &$element1 ) {
|
foreach ($categoryArray1 as $key1 => &$element1) {
|
||||||
foreach ( $element1 as $key2 => &$element2 ) {
|
foreach ($element1 as $key2 => &$element2) {
|
||||||
usort ( $element2, "cmp" );
|
usort($element2, "cmp");
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$tmp2 [$key1] [$key2] [0] = array (
|
$tmp2[$key1][$key2][0] = array(
|
||||||
'name' => null
|
'name' => null
|
||||||
);
|
);
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
|
|
||||||
foreach ( $element2 as $count => &$element3 ) {
|
foreach ($element2 as $count => &$element3) {
|
||||||
if ($element3 ["id"] != $tmp2 [$key1] [$key2] [$i] ["id"]) {
|
if ($element3["id"] != $tmp2[$key1][$key2][$i]["id"]) {
|
||||||
|
|
||||||
if ($tmp2 [$key1] [$key2] [$i] ["id"] != null) {
|
if ($tmp2[$key1][$key2][$i]["id"] != null) {
|
||||||
$i ++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp2 [$key1] [$key2] [$i] ["id"] = $element3 ["id"];
|
$tmp2[$key1][$key2][$i]["id"] = $element3["id"];
|
||||||
$tmp2 [$key1] [$key2] [$i] ["name"] = $element3 ["name"];
|
$tmp2[$key1][$key2][$i]["name"] = $element3["name"];
|
||||||
$tmp2 [$key1] [$key2] [$i] ["code"] = $element3 ["code"];
|
$tmp2[$key1][$key2][$i]["code"] = $element3["code"];
|
||||||
$tmp2 [$key1] [$key2] [$i] ["quantity"] = $element3 ["quantity"];
|
$tmp2[$key1][$key2][$i]["stock_address"] = $element3["stock_address"];
|
||||||
$tmp2 [$key1] [$key2] [$i] ["price"] = $element3 ["price"];
|
$tmp2[$key1][$key2][$i]["quantity"] = $element3["quantity"];
|
||||||
|
$tmp2[$key1][$key2][$i]["price"] = $element3["price"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$counter += 1;
|
$counter += 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($element2 [$count] ["name"] != $element2 [$count + 1] ["name"]) {
|
if ($element2 [$count] ["name"] != $element2 [$count + 1] ["name"]) {
|
||||||
$tmp2 [$key1] [$key2] [$i] ["marza"] = $tmp2 [$key1] [$key2] [$i] ["marza"] / $counter;
|
$tmp2 [$key1] [$key2] [$i] ["marza"] = $tmp2 [$key1] [$key2] [$i] ["marza"] / $counter;
|
||||||
@@ -197,67 +207,67 @@ foreach ( $categoryArray1 as $key1 => &$element1 ) {
|
|||||||
$categoryArray = $tmp2;
|
$categoryArray = $tmp2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ( $categoryArray as $key => &$element ) {
|
foreach ($categoryArray as $key => &$element) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ( $element as $keyy => &$elementt ) {
|
foreach ($element as $keyy => &$elementt) {
|
||||||
foreach ( $elementt as $keyyy => &$elementtt ) {
|
foreach ($elementt as $keyyy => &$elementtt) {
|
||||||
$sumSub ["QuantitySum"] [$key] += $elementtt ["quantity"];
|
$sumSub["QuantitySum"][$key] += $elementtt["quantity"];
|
||||||
$sumSub ["PriceSum"] [$key] += $elementtt ["price"];
|
$sumSub["PriceSum"][$key] += $elementtt["price"];
|
||||||
|
|
||||||
$sumSub2 ["QuantitySum"] [$key] [$keyy] += $elementtt ["quantity"];
|
$sumSub2["QuantitySum"][$key][$keyy] += $elementtt["quantity"];
|
||||||
$sumSub2 ["PriceSum"] [$key] [$keyy] += $elementtt ["price"];
|
$sumSub2["PriceSum"][$key][$keyy] += $elementtt["price"];
|
||||||
}
|
}
|
||||||
$count += sizeof ( $elementt );
|
$count += sizeof($elementt);
|
||||||
|
|
||||||
$categoryArray [$key] [$keyy] ["QuantitySum2"] = $sumSub2 ["QuantitySum"] [$key] [$keyy];
|
$categoryArray[$key][$keyy]["QuantitySum2"] = $sumSub2["QuantitySum"][$key][$keyy];
|
||||||
$categoryArray [$key] [$keyy] ["PriceSum2"] = $sumSub2 ["PriceSum"] [$key] [$keyy];
|
$categoryArray[$key][$keyy]["PriceSum2"] = $sumSub2["PriceSum"][$key][$keyy];
|
||||||
}
|
}
|
||||||
$categoryArray [$key] ["QuantitySum"] = $sumSub ["QuantitySum"] [$key];
|
$categoryArray[$key]["QuantitySum"] = $sumSub["QuantitySum"][$key];
|
||||||
$categoryArray [$key] ["PriceSum"] = $sumSub ["PriceSum"] [$key];
|
$categoryArray[$key]["PriceSum"] = $sumSub["PriceSum"][$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $categoryArray as $key => &$element ) {
|
foreach ($categoryArray as $key => &$element) {
|
||||||
$sum ["QuantitySumSum"] += $sumSub ["QuantitySum"] [$key];
|
$sum["QuantitySumSum"] += $sumSub["QuantitySum"][$key];
|
||||||
$sum ["PriceSumSum"] += $sumSub ["PriceSum"] [$key];
|
$sum["PriceSumSum"] += $sumSub["PriceSum"][$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $categoryArray as $key1 => &$element ) {
|
foreach ($categoryArray as $key1 => &$element) {
|
||||||
foreach ( $element as $key2 => &$elements ) {
|
foreach ($element as $key2 => &$elements) {
|
||||||
foreach ( $element as $key3 => &$element2 ) {
|
foreach ($element as $key3 => &$element2) {
|
||||||
if ($sumSub2 ["PriceSum"] [$key1] [$key2] > $sumSub2 ["PriceSum"] [$key1] [$key3]) {
|
if ($sumSub2["PriceSum"][$key1][$key2] > $sumSub2["PriceSum"][$key1][$key3]) {
|
||||||
$tmp = $sumSub2 ["PriceSum"] [$key1] [$key2];
|
$tmp = $sumSub2["PriceSum"][$key1][$key2];
|
||||||
$sumSub2 ["PriceSum"] [$key1] [$key2] = $sumSub2 ["PriceSum"] [$key1] [$key3];
|
$sumSub2["PriceSum"][$key1][$key2] = $sumSub2["PriceSum"][$key1][$key3];
|
||||||
$sumSub2 ["PriceSum"] [$key1] [$key3] = $tmp;
|
$sumSub2["PriceSum"][$key1][$key3] = $tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $sumSub ["PriceSum"] as $key1 => &$element ) {
|
foreach ($sumSub["PriceSum"] as $key1 => &$element) {
|
||||||
foreach ( $sumSub ["PriceSum"] as $key2 => &$element2 ) {
|
foreach ($sumSub["PriceSum"] as $key2 => &$element2) {
|
||||||
if ($sumSub ["PriceSum"] [$key1] > $sumSub ["PriceSum"] [$key2]) {
|
if ($sumSub["PriceSum"][$key1] > $sumSub["PriceSum"][$key2]) {
|
||||||
$tmp = $sumSub ["PriceSum"] [$key1];
|
$tmp = $sumSub["PriceSum"][$key1];
|
||||||
$sumSub ["PriceSum"] [$key1] = $sumSub ["PriceSum"] [$key2];
|
$sumSub["PriceSum"][$key1] = $sumSub["PriceSum"][$key2];
|
||||||
$sumSub ["PriceSum"] [$key2] = $tmp;
|
$sumSub["PriceSum"][$key2] = $tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////// SORT array /////////////////////////////////
|
// //////////////// SORT array /////////////////////////////////
|
||||||
$newArray2;
|
$newArray2;
|
||||||
foreach ( $sumSub ["PriceSum"] as $key1 => &$element1 ) {
|
foreach ($sumSub["PriceSum"] as $key1 => &$element1) {
|
||||||
foreach ( $categoryArray as $key2 => &$element2 ) {
|
foreach ($categoryArray as $key2 => &$element2) {
|
||||||
if ($sumSub ["PriceSum"] [$key1] == $categoryArray [$key2] ["PriceSum"]) {
|
if ($sumSub["PriceSum"][$key1] == $categoryArray[$key2]["PriceSum"]) {
|
||||||
$newArray2 [$key2] = $categoryArray [$key2];
|
$newArray2[$key2] = $categoryArray[$key2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$newArray1;
|
$newArray1;
|
||||||
foreach ( $newArray2 as $key1 => &$element1 ) {
|
foreach ($newArray2 as $key1 => &$element1) {
|
||||||
foreach ( $element1 as $key2 => &$element2 ) {
|
foreach ($element1 as $key2 => &$element2) {
|
||||||
foreach ( $element1 as $key3 => &$element3 ) {
|
foreach ($element1 as $key3 => &$element3) {
|
||||||
if ($sumSub2 ["PriceSum"] [$key1] [$key2] == $newArray2 [$key1] [$key3] ["PriceSum2"]) {
|
if ($sumSub2["PriceSum"][$key1][$key2] == $newArray2[$key1][$key3]["PriceSum2"]) {
|
||||||
$newArray1 [$key1] [$key3] = $newArray2 [$key1] [$key3];
|
$newArray1[$key1][$key3] = $newArray2[$key1][$key3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,17 +284,15 @@ foreach ( $newArray2 as $key1 => &$element1 ) {
|
|||||||
* **************************************************
|
* **************************************************
|
||||||
*/
|
*/
|
||||||
// create & execute smarty
|
// create & execute smarty
|
||||||
$smarty = new Sugar_Smarty ();
|
$smarty = new Sugar_Smarty();
|
||||||
global $mod_strings;
|
global $mod_strings;
|
||||||
$smarty->assign ( "MOD", $mod_strings );
|
$smarty->assign("MOD", $mod_strings);
|
||||||
$smarty->assign ( "DATA", $newArray1 );
|
$smarty->assign("DATA", $newArray1);
|
||||||
$smarty->assign ( "SUM", $sum );
|
$smarty->assign("SUM", $sum);
|
||||||
$smarty->assign ('KSGROUPS',$KSGROUPS);
|
$smarty->assign('KSGROUPS', $KSGROUPS);
|
||||||
$smarty->assign ( "STOCKS", $datastocks );
|
$smarty->assign("STOCKS", $datastocks);
|
||||||
$smarty->assign ( "selectStock", $selectStock );
|
$smarty->assign("selectStock", $selectStock);
|
||||||
$smarty->assign ('selectKS',$_GET['productKS']);
|
$smarty->assign('selectKS', $_GET['productKS']);
|
||||||
$smarty->assign ( "selectProductActive", $selectProductActive );
|
$smarty->assign("selectProductActive", $selectProductActive);
|
||||||
$smarty->assign ( "selectProductEol", $selectProductEol );
|
$smarty->assign("selectProductEol", $selectProductEol);
|
||||||
echo $smarty->display ( 'modules/EcmReports/tpls/ReportStocks.tpl' );
|
echo $smarty->display('modules/EcmReports/tpls/ReportStocks.tpl');
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>
|
<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>
|
<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="modules/EcmReports/TableSorter/css/theme.blue.css"/>
|
<link rel="stylesheet" type="text/css" href="modules/EcmReports/TableSorter/css/theme.blue.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="modules/EcmReports/TableSorter/css/theme.blue2.css"/>
|
<link rel="stylesheet" type="text/css" href="modules/EcmReports/TableSorter/css/theme.blue2.css" />
|
||||||
<!-- Tablesorter -->
|
<!-- Tablesorter -->
|
||||||
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.min.js"></script>
|
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.tablesorter.min.js"></script>
|
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.tablesorter.min.js"></script>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
{literal}
|
{literal}
|
||||||
|
|
||||||
thead, tfoot {font-weight: bold;}
|
thead, tfoot {font-weight: bold;}
|
||||||
|
|
||||||
@@ -34,45 +34,50 @@
|
|||||||
background-color: #BDC7B5;
|
background-color: #BDC7B5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sumAll td{
|
.sumAll td {
|
||||||
background-color: #BDC7B5;
|
background-color: #BDC7B5;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.tablesorter tbody tr:hover td {
|
table.tablesorter tbody tr:hover td {
|
||||||
background: #E8E8E8;
|
background: #E8E8E8;
|
||||||
color: #343432;
|
color: #343432;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extra selectors needed to override the default styling */
|
/* Extra selectors needed to override the default styling */
|
||||||
table.tablesorter tbody tr.normal-row td {
|
table.tablesorter tbody tr.normal-row td {
|
||||||
background: #EFEFF1;
|
background: #EFEFF1;
|
||||||
color: #343432;
|
color: #343432;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.tablesorter tbody tr.alt-row td {
|
table.tablesorter tbody tr.alt-row td {
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
color: #343432;
|
color: #343432;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extra selectors needed to override the default styling */
|
/* Extra selectors needed to override the default styling */
|
||||||
table.tablesorter tbody tr.normal-row:hover td {
|
table.tablesorter tbody tr.normal-row:hover td {
|
||||||
background: #E8E8E8;
|
background: #E8E8E8;
|
||||||
color: #343432;
|
color: #343432;
|
||||||
}
|
|
||||||
table.tablesorter tbody tr.alt-row:hover td {
|
|
||||||
background: #E8E8E8;
|
|
||||||
color: #343432;
|
|
||||||
}
|
|
||||||
table.tablesorter tbody tr.sumAll td {
|
|
||||||
background: #EBEBED;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
table.tablesorter tbody tr.sumAll:hover td {
|
|
||||||
background: #E0E0E2;
|
|
||||||
color: black;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.tablesorter .sumRow, .oddListRowS1 {
|
table.tablesorter tbody tr.alt-row:hover td {
|
||||||
|
background: #E8E8E8;
|
||||||
|
color: #343432;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.tablesorter tbody tr.sumAll td {
|
||||||
|
background: #EBEBED;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.tablesorter tbody tr.sumAll:hover td {
|
||||||
|
background: #E0E0E2;
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.tablesorter .sumRow,
|
||||||
|
.oddListRowS1 {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,15 +104,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<table id="tableMenu" cellspacing="0" cellpadding="0" border="0">
|
<table id="tableMenu" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts" width="16" border="0" height="16">
|
<img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;"
|
||||||
</td>
|
alt="EcmProducts" width="16" border="0" height="16">
|
||||||
<td>
|
</td>
|
||||||
<h2>{$MOD.LBL_REPORT_STOCKS} </h2>
|
<td>
|
||||||
</td>
|
<h2>{$MOD.LBL_REPORT_STOCKS} </h2>
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
@@ -120,143 +126,177 @@
|
|||||||
<form action="index.php" method="get" name="searchReportStocks">
|
<form action="index.php" method="get" name="searchReportStocks">
|
||||||
<input type="hidden" name="module" value="EcmReports" />
|
<input type="hidden" name="module" value="EcmReports" />
|
||||||
<input type="hidden" name="action" value="ReportStocks" />
|
<input type="hidden" name="action" value="ReportStocks" />
|
||||||
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
|
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0"
|
||||||
|
cellspacing="0">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap">{$MOD.LBL_STOCK}</td>
|
<td class="dataLabel" width="5%" nowrap="nowrap">{$MOD.LBL_STOCK}</td>
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
<select id="stock" name="selectStock">
|
<select id="stock" name="selectStock">
|
||||||
<option value="" { if $selectStock==""} selected="true" {/if} >{$MOD.LBL_ALL_STOCKS}</option>
|
<option value="" { if $selectStock=="" } selected="true" {/if}>{$MOD.LBL_ALL_STOCKS}</option>
|
||||||
{foreach from=$STOCKS item=STOCK key=count name=loop}
|
{foreach from=$STOCKS item=STOCK key=count name=loop}
|
||||||
<option value="{$STOCK.id}" { if $selectStock==$STOCK.id} selected="true" {/if} >{$STOCK.name}</option>
|
<option value="{$STOCK.id}" { if $selectStock==$STOCK.id} selected="true" {/if}>{$STOCK.name}
|
||||||
{/foreach}
|
</option>
|
||||||
</select>
|
{/foreach}
|
||||||
</td>
|
</select>
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
</td>
|
||||||
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
|
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap">{$MOD.LBL_PRODUCT_ACTIVE}</td>
|
<td class="dataLabel" width="5%" nowrap="nowrap">{$MOD.LBL_PRODUCT_ACTIVE}</td>
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
<select id="productActive" name="selectProductActive">
|
<select id="productActive" name="selectProductActive">
|
||||||
<option value="" { if $selectProductActive==""} selected="true" {/if} >{$MOD.LBL_YES}/{$MOD.LBL_NO}</option>
|
<option value="" { if $selectProductActive=="" } selected="true" {/if}>{$MOD.LBL_YES}/{$MOD.LBL_NO}
|
||||||
<option value="1" { if $selectProductActive=="1"} selected="true" {/if} >{$MOD.LBL_YES}</option>
|
</option>
|
||||||
<option value="0" { if $selectProductActive=="0"} selected="true" {/if} >{$MOD.LBL_NO}</option>
|
<option value="1" { if $selectProductActive=="1" } selected="true" {/if}>{$MOD.LBL_YES}</option>
|
||||||
</select>
|
<option value="0" { if $selectProductActive=="0" } selected="true" {/if}>{$MOD.LBL_NO}</option>
|
||||||
</td>
|
</select>
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
</td>
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap">End of line</td>
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
<td class="dataLabel" width="5%" nowrap="nowrap">End of line</td>
|
||||||
<select id="productEol" name="selectProductEol">
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
<option value="" { if $selectProductEol==""} selected="true" {/if} >{$MOD.LBL_YES}/{$MOD.LBL_NO}</option>
|
<select id="productEol" name="selectProductEol">
|
||||||
<option value="1" { if $selectProductEol=="1"} selected="true" {/if} >{$MOD.LBL_YES}</option>
|
<option value="" { if $selectProductEol=="" } selected="true" {/if}>{$MOD.LBL_YES}/{$MOD.LBL_NO}
|
||||||
<option value="0" { if $selectProductEol=="0"} selected="true" {/if} >{$MOD.LBL_NO}</option>
|
</option>
|
||||||
</select>
|
<option value="1" { if $selectProductEol=="1" } selected="true" {/if}>{$MOD.LBL_YES}</option>
|
||||||
</td>
|
<option value="0" { if $selectProductEol=="0" } selected="true" {/if}>{$MOD.LBL_NO}</option>
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
</select>
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap">Grupa księgowa</td>
|
</td>
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
<select id="productKS" name="productKS">
|
<td class="dataLabel" width="5%" nowrap="nowrap">Grupa księgowa</td>
|
||||||
<option value="" { if $selectKS==""} selected="true" {/if} >Wszystkie</option>
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
{foreach from=$KSGROUPS item=GROUP key=count name=loop}
|
<select id="productKS" name="productKS">
|
||||||
<option value="{$GROUP.id}" { if $selectKS==$GROUP.id} selected="true" {/if} >{$GROUP.name}</option>
|
<option value="" { if $selectKS=="" } selected="true" {/if}>Wszystkie</option>
|
||||||
{/foreach}
|
{foreach from=$KSGROUPS item=GROUP key=count name=loop}
|
||||||
</select>
|
<option value="{$GROUP.id}" { if $selectKS==$GROUP.id} selected="true" {/if}>{$GROUP.name}</option>
|
||||||
</td>
|
{/foreach}
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
</select>
|
||||||
|
</td>
|
||||||
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
|
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap"></td>
|
<td class="dataLabel" width="5%" nowrap="nowrap"></td>
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
|
|
||||||
</td>
|
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
|
||||||
<td class="dataLabel" width="5%" nowrap="nowrap"></td>
|
|
||||||
<td class="dataField" width="10%" nowrap="nowrap">
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<input class="button" name="submit" value="{$MOD.LBL_EXECUTE}" type="submit">
|
</td>
|
||||||
<input class="button" name="clear" value="{$MOD.LBL_CLEAR}" type="button" onclick="location.href='index.php?module=EcmReports&action=ReportSales';">
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
<input id="excelEksport" class="button" name="importToExcel" value="{$MOD.BTN_EXCEL_EXPORT}" type="button">
|
<td class="dataLabel" width="5%" nowrap="nowrap"></td>
|
||||||
|
<td class="dataField" width="10%" nowrap="nowrap">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="dataLabel" width="25%" nowrap="nowrap"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<input class="button" name="submit" value="{$MOD.LBL_EXECUTE}" type="submit">
|
||||||
|
<input class="button" name="clear" value="{$MOD.LBL_CLEAR}" type="button"
|
||||||
|
onclick="location.href='index.php?module=EcmReports&action=ReportSales';">
|
||||||
|
<input id="excelEksport" class="button" name="importToExcel" value="{$MOD.BTN_EXCEL_EXPORT}" type="button">
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<table id="myTable" class="tablesorter tablesorter-blue" role="grid">
|
<table id="myTable" class="tablesorter tablesorter-blue" role="grid">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="tablesorter-headerRow" role="row">
|
<tr class="tablesorter-headerRow" role="row">
|
||||||
|
|
||||||
<th width="30%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_PRODUCTS}</th>
|
<th width="30%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0"
|
||||||
<th width="10%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_INDEX}</th>
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="5" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_QUANTITY}</th>
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="6" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_VALUE}</th>
|
aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_PRODUCTS}</th>
|
||||||
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="6" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Średnia Cena</th>
|
<th width="4%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1"
|
||||||
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
|
aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_INDEX}</th>
|
||||||
|
<th width="6%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1"
|
||||||
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
|
aria-label="Name: No sort applied, activate to apply an ascending sort">Adres magazynowy</th>
|
||||||
|
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="5"
|
||||||
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
|
aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_QUANTITY}</th>
|
||||||
|
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="6"
|
||||||
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
|
aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_VALUE}</th>
|
||||||
|
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="6"
|
||||||
|
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
|
||||||
|
style="-moz-user-select: none;" aria-sort="none"
|
||||||
|
aria-label="Name: No sort applied, activate to apply an ascending sort">Średnia Cena</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{foreach from=$DATA item=CAT key=CATNAME name=loop}
|
{foreach from=$DATA item=CAT key=CATNAME name=loop}
|
||||||
{* Table headers *}
|
{* Table headers *}
|
||||||
<tbody id="functions-core" class="tablesorter-infoOnly">
|
<tbody id="functions-core" class="tablesorter-infoOnly">
|
||||||
<tr class="static category">
|
<tr class="static category">
|
||||||
{if $CATNAME != ""}
|
{if $CATNAME != ""}
|
||||||
<td class="oddListRowS1 alignLeft"><a class="plusStyle showTables">[+]</a><b> {$CATNAME}</b></td>
|
<td class="oddListRowS1 alignLeft"><a class="plusStyle showTables">[+]</a><b> {$CATNAME}</b></td>
|
||||||
{/if}
|
{/if}
|
||||||
<td class="oddListRowS1" ></td>
|
<td class="oddListRowS1"></td>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$DATA.$CATNAME.QuantitySum|number_format:4:",":"." }</b></td>
|
<td class="oddListRowS1"></td>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$DATA.$CATNAME.PriceSum|number_format:2:",":"." }</b></td>
|
<td class="oddListRowS1 sumRow"><b>{$DATA.$CATNAME.QuantitySum|number_format:4:",":"." }</b></td>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$DATA.$CATNAME.PriceSum/$DATA.$CATNAME.QuantitySum|number_format:2:",":"." }</b></td>
|
<td class="oddListRowS1 sumRow"><b>{$DATA.$CATNAME.PriceSum|number_format:2:",":"." }</b></td>
|
||||||
</tr>
|
<td class="oddListRowS1 sumRow">
|
||||||
</tbody>
|
<b>{$DATA.$CATNAME.PriceSum/$DATA.$CATNAME.QuantitySum|number_format:2:",":"." }</b></td>
|
||||||
{foreach from=$CAT item=CAT2 key=CAT2NAME name=loop}
|
</tr>
|
||||||
{if $CAT2NAME!="QuantitySum" && $CAT2NAME!="PriceSum"}
|
</tbody>
|
||||||
<tbody id="functions-core" class="tablesorter-infoOnly tablesShowHide">
|
{foreach from=$CAT item=CAT2 key=CAT2NAME name=loop}
|
||||||
<tr class="subcategory">
|
{if $CAT2NAME!="QuantitySum" && $CAT2NAME!="PriceSum"}
|
||||||
<td class="oddListRowS1 alignLeft"><a class="showRows" style="color: cadetblue; text-decoration: none; cursor: pointer;">[+]</a><b> {$CAT2NAME}</b></td>
|
<tbody id="functions-core" class="tablesorter-infoOnly tablesShowHide">
|
||||||
<td class="oddListRowS1" ></td>
|
<tr class="subcategory">
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$CAT.$CAT2NAME.QuantitySum2|number_format:4:",":"." }</b></td>
|
<td class="oddListRowS1 alignLeft"><a class="showRows"
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$CAT.$CAT2NAME.PriceSum2|number_format:2:",":"." }</b></td>
|
style="color: cadetblue; text-decoration: none; cursor: pointer;">[+]</a><b> {$CAT2NAME}</b>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$CAT.$CAT2NAME.PriceSum2/$CAT.$CAT2NAME.QuantitySum2|number_format:2:",":"." }</b></td>
|
</td>
|
||||||
</tr>
|
<td class="oddListRowS1"></td>
|
||||||
</tbody>
|
<td class="oddListRowS1"></td>
|
||||||
|
<td class="oddListRowS1 sumRow"><b>{$CAT.$CAT2NAME.QuantitySum2|number_format:4:",":"." }</b></td>
|
||||||
|
<td class="oddListRowS1 sumRow"><b>{$CAT.$CAT2NAME.PriceSum2|number_format:2:",":"." }</b></td>
|
||||||
|
<td class="oddListRowS1 sumRow">
|
||||||
|
<b>{$CAT.$CAT2NAME.PriceSum2/$CAT.$CAT2NAME.QuantitySum2|number_format:2:",":"." }</b></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
<tbody aria-live="polite" aria-relevant="all" class="rowShowHide">
|
<tbody aria-live="polite" aria-relevant="all" class="rowShowHide">
|
||||||
{foreach from=$CAT2 item=ROW name=loop}
|
{foreach from=$CAT2 item=ROW name=loop}
|
||||||
{if $CAT2NAME!="AvgPriceSum" && $CAT2NAME!="QuantitySum" && $ROW.name!=""}
|
{if $CAT2NAME!="AvgPriceSum" && $CAT2NAME!="QuantitySum" && $ROW.name!=""}
|
||||||
{if $smarty.foreach.loop.index % 2 == 1}
|
{if $smarty.foreach.loop.index % 2 == 1}
|
||||||
<tr role="row" class="contractor">
|
<tr role="row" class="contractor">
|
||||||
{else}
|
{else}
|
||||||
<tr class="contractor" role="row">
|
<tr class="contractor" role="row">
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<td class="oddListRowS1 alignLeft" style="text-align:left;">
|
<td class="oddListRowS1 alignLeft" style="text-align:left;">
|
||||||
<a target="new" href="index.php?module=EcmProducts&action=index&return_module=EcmProducts&action=DetailView&record={$ROW.id}">
|
<a target="new"
|
||||||
{$ROW.name}
|
href="index.php?module=EcmProducts&action=index&return_module=EcmProducts&action=DetailView&record={$ROW.id}">
|
||||||
</a>
|
{$ROW.name}
|
||||||
</td>
|
</a>
|
||||||
<td class="oddListRowS1 alignLeft" >{$ROW.code}</td>
|
</td>
|
||||||
<td class="oddListRowS1" >{$ROW.quantity|number_format:4:",":"."}</td>
|
<td class="oddListRowS1 alignLeft">{$ROW.code}</td>
|
||||||
<td class="oddListRowS1" >{$ROW.price|number_format:2:",":"."}</td>
|
<td class="oddListRowS1">{$ROW.stock_address}</td>
|
||||||
<td class="oddListRowS1" >{$ROW.price/$ROW.quantity|number_format:2:",":"."}</td>
|
<td class="oddListRowS1">{$ROW.quantity|number_format:4:",":"."}</td>
|
||||||
</tr>
|
<td class="oddListRowS1">{$ROW.price|number_format:2:",":"."}</td>
|
||||||
{/if}
|
<td class="oddListRowS1">{$ROW.price/$ROW.quantity|number_format:2:",":"."}</td>
|
||||||
{/foreach}
|
</tr>
|
||||||
</tbody>
|
{/if}
|
||||||
<tbody id="stopRows"></tbody>
|
{/foreach}
|
||||||
{/if}
|
</tbody>
|
||||||
{/foreach}
|
<tbody id="stopRows"></tbody>
|
||||||
<tbody id="stopTables"></tbody>
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tbody id="functions-core" class="tablesorter-infoOnly">
|
<tbody id="stopTables"></tbody>
|
||||||
<tr class="static category sumAll">
|
{/foreach}
|
||||||
<td class="oddListRowS1 alignLeft"><b>{$MOD.LBL_SUM}:</b></td>
|
<tbody id="functions-core" class="tablesorter-infoOnly">
|
||||||
<td class="oddListRowS1" ></td>
|
<tr class="static category sumAll">
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$SUM.QuantitySumSum|number_format:4:",":"." }</b></td>
|
<td class="oddListRowS1 alignLeft"><b>{$MOD.LBL_SUM}:</b></td>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$SUM.PriceSumSum|number_format:2:",":"." }</b></td>
|
<td class="oddListRowS1"></td>
|
||||||
<td class="oddListRowS1 sumRow" ><b>{$SUM.PriceSumSum/$SUM.QuantitySumSum|number_format:2:",":"." }</b></td>
|
<td class="oddListRowS1"></td>
|
||||||
</tr>
|
<td class="oddListRowS1 sumRow"><b>{$SUM.QuantitySumSum|number_format:4:",":"." }</b></td>
|
||||||
</tbody>
|
<td class="oddListRowS1 sumRow"><b>{$SUM.PriceSumSum|number_format:2:",":"." }</b></td>
|
||||||
</table>
|
<td class="oddListRowS1 sumRow"><b>{$SUM.PriceSumSum/$SUM.QuantitySumSum|number_format:2:",":"." }</b>
|
||||||
<br/>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<br />
|
||||||
@@ -76,7 +76,7 @@ if (
|
|||||||
$r = $db->fetchByAssoc ( $rows );
|
$r = $db->fetchByAssoc ( $rows );
|
||||||
if($r['id']!='')$can_edit=false;
|
if($r['id']!='')$can_edit=false;
|
||||||
|
|
||||||
$edit->ss->assign("CAN_EDIT", $can_edit);
|
$edit->ss->assign("CAN_EDIT", true);
|
||||||
|
|
||||||
$edit->ss->assign("CREATED_BY_NAME", $focus->created_by_name);
|
$edit->ss->assign("CREATED_BY_NAME", $focus->created_by_name);
|
||||||
$edit->ss->assign("MODIFIED_BY_NAME", $focus->modified_by_name);
|
$edit->ss->assign("MODIFIED_BY_NAME", $focus->modified_by_name);
|
||||||
|
|||||||
@@ -864,7 +864,7 @@ class EcmSale extends SugarBean
|
|||||||
$where = " and " . implode(" and ", $field_array);
|
$where = " and " . implode(" and ", $field_array);
|
||||||
else
|
else
|
||||||
$where = "";
|
$where = "";
|
||||||
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where . " ORDER BY send_date DESC";
|
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where . " ORDER BY send_date";
|
||||||
return $z;
|
return $z;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1059,6 +1059,16 @@ class EcmSale extends SugarBean
|
|||||||
$result_array[$i]['total_invoice'] = $total_invoice;
|
$result_array[$i]['total_invoice'] = $total_invoice;
|
||||||
$result_array[$i]['percent'] = $percent;
|
$result_array[$i]['percent'] = $percent;
|
||||||
$result_array[$i]['currency'] = $r['currency_id'];
|
$result_array[$i]['currency'] = $r['currency_id'];
|
||||||
|
$result_array[$i]['delivery_name'] = null;
|
||||||
|
|
||||||
|
if (strlen($r['shipping_address_name']) > 0) {
|
||||||
|
$result_array[$i]['delivery_name'] = $r['shipping_address_name'];
|
||||||
|
$d = $db->fetchByAssoc($db->query(sprintf("SELECT id, TRIM(name) FROM accounts WHERE name LIKE '%s' AND deleted=0", strtolower(trim($r['shipping_address_name'])))));
|
||||||
|
if ($d && $d['id']) {
|
||||||
|
$result_array[$i]['delivery_id'] = $d['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$sum_total_qty += $total_qty;
|
$sum_total_qty += $total_qty;
|
||||||
|
|||||||
@@ -1,120 +1,150 @@
|
|||||||
<?php
|
<?php
|
||||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
if (!defined('sugarEntry') || !sugarEntry)
|
||||||
die ( 'Not A Valid Entry Point' );
|
die ('Not A Valid Entry Point');
|
||||||
|
|
||||||
// require_once('modules/EcmGroupSales/HeaderMenu.php');
|
|
||||||
|
|
||||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||||
|
|
||||||
require_once ('modules/EcmInsideOrders/EcmInsideOrder.php');
|
require_once('modules/EcmInsideOrders/EcmInsideOrder.php');
|
||||||
require_once ('include/time.php');
|
require_once('include/time.php');
|
||||||
require_once ('include/json_config.php');
|
require_once('include/json_config.php');
|
||||||
|
|
||||||
// add jquery
|
// add jquery
|
||||||
echo '<link rel="stylesheet" type="text/css" href="modules/EcmSales/css/style.css"/>';
|
echo '<link rel="stylesheet" type="text/css" href="modules/EcmSales/css/style.css"/>';
|
||||||
echo '<script type="text/javascript"
|
echo '<script type="text/javascript" src="include/jQuery/jquery-lastes.js"></script>';
|
||||||
src="include/jQuery/jquery-lastes.js"></script>';
|
echo '<script type="text/javascript" src="include/jQuery/jquery.tablesorter.pager.js"></script>';
|
||||||
echo '<script type="text/javascript"
|
echo '<script type="text/javascript" src="modules/EcmSales/javascript/ProductSummary.js"></script>';
|
||||||
src="include/jQuery/jquery.tablesorter.pager.js"></script>';
|
|
||||||
echo '<script type="text/javascript"
|
|
||||||
src="modules/EcmSales/javascript/ProductSummary.js"></script>';
|
|
||||||
|
|
||||||
$json_config = new json_config ();
|
$json_config = new json_config ();
|
||||||
|
|
||||||
$focus = new EcmSale ();
|
$focus = new EcmSale ();
|
||||||
$db = $GLOBALS ['db'];
|
$db = $GLOBALS['db'];
|
||||||
$data = array();
|
|
||||||
$categoryArray=array();
|
|
||||||
$id_array= explode(",", $_GET['ids']) ;
|
|
||||||
|
|
||||||
//var_dump($id_array);
|
|
||||||
$where="and doc.id IN ('".implode("','",$id_array)."')";
|
|
||||||
if($_GET['product_group']=='1')$where.=" and pr.group_ks=1";
|
|
||||||
if($_GET['product_group']=='2')$where.=" and pr.group_ks=2";
|
|
||||||
if($_GET['product_group']=='3')$where.=" and pr.group_ks=3";
|
|
||||||
|
|
||||||
$query= "SELECT
|
|
||||||
pr.id,
|
|
||||||
item.code,
|
|
||||||
item.name,
|
|
||||||
ROUND(sum(item.quantity),0) AS quantity,
|
|
||||||
ROUND(ifnull(x.stock, 0),0) AS stock,
|
|
||||||
pr.group_ks,
|
|
||||||
pr.product_category_name,
|
|
||||||
pr.product_category_id
|
|
||||||
FROM
|
|
||||||
ecmsaleitems as item
|
|
||||||
INNER JOIN
|
|
||||||
ecmsales as doc ON doc.id=item.ecmsale_id
|
|
||||||
INNER JOIN
|
|
||||||
ecmproducts as pr ON pr.id=item.ecmproduct_id
|
|
||||||
LEFT JOIN
|
|
||||||
(SELECT sum(quantity) as stock ,product_id
|
|
||||||
FROM
|
|
||||||
ecmstockstates
|
|
||||||
GROUP BY product_id) x ON x.product_id=item.ecmproduct_id
|
|
||||||
WHERE doc.deleted='0' and doc.status!='s10' " . $where;
|
|
||||||
$query.=" AND NOT EXISTS
|
|
||||||
(
|
|
||||||
SELECT NULL
|
|
||||||
FROM ecmstockdocouts t1
|
|
||||||
WHERE t1.ecmsale_id = doc.id
|
|
||||||
) GROUP by item.ecmproduct_id
|
|
||||||
ORDER BY pr.group_ks DESC";
|
|
||||||
|
|
||||||
$rows = $db->query ($query);
|
|
||||||
|
|
||||||
while($r = $db->fetchByAssoc ( $rows ))
|
$positions = array();
|
||||||
{
|
$total = 0;
|
||||||
$row = array();
|
$stock = 0;
|
||||||
$row["id"] = $r["id"];
|
|
||||||
$row["code"] = $r["code"];
|
|
||||||
$row["name"] = $r["name"];
|
|
||||||
$row["quantity"] = $r["quantity"];
|
|
||||||
$row["stock"] = $r["stock"];
|
|
||||||
$row["product_category_name"]=$r["product_category_name"];
|
|
||||||
$row["group_ks"] = $r["group_ks"];
|
|
||||||
if($r["group_ks"]=='1')$daj='TH';
|
|
||||||
if($r["group_ks"]=='2')$daj='WG';
|
|
||||||
if($r["group_ks"]=='3')$daj='S';
|
|
||||||
$row["group_ks_name"] = $daj;
|
|
||||||
|
|
||||||
|
$id_array = isset($_GET['ids']) ? explode(",", $_GET['ids']) : array();
|
||||||
|
$where = "and doc.id IN ('" . implode("','", $id_array) . "')";
|
||||||
|
if (isset($_GET['product_group']) && $_GET['product_group'] == '1') $where .= " and pr.group_ks=1";
|
||||||
|
if (isset($_GET['product_group']) && $_GET['product_group'] == '2') $where .= " and pr.group_ks=2";
|
||||||
|
if (isset($_GET['product_group']) && $_GET['product_group'] == '3') $where .= " and pr.group_ks=3";
|
||||||
|
|
||||||
// get stock addresses
|
$query = "SELECT
|
||||||
$result = $db->query("SELECT stock_address, is_not_full FROM ecmproducts_stock_addresses WHERE ecmproduct_id='".$r['id']."';");
|
pr.id,
|
||||||
$stock_addresses = "";
|
item.code,
|
||||||
while($addr=$db->fetchByAssoc($result)) {
|
item.name,
|
||||||
if ($addr['is_not_full'] == '1') {
|
ROUND(SUM(item.quantity),0) AS quantity,
|
||||||
$stock_addresses .= " <span style='color: red;'>".$addr['stock_address']."</span>";
|
ROUND(IFNULL(x.stock, 0),0) AS stock,
|
||||||
} else {
|
pr.group_ks,
|
||||||
$stock_addresses .= " ".$addr['stock_address'];
|
pr.product_category_name,
|
||||||
}
|
pr.product_category_id
|
||||||
}
|
FROM ecmsaleitems AS item
|
||||||
$row['stock_addresses'] = $stock_addresses;
|
INNER JOIN ecmsales AS doc ON doc.id=item.ecmsale_id
|
||||||
|
INNER JOIN ecmproducts AS pr ON pr.id=item.ecmproduct_id
|
||||||
array_push($row, $r);
|
LEFT JOIN (
|
||||||
$data [] = $row;
|
SELECT SUM(quantity) AS stock, product_id
|
||||||
$total+=$r['quantity'];
|
FROM ecmstockstates
|
||||||
$stock+=$r['stock'];
|
GROUP BY product_id
|
||||||
}
|
) x ON x.product_id=item.ecmproduct_id
|
||||||
$data['quantity']=$total;
|
WHERE doc.deleted='0' AND doc.status!='s10' " . $where . "
|
||||||
$data['stock']=$stock;
|
AND NOT EXISTS (
|
||||||
|
SELECT NULL
|
||||||
|
FROM ecmstockdocouts t1
|
||||||
|
WHERE t1.ecmsale_id = doc.id
|
||||||
|
)
|
||||||
|
GROUP BY item.ecmproduct_id
|
||||||
|
ORDER BY pr.group_ks DESC";
|
||||||
|
|
||||||
|
$rows = $db->query($query);
|
||||||
|
|
||||||
$edit->ss = new Sugar_Smarty ();
|
while ($r = $db->fetchByAssoc($rows)) {
|
||||||
$edit->module = 'EcmSales';
|
$row = array();
|
||||||
|
$row['id'] = $r['id'];
|
||||||
|
$row['code'] = $r['code'];
|
||||||
|
$row['name'] = $r['name'];
|
||||||
|
$row['quantity'] = $r['quantity'];
|
||||||
|
$row['stock'] = $r['stock'];
|
||||||
|
$row['product_category_name'] = $r['product_category_name'];
|
||||||
|
$row['group_ks'] = $r['group_ks'];
|
||||||
|
|
||||||
$edit->ss->assign ( "CREATED_BY_NAME", $focus->created_by_name );
|
$daj = '';
|
||||||
$edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
|
if ($r['group_ks'] == '1') $daj = 'TH';
|
||||||
$edit->ss->assign ( 'FOCUS', $focus);
|
if ($r['group_ks'] == '2') $daj = 'WG';
|
||||||
$edit->ss->assign ( 'POST', $_POST);
|
if ($r['group_ks'] == '3') $daj = 'S';
|
||||||
$edit->ss->assign ( 'LINK', $link);
|
$row['group_ks_name'] = $daj;
|
||||||
$edit->ss->assign ( 'IDS', $_GET['ids']);
|
|
||||||
$edit->ss->assign('POSITION_LIST',$data);
|
|
||||||
$edit->ss->assign ( 'MOD', $mod_strings);
|
|
||||||
$edit->ss-> display('modules/EcmSales/tpls/ProductSummary.tpl'); //4
|
|
||||||
|
|
||||||
|
$result = $db->query("SELECT stock_address, is_not_full FROM ecmproducts_stock_addresses WHERE ecmproduct_id='" . $r['id'] . "' ORDER BY stock_address");
|
||||||
|
$addresses_raw = array();
|
||||||
|
while ($addr = $db->fetchByAssoc($result)) {
|
||||||
|
$addresses_raw[] = array(
|
||||||
|
'addr' => trim($addr['stock_address']),
|
||||||
|
'not_full' => ($addr['is_not_full'] == '1')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// loading view
|
if (!empty($addresses_raw)) {
|
||||||
//echo '<link rel="stylesheet" type="text/css" href="modules/EcmInsideOrders/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
usort($addresses_raw, function ($a, $b) {
|
||||||
?>
|
return strcmp($a['addr'], $b['addr']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$only_addrs = array();
|
||||||
|
$has_not_full = 0;
|
||||||
|
foreach ($addresses_raw as $ar) {
|
||||||
|
$only_addrs[] = $ar['addr'];
|
||||||
|
if ($ar['not_full']) $has_not_full = 1;
|
||||||
|
}
|
||||||
|
$row['stock_addresses_sort_key'] = implode(' ', $only_addrs);
|
||||||
|
$row['has_not_full'] = $has_not_full;
|
||||||
|
|
||||||
|
$stock_addresses_html = '';
|
||||||
|
foreach ($addresses_raw as $ar) {
|
||||||
|
if ($ar['not_full']) {
|
||||||
|
$stock_addresses_html .= " <span style='color: red;'>" . $ar['addr'] . "</span>";
|
||||||
|
} else {
|
||||||
|
$stock_addresses_html .= " " . $ar['addr'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$row['stock_addresses'] = $stock_addresses_html;
|
||||||
|
|
||||||
|
$positions[] = $row;
|
||||||
|
|
||||||
|
$total += (float)$r['quantity'];
|
||||||
|
$stock += (float)$r['stock'];
|
||||||
|
}
|
||||||
|
|
||||||
|
usort($positions, function ($a, $b) {
|
||||||
|
$ka = isset($a['stock_addresses_sort_key']) ? $a['stock_addresses_sort_key'] : '';
|
||||||
|
$kb = isset($b['stock_addresses_sort_key']) ? $b['stock_addresses_sort_key'] : '';
|
||||||
|
return strcmp($ka, $kb);
|
||||||
|
});
|
||||||
|
|
||||||
|
$data = $positions;
|
||||||
|
$data['quantity'] = $total;
|
||||||
|
$data['stock'] = $stock;
|
||||||
|
|
||||||
|
if (!isset($_REQUEST['to_pdf'])) {
|
||||||
|
$edit->ss = new Sugar_Smarty();
|
||||||
|
$edit->module = 'EcmSales';
|
||||||
|
|
||||||
|
$edit->ss->assign("CREATED_BY_NAME", $focus->created_by_name);
|
||||||
|
$edit->ss->assign("MODIFIED_BY_NAME", $focus->modified_by_name);
|
||||||
|
$edit->ss->assign('FOCUS', $focus);
|
||||||
|
$edit->ss->assign('POST', $_POST);
|
||||||
|
$edit->ss->assign('LINK', isset($link) ? $link : '');
|
||||||
|
$edit->ss->assign('IDS', isset($_GET['ids']) ? $_GET['ids'] : '');
|
||||||
|
$edit->ss->assign('POSITION_LIST', $data);
|
||||||
|
$edit->ss->assign('MOD', $mod_strings);
|
||||||
|
$edit->ss->display('modules/EcmSales/tpls/ProductSummary.tpl');
|
||||||
|
} else {
|
||||||
|
$t = '<table style="border: 1px solid black; border-collapse: collapse;"><tr><td><b>Kod</b></td><td><b>Nazwa</b></td><td><b>Ilość</b></td><td><b>Adres magazynowy</b></td></tr>';
|
||||||
|
|
||||||
|
foreach ($data as $r) {
|
||||||
|
if (isset($r['code'])) {
|
||||||
|
$t .= '<tr><td style="border: 1px solid black;">' . $r['code'] . '</td><td style="border: 1px solid black;">' . $r['name'] . '</td><td style="border: 1px solid black;">' . $r['quantity'] . '</td><td style="border: 1px solid black;">' . $r['stock_addresses'] . '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$t .= '</table>';
|
||||||
|
|
||||||
|
echo $t;
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ $(document).ready(
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#delivery_date").on('inputchange', function() {
|
$("#delivery_date").on('inputchange', function() {
|
||||||
calculateDate($("#delivery_date").val());
|
calculateDate($("#delivery_date").val());
|
||||||
});
|
});
|
||||||
if ($("#type").val() == 'interval_order') {
|
if ($("#type").val() == 'interval_order') {
|
||||||
addToValidate('EditView', 'sale_date_interval', 'id', 'true',
|
addToValidate('EditView', 'sale_date_interval', 'id', 'true',
|
||||||
@@ -109,7 +109,7 @@ $(document).ready(
|
|||||||
SetTab('ITEMS');
|
SetTab('ITEMS');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
calculateDate($("#delivery_date").val());
|
||||||
});
|
});
|
||||||
// handle save
|
// handle save
|
||||||
var check_form_ = check_form;
|
var check_form_ = check_form;
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ function getList() {
|
|||||||
}
|
}
|
||||||
function getList2() {
|
function getList2() {
|
||||||
if($('#idss').val()!=""){
|
if($('#idss').val()!=""){
|
||||||
window.open('index.php?module=EcmSales&action=productsSummaryList&to_pdf=1&ids='+$('#idss').val());
|
window.open('index.php?module=EcmSales&action=ProductSummary&to_pdf=1&ids='+$('#idss').val());
|
||||||
} else {
|
} else {
|
||||||
alert("Proszę zaznaczyć chociaż jedną pozycje!");
|
alert("Proszę zaznaczyć chociaż jedną pozycje!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
$("#myTable2").tablesorter({
|
alert('Wybierz pozycje.');
|
||||||
headers: {
|
return;
|
||||||
0: {
|
}
|
||||||
// disable it by setting the property sorter to false
|
var products = [];
|
||||||
sorter: false
|
ids.forEach(el => {
|
||||||
},
|
const qty = parseFloat($("#qtyInput-" + el).val().trim());
|
||||||
|
console.log(qty);
|
||||||
}
|
products.push(el + "|" + qty);
|
||||||
});
|
});
|
||||||
$("#myTable3").tablesorter({
|
$("#insideOrderProducts").val(products.join('*'));
|
||||||
headers: {
|
$("#createInsideOrderForm").submit();
|
||||||
0: {
|
}
|
||||||
// disable it by setting the property sorter to false
|
|
||||||
sorter: false
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -20,11 +20,18 @@ switch ($_POST['job']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calculateDate($date){
|
function calculateDate($date){
|
||||||
$date = new Datetime($date);
|
$date = new Datetime($date);
|
||||||
$date->modify('-1 day');
|
$date->modify('-1 day');
|
||||||
$tmp['date']=$date->format("d.m.Y");
|
$tmp['date']=$date->format("d.m.Y");
|
||||||
echo json_encode($tmp);
|
$tmp['date_day']=date('N', strtotime($tmp['date']));
|
||||||
return '';
|
if($tmp['date_day']==7){
|
||||||
|
$date->modify('-2 day');
|
||||||
|
} else if($tmp['date_day']==6){
|
||||||
|
$date->modify('-1 day');
|
||||||
|
}
|
||||||
|
$tmp['date']=$date->format("d.m.Y");
|
||||||
|
echo json_encode($tmp);
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
function validateDate($date,$date2){
|
function validateDate($date,$date2){
|
||||||
$date = new Datetime($date);
|
$date = new Datetime($date);
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<script type="text/javascript"
|
<script type="text/javascript" src="include/ECM/EcmMultiPdf/EcmMultiPdf.js"></script>
|
||||||
src="include/ECM/EcmMultiPdf/EcmMultiPdf.js"></script>
|
<script type="text/javascript" src="include/jQuery/jquery.blockUI.js"></script>
|
||||||
<script type="text/javascript"
|
|
||||||
src="include/jQuery/jquery.blockUI.js"></script>
|
|
||||||
<table cellspacing="0" cellpadding="0" border="0">
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="themes/Sugar/images/EcmProducts.gif"
|
<td><img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts"
|
||||||
style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts"
|
width="16" border="0" height="16"></td>
|
||||||
width="16" border="0" height="16"></td>
|
<td>
|
||||||
<td><h2>{$MOD.LBL_LISTNEWSALES_NAME}</h2></td>
|
<h2>{$MOD.LBL_LISTNEWSALES_NAME}</h2>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br/>
|
<br />
|
||||||
<form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales">
|
<form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales">
|
||||||
<ul class="tablist" style="width:100%;">
|
<ul class="tablist" style="width:100%;">
|
||||||
<input type="hidden" name="module" value="EcmSales">
|
<input type="hidden" name="module" value="EcmSales">
|
||||||
@@ -20,21 +19,21 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0"
|
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0"
|
||||||
cellspacing="0">
|
cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td nowrap="">
|
<td nowrap="">
|
||||||
Data wysyłki od
|
Data wysyłki od
|
||||||
</td>
|
</td>
|
||||||
<td nowrap="">
|
<td nowrap="">
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_from"
|
value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
|
||||||
name="date_send_from" autocomplete="off">
|
id="date_send_from" name="date_send_from" autocomplete="off">
|
||||||
<img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger"
|
<img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger"
|
||||||
alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
Calendar.setup({
|
Calendar.setup({
|
||||||
inputField: "date_send_from",
|
inputField: "date_send_from",
|
||||||
daFormat: "%d.%m.%Y",
|
daFormat: "%d.%m.%Y",
|
||||||
button: "date_send_from_trigger",
|
button: "date_send_from_trigger",
|
||||||
@@ -42,22 +41,21 @@
|
|||||||
dateStr: "",
|
dateStr: "",
|
||||||
step: 1,
|
step: 1,
|
||||||
weekNumbers: false
|
weekNumbers: false
|
||||||
}
|
});
|
||||||
);
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
||||||
|
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_to"
|
value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
|
||||||
name="date_send_to" autocomplete="off">
|
id="date_send_to" name="date_send_to" autocomplete="off">
|
||||||
<img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date"
|
<img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date"
|
||||||
src="themes/default/images/jscalendar.gif">
|
src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
Calendar.setup({
|
Calendar.setup({
|
||||||
inputField: "date_send_to",
|
inputField: "date_send_to",
|
||||||
daFormat: "%d.%m.%Y",
|
daFormat: "%d.%m.%Y",
|
||||||
button: "date_send_to_trigger",
|
button: "date_send_to_trigger",
|
||||||
@@ -65,8 +63,7 @@
|
|||||||
dateStr: "",
|
dateStr: "",
|
||||||
step: 1,
|
step: 1,
|
||||||
weekNumbers: false
|
weekNumbers: false
|
||||||
}
|
});
|
||||||
);
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
</td>
|
</td>
|
||||||
@@ -74,7 +71,8 @@
|
|||||||
<td rowspan="2">
|
<td rowspan="2">
|
||||||
<select id="sale_type" name="sale_type[]" multiple="true">
|
<select id="sale_type" name="sale_type[]" multiple="true">
|
||||||
{foreach from=$SALE_TYPES key="key" item="value" name="sale_types"}
|
{foreach from=$SALE_TYPES key="key" item="value" name="sale_types"}
|
||||||
<option {if in_array($key, $SELECTED_TYPES)}selected="selected" {/if} value="{$key}">{$value}</option>
|
<option {if in_array($key, $SELECTED_TYPES)}selected="selected" {/if} value="{$key}">{$value}
|
||||||
|
</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@@ -82,7 +80,8 @@
|
|||||||
<td rowspan="2">
|
<td rowspan="2">
|
||||||
<select id="sale_status" name="sale_status[]" multiple="true">
|
<select id="sale_status" name="sale_status[]" multiple="true">
|
||||||
{foreach from=$SALE_STATUSES key="key" item="value" name="sale_statuses"}
|
{foreach from=$SALE_STATUSES key="key" item="value" name="sale_statuses"}
|
||||||
<option {if in_array($key, $SELECTED_STATUSES)}selected="selected" {/if} value="{$key}">{$value}</option>
|
<option {if in_array($key, $SELECTED_STATUSES)}selected="selected" {/if} value="{$key}">{$value}
|
||||||
|
</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@@ -91,17 +90,17 @@
|
|||||||
</td>
|
</td>
|
||||||
<td nowrap="">
|
<td nowrap="">
|
||||||
<input type="text" title="" value="{if $POST.account_name!=''}{$POST.account_name}{/if}" size=""
|
<input type="text" title="" value="{if $POST.account_name!=''}{$POST.account_name}{/if}" size=""
|
||||||
id="account_name" tabindex="" name="account_name">
|
id="account_name" tabindex="" name="account_name">
|
||||||
<input type="hidden" value="{if $POST.account_id!=''}{$POST.account_id}{/if}" id="account_id"
|
<input type="hidden" value="{if $POST.account_id!=''}{$POST.account_id}{/if}" id="account_id"
|
||||||
name="account_id">
|
name="account_id">
|
||||||
<input type="button"
|
<input type="button"
|
||||||
onclick="{literal}open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"SearchFormListNewSales","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);{/literal}"
|
onclick="{literal}open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"SearchFormListNewSales","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);{/literal}"
|
||||||
value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex=""
|
value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex=""
|
||||||
name="btn_account_name">
|
name="btn_account_name">
|
||||||
<button value="Wyczyść" onclick="this.form.account_name.value = ''; this.form.account_id.value = '';"
|
<button value="Wyczyść" onclick="this.form.account_name.value = ''; this.form.account_id.value = '';"
|
||||||
class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex=""
|
class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex=""
|
||||||
name="btn_clr_parent_name_basic" type="button"><img
|
name="btn_clr_parent_name_basic" type="button"><img
|
||||||
src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1">
|
src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1">
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@@ -118,14 +117,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td nowrap="">
|
<td nowrap="">
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
value="{if $POST.date_from!=''}{$POST.date_from}{/if}"
|
value="{if $POST.date_from!=''}{$POST.date_from}{/if}" id="date_from" name="date_from"
|
||||||
id="date_from" name="date_from" autocomplete="off">
|
autocomplete="off">
|
||||||
<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date"
|
<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date"
|
||||||
src="themes/default/images/jscalendar.gif">
|
src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
Calendar.setup({
|
Calendar.setup({
|
||||||
inputField: "date_from",
|
inputField: "date_from",
|
||||||
daFormat: "%d.%m.%Y",
|
daFormat: "%d.%m.%Y",
|
||||||
button: "date_from_trigger",
|
button: "date_from_trigger",
|
||||||
@@ -133,20 +132,18 @@
|
|||||||
dateStr: "",
|
dateStr: "",
|
||||||
step: 1,
|
step: 1,
|
||||||
weekNumbers: false
|
weekNumbers: false
|
||||||
}
|
});
|
||||||
);
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
do:
|
do:
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
value="{if $POST.date_to!=''}{$POST.date_to}{/if}"
|
value="{if $POST.date_to!=''}{$POST.date_to}{/if}" id="date_to" name="date_to" autocomplete="off">
|
||||||
id="date_to" name="date_to" autocomplete="off">
|
|
||||||
<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date"
|
<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date"
|
||||||
src="themes/default/images/jscalendar.gif">
|
src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
Calendar.setup({
|
Calendar.setup({
|
||||||
inputField: "date_to",
|
inputField: "date_to",
|
||||||
daFormat: "%d.%m.%Y",
|
daFormat: "%d.%m.%Y",
|
||||||
button: "date_to_trigger",
|
button: "date_to_trigger",
|
||||||
@@ -154,8 +151,7 @@
|
|||||||
dateStr: "",
|
dateStr: "",
|
||||||
step: 1,
|
step: 1,
|
||||||
weekNumbers: false
|
weekNumbers: false
|
||||||
}
|
});
|
||||||
);
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
</td>
|
</td>
|
||||||
@@ -164,169 +160,180 @@
|
|||||||
</td>
|
</td>
|
||||||
<td nowrap="">
|
<td nowrap="">
|
||||||
<input type="text" value="{if $POST.parent_order_no!=''}{$POST.parent_order_no}{/if}"
|
<input type="text" value="{if $POST.parent_order_no!=''}{$POST.parent_order_no}{/if}"
|
||||||
name="parent_order_no">
|
name="parent_order_no">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę wysyłki{/if}</h3>
|
<h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę
|
||||||
|
wysyłki{/if}</h3>
|
||||||
<input type="hidden" id="idss" value="">
|
<input type="hidden" id="idss" value="">
|
||||||
<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
|
<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
|
||||||
<input type="button" onclick="location.href='index.php?module=EcmSales&action=ListNewSales';"
|
<input type="button" onclick="location.href='index.php?module=EcmSales&action=ListNewSales';"
|
||||||
value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button">
|
value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button">
|
||||||
<input type="button" id="gets" class="button" name="gets" value="{$MOD.LBL_LISTNEWSALES_CREATE_PDFS}"
|
<input type="button" id="gets" class="button" name="gets" value="{$MOD.LBL_LISTNEWSALES_CREATE_PDFS}"
|
||||||
onclick="createMultiPdf()">
|
onclick="createMultiPdf()">
|
||||||
<input type="button" id="products_list" class="button" name="products_list"
|
<input type="button" id="products_list" class="button" name="products_list"
|
||||||
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY}" onclick="getSelected(); getList();">
|
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY}" onclick="getSelected(); getList();">
|
||||||
<input type="button" id="products_list" class="button" name="products_list"
|
<input type="button" id="products_list" class="button" name="products_list"
|
||||||
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY} 2" onclick="getSelected(); getList2();">
|
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY} 2" onclick="getSelected(); getList2();">
|
||||||
<input type="button" id="products_list" class="button" name="products_list" value="Lista komponentów"
|
<input type="button" id="products_list" class="button" name="products_list" value="Lista komponentów"
|
||||||
onclick="getSelected(); getList3();">
|
onclick="getSelected(); getList3();">
|
||||||
<br>{if $LINK!=''}<a href="https://95.50.148.50/crm/pdftmp/{$LINK}">{$LINK}</a>{/if}
|
<br>{if $LINK!=''}<a href="https://95.50.148.50/crm/pdftmp/{$LINK}">{$LINK}</a>{/if}
|
||||||
|
|
||||||
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;" id="myTable" class="tablesorter">
|
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;" id="myTable" class="tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" name="selectall" id="selectall"></th>
|
<th><input type="checkbox" name="selectall" id="selectall"></th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_POS}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_POS}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_NUMBER}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_NUMBER}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_DESCRIPTION}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_DESCRIPTION}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_PARENT_NAME}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_PARENT_NAME}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_DELIVERY_DATE}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_DELIVERY_DATE}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Termin wysyłki</th>
|
<th>Termin wysyłki</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_QUANTITY}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_QUANTITY}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_NETTO}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_NETTO}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_VAT}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_VAT}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_BRUTTO}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_BRUTTO}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_INVOICE}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_TOTAL_INVOICE}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_PERCENT}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_PERCENT}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_CURRENCY}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_CURRENCY}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_PRINTED}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_PRINTED}</th>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{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><input type="checkbox" value="{$item.id}" class="make_pdf" id="make_pdf_{$item.position}"
|
<td><input type="checkbox" value="{$item.id}" class="make_pdf" id="make_pdf_{$item.position}"
|
||||||
name="selectedid[]"></td>
|
name="selectedid[]"></td>
|
||||||
<td>{$item.position}</td>
|
<td>{$item.position}</td>
|
||||||
<td data-price="{$item.number}"><a
|
<td data-price="{$item.number}"><a
|
||||||
href="index.php?module=EcmSales&action=DetailView&record={$item.id}">{$item.document_no}</a>
|
href="index.php?module=EcmSales&action=DetailView&record={$item.id}">{$item.document_no}</a>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a>
|
<a
|
||||||
</td>
|
href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a>
|
||||||
<td>{$item.delivery_date}</td>
|
{if $item.delivery_name}
|
||||||
<td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if}
|
{if $item.delivery_id}
|
||||||
disabled="disabled"></td>
|
(<a
|
||||||
<td>{$item.send_date} </td>
|
href="index.php?module=Accounts&action=DetailView&record={$item.delivery_id}">{$item.delivery_name}</a>)
|
||||||
<td style="text-align: right">{$item.quantity}</td>
|
{else}
|
||||||
<td data-total="{$item.total_netto}"
|
({$item.delivery_name})
|
||||||
style="text-align: right">{$item.total_netto|number_format:2:".":","}</td>
|
{/if}
|
||||||
<td data-total="{$item.total_vat}"
|
{/if}
|
||||||
style="text-align: right">{$item.total_vat|number_format:2:".":","}</td>
|
</td>
|
||||||
<td data-total="{$item.total_brutto}"
|
<td>{$item.delivery_date}</td>
|
||||||
style="text-align: right">{$item.total_brutto|number_format:2:".":","}</td>
|
<td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if} disabled="disabled">
|
||||||
<td data-total="{$item.total_invoice}"
|
</td>
|
||||||
style="text-align: right">{$item.total_invoice|number_format:2:".":","}</td>
|
<td>{$item.send_date} </td>
|
||||||
<td style="text-align: right">{$item.percent}<a style="cursor:pointer;"
|
<td style="text-align: right">{$item.quantity}</td>
|
||||||
onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img
|
<td data-total="{$item.total_netto}" style="text-align: right">
|
||||||
|
{$item.total_netto|number_format:2:".":","}</td>
|
||||||
|
<td data-total="{$item.total_vat}" style="text-align: right">{$item.total_vat|number_format:2:".":","}
|
||||||
|
</td>
|
||||||
|
<td data-total="{$item.total_brutto}" style="text-align: right">
|
||||||
|
{$item.total_brutto|number_format:2:".":","}</td>
|
||||||
|
<td data-total="{$item.total_invoice}" style="text-align: right">
|
||||||
|
{$item.total_invoice|number_format:2:".":","}</td>
|
||||||
|
<td style="text-align: right">{$item.percent}<a style="cursor:pointer;"
|
||||||
|
onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img
|
||||||
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
||||||
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;"
|
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;"
|
||||||
id="div{$item.id}">
|
id="div{$item.id}">
|
||||||
<table cellspacing="0" cellpadding="3" border="0">
|
<table cellspacing="0" cellpadding="3" border="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="40%"><strong>Index</strong></td>
|
<td width="40%"><strong>Index</strong></td>
|
||||||
<td><strong>Order</strong></td>
|
<td><strong>Order</strong></td>
|
||||||
<td><strong>WZ</strong></td>
|
<td><strong>WZ</strong></td>
|
||||||
<td><strong>ETA</strong></td>
|
<td><strong>ETA</strong></td>
|
||||||
</tr>
|
|
||||||
{foreach from=$item.products key="ki" item="va" name="products"}
|
|
||||||
{if $va.code!=''}
|
|
||||||
<tr style="color:black;">
|
|
||||||
<td style="color:black;"><a
|
|
||||||
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
|
||||||
</td>
|
|
||||||
{if $va.order>$va.wz}
|
|
||||||
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
|
||||||
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
|
||||||
{else}
|
|
||||||
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
|
||||||
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
|
||||||
{/if}
|
|
||||||
<td style="color:black;"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{foreach from=$item.products key="ki" item="va" name="products"}
|
||||||
{/foreach}
|
{if $va.code!=''}
|
||||||
|
<tr style="color:black;">
|
||||||
|
<td style="color:black;"><a
|
||||||
|
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
||||||
|
</td>
|
||||||
|
{if $va.order>$va.wz}
|
||||||
|
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
||||||
|
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
||||||
|
{else}
|
||||||
|
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
||||||
|
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
||||||
|
{/if}
|
||||||
|
<td style="color:black;"></td>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
<tr style="color:black;font-weight:bold">
|
<tr style="color:black;font-weight:bold">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
<td>{$item.products.order_total|number_format:2:".":","}</td>
|
<td>{$item.products.order_total|number_format:2:".":","}</td>
|
||||||
<td>{$item.products.wz_total|number_format:2:".":","}</td>
|
<td>{$item.products.wz_total|number_format:2:".":","}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<span style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span>
|
<span
|
||||||
</td>
|
style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td></td>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td></td>
|
||||||
<span style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span>
|
<td>
|
||||||
</td>
|
<span
|
||||||
</tr>
|
style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span>
|
||||||
</tbody>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
</div>
|
</tbody>
|
||||||
</td>
|
</table>
|
||||||
<td style="text-align: right">{$CURRENCIES[$item.currency]}</td>
|
</div>
|
||||||
<td></td>
|
</td>
|
||||||
<td>
|
<td style="text-align: right">{$CURRENCIES[$item.currency]}</td>
|
||||||
{if $item.type!='gratis'}
|
<td></td>
|
||||||
{if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}"
|
<td>
|
||||||
src="modules/EcmSales/images/convert_disabled.gif"
|
{if $item.type!='gratis'}
|
||||||
title="{$item.fv_name}" style="cursor:pointer;"
|
{if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}"
|
||||||
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if}
|
src="modules/EcmSales/images/convert_disabled.gif" title="{$item.fv_name}"
|
||||||
{if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}"
|
style="cursor:pointer;"
|
||||||
src="modules/EcmSales/images/convert_enabled.gif"
|
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if}
|
||||||
title="Create Invoice"
|
{if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}"
|
||||||
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}"
|
src="modules/EcmSales/images/convert_enabled.gif" title="Create Invoice"
|
||||||
style="cursor:pointer;" />{/if}
|
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}"
|
||||||
{if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
style="cursor:pointer;" />{/if}
|
||||||
title="{$item.wz_name}"
|
{if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
||||||
onclick="{literal}window.open('index.php?module=EcmStockDocOuts&action=DetailView&record={/literal}{$item.wz_id}{literal}','_newtab');{/literal}"
|
title="{$item.wz_name}"
|
||||||
style="cursor: pointer;" border="0"> {/if}
|
onclick="{literal}window.open('index.php?module=EcmStockDocOuts&action=DetailView&record={/literal}{$item.wz_id}{literal}','_newtab');{/literal}"
|
||||||
{if $item.wz_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
style="cursor: pointer;" border="0"> {/if}
|
||||||
title="{$MOD.LBL_LISTNEWSALES_CREATEWZ}"
|
{if $item.wz_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
||||||
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
title="{$MOD.LBL_LISTNEWSALES_CREATEWZ}"
|
||||||
style="cursor: pointer;" border="0">{/if}
|
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
||||||
{else}
|
style="cursor: pointer;" border="0">{/if}
|
||||||
{if $item.rw_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
{else}
|
||||||
title="{$item.rw_name}"
|
{if $item.rw_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
||||||
onclick="{literal}window.open('index.php?module=EcmStockDocInsideOuts&action=DetailView&record={/literal}{$item.rw_id}{literal}','_newtab');{/literal}"
|
title="{$item.rw_name}"
|
||||||
style="cursor: pointer;" border="0"> {/if}
|
onclick="{literal}window.open('index.php?module=EcmStockDocInsideOuts&action=DetailView&record={/literal}{$item.rw_id}{literal}','_newtab');{/literal}"
|
||||||
{if $item.rw_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
style="cursor: pointer;" border="0"> {/if}
|
||||||
title="{$MOD.LBL_LISTNEWSALES_CREATERW}"
|
{if $item.rw_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
||||||
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocInsideOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
title="{$MOD.LBL_LISTNEWSALES_CREATERW}"
|
||||||
style="cursor: pointer;" border="0">{/if}
|
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocInsideOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
||||||
{/if}
|
style="cursor: pointer;" border="0">{/if}
|
||||||
<img src="modules/EcmSales/images/pdf.gif" title="Preview Sale"
|
{/if}
|
||||||
onclick="{literal}EcmPreviewPDF('index.php?module=EcmSales&action=previewPDF&method=I&record={$item.id}&to_pdf=1',{zoom:75,toolbar:1});{/literal}"
|
<img src="modules/EcmSales/images/pdf.gif" title="Preview Sale"
|
||||||
style="cursor: pointer;" border="0">
|
onclick="{literal}EcmPreviewPDF('index.php?module=EcmSales&action=previewPDF&method=I&record={$item.id}&to_pdf=1',{zoom:75,toolbar:1});{/literal}"
|
||||||
</td>
|
style="cursor: pointer;" border="0">
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tr style="vertical-align:top;">
|
<tr style="vertical-align:top;">
|
||||||
<td></td>
|
<td></td>
|
||||||
@@ -343,56 +350,58 @@
|
|||||||
<td style="text-align: right">{$POSITION_LIST.total_brutto|number_format:2:".":","}</td>
|
<td style="text-align: right">{$POSITION_LIST.total_brutto|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$POSITION_LIST.total_invoice|number_format:2:".":","}</td>
|
<td style="text-align: right">{$POSITION_LIST.total_invoice|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$POSITION_LIST.total_percent|string_format:"%.2f"}%<a style="cursor:pointer;"
|
<td style="text-align: right">{$POSITION_LIST.total_percent|string_format:"%.2f"}%<a style="cursor:pointer;"
|
||||||
onclick="{literal}if(document.getElementById('div_all').style.display=='none'){document.getElementById('div_all').style.display='block';}else{document.getElementById('div_all').style.display='none';}{/literal}"><img
|
onclick="{literal}if(document.getElementById('div_all').style.display=='none'){document.getElementById('div_all').style.display='block';}else{document.getElementById('div_all').style.display='none';}{/literal}"><img
|
||||||
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
||||||
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;" id="div_all">
|
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;" id="div_all">
|
||||||
<table cellspacing="0" cellpadding="3" border="0">
|
<table cellspacing="0" cellpadding="3" border="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="40%"><strong>Index</strong></td>
|
<td width="40%"><strong>Index</strong></td>
|
||||||
<td><strong>Order</strong></td>
|
<td><strong>Order</strong></td>
|
||||||
<td><strong>WZ</strong></td>
|
<td><strong>WZ</strong></td>
|
||||||
<td><strong>ETA</strong></td>
|
<td><strong>ETA</strong></td>
|
||||||
{foreach from=$POSITION_LIST.total_product key="ki" item="va" name="products"}
|
{foreach from=$POSITION_LIST.total_product key="ki" item="va" name="products"}
|
||||||
{if $va.code!=''}
|
{if $va.code!=''}
|
||||||
|
|
||||||
|
|
||||||
<tr style="color:black;">
|
<tr style="color:black;">
|
||||||
<td style="color:black;"><a
|
<td style="color:black;"><a
|
||||||
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
||||||
</td>
|
</td>
|
||||||
{if $va.order>$va.wz}
|
{if $va.order>$va.wz}
|
||||||
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
||||||
{else}
|
{else}
|
||||||
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
||||||
{/if}
|
{/if}
|
||||||
<td style="color:black;"></td>
|
<td style="color:black;"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr style="color:black;font-weight:bold">
|
<tr style="color:black;font-weight:bold">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
<td>{$POSITION_LIST.total_product.order_total|number_format:2:".":","}</td>
|
<td>{$POSITION_LIST.total_product.order_total|number_format:2:".":","}</td>
|
||||||
<td>{$POSITION_LIST.total_product.wz_total|number_format:2:".":","}</td>
|
<td>{$POSITION_LIST.total_product.wz_total|number_format:2:".":","}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<span style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span>
|
<span
|
||||||
</td>
|
style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td></td>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td></td>
|
||||||
<span style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span>
|
<td>
|
||||||
</td>
|
<span
|
||||||
</tr>
|
style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span>
|
||||||
</tbody>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
</div>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@@ -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