Compare commits
96 Commits
Hotfix-4
...
Hotfix-101
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b253d91cd | |||
| 5d25352503 | |||
| d960dda689 | |||
| 680d280379 | |||
| 95db8d954e | |||
| b6760452d9 | |||
| 1cda739c2b | |||
| 0b266d6c4e | |||
| 273c52a353 | |||
| 602d8ebb50 | |||
| 4963de452c | |||
| a62aedaa99 | |||
| 549540d9a7 | |||
| 06ffc6657a | |||
| 8e8ade5c7d | |||
| a36ed2d9e8 | |||
| 22730e0340 | |||
| 17c5ac72f9 | |||
| 19a2bea8f6 | |||
| ce309a9df4 | |||
| 9213abb0f3 | |||
| 6b1ede6119 | |||
| 40df5f7bfd | |||
| 423f697471 | |||
| 276efb5190 | |||
| 7932f3a5c9 | |||
| 96ae98d39f | |||
| cc7e18d3ef | |||
| 8460d43275 | |||
| 90c3f1d5bb | |||
| 4bd52f51d1 | |||
| 74153a9fee | |||
| 1c47bbbe59 | |||
| 0a690e7421 | |||
| 610e3c9b10 | |||
| cd438e8971 | |||
| dc377d119e | |||
| 3dcd9b3799 | |||
| f7171cf2c1 | |||
| bc5a714228 | |||
| 8092fae347 | |||
| 0ca1bba534 | |||
| 5950d88065 | |||
| 1479bb2acc | |||
| 9c603fbcf2 | |||
| 2e9e470bc8 | |||
| 11ffd5c311 | |||
| f1375756fc | |||
| 2ad8e1abc7 | |||
| d7c56a3b9e | |||
| ec88947444 | |||
| 0d9b67e51a | |||
| edfb31eb29 | |||
| 145ce05525 | |||
| d7a38ec222 | |||
| 7fc12a03db | |||
| 5cbc9f179d | |||
| bba2d62128 | |||
| eecb5c2540 | |||
| d9277b3450 | |||
| 5372d8ae22 | |||
| 2281815bac | |||
| e45595d032 | |||
| ebea771603 | |||
| 26c647d966 | |||
| d331cf02d8 | |||
| c33f2fbe51 | |||
| 19b1b94b15 | |||
| 2a178756a2 | |||
| 175a9a4edd | |||
| f73012e6e9 | |||
| 8304a1a9b4 | |||
| ba017cd81c | |||
| 5845cb75ef | |||
| 613a4cae36 | |||
| 60c80619f5 | |||
| 3bfcb4ad91 | |||
| edd5bba14c | |||
| 8bf6279728 | |||
| 93648a9adc | |||
| beb90b4ce0 | |||
| 83a5f99f1b | |||
| dd96d1d2d4 | |||
| e9d4895ce4 | |||
| c54a713d53 | |||
| b0215c360c | |||
| 6666811e0f | |||
| add6d704e6 | |||
| 537beae792 | |||
| f761a6ae5e | |||
| 9f3613c464 | |||
| f83d572b37 | |||
| a120522807 | |||
| 89d7ff52ef | |||
| 89735b90e2 | |||
| 5cdc726cdc |
10
.idea/inspectionProfiles/Project_Default.xml
generated
10
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,6 +1,16 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="classname" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="TaskProblemsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -32,6 +32,7 @@ var _arr_aziende = [
|
||||
{n: "tosca_mi"},
|
||||
{n: "tosca_rm"},
|
||||
{n: "tosca_rg"},
|
||||
{n: "tosca_vr"},
|
||||
{n: "twobrothers"},
|
||||
{n: "vgalimenti", sub:['salpar']},
|
||||
{n: "vinella"}
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"dataTables": {
|
||||
"js": [
|
||||
"assets/datatables/js/jquery.dataTables.min.js",
|
||||
"assets/datatables/js/jquery.dataTables.custom.js",
|
||||
"assets/datatables/js/dataTables.bootstrap.min.js",
|
||||
"assets/datatables/js/dataTables.fixedColumns.min.js",
|
||||
"assets/datatables/js/dataTables.fixedHeader.min.js",
|
||||
|
||||
24
public_html/assets/datatables/js/jquery.dataTables.custom.js
Normal file
24
public_html/assets/datatables/js/jquery.dataTables.custom.js
Normal file
@@ -0,0 +1,24 @@
|
||||
$.fn.extend($.fn.dataTableExt.oSort, {
|
||||
"non-empty-string-asc": function (str1, str2) {
|
||||
if (str1 === "") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (str2 === "") {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return str1 < str2 ? -1 : (str1 > str2 ? 1 : 0);
|
||||
},
|
||||
"non-empty-string-desc": function (str1, str2) {
|
||||
if (str1 === "") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (str2 === "") {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return str1 < str2 ? 1 : (str1 > str2 ? -1 : 0);
|
||||
}
|
||||
});
|
||||
@@ -44,19 +44,30 @@ class StbFilesAttached {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function cache($idAttach, $flagRenew = true, $profileDb = null) {
|
||||
public static function cache($idAttach, $flagRenew = true, $profileDb = null, $options = null) {
|
||||
$options["renew"] = isset($options["renew"]) && $options["renew"] !== false;
|
||||
$options["resize"] = isset($options["resize"]) && is_array($options["resize"]) && isset($options["resize"][0]) ? $options["resize"] : false;
|
||||
$options["quality"] = isset($options["quality"]) ? $options["quality"] : null;
|
||||
$targetName = isset($options["targetName"]) ? $options["targetName"] : null;
|
||||
$Ret = self::get_item($idAttach, $profileDb);
|
||||
if ($Ret->is_OK()) {
|
||||
$subDir = "stbFileAttached";
|
||||
$result = $Ret->get_data();
|
||||
|
||||
$content = $result["content"];
|
||||
$fileName = pathinfo($result["file_name"], PATHINFO_BASENAME);
|
||||
$filePath = \Cache::get_filepath($fileName, $subDir, true);
|
||||
if ($flagRenew === false && file_exists($filePath)) {
|
||||
$Ret->set_string($filePath)->set_data(null);
|
||||
|
||||
if (\Utility\File::isImageFromName($fileName) && $options["resize"]) {
|
||||
$Ret = \Utility\Image::getResizeImage($fileName, $options, $content);
|
||||
|
||||
} else {
|
||||
$Ret = \Cache::writeR(pathinfo($fileName, PATHINFO_BASENAME), $result["content"], null, true);
|
||||
$fileName = $targetName ?: $fileName;
|
||||
$filePath = \Cache::get_filepath($fileName, $subDir, true);
|
||||
if ($flagRenew === false && file_exists($filePath)) {
|
||||
$Ret->set_string($filePath)->set_data(null);
|
||||
|
||||
} else {
|
||||
$Ret = \Cache::writeR(pathinfo($fileName, PATHINFO_BASENAME), $result["content"], null, true);
|
||||
}
|
||||
}
|
||||
|
||||
unset($result["content"]);
|
||||
|
||||
@@ -323,6 +323,14 @@
|
||||
"std-pkg"
|
||||
]
|
||||
},
|
||||
"presenze_pv": {
|
||||
"title": "Presenze",
|
||||
"pages": "presenze_pv.php",
|
||||
"position": [],
|
||||
"libs": [
|
||||
"std-pkg"
|
||||
]
|
||||
},
|
||||
"produttivita": {
|
||||
"title": "Produttività",
|
||||
"pages": "produttivita.php",
|
||||
@@ -1040,7 +1048,8 @@
|
||||
],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg"
|
||||
"std-pkg",
|
||||
"select2"
|
||||
]
|
||||
},
|
||||
"movimenti_contabili": {
|
||||
@@ -1251,5 +1260,26 @@
|
||||
"select2",
|
||||
"jquery-dateRangePicker"
|
||||
]
|
||||
},
|
||||
"contratti_di_acquisto": {
|
||||
"title": "Contratti di Acquisto",
|
||||
"pages": "contratti_di_acquisto.php",
|
||||
"position": [
|
||||
{
|
||||
"title": "In Corso",
|
||||
"url": "?in-corso"
|
||||
},
|
||||
{
|
||||
"title": "Scaduti",
|
||||
"url": "?scaduti"
|
||||
}
|
||||
],
|
||||
"children": [],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"select2",
|
||||
"jquery-dateRangePicker"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,10 @@ if (class_exists("PhpMyAdmin\MoTranslator\Loader")) {
|
||||
_textdomain("messages");
|
||||
|
||||
$translator = \PhpMyAdmin\MoTranslator\Loader::getInstance();
|
||||
} else {
|
||||
function __($msgid) {
|
||||
return $msgid;
|
||||
}
|
||||
}
|
||||
|
||||
Controller::$abs_root_project = __DIR__;
|
||||
|
||||
@@ -19,7 +19,6 @@ FROM (SELECT 1 AS gruppo,
|
||||
azienda.indirizzo,
|
||||
azienda.cap,
|
||||
azienda.citta,
|
||||
|
||||
azienda.prov,
|
||||
azienda.part_iva,
|
||||
azienda.cod_fiscale,
|
||||
@@ -39,7 +38,8 @@ FROM (SELECT 1 AS gruppo,
|
||||
ELSE mtb_aart.descrizione END AS coltura,
|
||||
CONVERT(VARCHAR(8000), descrizione_html) AS descrizione_html,
|
||||
mtb_aart.descrizione_estesa,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link AS url_image,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link + '/' +
|
||||
REPLACE(mtb_aart_link.cod_mart, '/', '~') AS url_image,
|
||||
list.note,
|
||||
CONVERT(VARCHAR(10), CASE
|
||||
WHEN mtb_aart.cod_msfa like '%[^0-9]%' THEN '/'
|
||||
|
||||
@@ -48,7 +48,7 @@ foreach ($rows as $i => $item) {
|
||||
->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)
|
||||
->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($cell)->applyFromArray($cellStyle["photolink"]);
|
||||
$sheet->getCell($cell)->getHyperlink()->setUrl($item["liknk1"]);
|
||||
$sheet->getCell($cell)->getHyperlink()->setUrl($item["liknk1"] . "/1");
|
||||
}
|
||||
|
||||
if (!is_null($item["liknk2"])) {
|
||||
@@ -59,7 +59,7 @@ foreach ($rows as $i => $item) {
|
||||
->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)
|
||||
->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
||||
$sheet->getStyle($cell)->applyFromArray($cellStyle["photolink"]);
|
||||
$sheet->getCell($cell)->getHyperlink()->setUrl($item["liknk2"]);
|
||||
$sheet->getCell($cell)->getHyperlink()->setUrl($item["liknk2"] . "/2");
|
||||
}
|
||||
|
||||
if (!is_null($item["descrizione_html"]) && strlen($item["descrizione_html"]) > 0) {
|
||||
|
||||
@@ -38,7 +38,8 @@ FROM (SELECT 1 AS grupp
|
||||
ELSE mtb_aart.descrizione END AS coltura,
|
||||
CONVERT(VARCHAR(8000), descrizione_html) AS descrizione_html,
|
||||
mtb_aart.descrizione_estesa,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link AS url_image,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link + '/' +
|
||||
REPLACE(mtb_aart_link.cod_mart, '/', '~') AS url_image,
|
||||
list.note,
|
||||
CONVERT(VARCHAR(10), CASE
|
||||
WHEN mtb_aart.cod_msfa like '%[^0-9]%' THEN '/'
|
||||
@@ -120,7 +121,8 @@ FROM (SELECT 1 AS grupp
|
||||
ELSE mtb_aart.descrizione END AS coltura,
|
||||
CONVERT(VARCHAR(8000), descrizione_html) AS descrizione_html,
|
||||
mtb_aart.descrizione_estesa,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link AS url_image,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link + '/' +
|
||||
REPLACE(mtb_aart_link.cod_mart, '/', '~') AS url_image,
|
||||
list.note,
|
||||
CONVERT(VARCHAR(10), CASE
|
||||
WHEN mtb_aart.cod_msfa like '%[^0-9]%' THEN '/'
|
||||
@@ -202,7 +204,8 @@ FROM (SELECT 1 AS grupp
|
||||
ELSE mtb_aart.descrizione END AS coltura,
|
||||
CONVERT(VARCHAR(8000), descrizione_html) AS descrizione_html,
|
||||
mtb_aart.descrizione_estesa,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link AS url_image,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link + '/' +
|
||||
REPLACE(mtb_aart_link.cod_mart, '/', '~') AS url_image,
|
||||
list.note,
|
||||
CONVERT(VARCHAR(10), CASE
|
||||
WHEN mtb_aart.cod_msfa like '%[^0-9]%' THEN '/'
|
||||
@@ -283,7 +286,8 @@ FROM (SELECT 1 AS grupp
|
||||
ELSE mtb_aart.descrizione END AS coltura,
|
||||
CONVERT(VARCHAR(8000), descrizione_html) AS descrizione_html,
|
||||
mtb_aart.descrizione_estesa,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link AS url_image,
|
||||
stb_gest_setup.value + mtb_aart_link.path_link + '/' +
|
||||
REPLACE(mtb_aart_link.cod_mart, '/', '~') AS url_image,
|
||||
list.note,
|
||||
CONVERT(VARCHAR(10), CASE
|
||||
WHEN mtb_aart.cod_msfa like '%[^0-9]%' THEN '/'
|
||||
|
||||
@@ -63,5 +63,13 @@
|
||||
"11",
|
||||
"12"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "contratti_di_acquisto",
|
||||
"group": "Acquisti",
|
||||
"usergroups": [
|
||||
"11",
|
||||
"12"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -112,6 +112,13 @@
|
||||
"2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "presenze_pv",
|
||||
"group": "Personale",
|
||||
"usergroups": [
|
||||
"10"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "produttivita",
|
||||
"group": "Produttività",
|
||||
@@ -127,6 +134,21 @@
|
||||
"!CENTRALE48"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "produttivita_a_valore",
|
||||
"group": "Produttività",
|
||||
"usergroups": [
|
||||
"10",
|
||||
"20"
|
||||
],
|
||||
"users": [
|
||||
"!CENTRALE28",
|
||||
"!CENTRALE28P",
|
||||
"!CUCINA",
|
||||
"!SPACCIO",
|
||||
"!CENTRALE48"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "produttivita2",
|
||||
"group": "Produttività",
|
||||
|
||||
@@ -33,7 +33,7 @@ class MainHandler extends DefaultHandler {
|
||||
$dto->setDate("dataOrd", $key["data_ord"]);
|
||||
$dto->set("numOrd", $key["num_ord"]);
|
||||
$dto->set("gestioneOrd", $key["gestione"]);
|
||||
$dto->set("quantity", $data["qta_collo"] * $ordineLav["qta_cnf"]);
|
||||
$dto->set("quantity", $data["qta_collo"] * $ordineLav["rap_conv_dist"]);
|
||||
$dto->set("posizione", $posizione);
|
||||
$dto->set("codCmac", $codCmac);
|
||||
$body->push($dto);
|
||||
|
||||
@@ -157,7 +157,7 @@ group by mr.cod_mart, ma.unt_mis");
|
||||
$dto->setDate("dataOrd", $key["data_ord"]);
|
||||
$dto->set("numOrd", $key["num_ord"]);
|
||||
$dto->set("gestioneOrd", $key["gestione"]);
|
||||
$dto->set("quantity", $data["qta_collo"] * $ordineLav["qta_cnf"]);
|
||||
$dto->set("quantity", $data["qta_collo"] * $ordineLav["rap_conv_dist"]);
|
||||
$dto->set("posizione", $posizione);
|
||||
$dto->set("codCmac", $codCmac);
|
||||
$body->push($dto);
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
<EFBFBD><12>1111<31><31><EFBFBD><EFBFBD>
|
||||
<EFBFBD><12>1111<31><31><EFBFBD><EFBFBD>
|
||||
@@ -1 +1 @@
|
||||
<EFBFBD><12>1111<31><7F><EFBFBD>
|
||||
<EFBFBD><12>1111<31><7F><EFBFBD>
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
<EFBFBD><04><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><04><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
public_html/config_aziende/TOSCA_VR/custom.css
Normal file
2
public_html/config_aziende/TOSCA_VR/custom.css
Normal file
@@ -0,0 +1,2 @@
|
||||
nav#nb-main .navbar-center #titlebar{color:#2f363d}.navbar-default{background-color:#f5f5f5;border-color:#e0e0e0}.navbar-default .navbar-brand{color:#2f363d}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#2f363d}.navbar-default .navbar-text{color:#2f363d}.navbar-default .navbar-nav>li>a{color:#2f363d}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#2f363d}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fff !important;background-color:#63221C}.navbar-default .navbar-nav>.open:not(.active)>a,.navbar-default .navbar-nav>.open:not(.active)>a:hover,.navbar-default .navbar-nav>.open:not(.active)>a:focus{color:#2f363d !important;background-color:#e0e0e0}.navbar-default .navbar-toggle{border-color:#e0e0e0}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#e0e0e0}.navbar-default .navbar-toggle .icon-bar{background-color:#2f363d}.navbar-default .navbar-link{color:#2f363d}.navbar-default .navbar-link:hover{color:#2f363d}@media (max-width: 767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#2f363d}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#2f363d}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff !important;background-color:#63221C}}#bt_nb-side-dismiss>i,#bt_nb-side-collapse>i{color:#8f9ca9}#nb-side>div>.navbar{background-color:#f5f5f5;border-color:#e0e0e0}
|
||||
/*# sourceMappingURL=custom.css.map */
|
||||
11
public_html/config_aziende/TOSCA_VR/custom.scss
Normal file
11
public_html/config_aziende/TOSCA_VR/custom.scss
Normal file
@@ -0,0 +1,11 @@
|
||||
/** NAVBAR */
|
||||
/* warning: ho generato con twbscolor, e aggiunto $bgActive, $colActive */
|
||||
|
||||
$bgDefault: #f5f5f5;
|
||||
$bgHighlight: #e0e0e0;
|
||||
$bgActive: #63221C;
|
||||
$colDefault: #2f363d;
|
||||
$colHighlight: #2f363d;
|
||||
$colActive: #fff;
|
||||
|
||||
@import "../navbar";
|
||||
2
public_html/config_aziende/TOSCA_VR/gestioni.json
Normal file
2
public_html/config_aziende/TOSCA_VR/gestioni.json
Normal file
@@ -0,0 +1,2 @@
|
||||
[
|
||||
]
|
||||
BIN
public_html/config_aziende/TOSCA_VR/images/logo_azienda.png
Normal file
BIN
public_html/config_aziende/TOSCA_VR/images/logo_azienda.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
30
public_html/config_aziende/tosca_vr.config.json
Normal file
30
public_html/config_aziende/tosca_vr.config.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"studioml": {
|
||||
"db": {
|
||||
"driver": "pdosqlsrv",
|
||||
"hostName": "192.168.2.214",
|
||||
"dbName": "tosca_vr",
|
||||
"userName": "sa",
|
||||
"password": "sa"
|
||||
},
|
||||
"endPoint": "192.168.3.15:8080",
|
||||
"endPointRemote": "https://www2.studioml.it",
|
||||
"public_url": "https://www.studioml.it/pvm/"
|
||||
},
|
||||
"cliente": {
|
||||
"db": {
|
||||
"driver": "pdosqlsrv",
|
||||
"hostName": "localhost",
|
||||
"dbName": "tosca_vr",
|
||||
"userName": "sa",
|
||||
"password": "sa"
|
||||
},
|
||||
"endPoint": "localhost:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": ""
|
||||
},
|
||||
"dbNameWeb": "TOSCA",
|
||||
"azienda": "TOSCA",
|
||||
"sc_project": "12024361",
|
||||
"sc_security": "5e40043c"
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"endPoint": "10.107.107.8:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": "http://93.64.252.218/portale/"
|
||||
"public_url": "http://ws.salpar.it/portale/"
|
||||
},
|
||||
"dbNameWeb": "VGALIMENTI",
|
||||
"azienda": "VGALIMENTI",
|
||||
|
||||
31
public_html/contratti_di_acquisto.php
Normal file
31
public_html/contratti_di_acquisto.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
session_start();
|
||||
include "functions.php";
|
||||
require_once "include_login.php";
|
||||
include "config.php";
|
||||
include "include/module.php";
|
||||
|
||||
include Controller::current_mainClasspath();
|
||||
include Controller::current_gestpath_include("ajax.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<!--html manifest="manifest.appcache"-->
|
||||
<html>
|
||||
<head>
|
||||
<? include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<? include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div><?
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<? include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
47
public_html/css/main/IntegryCustomColors.css
Normal file
47
public_html/css/main/IntegryCustomColors.css
Normal file
@@ -0,0 +1,47 @@
|
||||
.btn.icbtn {
|
||||
background: linear-gradient(transparent, rgba(0, 0, 0, 0.2)) top/100% 800%;
|
||||
transition: all .2s ease-in
|
||||
}
|
||||
|
||||
.btn.icbtn:hover {
|
||||
background-position: bottom;
|
||||
transform: scale(1.01);
|
||||
transition: all .2s ease-out
|
||||
}
|
||||
|
||||
.btn.icbtn.btn-success {
|
||||
background-color: #1eaf54;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.btn.icbtn.btn-info {
|
||||
background-color: #55acee;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.btn.icbtn.btn-primary {
|
||||
background-color: #007bff;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.btn.icbtn.btn-warning {
|
||||
background-color: #ffac44;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.btn.icbtn.btn-danger {
|
||||
background-color: #ed302f;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.panel-primary > .panel-heading.icpanel {
|
||||
background-image: linear-gradient(to right, #0065D2, #007BFF);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.panel-success > .panel-heading.icpanel, .modal.modal-success .modal-header {
|
||||
background-image: linear-gradient(to right, #188D44, #1EAF54);
|
||||
color: #fff
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=IntegryCustomColors.css.map */
|
||||
@@ -138,6 +138,8 @@ class Accettazione {
|
||||
->setVar("qs", $qs);
|
||||
$Ret = $Query->toRet()->execute();
|
||||
if ($Ret->is_OK()) {
|
||||
$GestSetup = new GestSetup();
|
||||
$chkDiffMultCnf = $GestSetup->section("ACCETTAZIONE")->keySection("CHK_DIFF_MULTIPLO_CNF")->asArray()->get();
|
||||
$tr_classes = $COND_DOC = "";
|
||||
$qtaOrd = $qtaDoc = $qtaCollo = $qtaInevasa = 0;
|
||||
$ricNonFat = $fattNonRic = $ricNonFatResa = 0;
|
||||
@@ -164,6 +166,7 @@ class Accettazione {
|
||||
$codMart = $row["cod_mart"];
|
||||
$codArtFor = $row["cod_art_for"];
|
||||
$descrizione = htmlentities($row["descrizione"]);
|
||||
$bindToMultiple = $row["flag_dig"] == "S" && $row["tipo_um"] == "UP" && in_array($data["data"]["cod_alis"], $chkDiffMultCnf);
|
||||
|
||||
$arr_attributes = array_merge($attributes_std, array("cod_mart" => $codMart, "cod_art_for" => $codArtFor, "descrizione" => $row["descrizione"], "tolleranza" => (double)$row["tolleranza"]));
|
||||
|
||||
|
||||
@@ -63,26 +63,28 @@ if (isset($codAlis)) {
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="row"><?
|
||||
if (!is_null($ragSoc)) {
|
||||
?>
|
||||
<div class="row">
|
||||
<?php if (!is_null($ragSoc)) { ?>
|
||||
<div class="col-xs-2">
|
||||
<h4 class="b-grey b-b">Cliente</h4>
|
||||
<div class="mt-4 small"><?= $ragSoc ?></div>
|
||||
</div><?
|
||||
} ?>
|
||||
<h4 class="b-grey b-b">Fornitore</h4>
|
||||
<div class="mt-4 small"><?= $ragSoc ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-xs-2">
|
||||
<h4 class="b-grey b-b">Ordini</h4>
|
||||
<div class="mt-4 small"><?
|
||||
<div class="mt-4 small">
|
||||
<?php
|
||||
foreach ($data["ordini"] as $item) {
|
||||
echo $item["num_ord"] . " del " . strftime("%d/%m/%Y", $item["data_ord"]) . "<br/>";
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
<h4 class="b-grey b-b">Doc. di cons.</h4>
|
||||
<div class="mt-4"><?
|
||||
<div class="mt-4">
|
||||
<?php
|
||||
if (count($data["documenti"]) > 0) {
|
||||
foreach ($data["documenti"] as $item) {
|
||||
echo "<small>" . $item["cod_dtip"] . " " . $item["num_doc"] . " " . $item["ser_doc"] . " del " . strftime("%d/%m/%Y", $item["data_doc"]) . "</small><br/>";
|
||||
@@ -91,37 +93,39 @@ if (isset($codAlis)) {
|
||||
$serDocNew = Accettazione::get_serDocDepo();
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-xs-5 pr-4 pl-0">
|
||||
<label for="data_doc_new">Data</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" id="data_doc_new" autocomplete="off"
|
||||
readonly/>
|
||||
<span class="input-group-addon dpicker">
|
||||
<div class="col-xs-5 pr-4 pl-0">
|
||||
<label for="data_doc_new">Data</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" id="data_doc_new" autocomplete="off"
|
||||
readonly/>
|
||||
<span class="input-group-addon dpicker">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 pr-4 pl-4">
|
||||
<label for="num_doc_new">Num.</label>
|
||||
<input type="number" class="form-control input-sm" id="num_doc_new" min="1"/>
|
||||
</div>
|
||||
<div class="col-xs-3 pr-0 pl-4">
|
||||
<label for="ser_doc_new">Serie</label>
|
||||
<input type="text" class="form-control input-sm" id="ser_doc_new"
|
||||
value="<?= $serDocNew ?>" maxlength="2"/>
|
||||
<input type="hidden" value="<?= $codAnag ?>" id="cod_anag_new"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 pr-4 pl-4">
|
||||
<label for="num_doc_new">Num.</label>
|
||||
<input type="number" class="form-control input-sm" id="num_doc_new" min="1"/>
|
||||
</div>
|
||||
<div class="col-xs-3 pr-0 pl-4">
|
||||
<label for="ser_doc_new">Serie</label>
|
||||
<input type="text" class="form-control input-sm" id="ser_doc_new"
|
||||
value="<?= $serDocNew ?>" maxlength="2"/>
|
||||
<input type="hidden" value="<?= $codAnag ?>" id="cod_anag_new"/>
|
||||
</div>
|
||||
</div><?
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-2">
|
||||
<h4 class="b-grey b-b">Checklist</h4>
|
||||
<div class="mt-4"><?
|
||||
<div class="mt-4">
|
||||
<?php
|
||||
foreach ($data["colli"] as $item) {
|
||||
echo $item["num_collo"] . " " . $item["ser_collo"] . " del " . strftime(Format::strftimeDMY, $item["data_collo"]) . "<br/>";
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -158,14 +162,12 @@ if (isset($codAlis)) {
|
||||
<input id="txt-flt_articoli" type="text" class="form-control" placeholder="Filtra risultati"
|
||||
autocomplete="off"/>
|
||||
</div>
|
||||
<? if ($setIdSegnalazione) {
|
||||
?>
|
||||
<?php if ($setIdSegnalazione) { ?>
|
||||
<div class="col-md-offset-8 col-sm-offset-7 col-sm-4 col-xs-12 mt-10">
|
||||
<input id="txt-id_segnalazione" type="text" class="form-control" placeholder="Id segnalazione"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
<?
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div><!-- lasciare qst div -->
|
||||
@@ -192,7 +194,8 @@ if (isset($codAlis)) {
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?
|
||||
<tbody>
|
||||
<?php
|
||||
$chkDiffMultCnf = $GestSetup->section("ACCETTAZIONE")->keySection("CHK_DIFF_MULTIPLO_CNF")->asArray()->get();
|
||||
foreach ($arr_rows as $row) {
|
||||
$qtaOrd = (double)$row["qta_ord"];
|
||||
@@ -250,7 +253,8 @@ if (isset($codAlis)) {
|
||||
);
|
||||
|
||||
include "list-articoli_tr.php";
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -269,7 +273,7 @@ if (isset($codAlis)) {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
<?php
|
||||
$html = Utility\Str::remove_multiple_spaces(ob_get_contents());
|
||||
@ob_end_clean();
|
||||
@ob_end_flush();
|
||||
|
||||
@@ -11,12 +11,18 @@ SELECT TOP 10
|
||||
THEN mtb_aart.rap_conv2
|
||||
ELSE 0 END
|
||||
ELSE stb_gest_setup.value END
|
||||
) AS tolleranza
|
||||
FROM (SELECT mtb_lisa.cod_mart AS cod_mart,
|
||||
mtb_lisa.descr_art_forn AS descrizione,
|
||||
) AS tolleranza,
|
||||
articoli.flag_dig,
|
||||
articoli.tipo_um
|
||||
FROM (SELECT mtb_lisa.cod_mart AS cod_mart,
|
||||
mtb_lisa.descr_art_forn AS descrizione,
|
||||
mtb_lisa.cod_art_for,
|
||||
mtb_lisa.cod_mart + mtb_lisa.cod_art_for + mtb_lisa.descr_art_forn AS search
|
||||
ISNULL(mtb_lisa.cod_mart, '') + ISNULL(mtb_lisa.cod_art_for, '') +
|
||||
ISNULL(mtb_lisa.descr_art_forn, '') AS search,
|
||||
mtb_unt_mis.flag_dig,
|
||||
mtb_unt_mis.tipo_um
|
||||
FROM mtb_lisa
|
||||
INNER JOIN mtb_unt_mis ON mtb_lisa.unt_mis_acq = mtb_unt_mis.unt_mis
|
||||
WHERE mtb_lisa.flag_attivo = 'S'
|
||||
AND mtb_lisa.cod_alis = '[cod_alis]'
|
||||
UNION
|
||||
@@ -24,10 +30,14 @@ FROM (SELECT mtb_lisa.cod_mart
|
||||
/*ISNULL(mtb_tcol.cod_mart, '') AS cod_mart,*/
|
||||
mtb_aart.descrizione AS descrizione,
|
||||
NULL AS cod_art_for,
|
||||
mtb_tcol.cod_mart + mtb_aart.descrizione AS search
|
||||
mtb_tcol.cod_mart + mtb_aart.descrizione AS search,
|
||||
mtb_unt_mis.flag_dig,
|
||||
mtb_unt_mis.tipo_um
|
||||
FROM mtb_tcol,
|
||||
mtb_aart
|
||||
mtb_aart,
|
||||
mtb_unt_mis
|
||||
WHERE mtb_tcol.cod_mart = mtb_aart.cod_mart
|
||||
AND mtb_aart.unt_mis = mtb_unt_mis.unt_mis
|
||||
) articoli
|
||||
LEFT OUTER JOIN mtb_aart ON articoli.cod_mart = mtb_aart.cod_mart
|
||||
LEFT OUTER JOIN stb_gest_setup ON stb_gest_setup.gest_name = 'PVM' AND
|
||||
|
||||
@@ -7,27 +7,25 @@ SELECT dtb_ordt.data_ord,
|
||||
dtb_ordt.listino,
|
||||
atb_list.descrizione,
|
||||
CASE WHEN tmp.listino IS NULL THEN 'N' ELSE 'S' END AS select_doc
|
||||
FROM dtb_ordr
|
||||
FROM dtb_ordt
|
||||
INNER JOIN (SELECT value_string AS listino
|
||||
FROM stb_gest_setup
|
||||
CROSS APPLY dbo.parseStringIntoArray(stb_gest_setup.value, '|')
|
||||
WHERE gest_name = 'PVM'
|
||||
AND section = 'ACCETTAZIONE'
|
||||
AND key_section = 'SELECT_DOC') tmp ON dtb_ordt.listino = tmp.listino
|
||||
INNER JOIN gtb_anag ON dtb_ordt.cod_anag = gtb_anag.cod_anag
|
||||
INNER JOIN atb_list ON dtb_ordt.listino = atb_list.cod_alis
|
||||
INNER JOIN dtb_ordr ON dtb_ordt.gestione = dtb_ordr.gestione AND
|
||||
dtb_ordt.data_ord = dtb_ordr.data_ord AND
|
||||
dtb_ordt.num_ord = dtb_ordr.num_ord
|
||||
LEFT OUTER JOIN (SELECT * FROM avw_ordini_accettazione WHERE cod_mdep = '[cod_mdep]') avw_ordini_accettazione
|
||||
ON
|
||||
dtb_ordr.gestione = avw_ordini_accettazione.gestione AND
|
||||
dtb_ordr.data_ord = avw_ordini_accettazione.data_ord AND
|
||||
dtb_ordr.num_ord = avw_ordini_accettazione.num_ord AND
|
||||
dtb_ordr.riga_ord = avw_ordini_accettazione.riga_ord,
|
||||
dtb_ordt
|
||||
LEFT OUTER JOIN (SELECT value_string AS listino
|
||||
FROM stb_gest_setup
|
||||
CROSS APPLY dbo.parseStringIntoArray(stb_gest_setup.value, '|')
|
||||
WHERE gest_name = 'PVM'
|
||||
AND section = 'ACCETTAZIONE'
|
||||
AND key_section = 'SELECT_DOC') tmp ON dtb_ordt.listino = tmp.listino,
|
||||
gtb_anag,
|
||||
atb_list
|
||||
WHERE dtb_ordt.gestione = dtb_ordr.gestione
|
||||
AND dtb_ordt.data_ord = dtb_ordr.data_ord
|
||||
AND dtb_ordt.num_ord = dtb_ordr.num_ord
|
||||
AND dtb_ordt.cod_anag = gtb_anag.cod_anag
|
||||
AND dtb_ordt.cod_mdep = '[cod_mdep]'
|
||||
dtb_ordr.gestione = avw_ordini_accettazione.gestione AND
|
||||
dtb_ordr.data_ord = avw_ordini_accettazione.data_ord AND
|
||||
dtb_ordr.num_ord = avw_ordini_accettazione.num_ord AND
|
||||
dtb_ordr.riga_ord = avw_ordini_accettazione.riga_ord
|
||||
WHERE dtb_ordt.cod_mdep = '[cod_mdep]'
|
||||
AND dtb_ordt.gestione = 'A'
|
||||
AND dtb_ordt.flag_annulla = 'N'
|
||||
AND dtb_ordt.data_ord >= '[data_da]'
|
||||
@@ -35,14 +33,15 @@ WHERE dtb_ordt.gestione = dtb_ordr.gestione
|
||||
AND dtb_ordr.flag_evaso = 'I'
|
||||
AND dtb_ordt.flag_evaso_forzato = 'N'
|
||||
AND avw_ordini_accettazione.data_ord IS NULL
|
||||
AND dtb_ordt.listino = atb_list.cod_alis
|
||||
GROUP BY dtb_ordt.data_ord,
|
||||
dtb_ordt.num_ord,
|
||||
dtb_ordt.gestione,
|
||||
dtb_ordt.cod_anag,
|
||||
dtb_ordt.cod_vdes,
|
||||
gtb_anag.rag_soc,
|
||||
dtb_ordt.listino,
|
||||
atb_list.descrizione,
|
||||
CASE WHEN tmp.listino IS NULL THEN 'N' ELSE 'S' END
|
||||
dtb_ordt.num_ord,
|
||||
dtb_ordt.gestione,
|
||||
dtb_ordt.cod_anag,
|
||||
dtb_ordt.cod_vdes,
|
||||
gtb_anag.rag_soc,
|
||||
dtb_ordt.listino,
|
||||
atb_list.descrizione,
|
||||
CASE WHEN tmp.listino IS NULL THEN 'N'
|
||||
ELSE
|
||||
'S' END
|
||||
ORDER BY dtb_ordt.data_ord DESC, dtb_ordt.num_ord DESC
|
||||
@@ -37,13 +37,10 @@ class Allegati {
|
||||
if (isset($data["activity_id"])) {
|
||||
$activityId = $data["activity_id"];
|
||||
$Ret = \Allegati\Attivita::get_filelist($activityId);
|
||||
|
||||
} else if (isset($data["cod_jcom"])) {
|
||||
$Ret = \Allegati\Commessa::get_filelist($data["cod_jcom"], $data["depth"], $filter);
|
||||
/*
|
||||
} else if(isset($data["cod_mart"])){
|
||||
$Ret = \Allegati\Articolo::get_filelist($data["cod_mart"]);
|
||||
*/
|
||||
} else if (isset($data["cod_alis"])) {
|
||||
$Ret = \Allegati\ListinoAcquisto::get_filelist($data["cod_alis"], $data["versione"]);
|
||||
} else {
|
||||
$Ret->set_error("Richiesta non valida");
|
||||
}
|
||||
@@ -107,7 +104,7 @@ class Allegati {
|
||||
return \StbActivityFile::cache($key["activity_id"], $key["file_name"], $options);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::STB_FILES_ATTACHED) {
|
||||
return \StbFilesAttached::cache($key["id_attach"], true, array_key_exists("profileDb", $key) ? $key["profileDb"] : null);
|
||||
return \StbFilesAttached::cache($key["id_attach"], true, array_key_exists("profileDb", $key) ? $key["profileDb"] : null, $options);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::DTB_DOC_PDF) {
|
||||
return \PdfDoc::cache($key);
|
||||
@@ -137,10 +134,8 @@ class Allegati {
|
||||
|
||||
if ($sourceType == SourceType::PARTITAMAG) {
|
||||
return Allegati\PartitaMag::upload($key, $file);
|
||||
|
||||
} else if ($sourceType == SourceType::LIBERO) {
|
||||
return Allegati\Libero::upload($file);
|
||||
|
||||
} else if (in_array($sourceType, array(SourceType::ORDCOM, SourceType::ORDACQCOM, SourceType::ORDLAVCOM, SourceType::ORDVENCOM))) {
|
||||
return Allegati\Ordine::upload($key, $file);
|
||||
}
|
||||
@@ -156,16 +151,37 @@ class Allegati {
|
||||
$sourceType = $filter["source_type"];
|
||||
$arr_editableDescrSourceType = $filter["editableDescriptionSourceTypes"];
|
||||
$arr_deletableSourceTypes = $filter["deletableSourceTypes"];
|
||||
$activityId = null;
|
||||
|
||||
if (array_key_exists("activity_id", $filter)) {
|
||||
$activityId = $filter["activity_id"];
|
||||
switch ($sourceType) {
|
||||
case SourceType::LIS_A:
|
||||
$Ret = Allegati\ListinoAcquisto::upload($filter, $fileItem);
|
||||
if ($Ret->is_OK()) {
|
||||
$reta = $Ret->get_data();
|
||||
$item = $reta["item"];
|
||||
unset($item["content"]);
|
||||
$item["source_type"] = $sourceType;
|
||||
$Ret->set_data($item);
|
||||
ob_start();
|
||||
include \Controller::current_gestpath_include("popup-main-tr.php");
|
||||
$html = \Utility\Str::remove_multiple_spaces(ob_get_contents());
|
||||
@ob_end_clean();
|
||||
@ob_end_flush();
|
||||
$Ret->set_string($html)->set_title($item["file_name"]);
|
||||
|
||||
} else if (array_key_exists("cod_jcom", $filter)) {
|
||||
$codJcom = $filter["cod_jcom"];
|
||||
$Ret = \Allegati\Commessa::get_activityId($codJcom);
|
||||
if ($Ret->is_OK()) {
|
||||
$activityId = $Ret->get_string();
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
break;
|
||||
case SourceType::ATTIVITA:
|
||||
$activityId = $filter["activity_id"];
|
||||
break;
|
||||
case SourceType::COMMESSA:
|
||||
$codJcom = $filter["cod_jcom"];
|
||||
$Ret = \Allegati\Commessa::get_activityId($codJcom);
|
||||
if ($Ret->is_OK()) {
|
||||
$activityId = $Ret->get_string();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($activityId)) {
|
||||
@@ -242,7 +258,17 @@ class Allegati {
|
||||
}
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$zipName = "allegati_" . (isset($filter["activity_id"]) ? "attivita_" . $filter["activity_id"] : "commessa_" . $filter["cod_jcom"]) . ".zip";
|
||||
// $zipName = "allegati_" . (isset($filter["activity_id"]) ? "attivita_" . $filter["activity_id"] : "commessa_" . $filter["cod_jcom"]) . ".zip";
|
||||
$zipName = "allegati";
|
||||
|
||||
if (isset($filter["activity_id"])) {
|
||||
$zipName .= "_attivita_" . $filter["activity_id"];
|
||||
} else if (isset($filter["cod_jcom"])) {
|
||||
$zipName .= "_commessa_" . $filter["cod_jcom"];
|
||||
} else if (isset($filter["cod_alis"])) {
|
||||
$zipName .= "_listino_" . $filter["cod_alis"];
|
||||
}
|
||||
|
||||
$Ret = \Utility\File::zipFiles($zipName, $arr_files);
|
||||
}
|
||||
}
|
||||
@@ -258,6 +284,9 @@ class Allegati {
|
||||
if ($sourceType == SourceType::ATTIVITA || $sourceType == SourceType::COMMESSA) {
|
||||
$Ret = \StbActivityFile::remove($key["activity_id"], $key["file_name"]);
|
||||
|
||||
} else if ($sourceType == SourceType::LIS_A) {
|
||||
$Ret = Allegati\ListinoAcquisto::remove($key);
|
||||
|
||||
} else if ($sourceType == SourceType::PARTITAMAG) {
|
||||
$Ret = Allegati\PartitaMag::remove($key);
|
||||
|
||||
@@ -273,11 +302,13 @@ class Allegati {
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$fileData = $Ret->get_data();
|
||||
$mime = $fileData["mime_type"];
|
||||
if (array_key_exists("mime_type", $fileData)) {
|
||||
$mime = $fileData["mime_type"];
|
||||
|
||||
if (Utility\File::isImageFromMimeType($mime)) { // ELIMINA DALLA CACHE/IMAGES LE ANTEPRIME
|
||||
$fileName = pathinfo($fileData["file_name"], PATHINFO_FILENAME);
|
||||
array_map("unlink", glob(Cache::get_filepath(null, "images") . $fileName . "__*.*"));
|
||||
if (Utility\File::isImageFromMimeType($mime)) { // ELIMINA DALLA CACHE/IMAGES LE ANTEPRIME
|
||||
$fileName = pathinfo($fileData["file_name"], PATHINFO_FILENAME);
|
||||
array_map("unlink", glob(Cache::get_filepath(null, "images") . $fileName . "__*.*"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,4 +364,5 @@ include "Commessa.class.php";
|
||||
include "JasperReport.class.php";
|
||||
include "PartitaMag.class.php";
|
||||
include "Libero.class.php";
|
||||
include "Ordine.class.php";
|
||||
include "Ordine.class.php";
|
||||
include "ListinoAcquisto.class.php";
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Allegati;
|
||||
use EntityItem;
|
||||
use Query;
|
||||
use Utility\Compression\GZ;
|
||||
use Utility\File;
|
||||
|
||||
class ListinoAcquisto {
|
||||
|
||||
public static function get_filelist($codAlis, $versione) {
|
||||
$Ret = self::get_items($codAlis, $versione);
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
foreach ($arr_rows as $i => $row) {
|
||||
$arr_rows[$i] = array_pick($row, "id_attach", "file_name", "descrizione", "icon", "icon_style", "mime_type", "last_upd", "size");
|
||||
$arr_rows[$i]["key"] = array_pick($row, "file_name", "id_attach", "cod_alis", "versione");
|
||||
$arr_rows[$i]["source_type"] = SourceType::LIS_A;
|
||||
}
|
||||
$Ret->set_data(array_orderby($arr_rows, "file_name"));
|
||||
}
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function get_items($codAlis, $versione) {
|
||||
$Query = new Query();
|
||||
$Query->importSqlFile("list-fileListino")
|
||||
->setVar("cod_alis", $codAlis)
|
||||
->setVar("versione", $versione);
|
||||
|
||||
$Ret = $Query->toRet()->execute();
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
foreach ($arr_rows as $i => $row) {
|
||||
$mime = File::getMimeTypeFromName($row["file_name"]);
|
||||
$icon = File::getFaIcoFromName($row["file_name"]);
|
||||
|
||||
$arr_rows[$i] = array_merge($arr_rows[$i], array(
|
||||
"size" => $row["file_size"], // unsettare 'original_size'
|
||||
"mime_type" => $mime,
|
||||
"user_creator" => null,
|
||||
"icon" => $icon["name"],
|
||||
"icon_style" => $icon["style"]
|
||||
));
|
||||
}
|
||||
|
||||
$Ret->set_data($arr_rows);
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function upload($key, $fileItem) {
|
||||
$ArlListDataAttach = new \EntityItem("arl_list_data_attach");
|
||||
$ArlListDataAttach->insert()
|
||||
->set("codAlis", $key["cod_alis"])
|
||||
->set("versione", $key["versione"]);
|
||||
|
||||
$Ret = StbFilesAttached::upload($fileItem, $ArlListDataAttach);
|
||||
if ($Ret->is_OK()) {
|
||||
$keyAttach = $Ret->get_data();
|
||||
$keyComplete = array_merge($key, $keyAttach);
|
||||
|
||||
$Ret = self::getFileItem($keyComplete);
|
||||
if ($Ret->is_OK()) {
|
||||
$Ret->set_data(array("key" => $keyComplete, "item" => $Ret->get_data()));
|
||||
}
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function getFileItem($key) {
|
||||
$Query = new \Query;
|
||||
$Query->importSqlFile("list-fileListino")
|
||||
->setVar("cod_alis", $key["cod_alis"])
|
||||
->setVar("versione", $key["versione"])
|
||||
->where("stb_files_attached.id_attach", $key["id_attach"]);
|
||||
|
||||
$Ret = $Query->toRet()->firstRow()->execute();
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$item = $Ret->get_data();
|
||||
if (!is_null($item)) {
|
||||
$Ret->set_data(StbFilesAttached::completeFileItemData($item, SourceType::LIS_A));
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Risorsa non trovata");
|
||||
}
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function remove($key)
|
||||
{
|
||||
return \StbFilesAttached::remove($key["id_attach"]);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ class SourceType {
|
||||
const LOGOLINEA = "logoLinea";
|
||||
const JASPERREPORT = "jasperReport";
|
||||
const NOTIFICATIONIMAGE = "notificationImage";
|
||||
const LIS_A = "listinoAcquisti";
|
||||
|
||||
public static function get_items() {
|
||||
$reflectionClass = new \ReflectionClass(new SourceType);
|
||||
@@ -38,7 +39,8 @@ class SourceType {
|
||||
self::LIBERO => array("title" => "Allegati sfusi", "table" => TableName::STB_FILES_ATTACHED),
|
||||
self::ARTICOLO => array("title" => "Allegati articolo", "table" => TableName::MTB_AART_LINK),
|
||||
self::LOGOLINEA => array("title" => "Logo linea", "table" => TableName::TTB_LINE),
|
||||
self::NOTIFICATIONIMAGE => array("title" => "Immagine notifica", "table" => TableName::STB_FILES_ATTACHED)
|
||||
self::NOTIFICATIONIMAGE => array("title" => "Immagine notifica", "table" => TableName::STB_FILES_ATTACHED),
|
||||
self::LIS_A => array("title" => "Allegati listino", "table" => TableName::STB_FILES_ATTACHED)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Allegati;
|
||||
use Utility\File;
|
||||
|
||||
class StbFilesAttached {
|
||||
|
||||
public static function upload($fileItem, $EntityDetail = null) {
|
||||
@@ -19,7 +21,8 @@ class StbFilesAttached {
|
||||
->set("fileName", $fileItem["name"])
|
||||
->set("description", $fileItem["name"])
|
||||
->set("fileSize", $fileItem["size"])
|
||||
->set("content", base64_encode($content));
|
||||
->set("content", base64_encode($content))
|
||||
->setDatetime("lastUpd", \Utility\Date::getNow());
|
||||
|
||||
if (\EntityItem::is_entityItem($EntityDetail)) {
|
||||
$StbFilesAttached->detail(\Utility\Str::camelCaseEncode($EntityDetail->getType()), $EntityDetail);
|
||||
@@ -47,12 +50,13 @@ class StbFilesAttached {
|
||||
"source_type" => $sourceType,
|
||||
"key" => $key,
|
||||
"file_name" => $item["file_name"],
|
||||
"last_upd" => $item["datetime_attach"],
|
||||
"mime_type" => File::getMimeTypeFromName($item["file_name"]),
|
||||
"size" => $item["file_size"],
|
||||
"user_creator" => $item["user_creator"],
|
||||
"icon" => $icon["name"],
|
||||
"icon_style" => $icon["style"],
|
||||
"descrizione" => $item["descrizione"],
|
||||
"last_upd" => isset($item["last_upd"]) ? $item["last_upd"] : null,
|
||||
"renderUrl" => \Allegati::getRenderedFileUrl(
|
||||
array(
|
||||
"id_attach" => $key["id_attach"],
|
||||
|
||||
@@ -21,11 +21,14 @@ if ($Ret->is_OK()) {
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($arr_files as $item) {
|
||||
include "main-tr.php";
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><?
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
$sourceType = $item["source_type"];
|
||||
$key = Allegati\SourceType::getFileKey($sourceType, $item);
|
||||
$fileName = $item["file_name"];
|
||||
@@ -12,30 +12,29 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
|
||||
?>
|
||||
<tr title="Doppio click per scaricare <?= $fileNameTruncated ?>" data-source_type="<?= $sourceType ?>"
|
||||
data-key="<?= $b64Key ?>" data-file_name="<?= $fileName ?>">
|
||||
<td class="vertical-middle" style="width: 30px;"><?
|
||||
<td class="vertical-middle" style="width: 30px;">
|
||||
<?php
|
||||
if ($isImage) {
|
||||
$urlThumb = Allegati::getRenderedFileUrl($key, $sourceType, array("renew" => false, "resize" => array(30, 30), "quality" => 50, "sadImageOnError" => true));
|
||||
$urlOriginal = Allegati::getRenderedFileUrl($key, $sourceType, array("renew" => false, "resize" => array(1600, 1200), "sadImageOnError" => true));
|
||||
?>
|
||||
<img class="img-rounded image-thumbnail cursor-pointer" src="<?= $urlThumb ?>"
|
||||
data-url="<?= $urlOriginal ?>" /><?
|
||||
} else { ?>
|
||||
<i class="fa fa-2x fa-<?= $item["icon"] ?> <?= $item["icon_style"] ?>"></i><?
|
||||
} ?>
|
||||
data-url="<?= $urlOriginal ?>"/>
|
||||
<?php } else { ?>
|
||||
<i class="fa fa-2x fa-<?= $item["icon"] ?> <?= $item["icon_style"] ?>"></i>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="vertical-middle" style="<?= $isDescrizioneEditabile ? "max-width: 110px;" : "max-width: 150px;" ?>"><?
|
||||
if ($isImage) {
|
||||
?>
|
||||
<td class="vertical-middle" style="<?= $isDescrizioneEditabile ? "max-width: 110px;" : "max-width: 150px;" ?>">
|
||||
<?php if ($isImage) { ?>
|
||||
<a href="<?= $downloadUrl ?>" title="<?= $fileName ?>"
|
||||
class="image-thumbnail cursor-pointer"><?= $fileNameTruncated ?></a><?
|
||||
} else { ?>
|
||||
class="image-thumbnail cursor-pointer"><?= $fileNameTruncated ?></a>
|
||||
<?php } else { ?>
|
||||
<a href="<?= $downloadUrl ?>" title="<?= $fileName ?>"
|
||||
class="btDownloadAllegato cursor-pointer"><?= $fileNameTruncated ?></a><?
|
||||
} ?>
|
||||
class="btDownloadAllegato cursor-pointer"><?= $fileNameTruncated ?></a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="vertical-middle"><?
|
||||
if ($isDescrizioneEditabile && $sourceType == Allegati\SourceType::ATTIVITA) {
|
||||
?>
|
||||
<td class="vertical-middle">
|
||||
<?php if ($isDescrizioneEditabile && $sourceType == Allegati\SourceType::ATTIVITA) { ?>
|
||||
<div class="input-group">
|
||||
<input class="txt_descrizione input-sm form-control" type="text" max="255"
|
||||
value="<?= nullIfBlank($item["descrizione"]) ?>" readonly autocomplete="off"/>
|
||||
@@ -48,10 +47,12 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
|
||||
<i class="fas fa-pencil text-primary"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div><?
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
echo $item["descrizione"];
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="small text-right text-muted vertical-middle">
|
||||
<small><?= Utility\File::formatSize($item["size"]) ?></small></td>
|
||||
@@ -59,19 +60,19 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
|
||||
title="<?= \Utility\Date\Format::DMYHMS($item["last_upd"]) ?>">
|
||||
<small><?= \Utility\Date::format($item["last_upd"], Format::strftimeDMy) ?></small></td>
|
||||
<td class="vertical-middle">
|
||||
<div class="btn-group btn-group-sm"><?
|
||||
if ($isEliminabile && ($sourceType == Allegati\SourceType::ATTIVITA || $sourceType == Allegati\SourceType::COMMESSA)) {
|
||||
?>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<?php if ($isEliminabile && ($sourceType == Allegati\SourceType::ATTIVITA || $sourceType == Allegati\SourceType::COMMESSA || $sourceType == Allegati\SourceType::LIS_A)) { ?>
|
||||
<button class="btn btn-default btRemoveAllegato" title="Rimuovi">
|
||||
<i class="fas fa-trash text-danger"></i>
|
||||
</button><?
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
if (Messenger::is_enabled()) {
|
||||
?>
|
||||
<button class="btn btn-default bt_sendAllegato" title="Allega ad un messaggio">
|
||||
<i class="fa fa-envelope text-info"></i>
|
||||
</button><?
|
||||
} ?>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,6 +1,8 @@
|
||||
function ModalAllegati() {
|
||||
this._activityId = null;
|
||||
this._codJcom = null;
|
||||
this._codAlis = null;
|
||||
this._versione = null;
|
||||
this._filter = {};
|
||||
this._depth = 0; // livello di attivita sotto commessa / -1 = tutte le attivita
|
||||
this._$button = null;
|
||||
@@ -90,6 +92,16 @@ ModalAllegati.prototype.waitLoader = function (v) {
|
||||
return this;
|
||||
};
|
||||
|
||||
ModalAllegati.prototype.codAlis = function (v) {
|
||||
this._codAlis = v;
|
||||
return this;
|
||||
};
|
||||
|
||||
ModalAllegati.prototype.versione = function (v) {
|
||||
this._versione = v;
|
||||
return this;
|
||||
};
|
||||
|
||||
ModalAllegati.prototype._getFilter = function () {
|
||||
var self = this;
|
||||
var filter = {
|
||||
@@ -101,14 +113,15 @@ ModalAllegati.prototype._getFilter = function () {
|
||||
editableDescriptionSourceTypes: self._editableDescriptionSourceTypes
|
||||
};
|
||||
|
||||
if (!is_null(self._activityId)) {
|
||||
if (!is_null(self._codAlis)) {
|
||||
filter.cod_alis = self._codAlis;
|
||||
filter.versione = self._versione;
|
||||
} else if (!is_null(self._activityId)) {
|
||||
filter.activity_id = self._activityId;
|
||||
|
||||
} else if (!is_null(self._codJcom)) {
|
||||
filter.cod_jcom = self._codJcom;
|
||||
filter.depth = self._depth;
|
||||
filter.onlyCurrentUser = self._flagOnlyCurrentUser;
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -129,8 +142,17 @@ ModalAllegati.prototype.open = function () {
|
||||
.waitToast(self._waitLoader)
|
||||
.noticeAsModal()
|
||||
.onSuccess(function (ret) {
|
||||
// let title = "Allegati " + (!is_null(self._activityId) ? "dell'attivita" : "della commessa " + filter.cod_jcom);
|
||||
|
||||
var title = "Allegati " + (!is_null(self._activityId) ? "dell'attivita" : "della commessa " + filter.cod_jcom);
|
||||
let title = "Allegati";
|
||||
|
||||
if (!is_null(self._activityId)) {
|
||||
title += " dell'attivita"
|
||||
} else if (!is_null(self._codJcom)) {
|
||||
title += " della commessa " + self._codJcom
|
||||
} else if (!is_null(self._codAlis)) {
|
||||
title += " del listino " + self._codAlis
|
||||
}
|
||||
|
||||
self.onBeforeShow(function ($div) {
|
||||
self._onRefreshSourceTypeTab();
|
||||
|
||||
@@ -106,11 +106,12 @@ var _allegati = {
|
||||
remove: function ($tr) {
|
||||
var self = this;
|
||||
var d = $.Deferred();
|
||||
|
||||
var sourceType = $tr.getDataAttr("source_type");
|
||||
var key = $tr.getDataAttr("key");
|
||||
var fileName = $tr.getDataAttr("file_name");
|
||||
|
||||
if ([self.sourceTypes.ATTIVITA, self.sourceTypes.LIBERO, self.sourceTypes.COMMESSA].indexOf(sourceType) >= 0) {
|
||||
if ([self.sourceTypes.ATTIVITA, self.sourceTypes.LIBERO, self.sourceTypes.COMMESSA, self.sourceTypes.LIS_A].indexOf(sourceType) >= 0) {
|
||||
var shortenFilename = shorten_filename(fileName, 20);
|
||||
var messageTitle = null;
|
||||
var messageFileDelete = "Stai eliminando <b>" + shortenFilename + "</b>";
|
||||
@@ -119,7 +120,7 @@ var _allegati = {
|
||||
if ($tr.find("img.image-thumbnail").exists()) {
|
||||
var imgResizedUri = _allegati.getRenderedFileUrl(key, sourceType, {
|
||||
renew: false,
|
||||
resize: [100, 100],
|
||||
resize: [200, 200],
|
||||
quality: 80
|
||||
});
|
||||
yesText = "Rimuovi";
|
||||
@@ -135,7 +136,8 @@ var _allegati = {
|
||||
message: messageFileDelete,
|
||||
title: messageTitle,
|
||||
btNo: "cancel",
|
||||
btYes: {text: yesText, icon: "trash-o", size: {sm: 5}}
|
||||
btYes: {text: yesText, icon: "trash-o", size: {sm: 5}},
|
||||
style: "danger"
|
||||
})
|
||||
.$toDisable($tr)
|
||||
.$button($tr.find(".btRemoveAllegato"))
|
||||
|
||||
12
public_html/gest-lib/allegati/sql/list-fileListino.sql
Normal file
12
public_html/gest-lib/allegati/sql/list-fileListino.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
SELECT stb_files_attached.id_attach,
|
||||
stb_files_attached.file_name,
|
||||
stb_files_attached.description AS descrizione,
|
||||
stb_files_attached.datetime_attach as last_upd,
|
||||
stb_files_attached.file_size,
|
||||
stb_files_attached.user_name AS user_creator,
|
||||
alda.versione,
|
||||
alda.cod_alis
|
||||
FROM stb_files_attached
|
||||
inner join arl_list_data_attach alda on stb_files_attached.id_attach = alda.id_attach
|
||||
WHERE alda.versione = '[versione]'
|
||||
AND alda.cod_alis = '[cod_alis]'
|
||||
@@ -0,0 +1,237 @@
|
||||
<?php
|
||||
|
||||
class ContrattiDiAcquisto {
|
||||
public static function _moduleDatasource($filter) {
|
||||
$Ret = new Ret;
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = array(//array("id" => "name", "data" => array()),
|
||||
);
|
||||
|
||||
$Ret->set_data($retData);
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function getListContratti($scaduti = false) {
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("list-contratti")
|
||||
->setVar("userName", User::get_current_username());
|
||||
|
||||
if ($scaduti) {
|
||||
$query->where("contratti.data_fine < Cast(GETDATE() as date)");
|
||||
} else {
|
||||
$query->where("contratti.data_fine >= Cast(GETDATE() as date)");
|
||||
}
|
||||
|
||||
return $query->toRet()->execute();
|
||||
}
|
||||
|
||||
public static function getTestataOfferta($codAlis, $versione) {
|
||||
if (empty($codAlis) || empty($versione)) {
|
||||
$ret = new Ret();
|
||||
return $ret->set_error("codAlis o versione vuoti.");
|
||||
}
|
||||
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->importSqlFile("offerta-testata")
|
||||
->setVar("codAlis", $codAlis)
|
||||
->setVar("versione", $versione)
|
||||
->firstRow()
|
||||
->toRet();
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
public static function getRigheOfferta($codAlis, $versione) {
|
||||
if (isset($codAlis) && isset($versione)) {
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->importSqlFile("offerta-righe")
|
||||
->setVar("codAlis", $codAlis)
|
||||
->setVar("versione", $versione)
|
||||
->toRet();
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
$ret = new Ret();
|
||||
|
||||
$ret->set_data(array());
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function searchFornitore($data, $codAnag = null) {
|
||||
$ret = new Ret();
|
||||
$q = trim(strtolower($data["q"]));
|
||||
|
||||
if (strlen($q) > 0 || $codAnag) {
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("search-fornitore");
|
||||
|
||||
if ($codAnag) {
|
||||
$query->where("gtb_anag.cod_anag = '$codAnag'");
|
||||
} else {
|
||||
$query->where("gtb_anag.cod_anag+';'+gtb_anag.rag_soc LIKE '%[Q]%'")
|
||||
->setVar("Q", str_replace("'", "''", $q));
|
||||
}
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
} else {
|
||||
$ret->set_error("Filtro ricerca fornitori nullo");
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function searchMediatore($data) {
|
||||
$ret = new Ret();
|
||||
$q = trim(strtolower($data["q"]));
|
||||
|
||||
if (strlen($q) > 0 ) {
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("search-mediatore");
|
||||
|
||||
$query->where("cod_vage+' '+rag_soc LIKE '%[Q]%'")
|
||||
->setVar("Q", str_replace("'", "''", $q));
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
} else {
|
||||
$ret->set_error("Filtro ricerca mediatori nullo");
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function searchVettore($data, $codVvet = null) {
|
||||
$ret = new Ret();
|
||||
$q = trim(strtolower($data["q"]));
|
||||
|
||||
if (strlen($q) > 0 || $codVvet) {
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("search-vettore");
|
||||
|
||||
if ($codVvet) {
|
||||
$query->where("cod_vvet = '$codVvet'");
|
||||
} else {
|
||||
$query->where("cod_vvet+' '+rag_soc LIKE '%[Q]%'")
|
||||
->setVar("Q", str_replace("'", "''", $q));
|
||||
}
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
} else {
|
||||
$ret->set_error("Filtro ricerca vettori nullo");
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function searchArticolo($data) {
|
||||
$ret = new Ret();
|
||||
$q = trim(strtolower($data["q"]));
|
||||
|
||||
if (strlen($q) > 0) {
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("search-articolo")
|
||||
->setVar("q", str_replace("'", "''", $q))
|
||||
->setVar("userName", User::get_current_username());
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function searchPrezzo($data)
|
||||
{
|
||||
$query = new Query();
|
||||
|
||||
$query->importSqlFile("search-prezzo")
|
||||
->setVar("cod_alis", $data["cod_alis"])
|
||||
->setVar("cod_mart", $data["cod_mart"]);
|
||||
|
||||
return $query->toRet()->firstRow()->execute();
|
||||
}
|
||||
|
||||
public static function saveOfferta($data) {
|
||||
if (empty($data["codAnag"])) {
|
||||
$ret = new Ret();
|
||||
|
||||
return $ret->set_error("Cod anag vuoto.");
|
||||
}
|
||||
|
||||
$imsApi = new IMSApi();
|
||||
|
||||
$body = new EntityItem();
|
||||
|
||||
$body->set("codAnag", $data["codAnag"]);
|
||||
|
||||
$listMtbLisaData = new EntityArray();
|
||||
|
||||
foreach ($data["rows"] as $row) {
|
||||
$mtbLisaData = new EntityItem("mtb_lisa_data");
|
||||
|
||||
$mtbLisaData
|
||||
->insert_or_update()
|
||||
->set("versione", $data["versione"])
|
||||
->set("codMart", $row["codMart"])
|
||||
->set("untMisAcq", $row["untMisAcq"])
|
||||
->set("qtaAcqContr", $row["giacenza"])
|
||||
->set("przAcq", $row["przAcq"])
|
||||
->set("rapConvAcq", 1)
|
||||
->set("perc1", $row["perc1"])
|
||||
->set("perc2", $row["perc2"])
|
||||
->set("perc3", $row["perc3"])
|
||||
->set("perc4", $row["perc4"])
|
||||
->set("percProv", $row["percProv"])
|
||||
->set("valProv", $row["valProv"])
|
||||
->set("valSpese", $row["valSpese"])
|
||||
;
|
||||
|
||||
if (isset($row["tipoVariazione"])) {
|
||||
$mtbLisaData->set("tipoVariazione", $row["tipoVariazione"]);
|
||||
}
|
||||
|
||||
$listMtbLisaData->append($mtbLisaData);
|
||||
}
|
||||
|
||||
$atbListData = new EntityItem("atb_list_data");
|
||||
|
||||
$atbListData
|
||||
->insert_or_update()
|
||||
->set("versione", $data["versione"])
|
||||
->setDate("dataIniz", $data["dataIniz"])
|
||||
->setDate("dataFine", $data["dataFine"])
|
||||
->set("mtbLisaData", $listMtbLisaData)
|
||||
->set("codVage", $data["codVage"])
|
||||
->set("codVvet", $data["codVvet"]);
|
||||
|
||||
$body->set("atbListData", $atbListData, false, true);
|
||||
|
||||
$imsApi
|
||||
->post("savePurchaseAgreement")
|
||||
->body($body);
|
||||
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function deleteContratto($data) {
|
||||
$AtbListData = new EntityItem("atb_list_data");
|
||||
|
||||
$AtbListData->delete()
|
||||
->set("codAlis", $data["codAlis"])
|
||||
->set("versione", $data["versione"]);
|
||||
|
||||
return $AtbListData->send();
|
||||
}
|
||||
}
|
||||
1
public_html/gest-lib/contratti_di_acquisto/css/main.css
Normal file
1
public_html/gest-lib/contratti_di_acquisto/css/main.css
Normal file
@@ -0,0 +1 @@
|
||||
.table>thead:first-child>tr:first-child>th{border-top:1px solid #ddd}.table>thead>tr>th{border-bottom:unset}/*# sourceMappingURL=main.css.map */
|
||||
BIN
public_html/gest-lib/contratti_di_acquisto/icon.png
Normal file
BIN
public_html/gest-lib/contratti_di_acquisto/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
35
public_html/gest-lib/contratti_di_acquisto/include/ajax.php
Normal file
35
public_html/gest-lib/contratti_di_acquisto/include/ajax.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
if (isset($_GET["popupOfferta"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["popupOfferta"]);
|
||||
include "popup-offerta.php";
|
||||
} else if (isset($_GET["getListContratti"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["getListContratti"]);
|
||||
ContrattiDiAcquisto::getListContratti(isset($data["scaduti"]) ? $data["scaduti"] : false)->display();
|
||||
} else if (isset($_POST["getRigheOfferta"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["getRigheOfferta"]);
|
||||
ContrattiDiAcquisto::getRigheOfferta($data["codAlis"], $data["versione"])->display();
|
||||
} else if (isset($_GET["searchFornitore"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["searchFornitore"]);
|
||||
ContrattiDiAcquisto::searchFornitore($data)->display();
|
||||
} else if (isset($_GET["searchMediatore"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["searchMediatore"]);
|
||||
ContrattiDiAcquisto::searchMediatore($data)->display();
|
||||
} else if (isset($_GET["searchVettore"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["searchVettore"]);
|
||||
ContrattiDiAcquisto::searchVettore($data)->display();
|
||||
} else if (isset($_GET["searchArticolo"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["searchArticolo"]);
|
||||
ContrattiDiAcquisto::searchArticolo($data)->display();
|
||||
} else if (isset($_GET["searchPrezzo"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["searchPrezzo"]);
|
||||
ContrattiDiAcquisto::searchPrezzo($data)->display();
|
||||
} else if (isset($_POST["saveOfferta"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["saveOfferta"]);
|
||||
ContrattiDiAcquisto::saveOfferta($data)->display();
|
||||
} else if (isset($_GET["deleteContratto"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["deleteContratto"]);
|
||||
ContrattiDiAcquisto::deleteContratto($data)->display();
|
||||
} else if (Controller::is_ajaxRequest()) {
|
||||
$Ret = new Ret;
|
||||
$Ret->set_errorCode(ErrorHandler::UNEXPECTED_AJAX_METHOD)->display();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-success icbtn btn-lg mb-10" id="nuovaOfferta" type="button">
|
||||
<span><i class="fa fa-plus"></i> Nuovo Contratto</span>
|
||||
</button>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<h3 class="panel-heading icpanel">
|
||||
In Corso
|
||||
</h3>
|
||||
|
||||
<table id="listContratti" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">N. Contratto</th>
|
||||
<th rowspan="2">Cod. Listino</th>
|
||||
<th rowspan="2">Descrizione</th>
|
||||
<th rowspan="2">Data inizio</th>
|
||||
<th rowspan="2">Data fine</th>
|
||||
<th rowspan="2">Articolo</th>
|
||||
<th colspan="3">Quantità</th>
|
||||
<th rowspan="2">Saldo quantità</th>
|
||||
<th rowspan="2"></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Contratto</th>
|
||||
<th>Ordinata</th>
|
||||
<th>Consegnata</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td colspan="11" style="overflow: hidden">
|
||||
<i class="fa fa-4x fa-spin fa-spinner-third fa-primary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
28
public_html/gest-lib/contratti_di_acquisto/include/main.php
Normal file
28
public_html/gest-lib/contratti_di_acquisto/include/main.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$view = "in-corso";
|
||||
|
||||
if (isset($_GET["in-corso"])) {
|
||||
$view = "in-corso";
|
||||
} else if (isset($_GET["scaduti"])) {
|
||||
$view = "scaduti";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="container" class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?php
|
||||
switch ($view) {
|
||||
case "in-corso":
|
||||
include "in-corso.php";
|
||||
break;
|
||||
case "scaduti":
|
||||
include "scaduti.php";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
$ret = new Ret();
|
||||
$testataOfferta = null;
|
||||
$arr_files = array();
|
||||
if (isset($data["codAlis"]) && isset($data["versione"])) {
|
||||
$ret = ContrattiDiAcquisto::getTestataOfferta($data["codAlis"], $data["versione"]);
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$testataOfferta = $ret->get_data();
|
||||
}
|
||||
|
||||
$RetAllegati = Allegati\ListinoAcquisto::get_filelist($data["codAlis"], $data["versione"]);
|
||||
$arr_files = $RetAllegati->is_OK() ? $RetAllegati->get_data() : array();
|
||||
}
|
||||
|
||||
$editMode = isset($testataOfferta);
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body header">
|
||||
<div class="row">
|
||||
<?php if ($editMode) { ?>
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<div>
|
||||
Fornitore
|
||||
</div>
|
||||
|
||||
<div class="font-weight-bold">
|
||||
<?= $testataOfferta["cod_anag"] ?> - <?= $testataOfferta["rag_soc"] ?>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="codAnag" name="codAnag" value="<?= $testataOfferta["cod_anag"] ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<div>
|
||||
Listino
|
||||
</div>
|
||||
|
||||
<div class="font-weight-bold">
|
||||
<?= $testataOfferta["cod_alis"] ?> - <?= $testataOfferta["descrizione_lisa"] ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-xs-12 col-md-3">
|
||||
<label for="searchCodAnag">
|
||||
Fornitore
|
||||
</label>
|
||||
|
||||
<input type="hidden" id="codAnag" name="codAnag">
|
||||
<input type="text" class="form-control" id="searchCodAnag" name="searchCodAnag" data-required>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<label for="searchCodVage">
|
||||
Mediatore
|
||||
</label>
|
||||
|
||||
<input type="hidden" id="codVage" name="codVage"
|
||||
value="<?= $testataOfferta["cod_vage"] ?>">
|
||||
<input type="text" class="form-control" id="searchCodVage" name="searchCodVage"
|
||||
value="<?= $testataOfferta["rag_soc_age"] ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<label for="searchCodVvet">
|
||||
Vettore
|
||||
</label>
|
||||
|
||||
<input type="hidden" id="codVvet" name="codVvet"
|
||||
value="<?= $testataOfferta["cod_vvet"] ?>">
|
||||
<input type="text" class="form-control" id="searchCodVvet" name="searchCodVvet"
|
||||
value="<?= $testataOfferta["rag_soc_vet"] ?>">
|
||||
</div>
|
||||
|
||||
<?php if ($editMode) { ?>
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<label for="dataIniz">
|
||||
Data Inizio
|
||||
</label>
|
||||
|
||||
<input type="date" class="form-control" id="dataIniz" name="dataIniz" readonly value="<?= \Utility\Date::format($testataOfferta["data_iniz"], Format::strftimeYMD) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<label for="dataFine">
|
||||
Data Fine
|
||||
</label>
|
||||
|
||||
<input type="date" class="form-control" id="dataFine" name="dataFine" data-required
|
||||
value="<?= \Utility\Date::format($testataOfferta["data_fine"], Format::strftimeYMD) ?>"
|
||||
min="<?= \Utility\Date::format($testataOfferta["data_iniz"], Format::strftimeYMD) ?>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-xs-12 col-md-3">
|
||||
<label for="dataInizFine">
|
||||
Data Inizio - Fine
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control" id="dataInizFine" name="dataInizFine">
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-2"></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-xs-12 col-md-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($editMode) { ?>
|
||||
<div class="panel-body">
|
||||
<button data-cod_alis="<?= $testataOfferta["cod_alis"] ?>" data-versione="<?= $testataOfferta["versione"] ?>" type="button" class="btn btn-success icbtn" id="mostraAllegati">
|
||||
<i class="fal fa-paperclip"></i> Allegati <span class="badge badge-sm"><?= count($arr_files) ?></span>
|
||||
</button>
|
||||
<button data-cod_alis="<?= $testataOfferta["cod_alis"] ?>" data-versione="<?= $testataOfferta["versione"] ?>" type="button" class="btn btn-danger icbtn" id="deleteContratto">
|
||||
<i class="fas fa-trash"></i> Elimina Contratto
|
||||
</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<table id="listRigheOfferta" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">Articolo</th>
|
||||
<th rowspan="2">Descrizione</th>
|
||||
<th rowspan="2">Unità di Misura</th>
|
||||
<th colspan="3">Quantità</th>
|
||||
<th rowspan="2">Prezzo acquisto</th>
|
||||
<th colspan="4">Sconto</th>
|
||||
<th rowspan="2">Perc. Prov.</th>
|
||||
<th rowspan="2">Val. Prov.</th>
|
||||
<th rowspan="2">Val. Spese</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Contratto</th>
|
||||
<th>Ordinata</th>
|
||||
<th>Consegnata</th>
|
||||
<th>1</th>
|
||||
<th>2</th>
|
||||
<th>3</th>
|
||||
<th>4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td colspan="11" style="overflow: hidden">
|
||||
<i class="fa fa-5x fa-spin fa-spinner-third fa-primary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$html = ob_get_clean();
|
||||
$ret->set_string($html);
|
||||
}
|
||||
|
||||
$ret->display();
|
||||
@@ -0,0 +1,36 @@
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-primary">
|
||||
<h3 class="panel-heading icpanel">
|
||||
Scaduti
|
||||
</h3>
|
||||
|
||||
<table id="listContratti" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">Cod. Listino</th>
|
||||
<th rowspan="2">Descrizione</th>
|
||||
<th rowspan="2">Data inizio</th>
|
||||
<th rowspan="2">Data fine</th>
|
||||
<th rowspan="2">Articolo</th>
|
||||
<th colspan="3">Quantità</th>
|
||||
<th rowspan="2">Saldo quantità</th>
|
||||
<th rowspan="2"></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Contratto</th>
|
||||
<th>Ordinata</th>
|
||||
<th>Consegnata</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td colspan="10" style="overflow: hidden">
|
||||
<i class="fa fa-4x fa-spin fa-spinner-third fa-primary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
575
public_html/gest-lib/contratti_di_acquisto/js/PopupOfferta.js
Normal file
575
public_html/gest-lib/contratti_di_acquisto/js/PopupOfferta.js
Normal file
@@ -0,0 +1,575 @@
|
||||
function PopupOfferta() {
|
||||
this.modalBox = null;
|
||||
|
||||
this._codAlis = null;
|
||||
this._versione = null;
|
||||
}
|
||||
|
||||
PopupOfferta.prototype.isEditMode = function () {
|
||||
return !is_null(this._codAlis) && !is_null(this._versione);
|
||||
};
|
||||
|
||||
PopupOfferta.prototype.codAlis = function (codAlis) {
|
||||
this._codAlis = codAlis;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
PopupOfferta.prototype.versione = function (versione) {
|
||||
this._versione = versione;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
PopupOfferta.prototype.open = function () {
|
||||
let self = this;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
new Ajax()
|
||||
.get("popupOfferta")
|
||||
.data({
|
||||
codAlis: self._codAlis,
|
||||
versione: self._versione,
|
||||
})
|
||||
.noticeAsModal()
|
||||
.onSuccess(function (popupRet) {
|
||||
self.modalBox = new ModalBox();
|
||||
|
||||
self.modalBox
|
||||
.title(self._versione ? `Contratto n. ${self._versione}` : "Nuovo Contratto")
|
||||
.okCancel()
|
||||
.btOK({
|
||||
text: "Conferma",
|
||||
onClick(e, $bt, $div) {
|
||||
const dataTable = $div.find("#listRigheOfferta").DataTable();
|
||||
const data = _checkForm.checkData($div.find(".header"));
|
||||
|
||||
data.codAlis = self._codAlis;
|
||||
data.versione = self._versione;
|
||||
|
||||
if (data.dataInizFine) {
|
||||
const dates = data.dataInizFine.split(" - ");
|
||||
|
||||
data.dataIniz = dates[0];
|
||||
data.dataFine = dates[1];
|
||||
}
|
||||
|
||||
data.rows = dataTable.$("tr").get()
|
||||
.filter(tr => {
|
||||
const $tr = $(tr);
|
||||
|
||||
return isNotEmpty($tr.find("[name='codMart']").val()) &&
|
||||
$tr.find("[name='giacenza']").val() > 0;
|
||||
})
|
||||
.map(tr => {
|
||||
const rowData = {};
|
||||
|
||||
$(tr).find("input, select").get()
|
||||
.forEach(input => {
|
||||
rowData[input.name] = input.value;
|
||||
});
|
||||
|
||||
return rowData;
|
||||
});
|
||||
|
||||
if (data && data.rows.length > 0) {
|
||||
new Ajax()
|
||||
.post("saveOfferta")
|
||||
.data(data)
|
||||
.waitModal("Salvataggio offerta..")
|
||||
.noticeAsModal()
|
||||
.onSuccess({
|
||||
toast: {message: "Contratto salvato correttamente."},
|
||||
callback(ret) {
|
||||
self.modalBox.close();
|
||||
|
||||
resolve(ret);
|
||||
}
|
||||
})
|
||||
.onError({
|
||||
toast: {message: "Errore nel salvataggio del contratto."}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
})
|
||||
.content(popupRet.returnString)
|
||||
.gridSize({xs: 12})
|
||||
.style(self.isEditMode() ? "primary" : "success")
|
||||
.backhash()
|
||||
.onClose(function () {
|
||||
reject();
|
||||
|
||||
delete self;
|
||||
})
|
||||
.onBeforeShow(function ($div) {
|
||||
const $okBtn = $div.find(".modal-btn-ok");
|
||||
|
||||
if (!self.isEditMode()) {
|
||||
$okBtn.disabled(true);
|
||||
}
|
||||
|
||||
$div.find("#searchCodAnag").bsautocomplete({
|
||||
minLength: 3,
|
||||
sourceAjaxAction: "searchFornitore",
|
||||
item_labelKey: "rag_soc",
|
||||
item_labelSmallKey: ["cod_anag"],
|
||||
item_labelSubKey: ["indirizzo", "citta", "prov"],
|
||||
onSelect: function (e, result, $this) {
|
||||
$this.blur();
|
||||
$this.val(result.rag_soc);
|
||||
$div.find("#codAnag").val(result.cod_anag);
|
||||
|
||||
$okBtn.disabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
$div.find("#searchCodVage").bsautocomplete({
|
||||
minLength: 3,
|
||||
sourceAjaxAction: "searchMediatore",
|
||||
item_labelKey: "rag_soc",
|
||||
item_labelSmallKey: ["cod_vage"],
|
||||
onSelect: function (e, result, $this) {
|
||||
$this.blur();
|
||||
$this.val(result.rag_soc);
|
||||
$div.find("#codVage").val(result.cod_vage);
|
||||
|
||||
$okBtn.disabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
$div.find("#searchCodVvet").bsautocomplete({
|
||||
minLength: 3,
|
||||
sourceAjaxAction: "searchVettore",
|
||||
item_labelKey: "rag_soc",
|
||||
item_labelSmallKey: ["cod_vvet"],
|
||||
onSelect: function (e, result, $this) {
|
||||
$this.blur();
|
||||
$this.val(result.rag_soc);
|
||||
$div.find("#codVvet").val(result.cod_vvet);
|
||||
|
||||
$okBtn.disabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
const $dataInizFine = $div.find("#dataInizFine");
|
||||
|
||||
$dataInizFine.daterangepicker({
|
||||
"parentEl": $div,
|
||||
"minDate": moment(),
|
||||
"showDropdowns": true,
|
||||
autoApply: true,
|
||||
locale: {
|
||||
format: "DD/MM/YYYY"
|
||||
}
|
||||
});
|
||||
|
||||
$div.find("#mostraAllegati").click(function () {
|
||||
let $bt = $(this);
|
||||
|
||||
if (_allegati.isLoaded() && _allegati.sourceTypes) {
|
||||
let modalAllegati = new ModalAllegati();
|
||||
|
||||
modalAllegati
|
||||
.codAlis($bt.closest("[data-cod_alis]").getDataAttr("cod_alis"))
|
||||
.versione($bt.closest("[data-versione]").getDataAttr("versione"))
|
||||
.sourceTypes([_allegati.sourceTypes.LIS_A])
|
||||
.allowUpload([_allegati.sourceTypes.LIS_A])
|
||||
.allowDelete([_allegati.sourceTypes.LIS_A])
|
||||
.editableDescription([_allegati.sourceTypes.LIS_A])
|
||||
.$button($bt)
|
||||
.onChange(function (c) {
|
||||
$bt.find(".badge").bs_element_setStyle(c > 0 ? "primary" : "default").text(c);
|
||||
})
|
||||
.open();
|
||||
}
|
||||
});
|
||||
|
||||
$div.find("#deleteContratto").click(function () {
|
||||
new Ajax()
|
||||
.get("deleteContratto")
|
||||
.data({
|
||||
codAlis: self._codAlis,
|
||||
versione: self._versione
|
||||
})
|
||||
.confirmModal({
|
||||
style: "danger",
|
||||
title: "Conferma Eliminazione",
|
||||
message: `
|
||||
<div class="text-center">
|
||||
<i class="fas fa-5x fa-exclamation-triangle text-danger"></i><br>
|
||||
<h4 class="mt-10">
|
||||
Confermi di voler eliminare il contratto n. <b>${self._versione}</b>?
|
||||
</h4>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
.$button($(this))
|
||||
.waitToast("Cancellazione contratto...")
|
||||
.noticeAsToast()
|
||||
.onSuccess({
|
||||
toast: {message: "Contratto eliminato correttamente."},
|
||||
callback: () => {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
});
|
||||
|
||||
})
|
||||
.onShow(function ($div) {
|
||||
$div.find("#searchCodAnag").focus();
|
||||
|
||||
new Ajax()
|
||||
.post("getRigheOfferta")
|
||||
.data({
|
||||
codAlis: self._codAlis,
|
||||
versione: self._versione,
|
||||
})
|
||||
.onSuccess(function (ret) {
|
||||
if (ret.returnData) {
|
||||
const data = ret.returnData;
|
||||
|
||||
const $listRigheOfferta = $div.find("#listRigheOfferta");
|
||||
|
||||
const dataTable = $listRigheOfferta.DataTable({
|
||||
autoWidth: false,
|
||||
language: _APP.dataTableLangIta,
|
||||
dom: "<'panel-body'<'row'<'col-sm-6'l><'col-sm-6'f>>>" +
|
||||
"<'row'<'col-sm-12'<'table-responsive'tr>>>" +
|
||||
"<'panel-footer'<'row'<'col-sm-6'i><'col-sm-6'p>>>",
|
||||
data,
|
||||
columns: [
|
||||
{
|
||||
data: "cod_mart",
|
||||
render(data, type, row) {
|
||||
if (type === "display") {
|
||||
return `<input type="text" class="form-control cod-mart" id="codMart" name="codMart" value="${data}" ${row.newRow ? "" : "readonly"}>`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{data: "descrizione_art"},
|
||||
{
|
||||
data: "unt_mis_acq",
|
||||
render(data, type, row) {
|
||||
if (type === "display") {
|
||||
const $select = $("<select>", {
|
||||
name: "untMisAcq",
|
||||
id: "untMisAcq",
|
||||
class: "form-control",
|
||||
"data-required": true
|
||||
});
|
||||
|
||||
if (data) {
|
||||
const option = new Option(data, data, false, true);
|
||||
|
||||
$select.append(option);
|
||||
}
|
||||
|
||||
if (row.unt_mis && row.unt_mis !== data) {
|
||||
row.arrUntMisAcq = [];
|
||||
|
||||
row.arrUntMisAcq.push(row.unt_mis);
|
||||
}
|
||||
|
||||
if (row.unt_mis2 && row.unt_mis2 !== data) {
|
||||
if (!row.arrUntMisAcq) {
|
||||
row.arrUntMisAcq = [];
|
||||
}
|
||||
|
||||
row.arrUntMisAcq.push(row.unt_mis2);
|
||||
}
|
||||
|
||||
if (row.unt_mis3 && row.unt_mis3 !== data) {
|
||||
if (!row.arrUntMisAcq) {
|
||||
row.arrUntMisAcq = [];
|
||||
}
|
||||
|
||||
row.arrUntMisAcq.push(row.unt_mis3);
|
||||
}
|
||||
|
||||
if (row.arrUntMisAcq && row.arrUntMisAcq.length > 0) {
|
||||
row.arrUntMisAcq.forEach(untMis => {
|
||||
const option = new Option(untMis, untMis, false, false);
|
||||
|
||||
$select.append(option);
|
||||
});
|
||||
}
|
||||
|
||||
return $select.outerHtml();
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "qta_acq_contr",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="giacenza" name="giacenza" value="${data}" min="0">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{data: "qta_ord"},
|
||||
{data: "qta_doc"},
|
||||
{
|
||||
data: "prz_acq",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="przAcq" name="przAcq" step="0.01" min="0" value="${data}">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "perc_1",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="perc1" name="perc1" value="${data}" min="0" max="100">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "perc_2",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="perc2" name="perc2" value="${data}" min="0" max="100">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "perc_3",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="perc3" name="perc3" value="${data}" min="0" max="100">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "perc_4",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="perc4" name="perc4" value="${data}" min="0" max="100">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "perc_prov",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="percProv" name="percProv" value="${data}" min="0" max="100">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "val_prov",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="valProv" name="valProv" value="${data}" min="0">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "val_spese",
|
||||
render(data, type) {
|
||||
if (type === "display") {
|
||||
return `<input type="number" class="form-control w-100" id="valSpese" name="valSpese" value="${data}" min="0">`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "tipo_variazione",
|
||||
orderable: false,
|
||||
render(data) {
|
||||
let returnString = `
|
||||
<button class="btn btn-danger icbtn delete" title="Elimina riga">
|
||||
<span class="fa fa-trash">
|
||||
</button>`;
|
||||
|
||||
if (data) {
|
||||
returnString = `<input type="hidden" id="tipoVariazione" name="tipoVariazione" value="${data}">${returnString}`;
|
||||
}
|
||||
|
||||
return returnString;
|
||||
}
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{type: "non-empty-string", targets: [0, 1, 2]},
|
||||
{
|
||||
className: "max-width-100px vertical-middle",
|
||||
targets: [2, 3]
|
||||
},
|
||||
{
|
||||
width: "43px",
|
||||
targets: [7, 8, 9, 10, 11]
|
||||
},
|
||||
{className: "vertical-middle", targets: "_all"}
|
||||
],
|
||||
rowCallback(row, data) {
|
||||
if (data.tipo_variazione === "D") {
|
||||
$(row).hide();
|
||||
}
|
||||
|
||||
$(row).find(".cod-mart").bsautocomplete({
|
||||
minLength: 3,
|
||||
sourceAjaxAction: "searchArticolo",
|
||||
item_labelKey: "descrizione",
|
||||
item_labelSmallKey: ["cod_mart"],
|
||||
item_labelSubKey: [],
|
||||
onSelect: function (e, result, $this) {
|
||||
const row = dataTable.row($this.parents("tr"));
|
||||
const data = row.data();
|
||||
|
||||
data.cod_mart = result.cod_mart;
|
||||
data.descrizione_art = result.descrizione;
|
||||
|
||||
if (result.unt_mis) {
|
||||
data.arrUntMisAcq = [];
|
||||
|
||||
data.arrUntMisAcq.push(result.unt_mis);
|
||||
}
|
||||
|
||||
if (result.unt_mis2) {
|
||||
if (!data.arrUntMisAcq) {
|
||||
data.arrUntMisAcq = [];
|
||||
}
|
||||
|
||||
data.arrUntMisAcq.push(result.unt_mis2);
|
||||
}
|
||||
|
||||
if (result.unt_mis3) {
|
||||
if (!data.arrUntMisAcq) {
|
||||
data.arrUntMisAcq = [];
|
||||
}
|
||||
|
||||
data.arrUntMisAcq.push(result.unt_mis3);
|
||||
}
|
||||
|
||||
|
||||
new Ajax()
|
||||
.get("searchPrezzo")
|
||||
.data({
|
||||
cod_alis: self._codAlis,
|
||||
cod_mart: data.cod_mart
|
||||
})
|
||||
.onSuccess(function (ret) {
|
||||
result = ret.returnData;
|
||||
|
||||
if (result) {
|
||||
data.prz_acq = result.prz_acq;
|
||||
data.perc_1 = result.perc_1;
|
||||
data.perc_2 = result.perc_2;
|
||||
data.perc_3 = result.perc_3;
|
||||
data.perc_4 = result.perc_4;
|
||||
}
|
||||
|
||||
row.data(data).draw();
|
||||
}).execute();
|
||||
}
|
||||
});
|
||||
|
||||
$(row).find(".delete").off("click").click(function () {
|
||||
const row = dataTable.row($(this).parents("tr"));
|
||||
const data = row.data();
|
||||
|
||||
if (data.newRow) {
|
||||
row.remove().draw();
|
||||
} else {
|
||||
new ModalBox()
|
||||
.title("Conferma Eliminazione")
|
||||
.content(`
|
||||
<div class="text-center">
|
||||
<i class="fas fa-5x fa-exclamation-triangle text-danger"></i><br>
|
||||
<h4 class="mt-10">
|
||||
Confermi di voler eliminare l'articolo <b>${data.descrizione_art}</b> dal contratto n. <b>${self._versione}</b>?
|
||||
</h4>
|
||||
</div>
|
||||
`)
|
||||
.yesNo(true, false)
|
||||
.style("danger")
|
||||
.show()
|
||||
.then(function (answer) {
|
||||
if (answer) {
|
||||
data.tipo_variazione = "D";
|
||||
|
||||
row.data(data).draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
drawCallback() {
|
||||
const table = this.api();
|
||||
|
||||
const indexes = table.rows({page: "current"}).indexes().filter(index => table.row(index).data().newRow);
|
||||
|
||||
if (indexes.length > 0) {
|
||||
$(table.row(indexes[indexes.length - 1]).node()).find("#codMart").focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("<div class='text-center mb-10'><button class='btn btn-success icbtn' id='aggiungiRiga'><i class='fa fa-plus'/> Aggiungi nuova riga</button></div>")
|
||||
.insertAfter($listRigheOfferta);
|
||||
|
||||
$("#aggiungiRiga").click(function () {
|
||||
dataTable.row.add({
|
||||
newRow: true,
|
||||
cod_mart: "",
|
||||
descrizione_art: null,
|
||||
prz_acq: 0,
|
||||
perc_1: 0,
|
||||
perc_2: 0,
|
||||
perc_3: 0,
|
||||
perc_4: 0,
|
||||
unt_mis_acq: "",
|
||||
qta_acq_contr: 0,
|
||||
qta_ord: 0,
|
||||
qta_doc: 0,
|
||||
perc_prov: 0,
|
||||
val_prov: 0,
|
||||
val_spese: 0
|
||||
}).draw();
|
||||
});
|
||||
}
|
||||
})
|
||||
.onError({
|
||||
toast: {message: "Errore nel caricamento dei contratti."},
|
||||
callback(error) {
|
||||
reject(error);
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
})
|
||||
.show();
|
||||
})
|
||||
.onError({
|
||||
toast: {message: "Errore nel caricamento del popup."},
|
||||
callback(error) {
|
||||
reject(error);
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
);
|
||||
};
|
||||
169
public_html/gest-lib/contratti_di_acquisto/js/main.js
Normal file
169
public_html/gest-lib/contratti_di_acquisto/js/main.js
Normal file
@@ -0,0 +1,169 @@
|
||||
$().ready(function () {
|
||||
_contrattiDiAcquisto.init();
|
||||
});
|
||||
|
||||
const _contrattiDiAcquisto = {
|
||||
module: undefined,
|
||||
$listContratti: undefined,
|
||||
contratti: undefined,
|
||||
view: "in-corso",
|
||||
|
||||
init() {
|
||||
const self = this;
|
||||
|
||||
self.module = new Module();
|
||||
|
||||
self.module
|
||||
.onLoad(function () {
|
||||
self.$listContratti = $("#listContratti");
|
||||
|
||||
$("#nuovaOfferta").click(function () {
|
||||
$(this).disabled(true);
|
||||
|
||||
new PopupOfferta()
|
||||
.open()
|
||||
.then(() => {
|
||||
self.$listContratti.DataTable().destroy();
|
||||
|
||||
self.loadListContratti();
|
||||
}
|
||||
)
|
||||
.finally(() => $(this).disabled(false));
|
||||
});
|
||||
|
||||
if (is_null(get_urlParameter("in-corso"))) {
|
||||
self.view = "in-corso";
|
||||
} else if (is_null(get_urlParameter("scaduti"))) {
|
||||
self.view = "scaduti";
|
||||
}
|
||||
})
|
||||
.load()
|
||||
.then(() => self.loadListContratti());
|
||||
},
|
||||
|
||||
loadListContratti() {
|
||||
const self = this;
|
||||
|
||||
new Ajax()
|
||||
.get("getListContratti")
|
||||
.data({
|
||||
scaduti: self.view === "scaduti"
|
||||
})
|
||||
.waitToast("Caricamento Contratti..")
|
||||
.noticeAsToast()
|
||||
.onSuccess(data => {
|
||||
if (data.returnData) {
|
||||
self.contratti = data.returnData;
|
||||
|
||||
const table = self.$listContratti.DataTable({
|
||||
autoWidth: false,
|
||||
language: _APP.dataTableLangIta,
|
||||
dom: "<'panel-body'<'row'<'col-sm-6'l><'col-sm-6'f>>>" +
|
||||
"<'row'<'col-sm-12'<'table-responsive'tr>>>" +
|
||||
"<'panel-footer'<'row'<'col-sm-5'i><'col-sm-7'p>>>",
|
||||
data: self.contratti,
|
||||
columns: [
|
||||
{data: "versione"},
|
||||
{data: "cod_alis"},
|
||||
{data: "descrizione_lisa"},
|
||||
{
|
||||
data: "data_iniz",
|
||||
type: "date",
|
||||
render(dataIniz, type) {
|
||||
if (type === "display" || type === "filter") {
|
||||
return moment.unix(dataIniz).format("DD/MM/YYYY");
|
||||
}
|
||||
|
||||
return dataIniz;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "data_fine",
|
||||
type: "date",
|
||||
render(dataFine, type) {
|
||||
if (type === "display" || type === "filter") {
|
||||
return moment.unix(dataFine).format("DD/MM/YYYY");
|
||||
}
|
||||
|
||||
return dataFine;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "cod_mart",
|
||||
render(codMart, type, row) {
|
||||
if (type === "display" || type === "filter") {
|
||||
return `${codMart} - ${row.descrizione_art}`;
|
||||
}
|
||||
|
||||
return codMart;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "qta_acq_contr",
|
||||
render(qtaAcqContratto, type, row) {
|
||||
if (type === "display" || type === "filter") {
|
||||
return `${qtaAcqContratto} ${row.unt_mis_acq}`;
|
||||
}
|
||||
|
||||
return qtaAcqContratto;
|
||||
}
|
||||
},
|
||||
{data: "qta_ord"},
|
||||
{data: "qta_doc"},
|
||||
{
|
||||
data: "qta_acq_contr",
|
||||
render(qtaAcqContratto, type, row) {
|
||||
return qtaAcqContratto - row.qta_doc;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: null,
|
||||
orderable: false,
|
||||
render() {
|
||||
return `
|
||||
<button class="btn btn-info icbtn edit" title="Modifica">
|
||||
<span class="fa fa-pencil">
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{className: "vertical-middle", targets: "_all"}
|
||||
],
|
||||
createdRow(row) {
|
||||
$(row).find(".edit").click(function () {
|
||||
$(this).disabled(true);
|
||||
|
||||
const contratto = table.row($(this).parents("tr")).data();
|
||||
|
||||
new PopupOfferta()
|
||||
.codAlis(contratto.cod_alis)
|
||||
.versione(contratto.versione)
|
||||
.open()
|
||||
.then(
|
||||
() => {
|
||||
table.destroy();
|
||||
|
||||
self.loadListContratti();
|
||||
},
|
||||
() => $(this).disabled(false)
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const toast = new Toast();
|
||||
|
||||
toast.warning("La ricerca non ha prodotto alcun risultato.");
|
||||
|
||||
self.contratti = null;
|
||||
self.$listContratti.children("tbody").remove();
|
||||
}
|
||||
})
|
||||
.onError({
|
||||
toast: {message: "Errore nel caricamento dei contratti."}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
.table > thead:first-child > tr:first-child > th {
|
||||
border-top: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.table > thead > tr > th {
|
||||
border-bottom: unset;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
SELECT contratti.versione,
|
||||
contratti.cod_alis,
|
||||
contratti.descrizione_lisa,
|
||||
contratti.data_iniz,
|
||||
contratti.data_fine,
|
||||
contratti.cod_mart,
|
||||
contratti.descrizione_art,
|
||||
contratti.qta_acq_contr,
|
||||
contratti.unt_mis_acq,
|
||||
contratti.qta_ord,
|
||||
contratti.qta_doc,
|
||||
contratti.cod_mgrp
|
||||
FROM avw_contratti_acquisto contratti
|
||||
WHERE (dbo.getGestSetupUser('[userName]', 'PVM', 'PIANO_ARRIVI', 'FILTRO_GRP_MERC') IS NULL OR
|
||||
contratti.cod_mgrp IN (SELECT *
|
||||
FROM Dbo.ParseStringIntoArray(
|
||||
(SELECT dbo.getGestSetupUser('[userName]', 'PVM', 'PIANO_ARRIVI',
|
||||
'FILTRO_GRP_MERC')), '|')))
|
||||
@@ -0,0 +1,21 @@
|
||||
SELECT contratti.cod_mart,
|
||||
contratti.descrizione_art,
|
||||
contratti.prz_acq,
|
||||
contratti.perc_1,
|
||||
contratti.perc_2,
|
||||
contratti.perc_3,
|
||||
contratti.perc_4,
|
||||
contratti.unt_mis_acq,
|
||||
ma.unt_mis,
|
||||
ma.unt_mis2,
|
||||
ma.unt_mis3,
|
||||
contratti.qta_acq_contr,
|
||||
contratti.qta_ord,
|
||||
contratti.qta_doc,
|
||||
contratti.perc_prov,
|
||||
contratti.val_prov,
|
||||
contratti.val_spese
|
||||
FROM avw_contratti_acquisto contratti
|
||||
INNER JOIN mtb_aart ma ON contratti.cod_mart = ma.cod_mart
|
||||
WHERE contratti.cod_alis = '[codAlis]'
|
||||
AND contratti.versione = [versione]
|
||||
@@ -0,0 +1,14 @@
|
||||
SELECT contratti.cod_anag,
|
||||
contratti.rag_soc,
|
||||
contratti.cod_vage,
|
||||
contratti.rag_soc_age,
|
||||
contratti.cod_vvet,
|
||||
contratti.rag_soc_vet,
|
||||
contratti.cod_alis,
|
||||
contratti.descrizione_lisa,
|
||||
contratti.data_iniz,
|
||||
contratti.data_fine,
|
||||
contratti.versione
|
||||
FROM avw_contratti_acquisto contratti
|
||||
WHERE contratti.cod_alis = '[codAlis]'
|
||||
AND contratti.versione = [versione]
|
||||
@@ -0,0 +1,9 @@
|
||||
SELECT TOP 50 *
|
||||
FROM mtb_aart
|
||||
WHERE mtb_aart.cod_mart + ';' + mtb_aart.descrizione LIKE '%[q]%'
|
||||
AND mtb_aart.flag_stato = 'A'
|
||||
AND (dbo.getGestSetupUser('[userName]', 'PVM', 'PIANO_ARRIVI', 'FILTRO_GRP_MERC') IS NULL OR
|
||||
mtb_aart.cod_mgrp IN (SELECT *
|
||||
FROM Dbo.ParseStringIntoArray(
|
||||
(SELECT dbo.getGestSetupUser('[userName]', 'PVM', 'PIANO_ARRIVI',
|
||||
'FILTRO_GRP_MERC')), '|')))
|
||||
@@ -0,0 +1,4 @@
|
||||
SELECT atb_forn.cod_anag, gtb_anag.rag_soc, atb_forn.cod_alis
|
||||
FROM atb_forn
|
||||
INNER JOIN gtb_anag ON atb_forn.cod_anag = gtb_anag.cod_anag
|
||||
WHERE atb_forn.flag_stato = 'A'
|
||||
@@ -0,0 +1,2 @@
|
||||
SELECT cod_vage, rag_soc
|
||||
FROM vtb_agen
|
||||
@@ -0,0 +1,2 @@
|
||||
SELECT *
|
||||
FROM dbo.getListinoAcquisto(NULL, '[cod_alis]', NULL, '[cod_mart]', 'S', NULL) lis_a
|
||||
@@ -0,0 +1,2 @@
|
||||
SELECT cod_vvet, rag_soc
|
||||
FROM vtb_vett
|
||||
@@ -28,6 +28,17 @@ class ContrattiDiVendita {
|
||||
return $query->toRet()->execute();
|
||||
}
|
||||
|
||||
public static function deleteContratto($data) {
|
||||
$vtbListData = new EntityItem("vtb_list_data");
|
||||
|
||||
$vtbListData
|
||||
->delete()
|
||||
->set("codVlis", $data["codVlis"])
|
||||
->set("versione", $data["versione"]);
|
||||
|
||||
return $vtbListData->send();
|
||||
}
|
||||
|
||||
public static function getTestataOfferta($codVlis, $versione) {
|
||||
if (empty($codVlis) || empty($versione)) {
|
||||
$ret = new Ret();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 23 KiB |
@@ -5,6 +5,9 @@ if (isset($_GET["popupOfferta"])) {
|
||||
} else if (isset($_GET["getListContratti"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["getListContratti"]);
|
||||
ContrattiDiVendita::getListContratti(isset($data["scaduti"]) ? $data["scaduti"] : false)->display();
|
||||
} else if (isset($_GET["deleteContratto"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["deleteContratto"]);
|
||||
ContrattiDiVendita::deleteContratto($data)->display();
|
||||
} else if (isset($_POST["getRigheOfferta"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["getRigheOfferta"]);
|
||||
ContrattiDiVendita::getRigheOfferta($data["codVlis"], $data["versione"])->display();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-primary">
|
||||
<h3 class="panel-heading">
|
||||
<h3 class="panel-heading icpanel">
|
||||
Completati
|
||||
</h3>
|
||||
|
||||
<table id="listContratti" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">N. Offerta</th>
|
||||
<th rowspan="2">N. Contratto</th>
|
||||
<th rowspan="2">Cod. Listino</th>
|
||||
<th rowspan="2">Descrizione</th>
|
||||
<th rowspan="2">Data inizio</th>
|
||||
@@ -15,6 +15,7 @@
|
||||
<th rowspan="2">Articolo</th>
|
||||
<th colspan="3">Quantità</th>
|
||||
<th rowspan="2">Saldo quantità</th>
|
||||
<th rowspan="2">Quantità disponibile</th>
|
||||
<th rowspan="2"></th>
|
||||
</tr>
|
||||
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td colspan="11" style="overflow: hidden">
|
||||
<td colspan="12" style="overflow: hidden">
|
||||
<i class="fa fa-4x fa-spin fa-spinner-third fa-primary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-success btn-lg mb-10" id="nuovaOfferta" type="button">
|
||||
<span><i class="fa fa-plus"></i> Nuova offerta</span>
|
||||
<button class="btn btn-success icbtn btn-lg mb-10" id="nuovaOfferta" type="button">
|
||||
<span><i class="fa fa-plus"></i> Nuovo Contratto</span>
|
||||
</button>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<h3 class="panel-heading">
|
||||
<h3 class="panel-heading icpanel">
|
||||
In Corso
|
||||
</h3>
|
||||
|
||||
<table id="listContratti" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">N. Offerta</th>
|
||||
<th rowspan="2">N. Contratto</th>
|
||||
<th rowspan="2">Cod. Listino</th>
|
||||
<th rowspan="2">Descrizione</th>
|
||||
<th rowspan="2">Data inizio</th>
|
||||
@@ -19,6 +19,7 @@
|
||||
<th rowspan="2">Articolo</th>
|
||||
<th colspan="3">Quantità</th>
|
||||
<th rowspan="2">Saldo quantità</th>
|
||||
<th rowspan="2">Quantità disponibile</th>
|
||||
<th rowspan="2"></th>
|
||||
</tr>
|
||||
|
||||
@@ -31,7 +32,7 @@
|
||||
|
||||
<tbody class="text-center">
|
||||
<tr>
|
||||
<td colspan="11" style="overflow: hidden">
|
||||
<td colspan="12" style="overflow: hidden">
|
||||
<i class="fa fa-4x fa-spin fa-spinner-third fa-primary"></i>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -85,7 +85,13 @@ if ($ret->is_OK()) {
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-2"></div>
|
||||
<div class="col-xs-12 col-md-2 text-center">
|
||||
<?php if ($editMode) { ?>
|
||||
<button class="btn btn-danger icbtn" id="deleteContratto" title="Elimina">
|
||||
<i class="fas fa-trash"></i> Elimina Contratto
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ function PopupOfferta() {
|
||||
|
||||
PopupOfferta.prototype.isEditMode = function () {
|
||||
return !is_null(this._codVlis) && !is_null(this._versione);
|
||||
}
|
||||
};
|
||||
|
||||
PopupOfferta.prototype.codVlis = function (codVlis) {
|
||||
this._codVlis = codVlis;
|
||||
@@ -36,7 +36,7 @@ PopupOfferta.prototype.open = function () {
|
||||
self.modalBox = new ModalBox();
|
||||
|
||||
self.modalBox
|
||||
.title(self._versione ? `Offerta n. ${self._versione}` : "Nuova Offerta")
|
||||
.title(self._versione ? `Contratto n. ${self._versione}` : "Nuovo Contratto")
|
||||
.okCancel()
|
||||
.btOK({
|
||||
text: "Conferma",
|
||||
@@ -77,10 +77,10 @@ PopupOfferta.prototype.open = function () {
|
||||
new Ajax()
|
||||
.post("saveOfferta")
|
||||
.data(data)
|
||||
.waitModal("Salvataggio offerta..")
|
||||
.waitModal("Salvataggio contratto..")
|
||||
.noticeAsModal()
|
||||
.onSuccess({
|
||||
toast: {message: "Offerta salvata correttamente."},
|
||||
toast: {message: "Contratto salvato correttamente."},
|
||||
callback(ret) {
|
||||
self.modalBox.close();
|
||||
|
||||
@@ -88,7 +88,7 @@ PopupOfferta.prototype.open = function () {
|
||||
}
|
||||
})
|
||||
.onError({
|
||||
toast: {message: "Errore nel salvataggio dell'offerta."}
|
||||
toast: {message: "Errore nel salvataggio del contratto."}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
@@ -137,6 +137,37 @@ PopupOfferta.prototype.open = function () {
|
||||
format: "DD/MM/YYYY"
|
||||
}
|
||||
});
|
||||
|
||||
$div.find("#deleteContratto").click(function () {
|
||||
new Ajax()
|
||||
.get("deleteContratto")
|
||||
.data({
|
||||
codVlis: self._codVlis,
|
||||
versione: self._versione
|
||||
})
|
||||
.confirmModal({
|
||||
style: "danger",
|
||||
title: "Conferma Eliminazione",
|
||||
message: `
|
||||
<div class="text-center">
|
||||
<i class="fas fa-5x fa-exclamation-triangle text-danger"></i><br>
|
||||
<h4 class="mt-10">
|
||||
Confermi di voler eliminare il contratto n. <b>${self._versione}</b>?
|
||||
</h4>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
.$button($(this))
|
||||
.waitToast("Cancellazione contratto...")
|
||||
.noticeAsToast()
|
||||
.onSuccess({
|
||||
toast: {message: "Contratto eliminato correttamente."},
|
||||
callback: () => {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
});
|
||||
})
|
||||
.onShow(function ($div) {
|
||||
$div.find("#searchCodAnag").focus();
|
||||
@@ -163,9 +194,9 @@ PopupOfferta.prototype.open = function () {
|
||||
columns: [
|
||||
{
|
||||
data: "cod_mart",
|
||||
render(data, type) {
|
||||
render(data, type, row) {
|
||||
if (type === "display") {
|
||||
return `<input type="text" class="form-control cod-mart" id="codMart" name="codMart" value="${data}">`;
|
||||
return `<input type="text" class="form-control cod-mart" id="codMart" name="codMart" value="${data}" ${row.newRow ? "" : "readonly"}>`;
|
||||
}
|
||||
|
||||
return data;
|
||||
@@ -190,9 +221,7 @@ PopupOfferta.prototype.open = function () {
|
||||
}
|
||||
|
||||
if (row.unt_mis && row.unt_mis !== data) {
|
||||
if (!row.arrUntMisVen) {
|
||||
row.arrUntMisVen = [];
|
||||
}
|
||||
row.arrUntMisVen = [];
|
||||
|
||||
row.arrUntMisVen.push(row.unt_mis);
|
||||
}
|
||||
@@ -294,7 +323,7 @@ PopupOfferta.prototype.open = function () {
|
||||
orderable: false,
|
||||
render(data) {
|
||||
let returnString = `
|
||||
<button class="btn btn-danger delete" title="Elimina riga">
|
||||
<button class="btn btn-danger icbtn delete" title="Elimina riga">
|
||||
<span class="fa fa-trash">
|
||||
</button>`;
|
||||
|
||||
@@ -326,13 +355,11 @@ PopupOfferta.prototype.open = function () {
|
||||
const row = dataTable.row($this.parents("tr"));
|
||||
const data = row.data();
|
||||
|
||||
data.cod_mart = result.cod_mart
|
||||
data.cod_mart = result.cod_mart;
|
||||
data.descrizione_articolo = result.descrizione;
|
||||
|
||||
if (result.unt_mis) {
|
||||
if (!data.arrUntMisVen) {
|
||||
data.arrUntMisVen = [];
|
||||
}
|
||||
data.arrUntMisVen = [];
|
||||
|
||||
data.arrUntMisVen.push(result.unt_mis);
|
||||
}
|
||||
@@ -370,7 +397,7 @@ PopupOfferta.prototype.open = function () {
|
||||
<div class="text-center">
|
||||
<i class="fas fa-5x fa-exclamation-triangle text-danger"></i><br>
|
||||
<h4 class="mt-10">
|
||||
Confermi di voler eliminare l'articolo <b>${data.descrizione_articolo}</b> dall'offerta n. <b>${self._versione}</b>?
|
||||
Confermi di voler eliminare l'articolo <b>${data.descrizione_articolo}</b> dal contratto n. <b>${self._versione}</b>?
|
||||
</h4>
|
||||
</div>
|
||||
`)
|
||||
@@ -398,7 +425,7 @@ PopupOfferta.prototype.open = function () {
|
||||
}
|
||||
});
|
||||
|
||||
$("<div class='text-center mb-10'><button class='btn btn-success' id='aggiungiRiga'><i class='fa fa-plus'/> Aggiungi nuova riga</button></div>")
|
||||
$("<div class='text-center mb-10'><button class='btn btn-success icbtn' id='aggiungiRiga'><i class='fa fa-plus'/> Aggiungi nuova riga</button></div>")
|
||||
.insertAfter($listRigheOfferta);
|
||||
|
||||
$("#aggiungiRiga").click(function () {
|
||||
|
||||
@@ -113,7 +113,17 @@ const _contrattiDiVendita = {
|
||||
{
|
||||
data: "qta_vend_contratto",
|
||||
render(qtaVendContratto, type, row) {
|
||||
return qtaVendContratto - row.qta_doc;
|
||||
return qtaVendContratto - row.qta_doc - row.qta_ord;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "qta_disp",
|
||||
render(data, type, row) {
|
||||
if (type === "display" || type === "filter") {
|
||||
return `${data} ${row.unt_mis_ven}`;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -121,10 +131,10 @@ const _contrattiDiVendita = {
|
||||
orderable: false,
|
||||
render() {
|
||||
return `
|
||||
<button class="btn btn-primary edit" title="Modifica">
|
||||
<button class="btn btn-info icbtn edit" title="Modifica">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</button>
|
||||
<button class="btn btn-primary print" title="Stampa">
|
||||
<button class="btn btn-primary icbtn print" title="Stampa">
|
||||
<i class="fa fa-print"></i>
|
||||
</button>
|
||||
`;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
SELECT contratti.cod_vlis,
|
||||
SELECT contratti.versione,
|
||||
contratti.cod_vlis,
|
||||
contratti.descrizione_listino,
|
||||
contratti.data_iniz,
|
||||
contratti.data_fine,
|
||||
contratti.versione /*non visualizzate*/,
|
||||
contratti.cod_mart,
|
||||
contratti.descrizione_articolo,
|
||||
contratti.unt_mis_ven,
|
||||
contratti.qta_vend_contratto,
|
||||
contratti.qta_ord,
|
||||
contratti.qta_doc
|
||||
contratti.qta_doc,
|
||||
contratti.qta_disp
|
||||
FROM vvw_contratti_vendita contratti
|
||||
/*
|
||||
--condizione per scadute
|
||||
|
||||
@@ -478,8 +478,8 @@ if ($Ret->is_OK()) {
|
||||
<?= DeliveryPlan::isGestioneVenditeAbilitata() ? "" : "readonly" ?>
|
||||
value="<?= !$isNuovoOrdine ? $ordine["rif_data_ord"] : "" ?>">
|
||||
<span class="input-group-addon dpicker">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ PopupListino.prototype._buildModalBox = function () {
|
||||
});
|
||||
_.forEach(self._articoli, articolo => {
|
||||
self._buildTr(articolo);
|
||||
})
|
||||
});
|
||||
|
||||
$div.find("#filter").textTableFilter({$table: $div.find("table"), children: 1});
|
||||
})
|
||||
|
||||
@@ -268,12 +268,12 @@ class EmisDdt {
|
||||
|
||||
public static function is_lottoEditable() {
|
||||
$GestSetup = new GestSetup;
|
||||
return $GestSetup->section("EMISSIONE_DOC")->keySection("MODIFY_LOTTO")->default_value("N")->asBoolean()->get();
|
||||
return $GestSetup->section("EMISSIONE_DOC")->keySection("MODIFY_LOTTO")->defaultValue("N")->asBoolean()->get();
|
||||
}
|
||||
|
||||
public static function is_lottoVisible() {
|
||||
$GestSetup = new GestSetup;
|
||||
return $GestSetup->section("EMISSIONE_DOC")->keySection("VIEW_LOTTO")->default_value("N")->asBoolean()->get();
|
||||
return $GestSetup->section("EMISSIONE_DOC")->keySection("VIEW_LOTTO")->defaultValue("N")->asBoolean()->get();
|
||||
}
|
||||
|
||||
public static function get_datiAggiuntiviDoc($docKey) {
|
||||
|
||||
@@ -235,7 +235,7 @@ class GestioneNotifiche {
|
||||
}
|
||||
|
||||
if (isset($dto["imageFile"]) && isset($dto["imageFile"]["attachId"])) {
|
||||
$entityNotification->set("imageUrl", PVM::getCurrentUrl() . Allegati::getRenderedFileUrl(
|
||||
$entityNotification->set("imageUrl", PVM::get_current_projectPublicUrl() . Allegati::getRenderedFileUrl(
|
||||
array(
|
||||
"id_attach" => $dto["imageFile"]["attachId"],
|
||||
"profileDb" => $_SESSION["profileDB"]
|
||||
|
||||
@@ -1 +1,40 @@
|
||||
#sidebar-logManager.sidebar{height:100%;position:fixed;z-index:1;top:0;left:0;background-color:#fbfbfb;overflow-x:hidden;padding-top:60px;border-right:2px solid #e0e0e0}#sidebar-logManager .nav-tabs{text-align:center}#sidebar-logManager .nav-tabs>li{float:none;display:inline-block;zoom:1}li.select2-results__option{min-height:34px}span.select2-selection.select2-selection--single{min-height:34px;line-height:33px}span.select2-selection__arrow{min-height:34px}.col-chartdiv{padding-bottom:70px}/*# sourceMappingURL=main.css.map */
|
||||
#sidebar-logManager.sidebar {
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #fbfbfb;
|
||||
overflow-x: hidden;
|
||||
padding-top: 60px;
|
||||
border-right: 2px solid #e0e0e0
|
||||
}
|
||||
|
||||
#sidebar-logManager .nav-tabs {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
#sidebar-logManager .nav-tabs > li {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
zoom: 1
|
||||
}
|
||||
|
||||
li.select2-results__option {
|
||||
min-height: 34px
|
||||
}
|
||||
|
||||
span.select2-selection.select2-selection--single {
|
||||
min-height: 34px;
|
||||
line-height: 33px
|
||||
}
|
||||
|
||||
span.select2-selection__arrow {
|
||||
min-height: 34px
|
||||
}
|
||||
|
||||
.col-chartdiv {
|
||||
padding-bottom: 70px
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
|
||||
@@ -221,7 +221,7 @@ class OrderEventHandler {
|
||||
|
||||
$MtbColr = new \EntityItem("mtb_colr");
|
||||
$MtbColr->insert()
|
||||
->set("qtaCol", $qtaCollo * $ordineLav["qta_cnf"])
|
||||
->set("qtaCol", ($qtaCollo * $ordineLav["rap_conv_dist"]))
|
||||
->set("codMart", $ordineLav["cod_prod"])
|
||||
->set("qtaCnf", $ordineLav["qta_cnf"])
|
||||
->setDate("dataOrd", $orderKey["data_ord"])
|
||||
|
||||
@@ -640,7 +640,7 @@ var _ordini = {
|
||||
|
||||
var $popoverDiv = _monitoraggioLinee.module.get_$template("popoverCreateUdc");
|
||||
var $popoverLabel = $popoverDiv.find("label");
|
||||
$popoverLabel.text($popoverLabel.text() + " (" + ordine.untOrd + ")");
|
||||
$popoverLabel.text($popoverLabel.text() + " (" + ordine.untMisProd + ")");
|
||||
|
||||
var $popover = $btUdc.popover({
|
||||
content: $popoverDiv.html(),
|
||||
|
||||
@@ -13,6 +13,7 @@ SELECT dtb_ordt.cod_tcol_ul,
|
||||
dtb_ordt.qta_prod,
|
||||
dtb_ordt.unt_mis_prod,
|
||||
dtb_ordt.rap_conv_prod,
|
||||
CASE WHEN mtb_aart.qta_cnf > 1 THEN mtb_aart.qta_cnf ELSE jtb_cicl.rap_conv_prod END as rap_conv_dist,
|
||||
dtb_ordt.cod_jfas,
|
||||
dtb_ordt.cod_jcom,
|
||||
dtb_ordt.note,
|
||||
@@ -33,6 +34,7 @@ FROM dtb_ordt
|
||||
dtb_ordr.data_ord = dtb_ordt.data_ord_rif AND
|
||||
dtb_ordr.num_ord = dtb_ordt.num_ord_rif AND
|
||||
dtb_ordr.riga_ord = dtb_ordt.riga_ord_rif
|
||||
INNER JOIN jtb_cicl on mtb_aart.cod_mart = jtb_cicl.cod_prod
|
||||
LEFT OUTER JOIN mtb_partita_mag on mtb_aart.cod_mart = mtb_partita_mag.cod_mart and
|
||||
mtb_partita_mag.partita_mag = dtb_ordr.partita_mag
|
||||
LEFT OUTER JOIN
|
||||
|
||||
@@ -1 +1 @@
|
||||
i.fa.fa-2x.fa-certificate.fa-success.promoIcon{position:relative;padding-top:5px;cursor:pointer}i.fa.fa-2x.fa-certificate.fa-success.promoIcon:after{content:"P";color:#fff;position:absolute;left:8px;font-size:20px;top:8px}.panel-info .info-text-white{color:#fff}th[data-filter=critical],th[data-filter=shortage]{padding:0 !important}th[data-filter=critical] label,th[data-filter=shortage] label{cursor:pointer;display:block;padding:12px 0}th[data-filter=shortage] label{padding:12px}.table>thead>tr>th[data-orderable],.table>thead>tr>th[data-filter]{cursor:pointer}.table>thead>tr>th[data-orderable] i.fa,.table>thead>tr>th[data-filter] i.fa{display:none}.table>thead>tr>th[data-orderable]:hover,.table>thead>tr>th[data-filter]:hover{background:#f1f1f1}.table>thead>tr>th[data-orderable].active,.table>thead>tr>th[data-filter].active{border-color:#2e6da4;background:#0068d8;color:#fff}.table>thead>tr>th[data-orderable].active:not(.asc) i.fa.fa-caret-down,.table>thead>tr>th[data-filter].active:not(.asc) i.fa.fa-caret-down{display:inline-block}.table>thead>tr>th[data-orderable].active.asc i.fa.fa-caret-up,.table>thead>tr>th[data-filter].active.asc i.fa.fa-caret-up{display:inline-block}.table>thead>tr>th[data-orderable].active:hover,.table>thead>tr>th[data-filter].active:hover{background-color:#286090;border-color:#204d74}.popover.fade{max-width:800px}.popover.fade .max-height-80vh thead{font-size:12px}.popover.fade .max-height-80vh tbody{font-size:11px}select[name=cod_tcol_ul]{min-width:170px}.MU{justify-content:center;color:inherit;margin:0;overflow:visible;cursor:pointer;vertical-align:middle;text-align:center !important;position:relative}.MU:hover{text-transform:revert;background-color:#007bff !important}.tooltipForClicking{visibility:hidden;width:120px;background-color:#fff;color:#333;text-align:center;padding:3px 0;border:solid .7px #333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif !important;font-size:85%;transition-delay:500ms;position:absolute;z-index:1}.lastRow{padding-top:17px !important}.btn-excel{background-color:#15864b;color:#fff}.btn-excel:hover,.btn-excel:focus{background-color:#1f9b61;color:#fff}/*# sourceMappingURL=main.css.map */
|
||||
i.fa.fa-2x.fa-certificate.fa-success.promoIcon{position:relative;padding-top:5px;cursor:pointer}i.fa.fa-2x.fa-certificate.fa-success.promoIcon:after{content:"P";color:#fff;position:absolute;left:8px;font-size:20px;top:8px}.panel-info .info-text-white{color:#fff}th[data-filter=critical],th[data-filter=shortage]{padding:0 !important}th[data-filter=critical] label,th[data-filter=shortage] label{cursor:pointer;display:block;padding:12px 0}th[data-filter=shortage] label{padding:12px}.table>thead>tr>th[data-orderable],.table>thead>tr>th[data-filter]{cursor:pointer}.table>thead>tr>th[data-orderable] i.fa,.table>thead>tr>th[data-filter] i.fa{display:none}.table>thead>tr>th[data-orderable]:hover,.table>thead>tr>th[data-filter]:hover{background:#f1f1f1}.table>thead>tr>th[data-orderable].active,.table>thead>tr>th[data-filter].active{border-color:#2e6da4;background:#0068d8;color:#fff}.table>thead>tr>th[data-orderable].active:not(.asc) i.fa.fa-caret-down,.table>thead>tr>th[data-filter].active:not(.asc) i.fa.fa-caret-down{display:inline-block}.table>thead>tr>th[data-orderable].active.asc i.fa.fa-caret-up,.table>thead>tr>th[data-filter].active.asc i.fa.fa-caret-up{display:inline-block}.table>thead>tr>th[data-orderable].active:hover,.table>thead>tr>th[data-filter].active:hover{background-color:#286090;border-color:#204d74}.popover.fade{max-width:800px}.popover.fade .max-height-80vh thead{font-size:12px}.popover.fade .max-height-80vh tbody{font-size:11px}select[name=cod_tcol_ul]{min-width:170px}.MU{justify-content:center;color:inherit;margin:0;overflow:visible;cursor:pointer;vertical-align:middle;text-align:center !important;position:relative}.MU:hover{text-transform:revert;background-color:#007bff !important}.tooltipForClicking{visibility:hidden;width:120px;background-color:#fff;color:#333;text-align:center;padding:3px 0;border:solid .7px #333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif !important;font-size:85%;transition-delay:500ms;position:absolute;z-index:1}.lastRow{padding-top:17px !important}.btn-excel{background-color:#15864b;color:#fff}.btn-excel:hover,.btn-excel:focus{background-color:#1f9b61;color:#fff}.table-striped>tbody>tr.last_selected_row{background-color:#d6ebf2}#main{display:flex;flex-flow:column;height:83vh}.headerGroup{height:255px}.tableFixHead{overflow:auto;flex-grow:1}.tableFixHead thead th{position:sticky;top:0;z-index:1;background-color:#fff}/*# sourceMappingURL=main.css.map */
|
||||
|
||||
@@ -25,136 +25,141 @@ if ($Ret->is_OK()) {
|
||||
$Alert->id("mgrpAlert")->text("Seleziona un gruppo merceologico per iniziare")->_class("mt-10")->show();
|
||||
?>
|
||||
<div class="hidden" id="main">
|
||||
<div id="panel-filter" class="panel panel-default panel-collapsible mt-16">
|
||||
<div class="panel-heading font-weight-bold p-6">
|
||||
Filtra risultati
|
||||
<a href="#" id="bt_cancelFilter" class="info-text-white font-weight-normal text-xs">Annulla</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<?php if (!empty($depositi)) { ?>
|
||||
<div class="headerGroup">
|
||||
<div id="panel-filter" class="panel panel-default panel-collapsible mt-16">
|
||||
<div class="panel-heading font-weight-bold p-6">
|
||||
Filtra risultati
|
||||
<a href="#" id="bt_cancelFilter" class="info-text-white font-weight-normal text-xs">Annulla</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<?php if (!empty($depositi)) { ?>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Deposito</span>
|
||||
<select class="form-control" id="flt-codMdep" multiple>
|
||||
<?php foreach ($depositi as $deposito) { ?>
|
||||
<option value="<?= $deposito["cod_mdep"] ?>" <?= $deposito["default_depo"] ? "selected" : "" ?>><?= $deposito["cod_mdep"] . " - " . $deposito["descrizione"] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Deposito</span>
|
||||
<select class="form-control" id="flt-codMdep" multiple>
|
||||
<?php foreach ($depositi as $deposito) { ?>
|
||||
<option value="<?= $deposito["cod_mdep"] ?>" <?= $deposito["default_depo"] ? "selected" : "" ?>><?= $deposito["cod_mdep"] . " - " . $deposito["descrizione"] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Cliente <i
|
||||
class="fa fa-info-circle text-primary cursor-pointer"
|
||||
id="flt-codAnagDescription"></i></span>
|
||||
<select class="form-control" id="flt-codAnag" multiple></select>
|
||||
<select class="form-control" id="flt-codAnag" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-gruppo</span>
|
||||
<select class="form-control" id="flt-codMsgr" multiple></select>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-gruppo</span>
|
||||
<select class="form-control" id="flt-codMsgr" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-famiglia</span>
|
||||
<select class="form-control" id="flt-codMsfa" multiple></select>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-famiglia</span>
|
||||
<select class="form-control" id="flt-codMsfa" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Tipo</span>
|
||||
<select class="form-control" id="flt-codMtip" multiple></select>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Tipo</span>
|
||||
<select class="form-control" id="flt-codMtip" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-tipo</span>
|
||||
<select class="form-control" id="flt-codMstp" multiple></select>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Sotto-tipo</span>
|
||||
<select class="form-control" id="flt-codMstp" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Data Cons.</span>
|
||||
<input type="date" class="form-control" id="flt-dataCons"
|
||||
min="<?= \Utility\Date::format(time(), Format::strftimeYMD) ?>">
|
||||
<div class="filterGroup col-sm-3 mt-10 pr-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Data Cons.</span>
|
||||
<input type="date" class="form-control" id="flt-dataCons"
|
||||
min="<?= \Utility\Date::format(time(), Format::strftimeYMD) ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-bottom: 20px">
|
||||
<button data-table="list-produzioni-gruppo" data-filename="Riepilogo MRP" class="btn btn-md btn-excel"
|
||||
title="Esporta in Excel"><span class="fas fa-file-excel"></span> Excel
|
||||
</button>
|
||||
<div style="padding-bottom: 20px">
|
||||
<button data-table="list-produzioni-gruppo" data-filename="Riepilogo MRP" class="btn btn-md btn-excel"
|
||||
title="Esporta in Excel"><span class="fas fa-file-excel"></span> Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="list-produzioni-gruppo"
|
||||
class="table table-hover table-striped table-condensed table-bordered table-text-middle cursor-default">
|
||||
<thead class="small">
|
||||
<tr>
|
||||
<th>
|
||||
<input type="text" id="flt-txt-articolo" class="form-control input-sm font-weight-normal"
|
||||
placeholder="Cerca prodotti per descrizione" autocomplete="off"/>
|
||||
</th>
|
||||
<th data-filter="critical">
|
||||
<label for="flt-critical" title="Mostra articoli con criticità">
|
||||
<span class="fa fa-exclamation-triangle fa-1_3x"></span>
|
||||
</label>
|
||||
<input id="flt-critical" type="checkbox" class="flt_critical hidden">
|
||||
</th>
|
||||
<th>U.M.</th>
|
||||
<th data-orderable data-orderby="giacenza">Giacenza <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="arrivi">Arrivi <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="impegni">Impegni <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="impegniNoPian">Impegni Prox <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-filter="shortage" class="nb-right">
|
||||
<label for="flt-shortage" title="Mostra articoli sotto-scorta">
|
||||
<span class="fa fa-exclamation fa-1_3x"></span>
|
||||
</label>
|
||||
<input id="flt-shortage" type="checkbox" class="flt_shortage hidden">
|
||||
</th>
|
||||
<th class="nb-left" data-orderable data-orderby="scortaMin">
|
||||
Scorta <br/> minima <i class="fa fa-caret-down"></i> <i class="fa fa-caret-up"></i>
|
||||
</th>
|
||||
<th class="nb-left" data-orderable data-orderby="consumoMedio">
|
||||
Consumi medi <i class="fa fa-caret-down"></i> <i class="fa fa-caret-up"></i>
|
||||
</th>
|
||||
<th data-orderable data-orderby="dispTot">Disp. <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th>Promo</th>
|
||||
<?php for ($i = 0; $i < 7; $i++) { ?>
|
||||
<th data-day_offset="<?= $i ?>"></th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2" class="text-right">TOTALE</th>
|
||||
<th class="text-center text-monospace sumUm" title="Unità di misura"></th>
|
||||
<th class="text-right text-monospace totGiac" title="Somma giacenza"></th>
|
||||
<th class="text-right text-monospace totArrivi" title="Somma arrivi"></th>
|
||||
<th class="text-right text-monospace totImp" title="Somma impegni"></th>
|
||||
<th class="text-right text-monospace totImpegniNoPian" title="Somma impegni prox"></th>
|
||||
<th colspan="2" class="text-right text-monospace totScortaMin" title="Somma Scorta minima"></th>
|
||||
<th class="text-right text-monospace totAvgCons" title="Somma Consumi medi"></th>
|
||||
<th class="text-right text-monospace sumDispTot" title="Somma Disponibilità totale"></th>
|
||||
<th title="Promo"> </th>
|
||||
<?php for ($i = 0; $i < 7; $i++) { ?>
|
||||
<th class="totDaily text-monospace text-right" data-day="<?= $i ?>"></th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="tableFixHead">
|
||||
<table id="list-produzioni-gruppo"
|
||||
class="table table-hover table-striped table-condensed table-bordered table-text-middle cursor-default">
|
||||
<thead class="small">
|
||||
<tr>
|
||||
<th>
|
||||
<input type="text" id="flt-txt-articolo" class="form-control input-sm font-weight-normal"
|
||||
placeholder="Cerca prodotti per descrizione" autocomplete="off"/>
|
||||
</th>
|
||||
<th data-filter="critical">
|
||||
<label for="flt-critical" title="Mostra articoli con criticità">
|
||||
<span class="fa fa-exclamation-triangle fa-1_3x"></span>
|
||||
</label>
|
||||
<input id="flt-critical" type="checkbox" class="flt_critical hidden">
|
||||
</th>
|
||||
<th>U.M.</th>
|
||||
<th data-orderable data-orderby="giacenza">Giacenza <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="arrivi">Arrivi <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="impegni">Impegni <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-orderable data-orderby="impegniNoPian">Impegni Prox <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th data-filter="shortage" class="nb-right">
|
||||
<label for="flt-shortage" title="Mostra articoli sotto-scorta">
|
||||
<span class="fa fa-exclamation fa-1_3x"></span>
|
||||
</label>
|
||||
<input id="flt-shortage" type="checkbox" class="flt_shortage hidden">
|
||||
</th>
|
||||
<th class="nb-left" data-orderable data-orderby="scortaMin">
|
||||
Scorta <br/> minima <i class="fa fa-caret-down"></i> <i class="fa fa-caret-up"></i>
|
||||
</th>
|
||||
<th class="nb-left" data-orderable data-orderby="consumoMedio">
|
||||
Consumi medi <i class="fa fa-caret-down"></i> <i class="fa fa-caret-up"></i>
|
||||
</th>
|
||||
<th data-orderable data-orderby="dispTot">Disp. <i class="fa fa-caret-down"></i> <i
|
||||
class="fa fa-caret-up"></i></th>
|
||||
<th>Promo</th>
|
||||
<?php for ($i = 0; $i < 7; $i++) { ?>
|
||||
<th data-day_offset="<?= $i ?>"></th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2" class="text-right">TOTALE</th>
|
||||
<th class="text-center text-monospace sumUm" title="Unità di misura"></th>
|
||||
<th class="text-right text-monospace totGiac" title="Somma giacenza"></th>
|
||||
<th class="text-right text-monospace totArrivi" title="Somma arrivi"></th>
|
||||
<th class="text-right text-monospace totImp" title="Somma impegni"></th>
|
||||
<th class="text-right text-monospace totImpegniNoPian" title="Somma impegni prox"></th>
|
||||
<th colspan="2" class="text-right text-monospace totScortaMin" title="Somma Scorta minima"></th>
|
||||
<th class="text-right text-monospace totAvgCons" title="Somma Consumi medi"></th>
|
||||
<th class="text-right text-monospace sumDispTot" title="Somma Disponibilità totale"></th>
|
||||
<th title="Promo"> </th>
|
||||
<?php for ($i = 0; $i < 7; $i++) { ?>
|
||||
<th class="totDaily text-monospace text-right" data-day="<?= $i ?>"></th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
$Ret->showErrorAlert();
|
||||
|
||||
@@ -195,15 +195,17 @@ var _mrp_filters = {
|
||||
},
|
||||
|
||||
reset_fltCodMsgr: function () {
|
||||
var self = this;
|
||||
var main = self.mainWindow;
|
||||
var $fltCodMsgr = $("#flt-codMsgr");
|
||||
let self = this;
|
||||
let main = self.mainWindow;
|
||||
let $fltCodMsgr = $("#flt-codMsgr");
|
||||
let selectedOptions = if_null($fltCodMsgr.val(), []);
|
||||
let arr_sottogruppi = main.get_sottogruppi();
|
||||
|
||||
$fltCodMsgr.enabled();
|
||||
var arr_sottogruppi = main.get_sottogruppi();
|
||||
|
||||
$fltCodMsgr.val("").html("");
|
||||
_.each(arr_sottogruppi, function (sottogruppo) {
|
||||
$fltCodMsgr.append("<option value='" + blankIfNull(sottogruppo.cod_msgr) + "'>" + sottogruppo.descrizione + "</option>");
|
||||
$fltCodMsgr.append("<option value='" + blankIfNull(sottogruppo.cod_msgr) + "' " + (selectedOptions.includes(sottogruppo.cod_msgr) ? 'selected' : '') + ">" + sottogruppo.descrizione + "</option>");
|
||||
});
|
||||
|
||||
if (arr_sottogruppi.length === 1) {
|
||||
@@ -216,11 +218,13 @@ var _mrp_filters = {
|
||||
},
|
||||
|
||||
reset_fltCodMsfa: function () {
|
||||
var self = this;
|
||||
var main = self.mainWindow;
|
||||
var $fltCodMsfa = $("#flt-codMsfa");
|
||||
let self = this;
|
||||
let main = self.mainWindow;
|
||||
let $fltCodMsfa = $("#flt-codMsfa");
|
||||
let selectedOptions = if_null($fltCodMsfa.val(), []);
|
||||
let arr_sottofamiglie = main.get_sottofamiglie();
|
||||
|
||||
$fltCodMsfa.enabled();
|
||||
var arr_sottofamiglie = main.get_sottofamiglie();
|
||||
$fltCodMsfa.val("").html("");
|
||||
|
||||
if (_.isEmpty(arr_sottofamiglie)) {
|
||||
@@ -228,7 +232,7 @@ var _mrp_filters = {
|
||||
|
||||
} else {
|
||||
_.each(arr_sottofamiglie, function (sottofamiglia) {
|
||||
$fltCodMsfa.append("<option value='" + if_null(sottofamiglia.cod_msfa, "NULL") + "'>" + sottofamiglia.descrizione + "</option>");
|
||||
$fltCodMsfa.append("<option value='" + blankIfNull(sottofamiglia.cod_msfa) + "' " + (selectedOptions.includes(sottofamiglia.cod_msfa) ? 'selected' : '') + ">" + sottofamiglia.descrizione + "</option>");
|
||||
$fltCodMsfa.selectpicker("refresh");
|
||||
});
|
||||
}
|
||||
@@ -237,16 +241,18 @@ var _mrp_filters = {
|
||||
},
|
||||
|
||||
reset_fltCodMtip: function () {
|
||||
var self = this;
|
||||
var main = self.mainWindow;
|
||||
let self = this;
|
||||
let main = self.mainWindow;
|
||||
let $fltCodMtip = $("#flt-codMtip");
|
||||
let selectedOptions = if_null($fltCodMtip.val(), []);
|
||||
let arr_tipi = main.get_tipi();
|
||||
|
||||
var $fltCodMtip = $("#flt-codMtip");
|
||||
$fltCodMtip.enabled();
|
||||
var arr_tipi = main.get_tipi();
|
||||
$fltCodMtip.val("").html("");
|
||||
|
||||
if (arr_tipi.length > 1) {
|
||||
_.each(arr_tipi, function (tipo) {
|
||||
$fltCodMtip.append("<option value='" + if_null(tipo.cod_mtip, "NULL") + "'>" + tipo.descrizione + "</option>");
|
||||
$fltCodMtip.append("<option value='" + if_null(tipo.cod_mtip, "NULL") + "' " + (selectedOptions.includes(tipo.cod_mtip) ? 'selected' : '') + ">" + tipo.descrizione + "</option>");
|
||||
$fltCodMtip.selectpicker("refresh");
|
||||
});
|
||||
$("#flt-codMtip, #flt-codMstp").closest(".input-group").parent().show();
|
||||
@@ -381,12 +387,14 @@ var _mrp_filters = {
|
||||
$("label[for=flt-critical]").parent().toggleClass("active", $flt.prop("checked"));
|
||||
self.refresh();
|
||||
},
|
||||
|
||||
toggleShortageFilter: function () {
|
||||
var self = this;
|
||||
var $flt = $("flt-shortage");
|
||||
$("label[for=flt-shortage]").parent().toggleClass("active", $flt.prop("checked"));
|
||||
self.refresh();
|
||||
},
|
||||
|
||||
reset_fltCodAnag: function () {
|
||||
var self = this;
|
||||
var main = self.mainWindow;
|
||||
|
||||
@@ -47,7 +47,14 @@ var _mrp = {
|
||||
|
||||
/****** AFTER CLICKING DATA ARE REQUESTED AND RETRIEVED FROM POPUP-FABB-PRODOTTO.PHP, TO DISPLAY THE POPUP ABOUT THE SINGLE PRODUCT ********************************/
|
||||
|
||||
$("table#list-produzioni-gruppo").on("click", "tr[data-cod_mart]", function () {
|
||||
$("table#list-produzioni-gruppo").on("click", "tr[data-cod_mart]", function (e) {
|
||||
let active = document.querySelector(".last_selected_row");
|
||||
if (active) {
|
||||
active.classList.remove("last_selected_row");
|
||||
}
|
||||
e.currentTarget.classList.add("last_selected_row");
|
||||
|
||||
$(this).addClass("last_selected_row");
|
||||
new PopupFabbProdotto().codMart($(this).data("cod_mart")).$domElement($(this)).open();
|
||||
});
|
||||
|
||||
|
||||
@@ -142,4 +142,32 @@ i.fas.bt_duplicateRow{
|
||||
.btn-excel:hover, .btn-excel:focus {
|
||||
background-color: #1F9B61;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr {
|
||||
&.last_selected_row {
|
||||
background-color: #D6EBF2;
|
||||
}
|
||||
}
|
||||
|
||||
#main {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
height: 83vh;
|
||||
}
|
||||
|
||||
.headerGroup {
|
||||
height: 255px;
|
||||
}
|
||||
|
||||
.tableFixHead {
|
||||
overflow: auto;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.tableFixHead thead th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background-color: white;
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
with mrp as (
|
||||
SELECT m.cod_mart,
|
||||
cod_mdep,
|
||||
SUM(case when qta < 0 and gestione = 'NP' then -qta else 0 end) AS impegni_no_pian,
|
||||
SUM(case when qta < 0 and ( gestione in ('NP', 'CV') OR ( gestione = 'V' AND flag_sospeso = 'S' )) then -qta else 0 end) AS impegni_no_pian,
|
||||
CONVERT(DATE, data_mrp) AS data_mrp,
|
||||
SUM(CASE WHEN qta < 0 THEN -qta ELSE 0 END) AS qta_fabbisogno_gg,
|
||||
SUM(CASE WHEN qta > 0 AND gestione IN ('A', 'L') THEN qta ELSE 0 END) AS QtaArriviGG,
|
||||
SUM(qta) AS QtaSaldoGG
|
||||
SUM(qta) AS QtaSaldoGG,
|
||||
sum(case when gestione = 'V' AND flag_sospeso = 'S' THEN qta ELSE 0 END) as ord_v_sospesi
|
||||
FROM dbo.MRP_DailyMaterialReq() m
|
||||
inner join mtb_aart on m.cod_mart = mtb_aart.cod_mart
|
||||
where mtb_aart.flag_stato = 'A'
|
||||
@@ -17,7 +18,8 @@ with mrp as (
|
||||
null AS data_mrp,
|
||||
0 AS qta_fabbisogno_gg,
|
||||
0 AS QtaArriviGG,
|
||||
0 AS QtaSaldoGG
|
||||
0 AS QtaSaldoGG,
|
||||
0 as ord_v_sospesi
|
||||
FROM mtb_part
|
||||
inner join mtb_aart on mtb_part.cod_mart = mtb_aart.cod_mart
|
||||
WHERE mtb_part.qta_imp_cli = 0
|
||||
@@ -56,8 +58,8 @@ with mrp as (
|
||||
mtb_aart.qta_cnf,
|
||||
mtb_part.giacenza,
|
||||
mtb_part.arrivi,
|
||||
mtb_part.impegni,
|
||||
articoli.impegni_no_pian,
|
||||
mtb_part.impegni + articoli.ord_v_sospesi as impegni ,
|
||||
articoli.impegni_no_pian as impegni_no_pian ,
|
||||
mtb_part.qta_media,
|
||||
(mtb_part.qta_media /
|
||||
case
|
||||
@@ -89,6 +91,7 @@ with mrp as (
|
||||
group by cod_mart, cod_mdep
|
||||
) mtb_part on articoli.cod_mart = mtb_part.cod_mart AND
|
||||
articoli.cod_mdep = mtb_part.cod_mdep
|
||||
|
||||
left outer join mtb_sfam on mtb_aart.cod_mgrp = mtb_sfam.cod_mgrp and
|
||||
mtb_aart.cod_msgr = mtb_sfam.cod_msgr and
|
||||
mtb_aart.cod_msfa = mtb_sfam.cod_msfa
|
||||
@@ -128,6 +131,17 @@ WHERE (LEN('[str-cod_mgrp]') = 0 OR cod_mgrp in ('[cod_mgrp]'))
|
||||
and dtb_ordr.qta_ord > dtb_ordr.qta_evasa
|
||||
and dtb_ordt.flag_annulla = 'N'
|
||||
and cod_mart is not null
|
||||
union all
|
||||
select distinct jtb_dist_mate.cod_mart
|
||||
from dtb_ordt INNER JOIN dtb_ordr ON dtb_ordt.gestione = dtb_ordr.gestione
|
||||
and dtb_ordt.data_ord = dtb_ordr.data_ord
|
||||
and dtb_ordt.num_ord = dtb_ordr.num_ord
|
||||
INNER JOIN jtb_dist_mate on dtb_ordr.cod_mart = jtb_dist_mate.cod_prod
|
||||
where dtb_ordt.cod_anag in ('[codAnag]')
|
||||
and dtb_ordr.flag_evaso = 'I'
|
||||
and dtb_ordr.qta_ord > dtb_ordr.qta_evasa
|
||||
and dtb_ordt.flag_annulla = 'N'
|
||||
and dtb_ordr.cod_mart is not null
|
||||
))
|
||||
|
||||
Order by cod_mgrp, cod_msgr, cod_msfa, cod_mart
|
||||
|
||||
@@ -12,4 +12,20 @@ where dtb_ordt.gestione = dtb_ordr.gestione
|
||||
and dtb_ordr.cod_mart is not null
|
||||
and dtb_ordt.gestione = 'V'
|
||||
and mtb_aart.cod_mgrp in ('[codMgrp]')
|
||||
and ([whereCond])
|
||||
union
|
||||
select distinct gtb_anag.cod_anag, gtb_anag.rag_soc
|
||||
from dtb_ordt,
|
||||
dtb_ordr INNER JOIN jtb_dist_mate on dtb_ordr.cod_mart = jtb_dist_mate.cod_prod,
|
||||
mtb_aart,
|
||||
gtb_anag
|
||||
where dtb_ordt.gestione = dtb_ordr.gestione
|
||||
and dtb_ordt.data_ord = dtb_ordr.data_ord
|
||||
and dtb_ordt.num_ord = dtb_ordr.num_ord
|
||||
and jtb_dist_mate.cod_mart = mtb_aart.cod_mart
|
||||
and dtb_ordt.cod_anag = gtb_anag.cod_anag
|
||||
and dtb_ordr.flag_evaso = 'I'
|
||||
and dtb_ordr.cod_mart is not null
|
||||
and dtb_ordt.gestione = 'V'
|
||||
and mtb_aart.cod_mgrp in ('[codMgrp]')
|
||||
and ([whereCond])
|
||||
@@ -186,7 +186,7 @@ if (!isset($_GET["k"])) {
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control text-right text-monospace"
|
||||
id="qtaTot_carrelli" value="" autocomplete="off" ù readonly/>
|
||||
id="qtaTot_carrelli" value="" autocomplete="off" readonly/>
|
||||
<span class="input-group-addon">Carrelli</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,10 @@ class PianoArrivi {
|
||||
array("id" => "issetJPOrdine", "data" => self::issetJPOrdine()),
|
||||
array("id" => "reportNameOrdine", "data" => self::getSetupReportNameOrdine()->get()),
|
||||
array("id" => "abilitazioni", "data" => self::getAbilitazioniUtente()),
|
||||
array("id" => "issetJPRiepilogoPeriodico", "data" => self::issetJPRiepilogoPeriodico())
|
||||
array("id" => "issetJPRiepilogoPeriodico", "data" => self::issetJPRiepilogoPeriodico()),
|
||||
array("id" => "mediatori", "data" => self::getMediatori()),
|
||||
array("id" => "vettori", "data" => self::getVettori()),
|
||||
array("id" => "flagViewQtaContratto", "data" => self::getFlagViewQtaContratto()),
|
||||
);
|
||||
|
||||
if (in_array($filter["page"], array("lista", "planner"))) {
|
||||
@@ -187,9 +190,58 @@ class PianoArrivi {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function separaRiga($data) {
|
||||
$key = $data["key"];
|
||||
$riga = $data["riga"];
|
||||
$riga_ord = $riga["riga_ord"];
|
||||
$qtaInserita = $data["qtaInserita"];
|
||||
$dataInserita = $data["dataInserita"];
|
||||
$EntityList = new EntityList;
|
||||
$DtbOrdt = new EntityItem("dtb_ordt");
|
||||
|
||||
if (!is_null($key)) {
|
||||
$DtbOrdt->update()
|
||||
->set("gestione", $key["gestione"])
|
||||
->setDate("dataOrd", $key["data_ord"])
|
||||
->set("numOrd", $key["num_ord"]);
|
||||
}
|
||||
|
||||
$qtaOriginale = $riga["qta_ord"];
|
||||
$qtaNuova = (int)$qtaOriginale - (int)$qtaInserita;
|
||||
|
||||
$DtbOrdr = new EntityItem("dtb_ordr");
|
||||
|
||||
$DtbOrdr->update()
|
||||
->set("rigaOrd", $riga_ord)
|
||||
->set("qtaOrd", $qtaNuova)
|
||||
;
|
||||
|
||||
$DtbOrdt->set("dtbOrdr")->append($DtbOrdr);
|
||||
|
||||
$DtbOrdrNew = new EntityItem("dtb_ordr");
|
||||
|
||||
$DtbOrdrNew->insert()
|
||||
->set("descrizioneEstesa", $riga["descrizione_estesa"])
|
||||
->set("valUnt", $riga["val_unt"])
|
||||
->set("qtaOrd", $qtaInserita)
|
||||
->setDate("dataCons", $dataInserita)
|
||||
->set("flagEvaso", $riga["flag_evaso"])
|
||||
->set("codAlis", $riga["cod_alis"])
|
||||
->set("codArtFor", $riga["cod_art_for"])
|
||||
->set("codMart", $riga["cod_mart"])
|
||||
->set("untOrd", $riga["unt_ord"])
|
||||
;
|
||||
|
||||
$DtbOrdt->set("dtbOrdr")->append($DtbOrdrNew);
|
||||
|
||||
$EntityList->push($DtbOrdt);
|
||||
$Ret = $EntityList->send();
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function updateOrdine($data) {
|
||||
$Ret = new Ret;
|
||||
|
||||
$head = $data["head"];
|
||||
|
||||
if (is_null($head) && count($data["rows"]) == 0) {
|
||||
@@ -227,6 +279,8 @@ class PianoArrivi {
|
||||
|
||||
if (!is_null($head) && !$data["isOrdTrasf"]) {
|
||||
$DtbOrdt->set("codMdep", $head["cod_mdep"])
|
||||
->set("codVage", $head["cod_vage"], true)
|
||||
->set("codVvet", $head["cod_vvet"], true)
|
||||
->set("codVdes", $head["cod_vdes"], true)
|
||||
->set("rifOrd", $head["rif_ord"], true)
|
||||
->set("porto", $head["porto"], true)
|
||||
@@ -281,13 +335,14 @@ class PianoArrivi {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
// exit;
|
||||
|
||||
$DtbOrdr->set("qtaOrd", $row["qta_ord"])
|
||||
->set("flagEvaso", $row["flag_evaso"])
|
||||
->set("valUnt", $row["val_unt"])
|
||||
->set("descrizioneEstesa", $row["descrizione_estesa"])
|
||||
->setDate("dataCons", $row["data_cons"]);
|
||||
->setDate("dataCons", $row["data_cons"])
|
||||
->set("percProv", $row["perc_prov"])
|
||||
->set("valProv", $row["val_prov"])
|
||||
;
|
||||
|
||||
if ($isNuova) {
|
||||
$DtbOrdr->insert()
|
||||
@@ -299,7 +354,7 @@ class PianoArrivi {
|
||||
|
||||
$DtbOrdt->set("dtbOrdr")->append($DtbOrdr);
|
||||
}
|
||||
//echo $DtbOrdt;exit;
|
||||
|
||||
$Ret = $DtbOrdt->send();
|
||||
if ($Ret->is_OK()) {
|
||||
if (is_null($key)) {
|
||||
@@ -324,7 +379,8 @@ class PianoArrivi {
|
||||
$Query->importSqlFile("righeListino")
|
||||
->setVar("cod_alis", $codAlis)
|
||||
->setVar("cod_art_for", $codArtFor)
|
||||
->setVar("cod_mdep", $codMdep);
|
||||
->setVar("cod_mdep", $codMdep)
|
||||
->setVar("userName", User::get_current_username());
|
||||
return $Query->firstRow()->cacheResult()->toRet()->execute();
|
||||
}
|
||||
|
||||
@@ -438,14 +494,16 @@ class PianoArrivi {
|
||||
$Query = new Query;
|
||||
$Query->importSqlFile("righeListino")
|
||||
->setVar("cod_alis", $data["cod_alis"])
|
||||
->setVar("cod_mdep", $data["cod_mdep"]);
|
||||
->setVar("cod_mdep", $data["cod_mdep"])
|
||||
->setVar("userName", User::get_current_username());
|
||||
return $Query->toRet()->execute();
|
||||
}
|
||||
|
||||
public static function getListFornitori() {
|
||||
$Query = new Query;
|
||||
$Query->importSqlFile("list-fornitori")
|
||||
->setVar("codAnag", null);
|
||||
->setVar("codAnag", null)
|
||||
->setVar("userName", User::get_current_username());
|
||||
$Ret = $Query->toRet()->execute();
|
||||
if ($Ret->is_OK()) {
|
||||
$items = $Ret->get_data();
|
||||
@@ -595,7 +653,6 @@ class PianoArrivi {
|
||||
$q = trim(strtolower($data["q"]));
|
||||
if (strlen($q) > 0) {
|
||||
$Query->where("cod_anag+rag_soc_fornitore LIKE '%[Q]%'")->setVar("Q", str_replace("'", "''", $q));
|
||||
|
||||
} else {
|
||||
return $Ret->set_error("Filtro ricerca nullo");
|
||||
}
|
||||
@@ -610,7 +667,6 @@ class PianoArrivi {
|
||||
$q = trim(strtolower($data["q"]));
|
||||
if (strlen($q) > 0) {
|
||||
$Query->where("ml.cod_mart+ma.descrizione LIKE '%[Q]%'")->setVar("Q", str_replace("'", "''", $q));
|
||||
|
||||
} else {
|
||||
return $Ret->set_error("Filtro ricerca nullo");
|
||||
}
|
||||
@@ -624,6 +680,24 @@ class PianoArrivi {
|
||||
);
|
||||
}
|
||||
|
||||
public static function getMediatori() {
|
||||
$Query = new Query;
|
||||
$Query->select("cod_vage", "rag_soc", "perc_prov")
|
||||
->from("vtb_agen")
|
||||
->orderBy("cod_vage");
|
||||
|
||||
return $Query->toRet(false)->cacheResult()->execute();
|
||||
}
|
||||
|
||||
public static function getVettori() {
|
||||
$Query = new Query;
|
||||
$Query->select("cod_vvet", "rag_soc")
|
||||
->from("vtb_vett")
|
||||
->orderBy("cod_vvet");
|
||||
|
||||
return $Query->toRet(false)->cacheResult()->execute();
|
||||
}
|
||||
|
||||
public static function isGestioneAcquistiAbilitata() {
|
||||
return User::isGestioneAbilitata("aordi");
|
||||
}
|
||||
@@ -633,6 +707,10 @@ class PianoArrivi {
|
||||
return $setup->keySection("DEFAULT_DEPO_ARRIVO")->get();
|
||||
}
|
||||
|
||||
public static function getFlagViewQtaContratto() {
|
||||
$GestSetup = new GestSetup;
|
||||
return $GestSetup->keySection("FLAG_VIEW_QTA_CONTRATTO")->defaultValue("N")->asBoolean()->get();
|
||||
}
|
||||
}
|
||||
|
||||
include "Stato.class.php";
|
||||
|
||||
@@ -47,6 +47,7 @@ class Stato {
|
||||
|
||||
private static function getColorStyle($item) {
|
||||
$code = is_integer($item) ? $item : self::getCode($item);
|
||||
|
||||
if ($code === self::INSERITO) {
|
||||
return "warning";
|
||||
} else if ($code === self::INVIATO) {
|
||||
@@ -58,6 +59,7 @@ class Stato {
|
||||
} else if ($code === self::SCADUTO) {
|
||||
return "danger";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -70,7 +72,10 @@ class Stato {
|
||||
return "Ricevuto dal fornitore il [data_ricezione]";
|
||||
} else if ($code === self::EVASO) {
|
||||
return "Ordine evaso";
|
||||
} else if ($code === self::SCADUTO) {
|
||||
return "Ordine scaduto";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
.popover{max-width:600px}.popover .popover-content{overflow-x:auto;padding:2px}ul.pagination{margin-top:0;margin-bottom:0}#content .alert.alert-default.alert-success{background-image:linear-gradient(45deg, #d4edda 25%, #f5f5f5 25%, #f5f5f5 50%, #d4edda 50%, #d4edda 75%, #f5f5f5 75%, #f5f5f5 100%);background-size:56.57px 56.57px}#content .alert.alert-default.alert-warning{background-image:linear-gradient(45deg, #fff3cd 25%, #f5f5f5 25%, #f5f5f5 50%, #fff3cd 50%, #fff3cd 75%, #f5f5f5 75%, #f5f5f5 100%);background-size:56.57px 56.57px}#content .alert.alert-success.alert-warning{background-image:linear-gradient(45deg, #fff3cd 25%, #d4edda 25%, #d4edda 50%, #fff3cd 50%, #fff3cd 75%, #d4edda 75%, #d4edda 100%);background-size:56.57px 56.57px}/*# sourceMappingURL=main.css.map */
|
||||
.popover{max-width:600px}.popover .popover-content{overflow-x:auto;padding:2px}ul.pagination{margin-top:0;margin-bottom:0}#content .alert.alert-default.alert-success{background-image:linear-gradient(45deg, #d4edda 25%, #f5f5f5 25%, #f5f5f5 50%, #d4edda 50%, #d4edda 75%, #f5f5f5 75%, #f5f5f5 100%);background-size:56.57px 56.57px}#content .alert.alert-default.alert-warning{background-image:linear-gradient(45deg, #fff3cd 25%, #f5f5f5 25%, #f5f5f5 50%, #fff3cd 50%, #fff3cd 75%, #f5f5f5 75%, #f5f5f5 100%);background-size:56.57px 56.57px}#content .alert.alert-success.alert-warning{background-image:linear-gradient(45deg, #fff3cd 25%, #d4edda 25%, #d4edda 50%, #fff3cd 50%, #fff3cd 75%, #d4edda 75%, #d4edda 100%);background-size:56.57px 56.57px}.select2{font-size:12px}span.select2-results{text-align:left}.select2-results__option{min-height:30px}.select2-selection.select2-selection--single{min-height:30px;line-height:30px}.select2-selection__arrow{min-height:30px}/*# sourceMappingURL=main.css.map */
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
<td class="text-right text-monospace">
|
||||
<span class="_qtaEvasa"></span>
|
||||
</td>
|
||||
<td class="text-right text-monospace">
|
||||
<span class="_percProv"></span>
|
||||
</td>
|
||||
<td class="text-right text-monospace">
|
||||
<span class="_valProv"></span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="_dataCons"></span>
|
||||
</td>
|
||||
|
||||
@@ -44,6 +44,18 @@
|
||||
<td class="text-right text-monospace">
|
||||
<span class="_qtaEvasa"></span>
|
||||
</td>
|
||||
<td style="width: 74px;">
|
||||
<div class="form-group mb-0">
|
||||
<input name="perc_prov" class="form-control no-spin-buttons input-xs text-right text-monospace" min="0" max="100"
|
||||
placeholder="0" type="number" step="1" lang="en" autocomplete="off"/>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 74px;">
|
||||
<div class="form-group mb-0">
|
||||
<input name="val_prov" class="form-control no-spin-buttons input-xs text-right text-monospace" min="0"
|
||||
placeholder="0" type="number" step="1" lang="en" autocomplete="off"/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group mb-0">
|
||||
<div class="input-group input-group-xs">
|
||||
@@ -61,7 +73,12 @@
|
||||
<option value="A">ANNULLATO</option>
|
||||
</select>
|
||||
<button class="btDelete btn btn-default btn-xs" type="button">
|
||||
<i class="fas fa-trash text-danger opacity-60"></i> <span class="small">RIMUOVI</span>
|
||||
<i class="fas fa-trash text-danger"></i> <span class="small">RIMUOVI</span>
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button class="btSplit btn btn-default btn-xs" type="button" title="Separa Quantità">
|
||||
<i class="fas fa-divide text-primary"></i> <span class="small">SEPARA</span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,6 +1,9 @@
|
||||
<div><?
|
||||
<div>
|
||||
<?php
|
||||
$Alert = new \BC\Alert;
|
||||
$Alert->text("Seleziona gli articoli che desideri aggiungere all'ordine")->show();
|
||||
|
||||
$flagViewQta = PianoArrivi::getFlagViewQtaContratto();
|
||||
?>
|
||||
<table class="table table-striped table-bordered table-condensed table-hover table-text-middle small">
|
||||
<thead>
|
||||
@@ -14,6 +17,9 @@
|
||||
<th rowspan="2">Gg.<br/>approvig.</th>
|
||||
<th rowspan="2">U.M.</th>
|
||||
<th rowspan="2">Q.tà min.<br/>ordinabile</th>
|
||||
<?php if ($flagViewQta) { ?>
|
||||
<th rowspan="2">Q.tà da<br/>contratto</th>
|
||||
<?php } ?>
|
||||
<th colspan="5" class="text-info">Deposito <span class="_codMdep"></span></th>
|
||||
<th rowspan="2" style="width: 90px">Num. consegne</th>
|
||||
</tr>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user