Compare commits
215 Commits
Integry_DP
...
Cosmapack_
| Author | SHA1 | Date | |
|---|---|---|---|
| 2652e61d9a | |||
| 67c9e51c10 | |||
| 6426581e54 | |||
| 449cc21dd8 | |||
| 1069e08e5b | |||
| 8d2c3c8bd6 | |||
| acb0f486a0 | |||
| 44c6a97684 | |||
| 53d51fca7e | |||
| 9269228e29 | |||
| 2584a63533 | |||
| ca39975d17 | |||
| 036e47800d | |||
| 744ce0351c | |||
| fda4904b4b | |||
| b4eebdd870 | |||
| e526a044e8 | |||
| 717c5ccbe5 | |||
| e63005ddfc | |||
| 96dc0cf15e | |||
| 53942db506 | |||
| 96d983a923 | |||
| 8a5be1660f | |||
| 4fed2f33c9 | |||
| 7987d97f44 | |||
| 3d9f9c09f9 | |||
| 5fdc93f017 | |||
| 5721d43d1f | |||
| daf64a1c82 | |||
| 9fd99d827a | |||
| 193cb49c30 | |||
| 2f67923b95 | |||
| 1758635eb2 | |||
| 78832c055f | |||
| 24a5cdefbc | |||
| dd9320d7c9 | |||
| 3c111096c1 | |||
| e6ed487499 | |||
| 96f5478273 | |||
| 5138f8fdd3 | |||
| 0ce750f233 | |||
| af66b3db12 | |||
| 8bfa118543 | |||
| 14b10ef9f3 | |||
| d224d513ea | |||
| 8b262876cc | |||
| 6f293a5459 | |||
| 162a5ecd22 | |||
| c005301fa6 | |||
| a81bca7bce | |||
| e875463467 | |||
| 58a2a9be6b | |||
| 41d9ac4a77 | |||
| 6ab6fbecd7 | |||
| ac5481d386 | |||
| 266c8df54b | |||
| 48006124be | |||
| 9d25af739b | |||
| a5b1a4a67d | |||
| 382b9d5df0 | |||
| c01fa9bdf6 | |||
| 7613a29370 | |||
| 4fca5ccfc9 | |||
| 8cfa6eea88 | |||
| fec4df0477 | |||
| 6e37719db1 | |||
| 7860043a2e | |||
| e6a5c32a77 | |||
| 210668a23f | |||
| 91a3f9f6ee | |||
| 20eb47b07e | |||
| f4cf0b2d43 | |||
| 42831ca8cb | |||
| c856ecc062 | |||
| 650a9285f8 | |||
| d17891bc72 | |||
| 0b9c2ae993 | |||
| a5107e669c | |||
| 05cca03d60 | |||
| da7211026a | |||
| 87fdd92ff9 | |||
| db11b4a719 | |||
| 8fafae725b | |||
| bd1154cf36 | |||
| ec8b3b1e08 | |||
| 61dd8ac8a2 | |||
| 8716bedac1 | |||
| 14786f68e6 | |||
| e57ad565f4 | |||
| 7cc44128ee | |||
| 0455406a52 | |||
| 12e205736c | |||
| 262a6feb0d | |||
| 7a5ee8c9b5 | |||
| ab3bc2fc90 | |||
| 3f2f59cff1 | |||
| 80a1f1dbe7 | |||
| 80e8f4da13 | |||
| 35f8774bf0 | |||
| 94781bef76 | |||
| b469535917 | |||
| 1ed42dda8e | |||
| 9c38b15470 | |||
| a0a2cec00d | |||
| 209d4f7922 | |||
| bca8636e4b | |||
| f4bbea373c | |||
| 847a5c3c63 | |||
| 652c3ba19f | |||
| d970b39ae9 | |||
| ffe760949d | |||
| 28fe701677 | |||
| fc8bc7e53c | |||
| bf74ba1698 | |||
| fa2ecee83b | |||
| 13cb6b86ab | |||
| c6ab8f85c2 | |||
| d8043c7589 | |||
| 59ccc62dc7 | |||
| 3ddc846689 | |||
| 0f83a0fcf2 | |||
| 65889d28a1 | |||
| 07dceb81cb | |||
| 34dc4091c1 | |||
| 5fb0e62d87 | |||
| 051dd901c7 | |||
| d8e1b95fbd | |||
| aa4e81a045 | |||
| 33726fad43 | |||
| a6c5b46794 | |||
| 0080e638c6 | |||
| 7eb571a2a7 | |||
| 0007f5b12f | |||
| 64a81c1888 | |||
| 241df06378 | |||
| 5a46ed9664 | |||
| b4e2f87f5b | |||
| d42641671c | |||
| 6df076518b | |||
| c30eb591bf | |||
| e04d381ce3 | |||
| 10cf9e2888 | |||
| e5c827d96c | |||
| 329fc7d0cb | |||
| 67e44e1d9a | |||
| 292e9f3c39 | |||
| 3c4e5eecc5 | |||
| 73541c2441 | |||
| c9d91630a4 | |||
| e04293fee9 | |||
| 5609a75dd7 | |||
| 277b79be7f | |||
| ece9a34b9e | |||
| 18eda39136 | |||
| d70d5b185b | |||
| f1988627ca | |||
| bb2982f8d5 | |||
| 98e377645d | |||
| 28b7128fcf | |||
| 2fb6a9ed24 | |||
| 3e6ae0439b | |||
| 240bc07a2a | |||
| 50cecba3ae | |||
| 48f98cd3bb | |||
| ab4e9d49e6 | |||
| 3c936fb16f | |||
| 7e4dc2d812 | |||
| f59aee83f9 | |||
| af08926a4d | |||
| b322d55f43 | |||
| 8e203589d1 | |||
| 7281a5be83 | |||
| 3517e4b0d5 | |||
| b4d37adf50 | |||
| 19833e083d | |||
| 9975671d7b | |||
| 582e7692fa | |||
| 532fbcb781 | |||
| 847e0a3cef | |||
| d820cce9f5 | |||
| ba87c261b9 | |||
| f79d073411 | |||
| 0de319043d | |||
| 52a033b707 | |||
| 54c9f06552 | |||
| 04438c8a5d | |||
| 204d5b3ff7 | |||
| 1632c52828 | |||
| 154d93dda8 | |||
| 69179b0795 | |||
| 9cbf5be8da | |||
| 0e008b5f0e | |||
| e68429b61a | |||
| 126b482112 | |||
| 71a24294f8 | |||
| 88de34de51 | |||
| b31902a93d | |||
| 2d0699869d | |||
| 8fde0a1341 | |||
| d11f8ba681 | |||
| c2ed46c835 | |||
| da56835301 | |||
| 30cca4cdda | |||
| 79ab0e9146 | |||
| 5e54e2494b | |||
| 186749d98a | |||
| 19ae35144a | |||
| 9e573d31e5 | |||
| 714cb81ed4 | |||
| 2067d4e9e4 | |||
| 42aed5443f | |||
| ed43f1a351 | |||
| e50b9aa317 | |||
| 04545c6ff8 | |||
| 6f69c8f21c |
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -3,7 +3,4 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="TaskProjectConfiguration">
|
||||
<server type="YouTrack" url="https://integry.myjetbrains.com/youtrack" />
|
||||
</component>
|
||||
</project>
|
||||
23
.idea/pvm.iml
generated
23
.idea/pvm.iml
generated
@@ -3,26 +3,30 @@
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/DULCIAR/monitoraggio_linee_v2" isTestSource="false" packagePrefix="DULCIAR" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/DULCIAR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/magazzino_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2" isTestSource="false" packagePrefix="GRAMM" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LEVANPLAST/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LEVANPLAST" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LICOR" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/modellini/include" isTestSource="false" packagePrefix="Modellini" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/report_area/classes" isTestSource="false" packagePrefix="ReportArea" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/DULCIAR/monitoraggio_linee_v2" isTestSource="false" packagePrefix="DULCIAR" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/DULCIAR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/DULCIAR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/magazzino_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/magazzino_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2" isTestSource="false" packagePrefix="GRAMM" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2" isTestSource="false" packagePrefix="GRAMM" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/GRAMM/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LEVANPLAST/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LEVANPLAST" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LEVANPLAST/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LEVANPLAST" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LICOR" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2" isTestSource="false" packagePrefix="LICOR" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/config_aziende/LICOR/monitoraggio_linee_v2/tipo_prod" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/modellini/include" isTestSource="false" packagePrefix="Modellini" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/modellini/include" isTestSource="false" packagePrefix="Modellini" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/monitoraggio_linee_v2/classes" isTestSource="false" packagePrefix="MonitoraggioLineeV2" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/report_area/classes" isTestSource="false" packagePrefix="ReportArea" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/public_html/gest-lib/report_area/classes" isTestSource="false" packagePrefix="ReportArea" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.idea/dataSources" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/public_html/cache/*" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/public_html/vendor/vlucas/phpdotenv" />
|
||||
@@ -77,6 +81,5 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="counter" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,6 +1,4 @@
|
||||
FROM php:7.4-apache
|
||||
|
||||
RUN a2enmod rewrite
|
||||
FROM php:7.4-fpm
|
||||
|
||||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ const _arr_aziende = [
|
||||
{n: "sapori_veri", sub: ["dispensa"]},
|
||||
{n: "smetar"},
|
||||
{n: "suit", sub: ["santantonio", "carni_sardegna", "valpietro"]},
|
||||
{n: "tosca_cloud"},
|
||||
{n: "tosca_ce"},
|
||||
{n: "tosca_ba"},
|
||||
{n: "tosca_mi"},
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
php-apache:
|
||||
ports:
|
||||
- "80:80"
|
||||
php-fpm:
|
||||
restart: unless-stopped
|
||||
extra_hosts:
|
||||
- host.docker.internal:host-gateway
|
||||
@@ -11,4 +9,15 @@ services:
|
||||
- ./:/var/www/html/pvm
|
||||
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
|
||||
- ./docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||
- ./docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
|
||||
- ./docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
|
||||
apache:
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/apache/Dockerfile
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./:/var/www/html/pvm
|
||||
depends_on:
|
||||
- php-fpm
|
||||
15
docker/apache/Dockerfile
Normal file
15
docker/apache/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM httpd:2.4
|
||||
|
||||
COPY ./docker/apache/apache.vhost.conf /usr/local/apache2/conf/extra/apache.vhost.conf
|
||||
RUN echo "Include /usr/local/apache2/conf/extra/apache.vhost.conf" >> /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Enable Apache modules to ensure proper functionality
|
||||
RUN sed -i \
|
||||
# Uncomment the configuration for mod_deflate to enable compression
|
||||
-e '/#LoadModule deflate_module/s/^#//g' \
|
||||
# Uncomment the configuration for mod_proxy to enable proxying capabilities
|
||||
-e '/#LoadModule proxy_module/s/^#//g' \
|
||||
# Uncomment the configuration for mod_proxy_fcgi to enable FastCGI proxy module
|
||||
-e '/#LoadModule proxy_fcgi_module/s/^#//g' \
|
||||
-e '/#LoadModule rewrite_module/s/^#//g' \
|
||||
/usr/local/apache2/conf/httpd.conf
|
||||
23
docker/apache/apache.vhost.conf
Normal file
23
docker/apache/apache.vhost.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
# Set the ServerName to localhost
|
||||
ServerName localhost
|
||||
|
||||
# Configure a VirtualHost to handle requests on port 80
|
||||
<VirtualHost *:80>
|
||||
# Proxy PHP requests to port 9000 PHP-FPM container
|
||||
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php-fpm:9000/var/www/html/$1 timeout=259200
|
||||
|
||||
# Set the DocumentRoot for the virtual host
|
||||
DocumentRoot /var/www/html/
|
||||
|
||||
# Directory configuration for the DocumentRoot
|
||||
<Directory /var/www/html/>
|
||||
DirectoryIndex index.php
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
# Define the CustomLog and ErrorLog destinations
|
||||
CustomLog /proc/self/fd/1 common
|
||||
ErrorLog /proc/self/fd/2
|
||||
</VirtualHost>
|
||||
6708
package-lock.json
generated
6708
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
"number-ticker": "file:public_html/assets/number-ticker",
|
||||
"pre-commit": "^1.2.2",
|
||||
"rimraf": "^4.4.1",
|
||||
"typescript": "^5.0.3"
|
||||
"typescript": "~5.0.3"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
|
||||
@@ -18,7 +18,7 @@ if (isset($methodName) && isset($type)) {
|
||||
$className = ucfirst(camelCaseEncode($data[0]));
|
||||
$newMethodName = $data[1];
|
||||
|
||||
$var = $type ? $_GET : $_POST;
|
||||
$var = $type === "GET" ? $_GET : $_POST;
|
||||
|
||||
$methodValue = $var[$methodName];
|
||||
unset($var[$methodName]);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
(function ($) {
|
||||
$.fn.dropzone = function (options) {
|
||||
if (!this.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const settings = $.extend({
|
||||
onDrop: undefined,
|
||||
dragBackgroundColor: "#e6ffe6",
|
||||
|
||||
32
public_html/chiusura_tagli_prezzo.php
Normal file
32
public_html/chiusura_tagli_prezzo.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
session_start();
|
||||
include "functions.php";
|
||||
require_once "include_login.php";
|
||||
include "config.php";
|
||||
include "include/module.php";
|
||||
|
||||
include Controller::current_mainClasspath();
|
||||
(new ChiusuraTagliPrezzoAjax())->checkAjaxRequests();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<!--html manifest="manifest.appcache"-->
|
||||
<html lang="it">
|
||||
<head>
|
||||
<?php include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php include pvm_headerNavbar; ?>
|
||||
<?php include pvm_splashScreen; ?>
|
||||
<div id="content">
|
||||
<div><?php
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Api;
|
||||
|
||||
use ErrorHandler;
|
||||
use Query;
|
||||
use Ret;
|
||||
|
||||
class Pvm extends Api {
|
||||
@@ -21,4 +22,32 @@ class Pvm extends Api {
|
||||
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function calcPrzVend($data) {
|
||||
$codVlis = array_get($data, "codVlis");
|
||||
$codMart = array_get($data, "codMart");
|
||||
$przBase = array_get($data, "przBase", 0);
|
||||
$ricarico = array_get($data, "ricarico", 0);
|
||||
$percSfrido = array_get($data, "percSfrido", 0);
|
||||
$maggPrzVend = array_get($data, "maggPrzVend", 0);
|
||||
|
||||
if (array_any_null(array($codVlis, $codMart))) {
|
||||
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, "calcPrzVend");
|
||||
}
|
||||
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->setSql("SELECT dbo.f_calcPrzVend('[codVlis]', '[codMart]', [przBase], [ricarico],
|
||||
[percSfrido],
|
||||
[maggPrzVend])")
|
||||
->setVar("codVlis", $codVlis)
|
||||
->setVar("codMart", $codMart)
|
||||
->setVar("przBase", $przBase)
|
||||
->setVar("ricarico", $ricarico)
|
||||
->setVar("percSfrido", $percSfrido)
|
||||
->setVar("maggPrzVend", $maggPrzVend);
|
||||
|
||||
return $query->firstRowFirstValue()->toRet()->execute();
|
||||
}
|
||||
}
|
||||
22
public_html/classes/Api/RemoteSynchronizationController.php
Normal file
22
public_html/classes/Api/RemoteSynchronizationController.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Api;
|
||||
|
||||
class RemoteSynchronizationController extends Api {
|
||||
protected static $group = "system/remote-sync";
|
||||
|
||||
|
||||
public static function publicationsStatus() {
|
||||
$imsApi = self::imsApi();
|
||||
$imsApi->get("publications/status");
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function startPublication($id) {
|
||||
$imsApi = self::imsApi();
|
||||
$id = array_get($id, "id");
|
||||
$imsApi->get("publications/{$id}/start");
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Api;
|
||||
|
||||
class RemoteSynchronizationSetupController extends Api {
|
||||
protected static $group = "system/remote-sync/setup";
|
||||
|
||||
|
||||
public static function retrievePublications() {
|
||||
$imsApi = self::imsApi();
|
||||
$imsApi->get("publications/retrieve");
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function insertPublicationGroup($data) {
|
||||
$imsApi = self::imsApi();
|
||||
$imsApi->post("publications/insert-group")
|
||||
->body($data);
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function insertPublicationDetail($data) {
|
||||
$imsApi = self::imsApi();
|
||||
$id = array_get($data, "id_parent");
|
||||
$imsApi->post("publications/{$id}/insert")
|
||||
->body(array_pick($data, array("id", "entityName", "active", "exportHistory", "whereCondSql", "whereCondJava")));
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function editPublicationDetail($data) {
|
||||
$imsApi = self::imsApi();
|
||||
$id = array_get($data, "id");
|
||||
$imsApi->post("publications/{$id}/edit")
|
||||
->body(array_pick($data, array("id", "entityName", "active", "exportHistory", "whereCondSql", "whereCondJava"))
|
||||
);
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function deletePublicationDetail($data) {
|
||||
$imsApi = self::imsApi();
|
||||
$id = array_get($data, "id_parent");
|
||||
$imsApi->post("publications/{$id}/delete")
|
||||
->body(array(
|
||||
"entityName" => array_get($data, "entityName"),
|
||||
"active" => array_get($data, "active"),
|
||||
"exportHistory" => array_get($data, "exportHistory")
|
||||
|
||||
));
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function deletePublicationGroup($id) {
|
||||
$imsApi = self::imsApi();
|
||||
$imsApi->get("publications/$id/delete-group");
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
public static function removePublicationGroup($id) {
|
||||
$imsApi = self::imsApi();
|
||||
$id = array_get($id, "id");
|
||||
$imsApi->post("publications/$id/delete-group");
|
||||
return $imsApi->send();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -31,4 +31,8 @@ class EntityArray {
|
||||
public function get_children() {
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
public function count() {
|
||||
return count($this->children);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,35 @@ class EntityItem {
|
||||
}
|
||||
}
|
||||
|
||||
public static function fromArray($array) {
|
||||
$entityItem = new EntityItem(array_get($array, "type"));
|
||||
|
||||
foreach ($array as $key => $value) {
|
||||
if (in_array($key, array("type"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$valueType = gettype($value);
|
||||
|
||||
switch ($valueType) {
|
||||
case "number":
|
||||
if (!$entityItem->set($key, $value, true)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
case "string":
|
||||
if (!$entityItem->setDatetime($key, $value, true)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $entityItem;
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return self::get_jsonBody();
|
||||
}
|
||||
@@ -119,9 +148,11 @@ class EntityItem {
|
||||
$value = strftime(Format::strftimeYMDHMS, $value);
|
||||
} else {
|
||||
try {
|
||||
$dateTime = new DateTime($value);
|
||||
$dateTime = DateTime::createFromFormat(DateTime::ISO8601, $value);
|
||||
|
||||
$value = $dateTime->format(Format::strtotimeYMDHMS);
|
||||
if ($dateTime) {
|
||||
$value = $dateTime->format(Format::strtotimeYMDHMS);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
class EntityList {
|
||||
private $endPoint = null;
|
||||
private $profileDB = null;
|
||||
/**
|
||||
* @var EntityItem[] $entityItems
|
||||
*/
|
||||
private $entityItems = array();
|
||||
private $entityResult = null;
|
||||
private $authUsername = null;
|
||||
|
||||
@@ -78,18 +78,17 @@ class GestSetupWebUser extends GestSetup {
|
||||
return !is_null($this->gest_name) && !is_null($this->getSection()) && !is_null($this->key_section) && !is_null($this->userName);
|
||||
}
|
||||
|
||||
|
||||
public function getAllBySection() {
|
||||
$Query = new Query;
|
||||
$Query->select("CONVERT(TEXT, value) AS value")
|
||||
$query = new Query;
|
||||
$query->select("key_section, CONVERT(TEXT, value) AS value")
|
||||
->from($this->setupTable)
|
||||
->where("user_name", $this->userName)
|
||||
->where("section", $this->getSection())
|
||||
->where("gest_name", $this->gest_name);
|
||||
$Ret = $Query->firstRowFirstValue()->toRet()->execute();
|
||||
|
||||
$value = $Ret->is_OK() ? $Ret->get_data() : null;
|
||||
$ret = $query->toRet()->execute();
|
||||
$value = $ret->is_OK() ? $ret->get_data() : null;
|
||||
|
||||
return $this->parseValue($value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -112,8 +112,7 @@ class MtbAartLink {
|
||||
|
||||
public static function upload($codMart, $fileItems) {
|
||||
$Ret = new Ret;
|
||||
|
||||
$fileItems = \Utility\File::rearrangeFilesArray($fileItems["files"]);
|
||||
$fileItems = \Utility\File::rearrangeFilesArray(array_get($fileItems, "files", $fileItems));
|
||||
|
||||
foreach ($fileItems as $fileItem) {
|
||||
if (file_exists($fileItem["tmp_name"])) {
|
||||
|
||||
@@ -1044,6 +1044,7 @@ class Query {
|
||||
$processSql->profileDB($this->profileDB);
|
||||
$processSql->setDate2ts($this->date2ts);
|
||||
$processSql->setDate2iso($this->date2iso);
|
||||
$processSql->camelCase($this->camelCaseColumnName);
|
||||
$processSql->anonymousAuth($this->anonymousAuth);
|
||||
$result = $processSql->send();
|
||||
if ($result->is_OK()) {
|
||||
|
||||
@@ -6,7 +6,6 @@ class ReportType {
|
||||
"ETICHETTA_SSCC_ACCETTAZIONE" => self::ETICHETTA_SSCC_ACCETTAZIONE,
|
||||
"ETICHETTA_SSCC_LAVORAZIONE" => self::ETICHETTA_SSCC_LAVORAZIONE,
|
||||
"ETICHETTA_SSCC_SPEDIZIONE" => self::ETICHETTA_SSCC_SPEDIZIONE,
|
||||
"WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD" => self::WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD,
|
||||
"WMS_SPEDIZIONE_PACKING_LIST_ORD" => self::WMS_SPEDIZIONE_PACKING_LIST_ORD,
|
||||
"STAMPA_LISTINI_VENDITA" => self::STAMPA_LISTINI_VENDITA
|
||||
);
|
||||
@@ -14,7 +13,6 @@ class ReportType {
|
||||
const ETICHETTA_SSCC_ACCETTAZIONE = 0;
|
||||
const ETICHETTA_SSCC_LAVORAZIONE = 1;
|
||||
const ETICHETTA_SSCC_SPEDIZIONE = 2;
|
||||
const WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD = 3;
|
||||
const WMS_SPEDIZIONE_PACKING_LIST_ORD = 4;
|
||||
const STAMPA_LISTINI_VENDITA = 5;
|
||||
|
||||
|
||||
@@ -58,25 +58,37 @@ class StbActivityFile {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function upload($activityId, $fileItem, $profileDb = null, $getItem = true) {
|
||||
public static function upload($activityId, $fileItems, $profileDb = null, $getItem = true) {
|
||||
$Ret = new Ret;
|
||||
if (file_exists($fileItem["tmp_name"])) {
|
||||
if (is_array($activityId)) {
|
||||
foreach ($activityId as $id) {
|
||||
if ($Ret->is_KO()) {
|
||||
break;
|
||||
$fileItems = \Utility\File::rearrangeFilesArray($fileItems["files"]);
|
||||
$attachments = array();
|
||||
|
||||
foreach ($fileItems as $fileItem) {
|
||||
if (file_exists($fileItem["tmp_name"])) {
|
||||
if (is_array($activityId)) {
|
||||
foreach ($activityId as $id) {
|
||||
if ($Ret->is_KO()) {
|
||||
break;
|
||||
}
|
||||
|
||||
$Ret = self::saveFile($id, $fileItem, true, $profileDb, $getItem);
|
||||
}
|
||||
$Ret = self::saveFile($id, $fileItem, true, $profileDb, $getItem);
|
||||
} else {
|
||||
$Ret = self::saveFile($activityId, $fileItem, true, $profileDb, $getItem);
|
||||
}
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = $Ret->get_data();
|
||||
$attachments[] = $retData;
|
||||
@unlink($fileItem["tmp_name"]);
|
||||
}
|
||||
} else {
|
||||
$Ret = self::saveFile($activityId, $fileItem, true, $profileDb, $getItem);
|
||||
}
|
||||
if ($Ret->is_OK()) {
|
||||
@unlink($fileItem["tmp_name"]);
|
||||
$Ret->set_error("File non trovato");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$Ret->set_error("File non trovato");
|
||||
if (count($attachments) > 0) {
|
||||
$Ret->set_data($attachments);
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"jquery-uiDatepicker"
|
||||
"jquery-uiDatepicker",
|
||||
"jquery-dropzone"
|
||||
],
|
||||
"requirePermission": false
|
||||
},
|
||||
@@ -2262,5 +2263,46 @@
|
||||
"visibility"
|
||||
],
|
||||
"requirePermission": true
|
||||
},
|
||||
"listini_vendita": {
|
||||
"title": "Listini di vendita",
|
||||
"pages": "listini_vendita.php",
|
||||
"position": [],
|
||||
"children": [
|
||||
"modal_selezione_articoli"
|
||||
],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"flexbox",
|
||||
"kendo"
|
||||
],
|
||||
"requirePermission": true
|
||||
},
|
||||
"chiusura_tagli_prezzo": {
|
||||
"title": "Chiusura Tagli Prezzo",
|
||||
"pages": "chiusura_tagli_prezzo.php",
|
||||
"position": [],
|
||||
"children": [],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"flexbox",
|
||||
"kendo"
|
||||
],
|
||||
"requirePermission": true
|
||||
},
|
||||
"sincronizzazioni": {
|
||||
"title": "Sincronizzazioni",
|
||||
"pages": "sincronizzazioni.php",
|
||||
"position": [],
|
||||
"children": [],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"kendo",
|
||||
"visibility"
|
||||
],
|
||||
"requirePermission": true
|
||||
}
|
||||
}
|
||||
@@ -11,37 +11,76 @@
|
||||
<?= $fermoMacchina["controllo"] ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td class="vertical-middle col-sm-4 text-center">
|
||||
Pulsanti
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
foreach ($fermiMacchina as $fermoMacchina) {
|
||||
$valoreRif = array_get($fermoMacchina, "valore_rif");
|
||||
$valoreRil = array_get($fermoMacchina['rip'][0], "valore_ril", "");
|
||||
?>
|
||||
<td class="vertical-middle col-sm-4 text-center"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-controllo="<?= $fermoMacchina['controllo'] ?>"
|
||||
data-repetitions=<?= $fermoMacchina['num_rip'] ?>>
|
||||
<?php
|
||||
$righePiene = array_unique(array_merge(...array_map(function ($fermoMacchina) {
|
||||
return array_map(function ($ripetizione) {
|
||||
return $ripetizione["num_rip"];
|
||||
}, $fermoMacchina["rip"]);
|
||||
}, $fermiMacchina)));
|
||||
|
||||
$maxNumRip = array_get($fermiMacchina[0], "num_rip");
|
||||
$righePiene = count($righePiene) ? $righePiene : array('0');
|
||||
sort($righePiene);
|
||||
|
||||
foreach ($righePiene as $i) {
|
||||
?>
|
||||
<tr class="fermoMacchinaRow" data-lastnumrip="<?= $i ?>">
|
||||
<?php
|
||||
foreach ($fermiMacchina as $fermoMacchina) {
|
||||
$ripetizioni = array_get($fermoMacchina, "rip");
|
||||
$ripetizione = current(array_filter($ripetizioni, function ($ripetizione) use ($i) {
|
||||
return $ripetizione["num_rip"] == $i;
|
||||
}));
|
||||
$valoreRif = array_get($fermoMacchina, "valore_rif");
|
||||
$valoreRil = array_get($ripetizione, "valore_ril", "");
|
||||
$numRip = array_get($ripetizione, "num_rip", 0);
|
||||
?>
|
||||
<td class="vertical-middle col-sm-4 text-center"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-controllo="<?= $fermoMacchina['controllo'] ?>">
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<?php if ($valoreRif === "Calendario") { ?>
|
||||
<input type="text" class="form-control controlInput dateTimePicker"
|
||||
name="valore_ril"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-num_rip="<?= $i ?>"
|
||||
data-prev="<?= $valoreRil ?>"
|
||||
value="<?= $valoreRil ?>"
|
||||
autocomplete="one-time-code" style="background-color: #fff;" readonly>
|
||||
<?php } else { ?>
|
||||
<input type="text" class="form-control controlInput"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-num_rip="<?= $i ?>"
|
||||
data-prev="<?= $valoreRil ?>" value="<?= $valoreRil ?>">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td class="vertical-middle col-sm-4 text-center" data-repetitions=<?= $maxNumRip ?>>
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<?php if ($valoreRif) { ?>
|
||||
<input type="date" class="form-control controlInput" id="dataIniz" name="valore_ril"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-num_rip="<?= $i + 1 ?>"
|
||||
data-prev="<?= $valoreRil ?>"
|
||||
value="<?= $valoreRil ?>">
|
||||
<?php } else { ?>
|
||||
<input type="text" class="form-control controlInput"
|
||||
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
|
||||
data-num_rip="<?= $i + 1 ?>"
|
||||
data-prev="<?= $valoreRil ?>"
|
||||
value="<?= $valoreRil ?>">
|
||||
<?php } ?>
|
||||
<span class="plusRow btn input-group-addon py-0 <?= $i !== end($righePiene) ? "disabled" : "" ?>"
|
||||
style="height: 35px; <?= $i !== end($righePiene) ? "" : "cursor: pointer" ?>"
|
||||
title="Aggiungi Riga">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-plus text-success"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="deleteRow btn input-group-addon py-0"
|
||||
style="height: 35px; cursor: pointer" title="Elimina Riga">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-trash-alt text-danger"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -59,24 +59,72 @@ CQ_DR03P06.prototype.generatePdf = function (f) {
|
||||
};
|
||||
|
||||
CQ_DR03P06.prototype.init = function (o) {
|
||||
var self = this;
|
||||
var $dom = self._$dom;
|
||||
const self = this;
|
||||
const $dom = self._$dom;
|
||||
self._parent = o;
|
||||
self._toast = new Toast();
|
||||
|
||||
if (is_jqueryObject($dom)) {
|
||||
var $cqInputs = $dom.find("div.input-group > input[data-num_rip]"); /* here we add the saving function to all the input-groups already loaded from db*/
|
||||
|
||||
$cqInputs.on("change", _.bind(self.saveSingleInput, self));
|
||||
$dom.find("input.caratInput").on("change", _.bind(self.saveCaratInput, self));
|
||||
/************************************* PLUS LISTENER ADDED ****************************************/
|
||||
var $plus = $dom.find("div.input-group > span.plus:not('disabled')");
|
||||
$plus.on("click", _.bind(self.onPlusClick, self)); //anziché chiamare self.setPlusListener()
|
||||
|
||||
var $trash = $dom.find("div.input-group > span.trash:not('disabled')");
|
||||
$trash.on("click", _.bind(self.onTrashClick, self));
|
||||
self.initButtons($dom);
|
||||
}
|
||||
};
|
||||
|
||||
CQ_DR03P06.prototype.initButtons = function ($tr) {
|
||||
const self = this;
|
||||
const $cqInputs = $tr.find("div.input-group > input[data-num_rip]"); /* here we add the saving function to all the input-groups already loaded from db*/
|
||||
|
||||
$cqInputs.on("change", _.bind(self.saveSingleInput, self));
|
||||
$tr.find("input.caratInput").on("change", _.bind(self.saveCaratInput, self));
|
||||
|
||||
const $plus = $tr.find("div.input-group > span.plus:not('.disabled')");
|
||||
$plus.on("click", _.bind(self.onPlusClick, self)); //anziché chiamare self.setPlusListener()
|
||||
|
||||
const $trash = $tr.find("div.input-group > span.trash:not('.disabled')");
|
||||
$trash.on("click", _.bind(self.onTrashClick, self));
|
||||
|
||||
const $plusRow = $tr.find("div.input-group > span.plusRow:not('.disabled')");
|
||||
$plusRow.on("click", _.bind(self.onPlusRowClick, self));
|
||||
|
||||
const $deleteRow = $tr.find("div.input-group > span.deleteRow:not('.disabled')");
|
||||
$deleteRow.on("click", _.bind(self.onDeleteRowClick, self));
|
||||
|
||||
const $dateTimePicker = $tr.find(".dateTimePicker");
|
||||
const onSelectDateTime = _.debounce((inst) => {
|
||||
inst.$el.trigger("change");
|
||||
}, 2000);
|
||||
|
||||
let lastDate;
|
||||
|
||||
$dateTimePicker.datepicker({
|
||||
timepicker: true,
|
||||
dateFormat: "dd/mm/yyyy",
|
||||
timeFormat: "hh:ii",
|
||||
inModal: true,
|
||||
position: "top left",
|
||||
clearButton: true,
|
||||
onSelect: function (formattedDate, date, inst) {
|
||||
const value = inst.$el.val();
|
||||
|
||||
if (lastDate === "" || lastDate !== value) {
|
||||
onSelectDateTime(inst);
|
||||
}
|
||||
},
|
||||
onShow: function (inst) {
|
||||
const value = inst.$el.val();
|
||||
const dateValue = moment(value, "DD/MM/YYYY HH:mm").toDate();
|
||||
|
||||
lastDate = value;
|
||||
if (isValidDate(dateValue)) {
|
||||
inst.selectDate(dateValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function isValidDate(d) {
|
||||
return d instanceof Date && !isNaN(d);
|
||||
}
|
||||
|
||||
/*
|
||||
@ adds subsequent input boxes and the relative onclick listeners
|
||||
*/
|
||||
@@ -93,18 +141,23 @@ CQ_DR03P06.prototype.onPlusClick = function (event) {
|
||||
var repetitionsLeft = totalRepetitions - $td.find("input.controlInput").length;
|
||||
|
||||
if (repetitionsLeft > 0) {
|
||||
var html = `<div class="col-sm-12 input-group mb-6">
|
||||
const html = `
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<input type="text" class="form-control controlInput" data-id_riga ="${$td.attr("data-id_riga")}" data-num_rip="${$td.find("input.controlInput").length + 1}" data-prev="" >
|
||||
<span class="plus cursor-pointer btn input-group-addon py-0" title="aggiungi ulteriore misurazione">
|
||||
<div class='p-0' >
|
||||
<i class="fa fa-plus"></i>
|
||||
<div class='p-0'>
|
||||
<i class="fa fa-plus text-success"></i>
|
||||
</div>
|
||||
</span>
|
||||
<span class=" trash btn input-group-addon py-0 disabled" title="elimina dato">
|
||||
<div class='p-0'><i class="fa fa-trash"></i></div>
|
||||
<span class="trash btn input-group-addon py-0 disabled" title="Elimina dato">
|
||||
<div class='p-0'>
|
||||
<i class="fa fa-trash text-danger"></i>
|
||||
</div>
|
||||
</span>
|
||||
</div>`;
|
||||
var $html = $(html);
|
||||
</div>
|
||||
`;
|
||||
|
||||
const $html = $(html);
|
||||
|
||||
/*************** ADD THE LISTENER TO THE FRESH NEW INPUT TO BE ADDED TO THE DOM ***************************************/
|
||||
/**** WE NEED TO ADD THE LISTENER HERE, BECAUSE ON BEFORE SHOW, THESE NEW INPUT BOXES DID NOT EXIST *****************/
|
||||
@@ -122,7 +175,92 @@ CQ_DR03P06.prototype.onPlusClick = function (event) {
|
||||
}
|
||||
} else {
|
||||
$input.focus();
|
||||
self._toast.warning("inserisci la prima misurazione");
|
||||
self._toast.warning("Inserisci la prima misurazione");
|
||||
}
|
||||
};
|
||||
|
||||
CQ_DR03P06.prototype.onPlusRowClick = function (event) {
|
||||
const self = this;
|
||||
const $plusRowBtn = $(event.currentTarget);
|
||||
const $fermoMacchinaRow = $(".fermoMacchinaRow");
|
||||
const $lastFermoMacchinaRow = $(".fermoMacchinaRow:last");
|
||||
const $td = $plusRowBtn.closest("td");
|
||||
const totalRepetitions = $td.getIntAttr("data-repetitions");
|
||||
const lastNumRip = $lastFermoMacchinaRow.getIntAttr("data-lastnumrip");
|
||||
|
||||
let repetitionsLeft = totalRepetitions - lastNumRip;
|
||||
|
||||
if (repetitionsLeft > 0) {
|
||||
const $row = $plusRowBtn.parents("tr.fermoMacchinaRow");
|
||||
const $clone = $row.clone().find("input").val("").end();
|
||||
const repetitions = $clone.find("[data-num_rip]");
|
||||
|
||||
const lastNumRip = $clone.attr("data-lastnumrip");
|
||||
const newLastNumRip = Number(lastNumRip) + 1;
|
||||
$clone.attr("data-lastnumrip", newLastNumRip);
|
||||
|
||||
repetitions.each(function () {
|
||||
const repetition = $(this).attr("data-num_rip");
|
||||
const newRepetition = Number(repetition) + 1;
|
||||
|
||||
$(this).attr("data-num_rip", newRepetition);
|
||||
});
|
||||
/*************** ADD THE LISTENER TO THE FRESH NEW INPUT TO BE ADDED TO THE DOM ***************************************/
|
||||
/**** WE NEED TO ADD THE LISTENER HERE, BECAUSE ON BEFORE SHOW, THESE NEW INPUT BOXES DID NOT EXIST *****************/
|
||||
|
||||
$row.find(".plusRow:not('.disabled')").off("click").addClass("disabled");
|
||||
$row.after($clone);
|
||||
$fermoMacchinaRow.find(".deleteRow.disabled").removeClass("disabled");
|
||||
self.initButtons($clone);
|
||||
|
||||
repetitionsLeft--;
|
||||
|
||||
if (repetitionsLeft <= 0) { /* it means that we have to insert the last input box */
|
||||
$clone.find(".plusRow").addClass("disabled").removeClass("cursor-pointer")
|
||||
.attr("title", "Non sono previste altre misurazioni per questo controllo");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CQ_DR03P06.prototype.onDeleteRowClick = function (event) {
|
||||
const self = this;
|
||||
const $plusRowBtn = $(event.currentTarget);
|
||||
const $fermoMacchinaRow = $(".fermoMacchinaRow");
|
||||
const $td = $plusRowBtn.closest("td");
|
||||
const $row = $plusRowBtn.parents("tr.fermoMacchinaRow");
|
||||
let fmrLength = $fermoMacchinaRow.length;
|
||||
|
||||
if (fmrLength > 0) {
|
||||
const rowInputs = $row.find("input.controlInput").val("");
|
||||
const cqrs = [];
|
||||
|
||||
_.each(rowInputs, function (rowInput) {
|
||||
const $rowInput = $(rowInput);
|
||||
const cqr = {
|
||||
id_riga: $rowInput.getIntDataAttr("id_riga"),
|
||||
num_rip: $rowInput.getIntDataAttr("num_rip"),
|
||||
valore_ril: $rowInput.val().trim(),
|
||||
data_ril: getNow(),
|
||||
};
|
||||
|
||||
cqrs.push(cqr);
|
||||
});
|
||||
|
||||
self._onCqrChange(cqrs).then((updateOK) => {
|
||||
if (updateOK) {
|
||||
if (fmrLength > 1) {
|
||||
$row.remove();
|
||||
}
|
||||
|
||||
self._allowToast ? self._toast.success("Riga eliminata correttamente") : self.allowFollowingToast(true);
|
||||
} else {
|
||||
self._toast.danger("Riga non eliminata, si prega di chiudere e riaprire i Dettagli");
|
||||
}
|
||||
});
|
||||
|
||||
if (fmrLength === 1) {
|
||||
$fermoMacchinaRow.find(".deleteRow:not('.disabled')").addClass("disabled");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -166,30 +304,34 @@ CQ_DR03P06.prototype.resetInput = function (event) {
|
||||
@ param: event - the onchange done on interested input
|
||||
*/
|
||||
CQ_DR03P06.prototype.saveSingleInput = function (event, finalEnableTrash = true, origin = "input-value") {
|
||||
var myUpdateOK;
|
||||
var self = this;
|
||||
const self = this;
|
||||
let $input;
|
||||
|
||||
if (!(typeof event.currentTarget === "undefined")) {
|
||||
/****** passed parameter is an event **********/
|
||||
var $input = $(event.currentTarget).closest("div.input-group").find("input.controlInput");
|
||||
$input = $(event.currentTarget).closest("div.input-group").find("input.controlInput");
|
||||
} else {
|
||||
/******* passed parameter is a context **********/
|
||||
var $input = event.closest("div.input-group").find("input.controlInput");
|
||||
$input = event.closest("div.input-group").find("input.controlInput");
|
||||
}
|
||||
|
||||
$input.prop("disabled", true);
|
||||
var $td = $input.closest("td[data-repetitions]");
|
||||
|
||||
const $td = $input.closest("td[data-repetitions]");
|
||||
/************ meanwhile disable alle delete operations ****************/
|
||||
var cqr = {
|
||||
const cqr = {
|
||||
id_riga: $input.getIntDataAttr("id_riga"),
|
||||
num_rip: $input.getIntDataAttr("num_rip"),
|
||||
valore_ril: (origin === "data-prev" ? ($input.data("prev")) : ($input.val().trim())),
|
||||
data_ril: getNow()
|
||||
};
|
||||
|
||||
if (!is_null(self._orderKey) && is_function(self._onCqrChange) && !_.isNil(cqr["valore_ril"]) && !_.isEmpty(cqr["valore_ril"])) {
|
||||
const savePromise = new $.Deferred();
|
||||
|
||||
if (!is_null(self._orderKey) && is_function(self._onCqrChange)) {
|
||||
/************** remember for future input-type modification: _.isEmpty(number) gives True !!!! *****************/
|
||||
self.disableTrash($td);
|
||||
/****************************************** NEW PROMISE *********************************************/
|
||||
var savePromise = new $.Deferred();
|
||||
|
||||
self._onCqrChange([cqr]).then((updateOK) => {
|
||||
if (updateOK) {
|
||||
$input.attr("data-prev", cqr["valore_ril"]);
|
||||
@@ -200,15 +342,16 @@ CQ_DR03P06.prototype.saveSingleInput = function (event, finalEnableTrash = true,
|
||||
$input.prop("disabled", false);
|
||||
} else {
|
||||
/******* this message should be never displayed *****/
|
||||
self._toast.danger("dati non salvati, si prega di chiudere e riaprire i Dettagli");
|
||||
self._toast.danger("Dati non salvati, si prega di chiudere e riaprire i Dettagli");
|
||||
$input.val("");
|
||||
savePromise.resolve(false);
|
||||
$input.prop("disabled", false);
|
||||
}
|
||||
});
|
||||
} else if (!is_null(self._orderKey) && is_function(self._onCqrChange) && !_.isNil(cqr["valore_ril"]) && _.isEmpty(cqr["valore_ril"])) {
|
||||
} else {
|
||||
self.resetInput(event);
|
||||
}
|
||||
|
||||
return savePromise;
|
||||
};
|
||||
|
||||
@@ -297,7 +440,7 @@ CQ_DR03P06.prototype.onTrashClick = function (event) {
|
||||
/****************** DELETION OF LAST ROW *****/
|
||||
self._onTrashClick([remainedCqr]).then((updateOK) => {
|
||||
if (updateOK) {
|
||||
self._toast.success("misurazione cancellata correttamente");
|
||||
self._toast.success("Misurazione cancellata correttamente");
|
||||
self.resetInput($inputGroup);
|
||||
$td.find("input.controlInput").prop("disabled", false);
|
||||
self.enableTrash($td);
|
||||
@@ -316,7 +459,7 @@ CQ_DR03P06.prototype.onTrashClick = function (event) {
|
||||
);
|
||||
} else {
|
||||
/************* last input is empty *************************/
|
||||
self._toast.success("misurazione cancellata correttamente");
|
||||
self._toast.success("Misurazione cancellata correttamente");
|
||||
$td.find("input.controlInput").prop("disabled", false);
|
||||
self.enableTrash($td);
|
||||
self.enablePlus($td);
|
||||
@@ -331,7 +474,7 @@ CQ_DR03P06.prototype.onTrashClick = function (event) {
|
||||
$td.find("input.controlInput").prop("disabled", false);
|
||||
self.enableTrash($td);
|
||||
self.enablePlus($td);
|
||||
self._toast.success("misurazione cancellata correttamente");
|
||||
self._toast.success("Misurazione cancellata correttamente");
|
||||
|
||||
} else {
|
||||
/***** the clicked input is the first and the last remained *****************/
|
||||
@@ -339,7 +482,7 @@ CQ_DR03P06.prototype.onTrashClick = function (event) {
|
||||
$input.val("");
|
||||
self.enableTrash($td);
|
||||
self.enablePlus($td);
|
||||
self._toast.success("misurazione cancellata correttamente");
|
||||
self._toast.success("Misurazione cancellata correttamente");
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -88,39 +88,44 @@ $CQDR03P06 = new CQDR03P06($arr_cq);
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($standardCQ as $singleControl) { ?>
|
||||
<?php foreach ($standardCQ as $controlloQualita) { ?>
|
||||
<tr class="">
|
||||
<td class="vertical-middle col-sm-4 text-center">
|
||||
<?= $singleControl['controllo'] ?>
|
||||
<?= $controlloQualita['controllo'] ?>
|
||||
</td>
|
||||
<td class="vertical-middle col-sm-4 text-center">
|
||||
<?= $singleControl['valore_rif'] ?>
|
||||
<?= $controlloQualita['valore_rif'] ?>
|
||||
</td>
|
||||
<td class="col-sm-4 text-center m-0"
|
||||
data-id_riga="<?= $singleControl["id_riga"] ?>"
|
||||
data-controllo="<?= $singleControl['controllo'] ?>"
|
||||
data-repetitions=<?= $singleControl['num_rip'] ?>>
|
||||
data-id_riga="<?= $controlloQualita["id_riga"] ?>"
|
||||
data-controllo="<?= $controlloQualita['controllo'] ?>"
|
||||
data-repetitions=<?= $controlloQualita['num_rip'] ?>>
|
||||
<?php
|
||||
if (is_array($singleControl['rip']) && count($singleControl['rip'])) {
|
||||
for ($i = 0; $i < count($singleControl['rip']); $i++) { /*$singleControl['rip'] is the total number of measurements */
|
||||
if (is_array($controlloQualita['rip']) && count($controlloQualita['rip'])) {
|
||||
$ripetizioni = array_get($controlloQualita, "rip");
|
||||
for ($i = 0; $i < count($ripetizioni); $i++) {
|
||||
$ripetizione = array_get($ripetizioni, $i);
|
||||
$valoreRil = array_get($ripetizione, "valore_ril", "");
|
||||
|
||||
/* $singleControl['rip'] is the total number of measurements */
|
||||
?>
|
||||
<!--the following input groups have to be added only if there are already data in the db-->
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<input type="text" class="form-control controlInput"
|
||||
data-id_riga="<?= $singleControl["id_riga"] ?>"
|
||||
data-id_riga="<?= $controlloQualita["id_riga"] ?>"
|
||||
data-num_rip="<?= $i + 1 ?>"
|
||||
data-prev="<?= ($singleControl['rip'][$i]['valore_ril']) ?>"
|
||||
value="<?= ($singleControl['rip'][$i]['valore_ril']) ?>">
|
||||
<span class="plus <?= $singleControl['num_rip'] == count($singleControl['rip']) ? ("cursor-pointer") : ("disabled") ?> btn input-group-addon py-0"
|
||||
title="<?= $singleControl['num_rip'] == count($singleControl['rip']) ? ("Aggiungi ulteriore misurazione") : ("Non sono previste altre misurazioni per questo controllo") ?>">
|
||||
data-prev="<?= $valoreRil ?>"
|
||||
value="<?= $valoreRil ?>">
|
||||
<span class="plus <?= $controlloQualita['num_rip'] == count($ripetizioni) ? ("cursor-pointer") : ("disabled") ?> btn input-group-addon py-0"
|
||||
title="<?= $controlloQualita['num_rip'] == count($ripetizioni) ? ("Aggiungi ulteriore misurazione") : ("Non sono previste altre misurazioni per questo controllo") ?>">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-plus text-success"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="trash btn input-group-addon py-0 cursor-pointer"
|
||||
title="Elimina Dato">
|
||||
title="Elimina dato">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-trash-alt text-danger"></i>
|
||||
<i class="fa fa-trash text-danger"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@@ -129,20 +134,21 @@ $CQDR03P06 = new CQDR03P06($arr_cq);
|
||||
} else {
|
||||
/* the other possibilities should be that $singleControl['rip'] is null or is an empty array*/
|
||||
?>
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<div class="col-sm-12 input-group mb-6">
|
||||
<input type="text" class="form-control controlInput"
|
||||
data-id_riga="<?= $singleControl["id_riga"] ?>"
|
||||
data-num_rip="1"
|
||||
data-prev=""
|
||||
value="">
|
||||
<span class="plus <?= ($singleControl['num_rip'] > 0 ? ("cursor-pointer") : ("disabled")) ?> btn input-group-addon py-0"
|
||||
title="<?= ($singleControl['num_rip'] > 0 ? ("aggiungi ulteriore misurazione") : ("non sono previste altre misurazioni per questo controllo")) ?>">
|
||||
<div class='p-0'><i class="fa fa-plus text-success"></i></div>
|
||||
</span>
|
||||
<span class="trash btn input-group-addon py-0 disabled"
|
||||
title="elimina dato">
|
||||
<div class='p-0'><i class="fa fa-trash-alt text-danger"></i></div>
|
||||
</span>
|
||||
data-id_riga="<?= $controlloQualita["id_riga"] ?>"
|
||||
data-num_rip="1" data-prev="" value="">
|
||||
<span class="plus <?= $controlloQualita['num_rip'] > 0 ? ("cursor-pointer") : ("disabled") ?> btn input-group-addon py-0"
|
||||
title="<?= $controlloQualita['num_rip'] > 0 ? ("Aggiungi ulteriore misurazione") : ("Non sono previste altre misurazioni per questo controllo") ?>">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-plus text-success"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="trash btn input-group-addon py-0 disabled" title="Elimina dato">
|
||||
<span class='p-0'>
|
||||
<i class="fa fa-trash text-danger"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
@@ -181,6 +187,7 @@ $CQDR03P06 = new CQDR03P06($arr_cq);
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
if ($mtbAart["cod_mgrp"] === "SL" && count($fermiMacchina) > 0) {
|
||||
include "cq_DR03P06-SL.php";
|
||||
|
||||
@@ -814,6 +814,7 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
columns: [
|
||||
{
|
||||
id: "37eea8cc-09e0-40e1-bd9d-61c42a48a915",
|
||||
field: "qta_vend_1trm_p",
|
||||
title: `${ucfirst(now.month(0).format("MMM"))}<br>${ucfirst(now.month(2).format("MMM"))}`,
|
||||
type: "number",
|
||||
attributes: {
|
||||
@@ -824,7 +825,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_1trm_p && this.numberFormat(data.qta_vend_1trm_p) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_1trm_p}) => qta_vend_1trm_p?.sum && this.numberFormat(qta_vend_1trm_p.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_1trm_p}) => qta_vend_1trm_p?.sum && this.numberFormat(qta_vend_1trm_p.sum) || "",
|
||||
footerTemplate: ({qta_vend_1trm_p}) => qta_vend_1trm_p?.sum && this.numberFormat(qta_vend_1trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "c39d87b7-a5cf-4b9d-b2a9-518bab8922ee",
|
||||
@@ -839,7 +841,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_2trm_p && this.numberFormat(data.qta_vend_2trm_p) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_2trm_p}) => qta_vend_2trm_p?.sum && this.numberFormat(qta_vend_2trm_p.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_2trm_p}) => qta_vend_2trm_p?.sum && this.numberFormat(qta_vend_2trm_p.sum) || "",
|
||||
footerTemplate: ({qta_vend_2trm_p}) => qta_vend_2trm_p?.sum && this.numberFormat(qta_vend_2trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "5c301c07-9ae7-4fa3-8a72-a41553a46013",
|
||||
@@ -854,7 +857,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_3trm_p && this.numberFormat(data.qta_vend_3trm_p) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_3trm_p}) => qta_vend_3trm_p?.sum && this.numberFormat(qta_vend_3trm_p.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_3trm_p}) => qta_vend_3trm_p?.sum && this.numberFormat(qta_vend_3trm_p.sum) || "",
|
||||
footerTemplate: ({qta_vend_3trm_p}) => qta_vend_3trm_p?.sum && this.numberFormat(qta_vend_3trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "9910ddac-9512-477c-ae80-623b2899042a",
|
||||
@@ -869,7 +873,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_4trm_p && this.numberFormat(data.qta_vend_4trm_p) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_4trm_p}) => qta_vend_4trm_p?.sum && this.numberFormat(qta_vend_4trm_p.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_4trm_p}) => qta_vend_4trm_p?.sum && this.numberFormat(qta_vend_4trm_p.sum) || "",
|
||||
footerTemplate: ({qta_vend_4trm_p}) => qta_vend_4trm_p?.sum && this.numberFormat(qta_vend_4trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "cc41885d-a259-47d1-8d33-f64126347889",
|
||||
@@ -909,7 +914,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_1trm_c && this.numberFormat(data.qta_vend_1trm_c) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_1trm_c}) => qta_vend_1trm_c?.sum && this.numberFormat(qta_vend_1trm_c.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_1trm_c}) => qta_vend_1trm_c?.sum && this.numberFormat(qta_vend_1trm_c.sum) || "",
|
||||
footerTemplate: ({qta_vend_1trm_c}) => qta_vend_1trm_c?.sum && this.numberFormat(qta_vend_1trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "e6bad069-35d5-4fd6-87c2-5130f246c43b",
|
||||
@@ -924,7 +930,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_2trm_c && this.numberFormat(data.qta_vend_2trm_c) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_2trm_c}) => qta_vend_2trm_c?.sum && this.numberFormat(qta_vend_2trm_c.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_2trm_c}) => qta_vend_2trm_c?.sum && this.numberFormat(qta_vend_2trm_c.sum) || "",
|
||||
footerTemplate: ({qta_vend_2trm_c}) => qta_vend_2trm_c?.sum && this.numberFormat(qta_vend_2trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "5c301c07-9ae7-4fa3-8a72-a41553a46013",
|
||||
@@ -939,7 +946,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_3trm_c && this.numberFormat(data.qta_vend_3trm_c) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_3trm_c}) => qta_vend_3trm_c?.sum && this.numberFormat(qta_vend_3trm_c.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_3trm_c}) => qta_vend_3trm_c?.sum && this.numberFormat(qta_vend_3trm_c.sum) || "",
|
||||
footerTemplate: ({qta_vend_3trm_c}) => qta_vend_3trm_c?.sum && this.numberFormat(qta_vend_3trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "46f92585-d58a-4d06-ad17-0359903d4ec3",
|
||||
@@ -954,7 +962,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.qta_vend_4trm_c && this.numberFormat(data.qta_vend_4trm_c) || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({qta_vend_4trm_c}) => qta_vend_4trm_c?.sum && this.numberFormat(qta_vend_4trm_c.sum) || ""
|
||||
groupHeaderColumnTemplate: ({qta_vend_4trm_c}) => qta_vend_4trm_c?.sum && this.numberFormat(qta_vend_4trm_c.sum) || "",
|
||||
footerTemplate: ({qta_vend_4trm_c}) => qta_vend_4trm_c?.sum && this.numberFormat(qta_vend_4trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "6ef5c35d-984d-4cb5-a461-9d9c0d3ebb36",
|
||||
@@ -994,7 +1003,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_1trm_p && this.numberFormat(data.val_vend_1trm_p, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_1trm_p}) => val_vend_1trm_p?.sum && this.numberFormat(val_vend_1trm_p.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_1trm_p}) => val_vend_1trm_p?.sum && this.numberFormat(val_vend_1trm_p.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_1trm_p}) => val_vend_1trm_p?.sum && this.numberFormat(val_vend_1trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "b9fc33ab-82ed-40cd-b33a-1336eb7c8548",
|
||||
@@ -1009,7 +1019,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_2trm_p && this.numberFormat(data.val_vend_2trm_p, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_2trm_p}) => val_vend_2trm_p?.sum && this.numberFormat(val_vend_2trm_p.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_2trm_p}) => val_vend_2trm_p?.sum && this.numberFormat(val_vend_2trm_p.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_2trm_p}) => val_vend_2trm_p?.sum && this.numberFormat(val_vend_2trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "f1e935fe-5a88-45ae-a836-9f08587555ac",
|
||||
@@ -1024,7 +1035,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_3trm_p && this.numberFormat(data.val_vend_3trm_p, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_3trm_p}) => val_vend_3trm_p?.sum && this.numberFormat(val_vend_3trm_p.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_3trm_p}) => val_vend_3trm_p?.sum && this.numberFormat(val_vend_3trm_p.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_3trm_p}) => val_vend_3trm_p?.sum && this.numberFormat(val_vend_3trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "f092c94b-ff25-4d02-85bf-611f2d18c142",
|
||||
@@ -1039,7 +1051,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_4trm_p && this.numberFormat(data.val_vend_4trm_p, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_4trm_p}) => val_vend_4trm_p?.sum && this.numberFormat(val_vend_4trm_p.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_4trm_p}) => val_vend_4trm_p?.sum && this.numberFormat(val_vend_4trm_p.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_4trm_p}) => val_vend_4trm_p?.sum && this.numberFormat(val_vend_4trm_p.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "4d7f0df8-6314-4b63-bba2-3982a5f9f267",
|
||||
@@ -1079,7 +1092,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_1trm_c && this.numberFormat(data.val_vend_1trm_c, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_1trm_c}) => val_vend_1trm_c?.sum && this.numberFormat(val_vend_1trm_c.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_1trm_c}) => val_vend_1trm_c?.sum && this.numberFormat(val_vend_1trm_c.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_1trm_c}) => val_vend_1trm_c?.sum && this.numberFormat(val_vend_1trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "acc4e1c4-a8d8-4361-a677-62fb3797512b",
|
||||
@@ -1094,7 +1108,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_2trm_c && this.numberFormat(data.val_vend_2trm_c, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_2trm_c}) => val_vend_2trm_c?.sum && this.numberFormat(val_vend_2trm_c.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_2trm_c}) => val_vend_2trm_c?.sum && this.numberFormat(val_vend_2trm_c.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_2trm_c}) => val_vend_2trm_c?.sum && this.numberFormat(val_vend_2trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "00ecb0b1-ee21-4b1d-b145-7b04f4f328b1",
|
||||
@@ -1109,7 +1124,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_3trm_c && this.numberFormat(data.val_vend_3trm_c, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_3trm_c}) => val_vend_3trm_c?.sum && this.numberFormat(val_vend_3trm_c.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_3trm_c}) => val_vend_3trm_c?.sum && this.numberFormat(val_vend_3trm_c.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_3trm_c}) => val_vend_3trm_c?.sum && this.numberFormat(val_vend_3trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "8bf13d82-16f3-4263-9d54-795b471cc7d3",
|
||||
@@ -1124,7 +1140,8 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
editable: () => false,
|
||||
template: (data: Budget) => data.val_vend_4trm_c && this.numberFormat(data.val_vend_4trm_c, undefined, "") || "",
|
||||
aggregates: ["sum"],
|
||||
groupHeaderColumnTemplate: ({val_vend_4trm_c}) => val_vend_4trm_c?.sum && this.numberFormat(val_vend_4trm_c.sum, undefined, "") || ""
|
||||
groupHeaderColumnTemplate: ({val_vend_4trm_c}) => val_vend_4trm_c?.sum && this.numberFormat(val_vend_4trm_c.sum, undefined, "") || "",
|
||||
footerTemplate: ({val_vend_4trm_c}) => val_vend_4trm_c?.sum && this.numberFormat(val_vend_4trm_c.sum) || ""
|
||||
},
|
||||
{
|
||||
id: "4d7f0df8-6314-4b63-bba2-3982a5f9f267",
|
||||
@@ -1625,7 +1642,7 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
const command = $(e.item).data("command");
|
||||
|
||||
try {
|
||||
let ret: PVM.IRet = null;
|
||||
let ret: PVM.IRet<unknown> = null;
|
||||
|
||||
switch (command) {
|
||||
case "assignCodMartStat": {
|
||||
@@ -1698,7 +1715,7 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
const command = $(e.item).data("command");
|
||||
|
||||
try {
|
||||
let ret: PVM.IRet = null;
|
||||
let ret: PVM.IRet<unknown> = null;
|
||||
|
||||
switch (command) {
|
||||
case "assignCodMartStat": {
|
||||
@@ -2054,7 +2071,7 @@ export default class RossogargAnalisiBudget extends AnalisiBudget {
|
||||
.post("assignCodMartStat")
|
||||
.data({articoli: articoli.flatMap(articolo => articolo.cod_mart), codMart})
|
||||
.noticeAsModal()
|
||||
.execute();
|
||||
.execute<void>();
|
||||
}
|
||||
|
||||
async addArtInBdg(data: { idBdg: number, codAnag: string, codMart: string }) {
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
import BasePopup from "@js/BasePopup.js";
|
||||
import {MtbColt, OperationType, VtbVett, VtbViaggi} from "@js/ims/ems-core.module.js";
|
||||
import {getListVettori} from "@js/api/stdutils.js";
|
||||
import {Mezzo, OperationType, VtbVett, VtbViaggi} from "@js/ims/ems-core.module.js";
|
||||
import {getListAutomezzi, getListVettori} from "@js/api/stdutils.js";
|
||||
|
||||
export class CreaViaggioForm extends kendo.data.Model.define({}) {
|
||||
export class CreaViaggioForm implements kendo.ui.FormData {
|
||||
codAuto: string;
|
||||
codVvet: string;
|
||||
codVzon: string;
|
||||
dataOraInizTrasp: Date;
|
||||
flagRitirClie: boolean;
|
||||
idViaggio: string;
|
||||
note: string;
|
||||
targa: string;
|
||||
numPrenotazione: string;
|
||||
mezzo: Mezzo;
|
||||
|
||||
constructor(data: VtbViaggi = null) {
|
||||
super(data);
|
||||
|
||||
this.codAuto = data?.codAuto;
|
||||
this.codVvet = data?.codVvet;
|
||||
this.codVzon = data?.codVzon;
|
||||
this.dataOraInizTrasp = data?.dataOraInizTrasp;
|
||||
this.flagRitirClie = data?.flagRitirClie || false;
|
||||
this.idViaggio = data?.idViaggio;
|
||||
this.note = data?.note;
|
||||
this.targa = data?.targa;
|
||||
this.numPrenotazione = data?.numPrenotazione;
|
||||
this.mezzo = data?.mezzo || Mezzo.VETTORE;
|
||||
}
|
||||
}
|
||||
|
||||
export default class PopupCreaViaggio extends BasePopup {
|
||||
export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
|
||||
private readonly formData: CreaViaggioForm
|
||||
private kendoForm: kendo.ui.Form
|
||||
private promise: Promise<VtbViaggi>
|
||||
@@ -85,7 +87,7 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
this.$okBtn.btn_setWaitStatus();
|
||||
|
||||
try {
|
||||
this.promise = this.creaViaggio(e.model as CreaViaggioForm);
|
||||
this.promise = this.creaViaggio(e.model as any);
|
||||
|
||||
if (await this.promise) {
|
||||
this.modalBox.close();
|
||||
@@ -100,11 +102,81 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
gutter: 10
|
||||
},
|
||||
items: [
|
||||
{
|
||||
field: "mezzo",
|
||||
label: "Mezzo",
|
||||
title: "Mezzo",
|
||||
colSpan: 1,
|
||||
editor: "DropDownList",
|
||||
editorOptions: {
|
||||
dataTextField: "text",
|
||||
dataValueField: "value",
|
||||
optionLabel: {
|
||||
value: null,
|
||||
text: "Seleziona il mezzo"
|
||||
},
|
||||
dataBound: (e: kendo.ui.DropDownListDataBoundEvent) => e.sender.list.find(".k-list-optionlabel").hide(),
|
||||
dataSource: [
|
||||
{
|
||||
value: Mezzo.VETTORE,
|
||||
text: "Vettore"
|
||||
},
|
||||
{
|
||||
value: Mezzo.MITTENTE,
|
||||
text: "Mittente"
|
||||
},
|
||||
{
|
||||
value: Mezzo.DESTINATARIO,
|
||||
text: "Destinatario"
|
||||
},
|
||||
],
|
||||
change: (e: kendo.ui.DropDownListChangeEvent) => {
|
||||
const value = e.sender.value();
|
||||
|
||||
if (value) {
|
||||
const vettDropDownList = this.modalBox.$div.find("[name='codVvet']").data("kendoDropDownList");
|
||||
const autoDropDownList = this.modalBox.$div.find("[name='codAuto']").data("kendoDropDownList");
|
||||
|
||||
switch (parseInt(value)) {
|
||||
case Mezzo.VETTORE:
|
||||
vettDropDownList.element.parents(".k-form-field").show();
|
||||
autoDropDownList.element.parents(".k-form-field").hide();
|
||||
|
||||
autoDropDownList.value("");
|
||||
autoDropDownList.trigger("change");
|
||||
|
||||
break;
|
||||
case Mezzo.MITTENTE:
|
||||
vettDropDownList.element.parents(".k-form-field").hide();
|
||||
autoDropDownList.element.parents(".k-form-field").show();
|
||||
|
||||
vettDropDownList.value("");
|
||||
vettDropDownList.trigger("change");
|
||||
|
||||
break;
|
||||
case Mezzo.DESTINATARIO:
|
||||
vettDropDownList.element.parents(".k-form-field").hide();
|
||||
autoDropDownList.element.parents(".k-form-field").hide();
|
||||
|
||||
vettDropDownList.value("");
|
||||
vettDropDownList.trigger("change");
|
||||
autoDropDownList.value("");
|
||||
autoDropDownList.trigger("change");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} as kendo.ui.DropDownListOptions
|
||||
},
|
||||
{
|
||||
field: "codVvet",
|
||||
label: "Vettore",
|
||||
title: "Vettore",
|
||||
colSpan: 1,
|
||||
attributes: {
|
||||
class: "hide-form"
|
||||
},
|
||||
editor: "DropDownList",
|
||||
editorOptions: {
|
||||
filter: "contains",
|
||||
@@ -145,9 +217,7 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
|
||||
return $btn;
|
||||
},
|
||||
dataBound: (e) => {
|
||||
e.sender.list.find(".k-list-optionlabel").hide();
|
||||
},
|
||||
dataBound: (e) => e.sender.list.find(".k-list-optionlabel").text("Rimuovi"),
|
||||
dataSource: {
|
||||
sort: {
|
||||
field: "ragSoc",
|
||||
@@ -182,37 +252,88 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
const value = e.sender.value();
|
||||
|
||||
if (value) {
|
||||
const flagRitirClie = this.modalBox.$div.find("[name='flagRitirClie']").data("kendoSwitch");
|
||||
const autoDropDownList = this.modalBox.$div.find("[name='codAuto']").data("kendoDropDownList");
|
||||
|
||||
flagRitirClie.check(false);
|
||||
flagRitirClie.trigger("change");
|
||||
autoDropDownList.value("");
|
||||
autoDropDownList.trigger("change");
|
||||
}
|
||||
}
|
||||
} as kendo.ui.DropDownListOptions,
|
||||
},
|
||||
{
|
||||
field: "flagRitirClie",
|
||||
label: "Ritiro Cliente",
|
||||
title: "Ritiro Cliente",
|
||||
field: "codAuto",
|
||||
label: "Automezzo",
|
||||
title: "Automezzo",
|
||||
colSpan: 1,
|
||||
editor: "Switch",
|
||||
editor: "DropDownList",
|
||||
attributes: {
|
||||
class: "hide-form"
|
||||
},
|
||||
editorOptions: {
|
||||
messages: {
|
||||
checked: "Si",
|
||||
unchecked: "No"
|
||||
filter: "contains",
|
||||
dataTextField: "descrizione",
|
||||
dataValueField: "codAuto",
|
||||
optionLabel: "Seleziona l'automezzo",
|
||||
valuePrimitive: true,
|
||||
dataBound: (e) => e.sender.list.find(".k-list-optionlabel").text("Rimuovi"),
|
||||
dataSource: {
|
||||
sort: {
|
||||
field: "descrizione",
|
||||
dir: "asc"
|
||||
},
|
||||
transport: {
|
||||
read: async (options) => {
|
||||
try {
|
||||
const ret = await getListAutomezzi();
|
||||
|
||||
options.success(ret);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
options.error(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
schema: {
|
||||
model: {
|
||||
id: "codAuto",
|
||||
}
|
||||
}
|
||||
},
|
||||
change: (e: kendo.ui.SwitchChangeEvent) => {
|
||||
const checked = e.sender.check();
|
||||
change: (e: kendo.ui.DropDownListChangeEvent) => {
|
||||
const value = e.sender.value();
|
||||
|
||||
if (checked) {
|
||||
const codVvet = this.modalBox.$div.find("[name='codVvet']").data("kendoDropDownList");
|
||||
if (value) {
|
||||
const vvetDropDownList = this.modalBox.$div.find("[name='codVvet']").data("kendoDropDownList");
|
||||
|
||||
codVvet.value("");
|
||||
codVvet.trigger("change");
|
||||
vvetDropDownList.value("");
|
||||
vvetDropDownList.trigger("change");
|
||||
}
|
||||
}
|
||||
} as kendo.ui.SwitchOptions,
|
||||
} as kendo.ui.DropDownListOptions,
|
||||
},
|
||||
// {
|
||||
// field: "flagRitirClie",
|
||||
// label: "Ritiro Cliente",
|
||||
// title: "Ritiro Cliente",
|
||||
// colSpan: 1,
|
||||
// editor: "Switch",
|
||||
// editorOptions: {
|
||||
// messages: {
|
||||
// checked: "Si",
|
||||
// unchecked: "No"
|
||||
// },
|
||||
// change: (e: kendo.ui.SwitchChangeEvent) => {
|
||||
// const checked = e.sender.check();
|
||||
//
|
||||
// if (checked) {
|
||||
// const codVvet = this.modalBox.$div.find("[name='codVvet']").data("kendoDropDownList");
|
||||
//
|
||||
// codVvet.value("");
|
||||
// codVvet.trigger("change");
|
||||
// }
|
||||
// }
|
||||
// } as kendo.ui.SwitchOptions,
|
||||
// },
|
||||
{
|
||||
field: "dataOraInizTrasp",
|
||||
label: "Data Inizio Trasporto",
|
||||
@@ -220,7 +341,7 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
colSpan: 2,
|
||||
editor: "DateTimePicker",
|
||||
editorOptions: {
|
||||
min: this.formData.dataOraInizTrasp
|
||||
min: moment(this.formData.dataOraInizTrasp).startOf("day").toDate()
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -241,7 +362,7 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
editor: "TextBox",
|
||||
},
|
||||
{
|
||||
field: "num_prenotazione",
|
||||
field: "numPrenotazione",
|
||||
label: "Num. Prenotazione",
|
||||
title: "Num. Prenotazione",
|
||||
colSpan: 2,
|
||||
@@ -250,6 +371,25 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
]
|
||||
}).data("kendoForm");
|
||||
|
||||
this.kendoForm.element.find(".hide-form").parents(".k-form-field").hide();
|
||||
|
||||
let elToShow = null;
|
||||
|
||||
switch (this.formData.mezzo) {
|
||||
case Mezzo.VETTORE:
|
||||
elToShow = "codVvet";
|
||||
|
||||
break;
|
||||
case Mezzo.MITTENTE:
|
||||
elToShow = "codAuto";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (elToShow) {
|
||||
this.kendoForm.element.find(`#${elToShow}`).parents(".k-form-field").show();
|
||||
}
|
||||
|
||||
// this.kendoForm.validator.setOptions({
|
||||
// rules: {
|
||||
// requiredIf: (input: JQuery<HTMLElement>) => {
|
||||
@@ -266,10 +406,6 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
// } as kendo.ui.ValidatorOptions)
|
||||
}
|
||||
|
||||
async open(): Promise<VtbViaggi> {
|
||||
return super.open();
|
||||
}
|
||||
|
||||
async creaViaggio(data: CreaViaggioForm): Promise<VtbViaggi> {
|
||||
const ret = await this.ajax()
|
||||
.get("creaViaggio")
|
||||
@@ -278,7 +414,7 @@ export default class PopupCreaViaggio extends BasePopup {
|
||||
.execute();
|
||||
|
||||
return {
|
||||
...this.formData.toJSON(),
|
||||
...data,
|
||||
...ret?.returnData[0].entity
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
[id^=table-].k-grid .k-grid-header .k-table-th{vertical-align:middle;font-weight:bold;text-align:left !important}[id^=table-].k-grid .k-grid-header .k-table-row,[id^=table-].k-grid .k-grouping-header .k-table-row,[id^=table-].k-grid .k-grid-add-row .k-table-row,[id^=table-].k-grid .k-grid-footer .k-table-row{background-color:#dedede}[id^=table-].k-grid .k-grid-header .k-table-row:first-child,[id^=table-].k-grid .k-grouping-header .k-table-row:first-child,[id^=table-].k-grid .k-grid-add-row .k-table-row:first-child,[id^=table-].k-grid .k-grid-footer .k-table-row:first-child{background-color:#bababa}[id^=table-].k-grid .k-grouping-row:not(:first-child) td{border-top-width:1px}[id^=table-].k-grid .k-table-tbody .k-group-cell{background-color:#fff}[id^=table-].k-grid .k-grouping-row .k-group-cell,[id^=table-].k-grid .k-grouping-row+.k-table-row .k-group-cell{border-top-width:1px}.td-hidden{border-left:0 !important;border-right:0 !important;background-color:#fff !important}.attachments .k-icon{font-size:2rem;margin:2px !important}/*# sourceMappingURL=PopupRiepGiorno.css.map */
|
||||
[id^=table-].k-grid .k-grid-header .k-table-th{vertical-align:middle;font-weight:bold;text-align:left !important}[id^=table-].k-grid .k-grid-header .k-table-th:has(.text-right){text-align:right !important}[id^=table-].k-grid .k-grid-header .k-table-row,[id^=table-].k-grid .k-grouping-header .k-table-row,[id^=table-].k-grid .k-grid-add-row .k-table-row,[id^=table-].k-grid .k-grid-footer .k-table-row{background-color:#dedede}[id^=table-].k-grid .k-grid-header .k-table-row:first-child,[id^=table-].k-grid .k-grouping-header .k-table-row:first-child,[id^=table-].k-grid .k-grid-add-row .k-table-row:first-child,[id^=table-].k-grid .k-grid-footer .k-table-row:first-child{background-color:#bababa}[id^=table-].k-grid .k-grouping-row:not(:first-child) td{border-top-width:1px}[id^=table-].k-grid .k-table-tbody .k-group-cell{background-color:#fff}[id^=table-].k-grid .k-grouping-row .k-group-cell,[id^=table-].k-grid .k-grouping-row+.k-table-row .k-group-cell{border-top-width:1px}.td-hidden{border-left:0 !important;border-right:0 !important;background-color:#fff !important}.attachments .k-icon{font-size:2rem;margin:2px !important}/*# sourceMappingURL=PopupRiepGiorno.css.map */
|
||||
|
||||
@@ -2,7 +2,7 @@ import BasePopup from "@js/BasePopup.js";
|
||||
import groupBy from "lodash-es/groupBy.js";
|
||||
import Moment = moment.Moment;
|
||||
import PopupCreaViaggio from "@config-aziende/ROSSOGARGANO/delivery_plan/PopupCreaViaggio.module.js";
|
||||
import {VtbViaggi} from "@js/ims/ems-core.module.js";
|
||||
import {Mezzo, VtbViaggi} from "@js/ims/ems-core.module.js";
|
||||
import {numberStyle, numberToColor} from "@js/utils.js";
|
||||
import round from "lodash-es/round.js";
|
||||
import mapKeys from "lodash-es/mapKeys.js";
|
||||
@@ -16,16 +16,20 @@ export class Riepilogo extends kendo.data.Model.define({
|
||||
row_number: {type: "number"},
|
||||
sort: {type: "string"},
|
||||
nazionalita: {type: "string"},
|
||||
nazionalita_det: {type: "string"},
|
||||
id_viaggio: {type: "string"},
|
||||
data_ora_iniz_trasp: {type: "date"},
|
||||
cod_vvet: {type: "string"},
|
||||
vettore: {type: "string"},
|
||||
cod_auto: {type: "string"},
|
||||
automezzo: {type: "string"},
|
||||
flag_ritir_clie: {type: "string"},
|
||||
note_viag: {type: "string"},
|
||||
gestione: {type: "string"},
|
||||
data_ord: {type: "date"},
|
||||
num_ord: {type: "number"},
|
||||
riga_ord: {type: "number"},
|
||||
pos_riga: {type: "number"},
|
||||
precode: {type: "string"},
|
||||
cod_anag: {type: "string"},
|
||||
rag_soc: {type: "string"},
|
||||
@@ -35,6 +39,7 @@ export class Riepilogo extends kendo.data.Model.define({
|
||||
cod_mart: {type: "string"},
|
||||
descrizione: {type: "string"},
|
||||
cod_mdep: {type: "string"},
|
||||
posti_pallet: {type: "number"},
|
||||
pedane_ord: {type: "number"},
|
||||
num_cnf: {type: "number"},
|
||||
colli_pedana: {type: "number"},
|
||||
@@ -50,18 +55,23 @@ export class Riepilogo extends kendo.data.Model.define({
|
||||
id_ord: string
|
||||
sort: string
|
||||
nazionalita: string
|
||||
nazionalita_det: string
|
||||
id_viaggio: string
|
||||
data_ora_iniz_trasp: Date
|
||||
cod_vvet: string
|
||||
vettore: string
|
||||
cod_auto: string
|
||||
automezzo: string
|
||||
note_viag: string
|
||||
flag_ritir_clie: string
|
||||
targa: string
|
||||
num_prenotazione: string
|
||||
note_viag: string
|
||||
mezzo: Mezzo
|
||||
gestione: string
|
||||
data_ord: Date
|
||||
num_ord: number
|
||||
riga_ord: number
|
||||
pos_riga: number
|
||||
precode: string
|
||||
cod_anag: string
|
||||
rag_soc: string
|
||||
@@ -72,6 +82,7 @@ export class Riepilogo extends kendo.data.Model.define({
|
||||
descrizione: string
|
||||
cod_mdep: string
|
||||
depositi: Array<{ cod_mdep: string, descrizione: string, qta_esistente: number, unt_mis: string }>
|
||||
posti_pallet: number
|
||||
pedane_ord: number
|
||||
num_cnf: number
|
||||
colli_pedana: number
|
||||
@@ -107,6 +118,14 @@ const aggregates = [
|
||||
field: "rif_ord",
|
||||
aggregate: "min"
|
||||
},
|
||||
{
|
||||
field: "posti_pallet",
|
||||
aggregate: "min"
|
||||
},
|
||||
{
|
||||
field: "pedane_ord",
|
||||
aggregate: "sum"
|
||||
},
|
||||
{
|
||||
field: "destinazione",
|
||||
aggregate: "min"
|
||||
@@ -154,7 +173,7 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
$btn.btn_setWaitStatus();
|
||||
|
||||
try {
|
||||
await this.showRiepiloghiGiorno(this.dataCons);
|
||||
await this.showRiepilogoGiorno(this.dataCons);
|
||||
} finally {
|
||||
$btn.btn_setWaitStatus(false);
|
||||
}
|
||||
@@ -273,6 +292,11 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
|
||||
async loadRiepiloghi(keepScrollPos = true) {
|
||||
const isEditable = this.isEditable();
|
||||
const onSave = async (grid: kendo.ui.Grid) => {
|
||||
await timeout(250);
|
||||
|
||||
await grid.dataSource.sync();
|
||||
}
|
||||
|
||||
const scrollTop = this.modalBox.$div.find(".modal-body").scrollTop();
|
||||
|
||||
@@ -305,7 +329,7 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
const columns = _kendo.setDefaultCellOptions([
|
||||
{
|
||||
id: "e2dd706a-ec44-4f69-896b-7330c15e7b2f",
|
||||
title: firstRiepilogo.data_ora_iniz_trasp && `Ora Partenza: ${moment(riepiloghi[0].data_ora_iniz_trasp).format("HH:mm")}` || "",
|
||||
title: firstRiepilogo.data_ora_iniz_trasp && `ID: ${firstRiepilogo.id_viaggio}<br>ORA PARTENZA: ${moment(firstRiepilogo.data_ora_iniz_trasp).format("HH:mm")}` || "",
|
||||
columns: [
|
||||
{
|
||||
id: "7e281934-0241-4f35-98cf-f5e6df253eef",
|
||||
@@ -315,31 +339,54 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
attributes: {
|
||||
"class": "td-hidden"
|
||||
},
|
||||
groupHeaderTemplate: ({id_ord, precode, rag_soc, rif_ord, destinazione, note_ord}) => {
|
||||
groupHeaderTemplate: ({
|
||||
id_ord,
|
||||
precode,
|
||||
rag_soc,
|
||||
rif_ord,
|
||||
posti_pallet,
|
||||
pedane_ord,
|
||||
destinazione,
|
||||
note_ord
|
||||
}) => {
|
||||
const data = id_ord.min.split("~");
|
||||
|
||||
// language=HTML
|
||||
return [
|
||||
`
|
||||
<td>
|
||||
${data[2]}
|
||||
/${moment(data[1]).format("YY")}${precode.min && `<br>(${precode.min})` || ""}
|
||||
${data[3]}/${moment(data[2]).format("YY")}
|
||||
${precode.min && `<br>(${precode.min})` || ""}
|
||||
</td>`,
|
||||
`
|
||||
<td>
|
||||
${rag_soc.min}${destinazione.min && `<br>${destinazione.min}` || ""}
|
||||
</td>`,
|
||||
`
|
||||
<td colspan="5">
|
||||
<td colspan="2">
|
||||
${rif_ord.min && `RIF. ORDINE: ${rif_ord.min}` || ""}
|
||||
|
||||
<button class="attachments ml-10" type="button"
|
||||
title="Allegati"></button>
|
||||
</td>`,
|
||||
`
|
||||
<td
|
||||
class="!k-text-center ${posti_pallet.min && posti_pallet.min !== pedane_ord.sum && "!k-text-warning" || ""} togglePostiPallet"
|
||||
title="${posti_pallet.min && posti_pallet.min !== pedane_ord.sum && "Diverso dalla somma delle pedane\n" || ""}Clicca per modificare">
|
||||
${numberStyle(posti_pallet.min || pedane_ord.sum)}
|
||||
<input class="hidden"
|
||||
data-change="${_ojbc.B64JSON_stringify({
|
||||
component: "kendoTextBox",
|
||||
field: "posti_pallet",
|
||||
})}"
|
||||
title="Pedane" value="${posti_pallet.min || pedane_ord.sum}">
|
||||
</td>`,
|
||||
`
|
||||
<td colspan="2"></td>`,
|
||||
`
|
||||
<td class="toggleNoteOrd" title="Clicca per modificare">
|
||||
<span>${note_ord.min || ""}</span>
|
||||
<input type="text" class="hidden" data-change="noteOrd"
|
||||
<input class="hidden" data-change="note_ord"
|
||||
title="Note" value="${note_ord.min || ""}">`
|
||||
].join("");
|
||||
},
|
||||
@@ -349,9 +396,12 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
},
|
||||
{
|
||||
id: "3bb73886-f814-4701-ae6a-a3543a39241f",
|
||||
title: [
|
||||
firstRiepilogo.vettore && `Vettore: ${firstRiepilogo.vettore}` || firstRiepilogo.flag_ritir_clie && "LORO" || "Vettore non assegnato",
|
||||
firstRiepilogo.targa && `Targa ${firstRiepilogo.targa}` || firstRiepilogo.num_prenotazione || ""
|
||||
title: !firstRiepilogo.id_viaggio && "VIAGGIO NON ASSEGNATO" || [
|
||||
firstRiepilogo.mezzo === Mezzo.VETTORE && (firstRiepilogo.vettore && `VETTORE: ${firstRiepilogo.vettore}` || "VETTORE NON ASSEGNATO") ||
|
||||
firstRiepilogo.mezzo === Mezzo.MITTENTE && ("CONSEGNA CON NOSTRO MEZZO"
|
||||
+ (firstRiepilogo.automezzo && `<br>MEZZO: ${firstRiepilogo.automezzo}` || "")) ||
|
||||
firstRiepilogo.mezzo === Mezzo.DESTINATARIO && "RITIRA IL CLIENTE" || "",
|
||||
firstRiepilogo.targa && `TARGA ${firstRiepilogo.targa}` || firstRiepilogo.num_prenotazione || ""
|
||||
].join("<br>"),
|
||||
columns: [
|
||||
{
|
||||
@@ -376,8 +426,8 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
] as Array<kendo.ui.GridColumn>
|
||||
},
|
||||
{
|
||||
id: "7e54b38c-2271-424f-8d7f-6e484bae5dca",
|
||||
title: firstRiepilogo.note_viag && `Note: ${firstRiepilogo.note_viag}` || "",
|
||||
id: "e761b24b-29bd-40c6-906e-e69971e4b16a",
|
||||
headerTemplate: numberStyle(riepiloghi.map(riepilogo => riepilogo.pedane_ord).reduce((a, b) => a + b, 0), "right"),
|
||||
columns: [
|
||||
{
|
||||
id: "eda00bf7-aa54-4675-94db-af1afb71e834",
|
||||
@@ -406,7 +456,9 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
// language=HTML
|
||||
return `
|
||||
${data.descrizione}<br>
|
||||
Giacenza ${numberStyle(data.qta_esistente, undefined, "", data.unt_mis)}`;
|
||||
Giacenza ${numberStyle(data.qta_esistente, undefined, {
|
||||
postfix: data.unt_mis
|
||||
})}`;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -426,6 +478,12 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
},
|
||||
template: ({pedane_ord}: Riepilogo) => numberStyle(pedane_ord)
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "7e54b38c-2271-424f-8d7f-6e484bae5dca",
|
||||
title: firstRiepilogo.note_viag && `${firstRiepilogo.note_viag.replaceAll("\n", "<br>")}` || "",
|
||||
columns: [
|
||||
{
|
||||
id: "95c5b224-5725-4011-9b7a-69c5dfa1c737",
|
||||
title: "COL. PED.",
|
||||
@@ -499,44 +557,44 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
total: "total",
|
||||
model: Riepilogo
|
||||
},
|
||||
sort: [
|
||||
{
|
||||
field: "sort",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "nazionalita",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "id_viaggio",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "rag_soc",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "destinazione",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "data_ord",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "num_ord",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "gruppo_cons",
|
||||
dir: "asc"
|
||||
},
|
||||
{
|
||||
field: "riga_ord",
|
||||
dir: "asc"
|
||||
}
|
||||
],
|
||||
// sort: [
|
||||
// {
|
||||
// field: "sort",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "nazionalita",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "id_viaggio",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "rag_soc",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "destinazione",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "data_ord",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "num_ord",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "gruppo_cons",
|
||||
// dir: "asc"
|
||||
// },
|
||||
// {
|
||||
// field: "pos_riga",
|
||||
// dir: "asc"
|
||||
// }
|
||||
// ],
|
||||
group: [
|
||||
{
|
||||
field: "id_ord",
|
||||
@@ -568,68 +626,83 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
$dataChangeElements.kendoTextBox({
|
||||
change: async (e: kendo.ui.TextBoxChangeEvent) => {
|
||||
const textBox = e.sender;
|
||||
const table = textBox.element.parents(".k-grid").data("kendoGrid");
|
||||
$dataChangeElements.each((index, el) => {
|
||||
const definition = _ojbc.B64JSON_parse($(el).attr("data-change")) || $(el).attr("data-change");
|
||||
|
||||
const riepiloghi = textBox.element.parents(".k-grouping-row").nextUntil(".k-grouping-row").map((_, el) => table.dataItem(el)).toArray() as Array<Riepilogo>;
|
||||
const riepilogo = riepiloghi[0];
|
||||
($(el) as any)[definition?.component || "kendoTextBox"]({
|
||||
...(definition?.options || {}),
|
||||
change: async (e: kendo.ui.TextBoxChangeEvent) => {
|
||||
const textBox = e.sender;
|
||||
const table = textBox.element.parents(".k-grid").data("kendoGrid");
|
||||
|
||||
riepilogo.set("note_ord", textBox.value());
|
||||
const riepiloghi = textBox.element.parents(".k-grouping-row").nextUntil(".k-grouping-row").map((_, el) => table.dataItem(el)).toArray() as Array<Riepilogo>;
|
||||
const riepilogo = riepiloghi[0];
|
||||
|
||||
// grid.saveChanges();
|
||||
riepilogo.set(definition?.field || definition, textBox.value());
|
||||
|
||||
// await this.loadRiepiloghi();
|
||||
}
|
||||
grid.dataSource.sync();
|
||||
|
||||
await this.loadRiepiloghi();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (isEditable) {
|
||||
e.sender.element.find(".toggleNoteOrd").on("click focusout", (e) => {
|
||||
e.sender.element.find("[data-change]").parents("td").on("click focusout", (e) => {
|
||||
const $children = $(e.currentTarget).children();
|
||||
|
||||
$children.toggleClass("hidden");
|
||||
$children.children().toggleClass("hidden");
|
||||
$children.children("input").toggleClass("hidden");
|
||||
});
|
||||
}
|
||||
|
||||
e.sender.tbody.children().each(function (_index, row) {
|
||||
const $row = $(row);
|
||||
e.sender.tbody.children()
|
||||
.filter((index, row) => $(row).hasClass("k-grouping-row"))
|
||||
.each(function (_index, row) {
|
||||
const $row = $(row);
|
||||
|
||||
const dataItem = e.sender.dataItem($row) as Riepilogo;
|
||||
const dataItem = e.sender.dataItem($row) as Riepilogo;
|
||||
|
||||
if (!["PF", "SL"].includes(dataItem.tipo_mgrp)) {
|
||||
$row.addClass("hidden");
|
||||
} else if (dataItem.gruppo_cons) {
|
||||
$row.find(".col-pedane").css("background-color", numberToColor(parseInt(dataItem.gruppo_cons))).text("DA FARE");
|
||||
}
|
||||
const $attachmentBtn = $row.find(".attachments");
|
||||
|
||||
const $attachmentBtn = $row.find(".attachments");
|
||||
if ($attachmentBtn.length) {
|
||||
const attachmentButton = $attachmentBtn.kendoButton({
|
||||
icon: "- fal fa-paperclip fa-flip-vertical",
|
||||
badge: {
|
||||
text: dataItem.n_allegati
|
||||
},
|
||||
click: async (e: kendo.ui.ButtonClickEvent) => {
|
||||
await new ModalAllegati()
|
||||
.sourceTypes([_allegati.sourceTypes.ORDCOM])
|
||||
.allowUpload(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.allowDelete(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.editableDescription(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.gestione(dataItem.gestione)
|
||||
.dataOrd(moment(dataItem.data_ord).unix())
|
||||
.numOrd(dataItem.num_ord)
|
||||
.$button(e.sender.element)
|
||||
.onChange(function (c) {
|
||||
(attachmentButton as any)._badge(c);
|
||||
})
|
||||
.open();
|
||||
}
|
||||
}).data("kendoButton");
|
||||
}
|
||||
});
|
||||
|
||||
if ($attachmentBtn.length) {
|
||||
const attachmentButton = $attachmentBtn.kendoButton({
|
||||
icon: "- fal fa-paperclip fa-flip-vertical",
|
||||
badge: {
|
||||
text: dataItem.n_allegati
|
||||
},
|
||||
click: async (e: kendo.ui.ButtonClickEvent) => {
|
||||
await new ModalAllegati()
|
||||
.sourceTypes([_allegati.sourceTypes.ORDCOM])
|
||||
.allowUpload(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.allowDelete(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.editableDescription(isEditable && [_allegati.sourceTypes.ORDCOM] || [])
|
||||
.gestione(dataItem.gestione)
|
||||
.dataOrd(moment(dataItem.data_ord).unix())
|
||||
.numOrd(dataItem.num_ord)
|
||||
.$button(e.sender.element)
|
||||
.onChange(function (c) {
|
||||
(attachmentButton as any)._badge(c);
|
||||
})
|
||||
.open();
|
||||
}
|
||||
}).data("kendoButton");
|
||||
}
|
||||
});
|
||||
e.sender.tbody.children()
|
||||
.filter((index, row) => !$(row).hasClass("k-grouping-row"))
|
||||
.each(function (_index, row) {
|
||||
const $row = $(row);
|
||||
|
||||
const dataItem = e.sender.dataItem($row) as Riepilogo;
|
||||
|
||||
if (!["PF", "SL"].includes(dataItem.tipo_mgrp)) {
|
||||
$row.addClass("hidden");
|
||||
} else if (dataItem.gruppo_cons) {
|
||||
$row.find(".col-pedane").css("background-color", numberToColor(parseInt(dataItem.gruppo_cons))).text("DA FARE");
|
||||
}
|
||||
});
|
||||
|
||||
// $(".k-grouping-row").each(function () {
|
||||
// const groupKey = rowGroupKey($(this), e.sender);
|
||||
@@ -645,6 +718,10 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
if (e.values?.colli_pedana) {
|
||||
riepilogo.set("pedane_ord", round(riepilogo.num_cnf / e.values?.colli_pedana, 0));
|
||||
}
|
||||
|
||||
if (riepilogo.dirty) {
|
||||
onSave(e.sender);
|
||||
}
|
||||
}
|
||||
})
|
||||
.data("kendoGrid");
|
||||
@@ -804,6 +881,16 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
if (!riepilogo.get("cod_mdep") && riepilogo.depositi?.length === 1) {
|
||||
riepilogo.set("cod_mdep", riepilogo.depositi[0].cod_mdep);
|
||||
}
|
||||
|
||||
if (!riepilogo.get("posti_pallet")) {
|
||||
riepilogo.set("posti_pallet", riepiloghi
|
||||
.filter(elRiepilogo =>
|
||||
elRiepilogo.gestione === riepilogo.gestione
|
||||
&& elRiepilogo.data_ord === riepilogo.data_ord
|
||||
&& elRiepilogo.num_ord === riepilogo.num_ord)
|
||||
.reduce((pedaneOrd, riepilogo) => pedaneOrd + riepilogo.pedane_ord, 0)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
await grid.dataSource.sync();
|
||||
@@ -948,7 +1035,9 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
},
|
||||
template: (data) => {
|
||||
data.text_field = `
|
||||
<b>Ore
|
||||
<b>
|
||||
ID: ${data.id_viaggio}
|
||||
Ore
|
||||
${moment(data.data_ora_iniz_trasp).format("HH:mm")}${data.rag_soc && ` - ${data.rag_soc}` || " - Ritiro Cliente"}</b>
|
||||
<br>
|
||||
${data.destinazioni}${data.note && `<br>${data.note}` || ""}
|
||||
@@ -997,11 +1086,11 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
.show();
|
||||
}
|
||||
|
||||
async showRiepiloghiGiorno(dataCons: Moment): Promise<boolean> {
|
||||
async showRiepilogoGiorno(dataCons: Moment): Promise<boolean> {
|
||||
// language=HTML
|
||||
return await new ModalBox()
|
||||
.content(`
|
||||
<div id="tableRiepiloghiGiorno"></div>
|
||||
<div id="tableRiepilogoGiorno"></div>
|
||||
`)
|
||||
.onBeforeShow(($div) => {
|
||||
const columns = _kendo.setDefaultCellOptions([
|
||||
@@ -1023,7 +1112,6 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
footerAttributes: {
|
||||
class: "!k-text-center"
|
||||
},
|
||||
footerTemplate: ({ num_pedane }) => numberStyle(num_pedane.sum),
|
||||
},
|
||||
{
|
||||
field: "colli_pedana",
|
||||
@@ -1045,7 +1133,26 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
footerAttributes: {
|
||||
class: "!k-text-center"
|
||||
},
|
||||
footerTemplate: ({ tot_colli }) => numberStyle(tot_colli.sum),
|
||||
footerTemplate: ({tot_colli}) => numberStyle(tot_colli.sum),
|
||||
},
|
||||
{
|
||||
field: "qta_esistente",
|
||||
title: "Qtà esistente",
|
||||
type: "number",
|
||||
template: ({qta_esistente}) => qta_esistente && numberStyle(qta_esistente) || "",
|
||||
},
|
||||
{
|
||||
field: "qta_residua",
|
||||
title: "Qtà residua",
|
||||
type: "number",
|
||||
template: ({qta_residua}) => qta_residua && numberStyle(qta_residua, qta_residua < 0 && "negative" || undefined) || "",
|
||||
},
|
||||
{
|
||||
field: "ammanco",
|
||||
title: "Ammanco",
|
||||
type: "number",
|
||||
hidden: true,
|
||||
template: ({ammanco}) => ammanco && numberStyle(ammanco, ammanco && "negative" || undefined) || "",
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -1058,11 +1165,11 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
);
|
||||
|
||||
try {
|
||||
const riepiloghiGiorno = await this.getRiepiloghiGiorno(dataCons);
|
||||
const riepilogoGiorno = await this.getRiepilogoGiorno(dataCons);
|
||||
|
||||
options.success({
|
||||
data: riepiloghiGiorno,
|
||||
total: riepiloghiGiorno?.length && riepiloghiGiorno[0].rows_count
|
||||
data: riepilogoGiorno,
|
||||
total: riepilogoGiorno?.length && riepilogoGiorno[0].rows_count
|
||||
});
|
||||
} catch (e) {
|
||||
options.error(e);
|
||||
@@ -1102,7 +1209,7 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
serverSorting: false,
|
||||
});
|
||||
|
||||
$div.find("#tableRiepiloghiGiorno").kendoGrid({
|
||||
$div.find("#tableRiepilogoGiorno").kendoGrid({
|
||||
columns,
|
||||
dataSource,
|
||||
scrollable: false,
|
||||
@@ -1113,8 +1220,26 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
xs: 12,
|
||||
md: 8
|
||||
})
|
||||
.closeOnly()
|
||||
.title("Riepiloghi al " + dataCons.format("DD/MM/YYYY"))
|
||||
.okCancel()
|
||||
.btOK({
|
||||
text: "Chiudi",
|
||||
style: "default",
|
||||
dismissOnClick: true
|
||||
})
|
||||
.btCancel({
|
||||
text: "Stampa",
|
||||
style: "primary",
|
||||
onClick: async (e, $btn) => {
|
||||
$btn.btn_setWaitStatus();
|
||||
|
||||
try {
|
||||
await this.printRiepilogoGiorno(this.dataCons);
|
||||
} finally {
|
||||
$btn.btn_setWaitStatus(false);
|
||||
}
|
||||
}
|
||||
})
|
||||
.title("Riepilogo al " + dataCons.format("DD/MM/YYYY"))
|
||||
.show();
|
||||
}
|
||||
|
||||
@@ -1169,13 +1294,24 @@ export default class PopupRiepGiorno extends BasePopup {
|
||||
return ret?.returnId === 1;
|
||||
}
|
||||
|
||||
async getRiepiloghiGiorno(dataCons: Moment) {
|
||||
async getRiepilogoGiorno(dataCons: Moment) {
|
||||
const ret = await this.ajax()
|
||||
.get("getRiepiloghiGiorno")
|
||||
.get("getRiepilogoGiorno")
|
||||
.data({dataCons: dataCons.unix()})
|
||||
.noticeAsModal()
|
||||
.execute();
|
||||
.execute<Array<{ rows_count: number }>>();
|
||||
|
||||
return ret?.returnData;
|
||||
}
|
||||
|
||||
async printRiepilogoGiorno(dataCons: Moment) {
|
||||
const ret = await this.ajax()
|
||||
.get("printRiepilogoGiorno")
|
||||
.data({dataCons: dataCons.unix()})
|
||||
.noticeAsModal()
|
||||
.onSuccess({modalBox: {IFrame: true}})
|
||||
.execute();
|
||||
|
||||
return ret?.returnId === 1;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,10 @@
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
text-align: left !important;
|
||||
|
||||
&:has(.text-right) {
|
||||
text-align: right !important;
|
||||
}
|
||||
}
|
||||
|
||||
.k-grid-header, .k-grouping-header, .k-grid-add-row, .k-grid-footer {
|
||||
|
||||
1
public_html/config_aziende/TOSCA_CLOUD/custom.css
Normal file
1
public_html/config_aziende/TOSCA_CLOUD/custom.css
Normal file
@@ -0,0 +1 @@
|
||||
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_CLOUD/custom.scss
Normal file
11
public_html/config_aziende/TOSCA_CLOUD/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_CLOUD/gestioni.json
Normal file
2
public_html/config_aziende/TOSCA_CLOUD/gestioni.json
Normal file
@@ -0,0 +1,2 @@
|
||||
[
|
||||
]
|
||||
BIN
public_html/config_aziende/TOSCA_CLOUD/images/logo_azienda.png
Normal file
BIN
public_html/config_aziende/TOSCA_CLOUD/images/logo_azienda.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -23,7 +23,7 @@
|
||||
"endPointRemote": null,
|
||||
"public_url": ""
|
||||
},
|
||||
"dbNameWeb": "cosmint",
|
||||
"dbNameWeb": "COSMAPACK",
|
||||
"azienda": "COSMAPACK",
|
||||
"sc_project": null,
|
||||
"sc_security": null
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"endPoint": "192.168.1.12:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": "http://app.dulciar.com/portale/"
|
||||
"public_url": "https://app.dulciar.com/portale/"
|
||||
},
|
||||
"dbNameWeb": "DULCIAR",
|
||||
"azienda": "DULCIAR",
|
||||
|
||||
16
public_html/config_aziende/tosca_cloud.config.json
Normal file
16
public_html/config_aziende/tosca_cloud.config.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"studioml": {
|
||||
"endPoint": "192.168.3.15:8080",
|
||||
"endPointRemote": "https://www2.studioml.it",
|
||||
"public_url": "https://www.studioml.it/pvm/"
|
||||
},
|
||||
"cliente": {
|
||||
"endPoint": "10.4.0.4:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": ""
|
||||
},
|
||||
"dbNameWeb": "TOSCA_CLOUD",
|
||||
"azienda": "TOSCA_CLOUD",
|
||||
"sc_project": "12024361",
|
||||
"sc_security": "5e40043c"
|
||||
}
|
||||
@@ -12,13 +12,6 @@
|
||||
"public_url": "https://www.studioml.it/pvm/"
|
||||
},
|
||||
"cliente": {
|
||||
"db": {
|
||||
"driver": "pdosqlsrv",
|
||||
"hostName": "localhost",
|
||||
"dbName": "tosca_cz",
|
||||
"userName": "sa",
|
||||
"password": "sa"
|
||||
},
|
||||
"endPoint": "localhost:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": ""
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"endPoint": "10.107.107.15:8080",
|
||||
"endPointRemote": null,
|
||||
"public_url": "http://ws.salpar.it/portale/"
|
||||
"public_url": "https://ws.salpar.it/portale/"
|
||||
},
|
||||
"dbNameWeb": "VGALIMENTI",
|
||||
"azienda": "VGALIMENTI",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,19 +1,6 @@
|
||||
importScripts("assets/firebase/firebase-app.js");
|
||||
importScripts("assets/firebase/firebase-messaging.js");
|
||||
importScripts("gest-lib/notifiche/js/main.js");
|
||||
|
||||
// self._firebase = undefined;
|
||||
|
||||
// self.addEventListener("install", () => {
|
||||
// _notifiche.setForSW(true);
|
||||
// _notifiche.getFirebase().then(firebase => {
|
||||
// if (firebase) {
|
||||
// self._firebase = firebase;
|
||||
//
|
||||
// firebase.messaging();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
importScripts("dist/gest-lib/notifiche/js/main.js");
|
||||
|
||||
self.addEventListener("notificationclick", e => {
|
||||
e.notification.close();
|
||||
@@ -63,4 +50,4 @@ self.addEventListener("push", async function (e) {
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -26,13 +26,6 @@ class Allegati {
|
||||
"versione" => $key["versione"]
|
||||
);
|
||||
|
||||
return Allegati\ListinoAcquisto::get_filelist($key);
|
||||
} else if ($sourceType == SourceType::ORDACQCOM) {
|
||||
$key = array(
|
||||
"cod_alis" => $key["cod_alis"],
|
||||
"versione" => $key["versione"]
|
||||
);
|
||||
|
||||
return Allegati\ListinoAcquisto::get_filelist($key);
|
||||
} else if (in_array($sourceType, array(SourceType::ORDCOM, SourceType::ORDLAVCOM, SourceType::ORDVENCOM))) {
|
||||
return Allegati\Ordine::get_filelist($key);
|
||||
@@ -111,22 +104,16 @@ class Allegati {
|
||||
|
||||
if ($tableName === \Allegati\TableName::STB_ACTIVITY_FILE) {
|
||||
return \StbActivityFile::get_item($key["activity_id"], $key["file_name"]);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::STB_FILES_ATTACHED) {
|
||||
return \StbFilesAttached::get_item($key["id_attach"]);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::DTB_DOC_PDF) {
|
||||
return \PdfDoc::get($key);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::DTB_ORD_PDF) {
|
||||
return \PdfOrd::get($key);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::MTB_AART_LINK) {
|
||||
return \MtbAartLink::getItemContent($key["cod_mart"], $key["id_riga"], $options);
|
||||
|
||||
} else if ($tableName === \Allegati\TableName::TTB_LINE) {
|
||||
return \UtilityTextiles::getLogoLineaContent($key["cod_line"], $options);
|
||||
|
||||
} else if ($sourceType === SourceType::JASPERREPORT) {
|
||||
return Allegati\JasperReport::run($key, $options);
|
||||
}
|
||||
@@ -188,9 +175,8 @@ class Allegati {
|
||||
}
|
||||
|
||||
public static function upload($data, $files) {
|
||||
$file = $files[0];
|
||||
$file = reset($files);
|
||||
$sourceType = $data["sourceType"];
|
||||
//$tableName = Allegati\SourceType::getTableName($sourceType);
|
||||
$key = $data["key"];
|
||||
|
||||
if ($sourceType == SourceType::PARTITAMAG) {
|
||||
@@ -198,12 +184,10 @@ class Allegati {
|
||||
} else if ($sourceType == SourceType::ARTICOLO) {
|
||||
return Allegati\Articolo::upload($key, $file);
|
||||
} else if ($sourceType == SourceType::LIBERO) {
|
||||
return Allegati\Libero::upload($file);
|
||||
return Allegati\Libero::upload($files);
|
||||
} else if ($sourceType == SourceType::LIS_A) {
|
||||
return Allegati\ListinoAcquisto::upload($key, $file);
|
||||
} else if ($sourceType == SourceType::ORDACQCOM) {
|
||||
return Allegati\OrdineAcquisto::upload($key, $file);
|
||||
} else if (in_array($sourceType, array(SourceType::ORDCOM, SourceType::ORDLAVCOM, SourceType::ORDVENCOM))) {
|
||||
} else if (in_array($sourceType, array(SourceType::ORDCOM, SourceType::ORDLAVCOM, SourceType::ORDVENCOM, SourceType::ORDACQCOM))) {
|
||||
return Allegati\Ordine::upload($key, $file);
|
||||
}
|
||||
|
||||
@@ -212,7 +196,7 @@ class Allegati {
|
||||
}
|
||||
|
||||
public static function uploadFromModal($filter, $fileItem) {
|
||||
$Ret = new \Ret;
|
||||
$ret = new \Ret;
|
||||
|
||||
$sourceTypesDict = Allegati\SourceType::get_dictionary();
|
||||
$sourceType = $filter["source_type"];
|
||||
@@ -222,19 +206,19 @@ class Allegati {
|
||||
|
||||
switch ($sourceType) {
|
||||
case SourceType::LIS_A:
|
||||
$Ret = Allegati\ListinoAcquisto::upload($filter, $fileItem);
|
||||
if ($Ret->is_OK()) {
|
||||
$reta = $Ret->get_data();
|
||||
$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);
|
||||
$ret->set_data($item);
|
||||
ob_start();
|
||||
include \Controller::current_gestpath_include("popup-main-tr.php");
|
||||
$html = \Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
$Ret->set_string($html)->set_title($item["file_name"]);
|
||||
$ret->set_string($html)->set_title($item["file_name"]);
|
||||
|
||||
return $Ret;
|
||||
return $ret;
|
||||
}
|
||||
break;
|
||||
case SourceType::ATTIVITA:
|
||||
@@ -242,47 +226,31 @@ class Allegati {
|
||||
break;
|
||||
case SourceType::COMMESSA:
|
||||
$codJcom = $filter["cod_jcom"];
|
||||
$Ret = \Allegati\Commessa::get_activityId($codJcom);
|
||||
if ($Ret->is_OK()) {
|
||||
$activityId = $Ret->get_string();
|
||||
$ret = \Allegati\Commessa::get_activityId($codJcom);
|
||||
if ($ret->is_OK()) {
|
||||
$activityId = $ret->get_string();
|
||||
}
|
||||
break;
|
||||
case SourceType::PARTITAMAG:
|
||||
$Ret = Allegati\PartitaMag::upload($filter, $fileItem);
|
||||
if ($Ret->is_OK()) {
|
||||
$reta = $Ret->get_data();
|
||||
$ret = Allegati\PartitaMag::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);
|
||||
$ret->set_data($item);
|
||||
ob_start();
|
||||
include \Controller::current_gestpath_include("popup-main-tr.php");
|
||||
$html = \Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
$Ret->set_string($html)->set_title($item["file_name"]);
|
||||
$ret->set_string($html)->set_title($item["file_name"]);
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
break;
|
||||
case SourceType::ORDACQCOM:
|
||||
$Ret = Allegati\OrdineAcquisto::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_clean());
|
||||
$Ret->set_string($html)->set_title($item["file_name"]);
|
||||
|
||||
return $Ret;
|
||||
return $ret;
|
||||
}
|
||||
break;
|
||||
case SourceType::ORDCOM:
|
||||
$Ret = Allegati\Ordine::upload($filter, $fileItem);
|
||||
if ($Ret->is_OK()) {
|
||||
$attachments = $Ret->get_data();
|
||||
$ret = Allegati\Ordine::upload($filter, $fileItem);
|
||||
if ($ret->is_OK()) {
|
||||
$attachments = $ret->get_data();
|
||||
$html = "";
|
||||
|
||||
foreach ($attachments as $index => $attachment) {
|
||||
@@ -295,9 +263,9 @@ class Allegati {
|
||||
$html .= \Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
}
|
||||
|
||||
$Ret->set_data($attachments)->set_string($html);
|
||||
$ret->set_data($attachments)->set_string($html);
|
||||
|
||||
return $Ret;
|
||||
return $ret;
|
||||
}
|
||||
break;
|
||||
case SourceType::ATBOFFT:
|
||||
@@ -319,23 +287,28 @@ class Allegati {
|
||||
}
|
||||
|
||||
if (isset($activityId)) {
|
||||
$Ret = \StbActivityFile::upload($activityId, $fileItem);
|
||||
if ($Ret->is_OK()) {
|
||||
$item = $Ret->get_data();
|
||||
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_clean());
|
||||
$Ret->set_string($html)->set_title($item["file_name"]);
|
||||
}
|
||||
$ret = \StbActivityFile::upload($activityId, $fileItem);
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$attachments = $ret->get_data();
|
||||
$html = "";
|
||||
|
||||
foreach ($attachments as $index => $item) {
|
||||
unset($item["content"]);
|
||||
$item["source_type"] = $sourceType;
|
||||
$attachments[$index] = $item;
|
||||
ob_start();
|
||||
include \Controller::current_gestpath_include("popup-main-tr.php");
|
||||
$html .= \Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
}
|
||||
|
||||
$ret->set_data($attachments)->set_string($html);
|
||||
}
|
||||
} else {
|
||||
$Ret->set_error("Richiesta di upload non valida");
|
||||
$ret->set_error("Richiesta di upload non valida");
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function download_all($filter) {
|
||||
@@ -415,25 +388,16 @@ class Allegati {
|
||||
|
||||
if ($sourceType == SourceType::ATTIVITA || $sourceType == SourceType::COMMESSA) {
|
||||
$Ret = \StbActivityFile::remove($key["activity_id"], $key["file_name"]);
|
||||
|
||||
} else if ($sourceType == SourceType::ARTICOLO) {
|
||||
$Ret = Allegati\Articolo::remove($key);
|
||||
|
||||
} else if ($sourceType == SourceType::LIS_A) {
|
||||
$Ret = Allegati\ListinoAcquisto::remove($key);
|
||||
|
||||
} else if ($sourceType == SourceType::PARTITAMAG) {
|
||||
$Ret = Allegati\PartitaMag::remove($key);
|
||||
|
||||
} else if ($sourceType == SourceType::LIBERO) {
|
||||
$Ret = Allegati\Libero::remove($key);
|
||||
|
||||
} else if ($sourceType == SourceType::ORDACQCOM) {
|
||||
$Ret = Allegati\OrdineAcquisto::remove($key);
|
||||
|
||||
} else if (in_array($sourceType, array(SourceType::ORDCOM, SourceType::ORDLAVCOM, SourceType::ORDVENCOM))) {
|
||||
$Ret = Allegati\Ordine::remove($key);
|
||||
|
||||
} else {
|
||||
$Ret->set_error("Source non supportato");
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Allegati;
|
||||
|
||||
use Utility\File;
|
||||
|
||||
class StbFilesAttached {
|
||||
|
||||
public static function upload($fileItems, $EntityDetail = null) {
|
||||
$Ret = new \Ret;
|
||||
|
||||
$fileItems = \Utility\File::rearrangeFilesArray(array_get($fileItems, "files", $fileItems));
|
||||
|
||||
$idAttachs = array();
|
||||
|
||||
@@ -38,9 +38,8 @@ if (isset($_GET["popup-main"])) {
|
||||
} else if (isset($_POST["upload"])) {
|
||||
$Ret = new Ret;
|
||||
if (count($_FILES) > 0) {
|
||||
$files = array_values($_FILES);
|
||||
$data = Utility::B64JSON_parse($_POST["upload"]);
|
||||
$Ret = Allegati::upload($data, $files);
|
||||
$Ret = Allegati::upload($data, $_FILES);
|
||||
} else {
|
||||
$Ret->set_error("File non pervenuti");
|
||||
}
|
||||
|
||||
@@ -4,31 +4,33 @@ if ($Ret->is_OK()) {
|
||||
$arr_files = $Ret->get_data();
|
||||
?>
|
||||
<div class="col-sm-10 col-sm-offset-1">
|
||||
<table id="file-list"
|
||||
class="table table-striped table-hover table-condensed table-bordered table-text-middle small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">File</th>
|
||||
<th>ID</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Modificato da</th>
|
||||
<th>Dimensioni</th>
|
||||
<th>Ultima modifica</th>
|
||||
<th>
|
||||
<button id="bt_upload" class="btn btn-default btn-xs">
|
||||
<span class="text-success">Aggiungi</span>
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($arr_files as $item) {
|
||||
include "main-tr.php";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="dropzone"></div>
|
||||
|
||||
<table id="file-list"
|
||||
class="table table-striped table-hover table-condensed table-bordered table-text-middle small mt-14">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">File</th>
|
||||
<th>ID</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Modificato da</th>
|
||||
<th>Dimensioni</th>
|
||||
<th>Ultima modifica</th>
|
||||
<th>
|
||||
<!-- <button id="bt_upload" class="btn btn-default btn-xs">-->
|
||||
<!-- <span class="text-success">Aggiungi</span>-->
|
||||
<!-- </button>-->
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($arr_files as $item) {
|
||||
include "main-tr.php";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -61,18 +61,11 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
|
||||
<small><?= \Utility\Date::format($item["last_upd"], Format::strftimeDMy) ?></small></td>
|
||||
<td class="vertical-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<?php if ($isEliminabile && ($sourceType == Allegati\SourceType::ATTIVITA || $sourceType == Allegati\SourceType::COMMESSA || $sourceType == Allegati\SourceType::LIS_A || $sourceType == Allegati\SourceType::PARTITAMAG || $sourceType == Allegati\SourceType::ORDACQCOM || $sourceType == Allegati\SourceType::ORDCOM)) { ?>
|
||||
<?php if ($isEliminabile && ($sourceType == Allegati\SourceType::ATTIVITA || $sourceType == Allegati\SourceType::COMMESSA || $sourceType == Allegati\SourceType::LIS_A || $sourceType == Allegati\SourceType::PARTITAMAG || $sourceType == Allegati\SourceType::ORDCOM)) { ?>
|
||||
<button class="btn btn-default btRemoveAllegato" title="Rimuovi">
|
||||
<i class="fas fa-trash text-danger"></i>
|
||||
</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>-->
|
||||
<!-- --><?php //} ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -47,24 +47,26 @@ if ($Ret->is_OK()) {
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div style="height: 60vh;max-height: 60vh;overflow-y: auto;">
|
||||
<table id="m_tbAllegati" class="table table-condensed table-striped table-hover mt-8">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">File</th>
|
||||
<th>Descrizione</th>
|
||||
<th class="small">Dimensioni</th>
|
||||
<th class="small" style="width: 80px;">Modificato il</th>
|
||||
<th style="width: 50px;"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?php
|
||||
foreach ($arr_files as $item) {
|
||||
include "popup-main-tr.php";
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><?php
|
||||
|
||||
<table id="m_tbAllegati" class="table table-condensed table-striped table-hover mt-8">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">File</th>
|
||||
<th>Descrizione</th>
|
||||
<th class="small">Dimensioni</th>
|
||||
<th class="small" style="width: 80px;">Modificato il</th>
|
||||
<th style="width: 50px;"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($arr_files as $item) {
|
||||
include "popup-main-tr.php";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
$html = Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
$Ret->set_string($html)->set_data();
|
||||
}
|
||||
|
||||
@@ -310,9 +310,10 @@ ModalAllegati.prototype.initDropzone = function () {
|
||||
};
|
||||
|
||||
ModalAllegati.prototype._onRefreshSourceTypeTab = function () {
|
||||
var self = this;
|
||||
var sourceType = self._getCurrentSourceType();
|
||||
var $table = self._getShowedTable();
|
||||
const self = this;
|
||||
const sourceType = self._getCurrentSourceType();
|
||||
const $table = self._getShowedTable();
|
||||
|
||||
$table.find("tr[data-source_type]").hide();
|
||||
$table.find("tr[data-source_type='" + sourceType + "']").show();
|
||||
return self;
|
||||
|
||||
@@ -34,42 +34,71 @@ let _allegati = {
|
||||
self.module.onLoad(function () {
|
||||
self.sourceTypes = self.module.get_dataSource("sourceTypes");
|
||||
|
||||
let $btUpload = $("#bt_upload");
|
||||
$btUpload.uploadButton({
|
||||
onChange: function () {
|
||||
$("#dropzone").dropzone({
|
||||
onDrop: async (e, files) => {
|
||||
const formData = new FormData();
|
||||
|
||||
let arr_files = $btUpload.uploadButton("getFiles");
|
||||
if (arr_files.length > 0) {
|
||||
let fileItem = arr_files[0];
|
||||
Array.from(files).forEach(file => formData.append("files[]", file));
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append(fileItem.index, fileItem.file);
|
||||
const ret = await _allegati.upload(
|
||||
_allegati.sourceTypes.LIBERO,
|
||||
null,
|
||||
formData
|
||||
);
|
||||
|
||||
new Ajax()
|
||||
.post("upload")
|
||||
.module("allegati")
|
||||
.formData(formData)
|
||||
.data({sourceType: _allegati.sourceTypes.LIBERO, key: null})
|
||||
.$button($btUpload)
|
||||
if (ret.returnId === 1) {
|
||||
await new Ajax()
|
||||
.get("buildTableRow")
|
||||
.data({item: ret.returnData.item})
|
||||
.noticeAsToast()
|
||||
.onSuccess(function (ret) {
|
||||
new Ajax()
|
||||
.get("buildTableRow")
|
||||
.data({item: ret.returnData.item})
|
||||
.noticeAsToast()
|
||||
.onSuccess(function (ret) {
|
||||
$("#file-list > tbody").append(ret.returnString);
|
||||
$("#file-list > tbody > tr:last").highlightRow();
|
||||
})
|
||||
.onUnsuccess({locationReload: true})
|
||||
.execute();
|
||||
$("#file-list > tbody").append(ret.returnString);
|
||||
$("#file-list > tbody > tr:last").highlightRow();
|
||||
})
|
||||
.onUnsuccess({locationReload: true})
|
||||
.execute();
|
||||
}
|
||||
|
||||
$btUpload.uploadButton("empty");
|
||||
}
|
||||
return ret.returnId === 1;
|
||||
},
|
||||
});
|
||||
|
||||
// let $btUpload = $("#bt_upload");
|
||||
// $btUpload.uploadButton({
|
||||
// onChange: function () {
|
||||
//
|
||||
// let arr_files = $btUpload.uploadButton("getFiles");
|
||||
// if (arr_files.length > 0) {
|
||||
// let fileItem = arr_files[0];
|
||||
//
|
||||
// let formData = new FormData();
|
||||
// formData.append(fileItem.index, fileItem.file);
|
||||
//
|
||||
// new Ajax()
|
||||
// .post("upload")
|
||||
// .module("allegati")
|
||||
// .formData(formData)
|
||||
// .data({sourceType: _allegati.sourceTypes.LIBERO, key: null})
|
||||
// .$button($btUpload)
|
||||
// .noticeAsToast()
|
||||
// .onSuccess(function (ret) {
|
||||
// new Ajax()
|
||||
// .get("buildTableRow")
|
||||
// .data({item: ret.returnData.item})
|
||||
// .noticeAsToast()
|
||||
// .onSuccess(function (ret) {
|
||||
// $("#file-list > tbody").append(ret.returnString);
|
||||
// $("#file-list > tbody > tr:last").highlightRow();
|
||||
// })
|
||||
// .onUnsuccess({locationReload: true})
|
||||
// .execute();
|
||||
// })
|
||||
// .execute();
|
||||
// }
|
||||
//
|
||||
// $btUpload.uploadButton("empty");
|
||||
// }
|
||||
// });
|
||||
});
|
||||
|
||||
return self.module.silentLoad().load();
|
||||
@@ -144,7 +173,7 @@ let _allegati = {
|
||||
let key = $tr.getDataAttr("key");
|
||||
let fileName = $tr.getDataAttr("file_name");
|
||||
|
||||
if ([self.sourceTypes.ATTIVITA, self.sourceTypes.LIBERO, self.sourceTypes.COMMESSA, self.sourceTypes.LIS_A, self.sourceTypes.PARTITAMAG, self.sourceTypes.ORDACQCOM, self.sourceTypes.ORDCOM].indexOf(sourceType) >= 0) {
|
||||
if ([self.sourceTypes.ATTIVITA, self.sourceTypes.LIBERO, self.sourceTypes.COMMESSA, self.sourceTypes.LIS_A, self.sourceTypes.PARTITAMAG, self.sourceTypes.ORDCOM].indexOf(sourceType) >= 0) {
|
||||
let shortenFilename = shorten_filename(fileName, 20);
|
||||
let messageTitle = null;
|
||||
let messageFileDelete = "Stai eliminando <b>" + shortenFilename + "</b>";
|
||||
|
||||
@@ -8,12 +8,10 @@ FROM stb_files_attached
|
||||
LEFT OUTER JOIN mrl_partita_mag_attached ON stb_files_attached.id_attach = mrl_partita_mag_attached.id_attach
|
||||
LEFT OUTER JOIN drl_ord_attached ON stb_files_attached.id_attach = drl_ord_attached.id_attach
|
||||
LEFT OUTER JOIN drl_doc_attached ON stb_files_attached.id_attach = drl_doc_attached.id_attach
|
||||
WHERE stb_files_attached.data_doc IS NULL
|
||||
AND stb_files_attached.num_doc IS NULL
|
||||
AND parent_id_attach IS NULL
|
||||
AND mrl_partita_mag_attached.id_attach IS NULL
|
||||
AND mrl_partita_mag_attached.id_attach IS NULL
|
||||
WHERE parent_id_attach IS NULL
|
||||
AND mrl_partita_mag_attached.id_attach IS NULL
|
||||
AND drl_ord_attached.id_attach IS NULL
|
||||
AND drl_doc_attached.id_attach IS NULL
|
||||
AND flag_lock = 'N'
|
||||
AND file_size > 0
|
||||
ORDER BY stb_files_attached.file_name
|
||||
@@ -382,7 +382,7 @@ class AssociazioneReport {
|
||||
->set("reportId", $data["report"])
|
||||
->set("codMdep", $data["cod_mdep"])
|
||||
->set("printerName", $data["stampante"])
|
||||
->set("tipo", $data["tipologia"])
|
||||
->set("tipo", (int)$data["tipologia"])
|
||||
->set("printQuantity", $data["num_copie"]);
|
||||
|
||||
if (!$isNew) {
|
||||
|
||||
@@ -35,10 +35,8 @@ if (isset($_GET["load_filters"])) {
|
||||
} else if (isset($_POST["upload_allegato"])) {
|
||||
$Ret = new Ret;
|
||||
if (count($_FILES) > 0) {
|
||||
$files = array_values($_FILES);
|
||||
$file = $files[0];
|
||||
$data = Utility::B64JSON_parse($_POST["upload_allegato"]);
|
||||
$Ret = Catalogo\Prodotto::upload_allegato($data, $file);
|
||||
$Ret = Catalogo\Prodotto::upload_allegato($data, $_FILES);
|
||||
} else {
|
||||
$Ret->set_error("File non pervenuto");
|
||||
}
|
||||
|
||||
@@ -23,24 +23,25 @@ $(function () {
|
||||
});
|
||||
|
||||
$(document).on("change", "#m_fileAllegato", function (e) {
|
||||
var $file = $(this);
|
||||
if (!is_null($file.getValue())) {
|
||||
var $toDisable = $file.closest(".modal-content").children();
|
||||
const $file = $(this);
|
||||
|
||||
if (!is_null($file.getValue())) {
|
||||
const $toDisable = $file.closest(".modal-content").children();
|
||||
const data = {codMart: _catalogo.product.codMart};
|
||||
const ajax = new Ajax();
|
||||
|
||||
var data = {codMart: _catalogo.product.codMart};
|
||||
var ajax = new Ajax();
|
||||
ajax.post("upload_allegato")
|
||||
.data(data)
|
||||
.file($file)
|
||||
.file($file, true)
|
||||
.$button($("#m_btAllega"))
|
||||
.$toDisable($toDisable)
|
||||
.noticeAsModal()
|
||||
.onSuccess(function (ret) {
|
||||
_catalogo.product.allegato.callbackOK(ret.returnData);
|
||||
var toast = new Toast();
|
||||
const toast = new Toast();
|
||||
toast.success("Il file <b>" + ret.returnData.path_link + "</b> è stato aggiunto");
|
||||
|
||||
var $tr = $(ret.returnString);
|
||||
const $tr = $(ret.returnString);
|
||||
$("#m_tbAllegati").children("tbody").append($tr);
|
||||
$tr.highlightRow();
|
||||
})
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
class ChiusuraTagliPrezzo {
|
||||
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 getPromozioni($data) {
|
||||
$dataVal = array_get($data, "dataVal");
|
||||
|
||||
if (is_null($dataVal)) {
|
||||
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, "getPromozioni");
|
||||
}
|
||||
|
||||
$query = KendoService::queryInitializerService($data, "get-promozioni", "1, 2", false, false);
|
||||
|
||||
$query->setDateVar("dataVal", $dataVal);
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$promozioni = $ret->get_data();
|
||||
|
||||
$ret->set_data(array(
|
||||
"data" => $promozioni,
|
||||
"total" => array_get($promozioni, "0.rows_count")
|
||||
));
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function updateListiniVend($data) {
|
||||
$promozioni = array_get($data, "promozioni");
|
||||
|
||||
$promozioni = array_map(function ($promozione) {
|
||||
return EntityItem::fromArray($promozione);
|
||||
}, $promozioni);
|
||||
|
||||
$entityList = new EntityList();
|
||||
|
||||
foreach ($promozioni as $promozione) {
|
||||
$entityList->push($promozione);
|
||||
}
|
||||
|
||||
$imsApi = new IMSApi();
|
||||
|
||||
$imsApi
|
||||
->post("listini-vendita/update")
|
||||
->body($entityList);
|
||||
|
||||
return $imsApi->send();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class ChiusuraTagliPrezzoAjax extends Ajax {
|
||||
protected function checkCustomRequests() {
|
||||
if (self::get("popup-sample")) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["popup-sample"]);
|
||||
include "popup-sample.php";
|
||||
}
|
||||
}
|
||||
}
|
||||
1
public_html/gest-lib/chiusura_tagli_prezzo/css/main.css
Normal file
1
public_html/gest-lib/chiusura_tagli_prezzo/css/main.css
Normal file
@@ -0,0 +1 @@
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
BIN
public_html/gest-lib/chiusura_tagli_prezzo/icon.png
Normal file
BIN
public_html/gest-lib/chiusura_tagli_prezzo/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<?php ?>
|
||||
|
||||
<div id="app">Caricamento...</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
$Ret = new Ret;
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
ob_start();
|
||||
|
||||
$html = Utility\Str::remove_multiple_spaces(@ob_get_clean());
|
||||
$Ret->set_string($html);
|
||||
}
|
||||
|
||||
$Ret->display();
|
||||
@@ -0,0 +1,102 @@
|
||||
WITH art AS (SELECT cod_mart, cod_mart AS cod_mart_mov, descrizione
|
||||
FROM carelli.dbo.mtb_aart
|
||||
WHERE articolo_composto = 'N'
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT mtb_aart.cod_mart, mtb_comp.cod_comp AS cod_Mart_mov, descrizione
|
||||
FROM carelli.dbo.mtb_aart
|
||||
INNER JOIN carelli.dbo.mtb_comp ON mtb_aart.cod_mart = mtb_comp.cod_mart
|
||||
WHERE articolo_composto = 'S'),
|
||||
ordini AS (SELECT dtb_ordr.cod_mart,
|
||||
t.data_ord,
|
||||
t.num_ord,
|
||||
listino,
|
||||
data_esportazione,
|
||||
t.serie,
|
||||
t.cod_mdep
|
||||
FROM carelli.dbo.dtb_ordt t
|
||||
INNER JOIN carelli.dbo.dtb_ordr ON
|
||||
t.data_ord = dtb_ordr.data_ord AND
|
||||
t.num_ord = dtb_ordr.num_ord AND
|
||||
t.gestione = dtb_ordr.gestione
|
||||
WHERE CAST(t.data_esportazione AS DATE) = DATEADD(DAY, -1, CAST(GETDATE() AS DATE))
|
||||
AND flag_annulla <> 'S'
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT dtb_ordr.cod_mart,
|
||||
t.data_ord,
|
||||
t.num_ord,
|
||||
listino,
|
||||
data_esportazione,
|
||||
t.serie,
|
||||
t.cod_mdep
|
||||
FROM panimal.dbo.dtb_ordt t
|
||||
INNER JOIN panimal.dbo.dtb_ordr ON
|
||||
t.data_ord = dtb_ordr.data_ord AND
|
||||
t.num_ord = dtb_ordr.num_ord AND
|
||||
t.gestione = dtb_ordr.gestione
|
||||
WHERE CAST(t.data_esportazione AS DATE) = DATEADD(DAY, -1, CAST(GETDATE() AS DATE))
|
||||
AND flag_annulla <> 'S'
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT dtb_ordr.cod_mart,
|
||||
t.data_ord,
|
||||
t.num_ord,
|
||||
listino,
|
||||
data_esportazione,
|
||||
t.serie,
|
||||
t.cod_mdep
|
||||
FROM gestfood.dbo.dtb_ordt t
|
||||
INNER JOIN gestfood.dbo.dtb_ordr ON
|
||||
t.data_ord = dtb_ordr.data_ord AND
|
||||
t.num_ord = dtb_ordr.num_ord AND
|
||||
t.gestione = dtb_ordr.gestione
|
||||
WHERE CAST(t.data_esportazione AS DATE) = DATEADD(DAY, -1, CAST(GETDATE() AS DATE))
|
||||
AND flag_annulla <> 'S'),
|
||||
tmp_ord AS (SELECT art.cod_mart,
|
||||
art.descrizione,
|
||||
cod_mart_mov,
|
||||
ordini.data_ord,
|
||||
ordini.num_ord,
|
||||
ordini.listino,
|
||||
ordini.data_esportazione,
|
||||
CAST(IIF(ordini.serie = 'SU', 1, 0) AS BIT) AS sudd,
|
||||
mtb_depo.cod_vlis
|
||||
FROM ordini
|
||||
INNER JOIN art ON ordini.cod_mart = art.cod_mart
|
||||
INNER JOIN mtb_depo ON ordini.cod_mdep = mtb_depo.cod_mdep),
|
||||
TempResult AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS row_number,
|
||||
*
|
||||
FROM (SELECT DISTINCT promo.cod_vlis + '-' + promo.cod_mart AS id,
|
||||
promo.cod_vlis,
|
||||
promo.descrizione,
|
||||
promo.cod_mart,
|
||||
mtb_aart.descrizione AS articolo,
|
||||
data_iniz,
|
||||
data_fine,
|
||||
cod_promo,
|
||||
promo.note,
|
||||
aggiornato_da,
|
||||
prz_vend_iva,
|
||||
ISNULL(ordini.sudd, 0) AS sudd,
|
||||
CAST(IIF(ordini.data_ord IS NOT NULL, 1, 0) AS BIT) AS flag_riass,
|
||||
UPPER(IIF(CHARINDEX(' ', aggiornato_da) > 0,
|
||||
LEFT(aggiornato_da, CHARINDEX(' ', aggiornato_da)),
|
||||
aggiornato_da)) AS user_name
|
||||
FROM dbo.getPromozioneVendita('[dataVal]', '[dataVal]', NULL, NULL, NULL) promo
|
||||
INNER JOIN mtb_aart ON promo.cod_marT = mtb_aart.cod_mart
|
||||
LEFT OUTER JOIN tmp_ord ordini ON promo.cod_vlis = ordini.cod_vlis AND
|
||||
promo.cod_mart = ordini.cod_mart AND
|
||||
ordini.data_ord BETWEEN promo.data_iniz AND promo.data_fine
|
||||
WHERE promo.flag_tipo_promo = 'T') t
|
||||
WHERE [filter]),
|
||||
TempCount AS (SELECT COUNT(*) AS rows_count
|
||||
FROM TempResult)
|
||||
SELECT TempResult.*,
|
||||
TempCount.*
|
||||
FROM TempResult,
|
||||
TempCount
|
||||
ORDER BY [orderBy]
|
||||
@@ -0,0 +1,449 @@
|
||||
import ViewModule from "@js/modules/ViewModule.js";
|
||||
import mapKeys from "lodash-es/mapKeys.js";
|
||||
import camelCase from "lodash-es/camelCase.js";
|
||||
|
||||
export class Promozione extends kendo.data.Model.define({
|
||||
id: "id",
|
||||
fields: {
|
||||
id: {type: "string"},
|
||||
cod_vlis: {type: "string"},
|
||||
descrizione: {type: "string"},
|
||||
cod_mart: {type: "string"},
|
||||
articolo: {type: "string"},
|
||||
data_iniz: {type: "date"},
|
||||
data_fine: {type: "date"},
|
||||
cod_promo: {type: "string"},
|
||||
note: {type: "string"},
|
||||
aggiornato_da: {type: "string"},
|
||||
prz_vend_iva: {type: "number"},
|
||||
sudd: {type: "boolean"},
|
||||
flag_riass: {type: "boolean"},
|
||||
user_name: {type: "string"},
|
||||
}
|
||||
}) {
|
||||
type = "mtb_lisv_data"
|
||||
id_ord: string
|
||||
cod_vlis: string
|
||||
descrizione: string
|
||||
cod_mart: string
|
||||
articolo: string
|
||||
data_iniz: Date
|
||||
data_fine: Date
|
||||
cod_promo: string
|
||||
note: string
|
||||
aggiornato_da: string
|
||||
prz_vend_iva: number
|
||||
sudd: boolean
|
||||
flag_riass: boolean
|
||||
user_name: string
|
||||
}
|
||||
|
||||
export default class ChiusuraTagliPrezzo extends ViewModule {
|
||||
private dataVal: kendo.ui.DatePicker
|
||||
private checkboxRiass: kendo.ui.CheckBox
|
||||
private checkboxMiePromo: kendo.ui.CheckBox
|
||||
private readonly columnsPromozioni: Array<kendo.ui.GridColumn>
|
||||
private readonly dataSourcePromozioni: kendo.data.DataSource
|
||||
private tablePromozioni: kendo.ui.Grid
|
||||
|
||||
constructor(selector: string | null) {
|
||||
super(selector);
|
||||
|
||||
this.columnsPromozioni = _kendo.setDefaultCellOptions([
|
||||
{
|
||||
id: "c0f8bf55-9744-4bdd-a4f0-8db3066e88a7",
|
||||
field: "cod_mart",
|
||||
title: "Cod. Art.",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "f7d7626e-73c8-4d4b-818d-f7dd81c49827",
|
||||
field: "articolo",
|
||||
title: "Articolo",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "eb844518-e289-4a0f-9d34-fed9ad7e17fd",
|
||||
field: "cod_vlis",
|
||||
title: "Listino",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "5e817e11-901a-4a4c-9263-1fdadcadcc78",
|
||||
field: "descrizione",
|
||||
title: "Descrizione",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "b01bedb3-2ac4-4c15-b1be-3f108a772015",
|
||||
field: "data_iniz",
|
||||
title: "Data Inizio",
|
||||
type: "date",
|
||||
format: "{0:dd/MM/yyyy}",
|
||||
filterable: {
|
||||
cell: {
|
||||
minLength: 100,
|
||||
operator: "eq",
|
||||
suggestionOperator: "eq"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "9256ed35-434d-4ee6-9e2f-9b4f1c2a00ab",
|
||||
field: "data_fine",
|
||||
title: "Data Fine",
|
||||
type: "date",
|
||||
format: "{0:dd/MM/yyyy}",
|
||||
filterable: {
|
||||
cell: {
|
||||
minLength: 100,
|
||||
operator: "eq",
|
||||
suggestionOperator: "eq"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "dd73e45b-31ff-480a-a61a-f6887ef2cad7",
|
||||
field: "cod_promo",
|
||||
title: "Cod. Promo",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "0cc0e1d6-f57e-44f9-a11a-ecfe2bcbe94f",
|
||||
field: "note",
|
||||
title: "Note",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "0ad4f5a1-b9e6-4a41-bcb1-a785a0141b12",
|
||||
field: "sudd",
|
||||
title: "Suddivisione",
|
||||
type: "boolean",
|
||||
template: ({sudd}) => `<i class="fas fa-${sudd && "check" || "times"}"></i>`,
|
||||
filterable: {
|
||||
ui: (input) => input.kendoDropDownList({
|
||||
dataSource: {
|
||||
data: [
|
||||
{text: "Si", value: true},
|
||||
{text: "No", value: false}
|
||||
]
|
||||
},
|
||||
dataTextField: "text",
|
||||
dataValueField: "value",
|
||||
valuePrimitive: true,
|
||||
optionLabel: "Tutti"
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "bccc7a72-a789-4d38-9f7d-b9170801282b",
|
||||
field: "user_name",
|
||||
title: "Utente",
|
||||
type: "string",
|
||||
filterable: {
|
||||
operators: {
|
||||
string: {
|
||||
contains: "Contiene",
|
||||
doesnotcontain: "Non contiene"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
||||
this.dataSourcePromozioni = new kendo.data.DataSource({
|
||||
transport: {
|
||||
read: async (options) => {
|
||||
_kendo.checkFilterValuesColumns(
|
||||
options.data.filter,
|
||||
this.columnsPromozioni
|
||||
);
|
||||
|
||||
try {
|
||||
const data = await this.getPromozioni({
|
||||
dataVal: this.dataVal.value(),
|
||||
...options.data,
|
||||
filter: {
|
||||
filters: [
|
||||
...options.data.filter?.filters || [],
|
||||
...this.checkboxRiass.check() && [{
|
||||
field: "flag_riass",
|
||||
operator: "eq",
|
||||
value: true
|
||||
}] || [],
|
||||
...this.checkboxMiePromo.check() && [{
|
||||
field: "aggiornato_da",
|
||||
operator: "contains",
|
||||
value: _USER.username
|
||||
}] || []
|
||||
],
|
||||
logic: "and"
|
||||
}
|
||||
});
|
||||
|
||||
options.success(data);
|
||||
} catch (e) {
|
||||
options.error(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
schema: {
|
||||
data: "data",
|
||||
total: "total",
|
||||
model: Promozione
|
||||
},
|
||||
// sort: {
|
||||
// field: "cod_vlis",
|
||||
// dir: "desc"
|
||||
// },
|
||||
serverPaging: false,
|
||||
serverFiltering: true,
|
||||
serverSorting: false
|
||||
});
|
||||
}
|
||||
|
||||
async content(): Promise<string> {
|
||||
// language=HTML
|
||||
return `
|
||||
<aside class="flex gaps mb-10 align-center">
|
||||
<input type="text" id="dataVal" style="width: 10%">
|
||||
|
||||
<button id="selectAll" type="button">
|
||||
Seleziona tutto
|
||||
</button>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="filterRiass" class="mt-0">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="filterMiePromo" class="mt-0">
|
||||
</div>
|
||||
</aside>
|
||||
<div id="tablePromozioni"></div>
|
||||
`;
|
||||
}
|
||||
|
||||
name(): string {
|
||||
return "chiusura_tagli_prezzo";
|
||||
}
|
||||
|
||||
async onLoad(hideSplashScreen = true): Promise<void> {
|
||||
await super.onLoad(hideSplashScreen);
|
||||
|
||||
this.dataVal = this.$container.find("#dataVal").kendoDatePicker({
|
||||
dateInput: true,
|
||||
value: new Date(),
|
||||
label: "Data Validità",
|
||||
change: () => {
|
||||
this.dataSourcePromozioni.read();
|
||||
}
|
||||
}).data("kendoDatePicker");
|
||||
|
||||
this.$container.find("#selectAll").kendoButton({
|
||||
click: () => {
|
||||
const selected = this.tablePromozioni.select();
|
||||
|
||||
this.tablePromozioni.clearSelection();
|
||||
this.tablePromozioni.select($("tr").not(selected));
|
||||
}
|
||||
});
|
||||
|
||||
this.checkboxRiass = this.$container.find("#filterRiass").kendoCheckBox({
|
||||
label: "Solo articoli riassortiti",
|
||||
checked: true,
|
||||
change: () => {
|
||||
this.dataSourcePromozioni.read();
|
||||
}
|
||||
}).data("kendoCheckBox");
|
||||
|
||||
this.checkboxMiePromo = this.$container.find("#filterMiePromo").kendoCheckBox({
|
||||
label: "Visualizza mie promo",
|
||||
change: () => {
|
||||
this.dataSourcePromozioni.read();
|
||||
}
|
||||
}).data("kendoCheckBox");
|
||||
|
||||
this.tablePromozioni = await _kendo.savableTable(this.$container.find("#tablePromozioni"), "PROMOZIONI", {
|
||||
columns: this.columnsPromozioni,
|
||||
dataSource: this.dataSourcePromozioni,
|
||||
filterable: {
|
||||
mode: "menu"
|
||||
},
|
||||
pageable: false,
|
||||
selectable: "multiple, row",
|
||||
contextMenu: {
|
||||
body: [
|
||||
{
|
||||
name: "ChiusuraAnticipata",
|
||||
text: "Chiusura Anticipata",
|
||||
icon: "- fas fa-trash",
|
||||
command: "ChiusuraAnticipata"
|
||||
}
|
||||
],
|
||||
open: (e) => {
|
||||
const selectedRows = this.tablePromozioni.select();
|
||||
const targetTr = $(e.target).parents("tr").get(0);
|
||||
|
||||
if (!selectedRows.toArray().some(selectedRow => selectedRow === targetTr)) {
|
||||
this.tablePromozioni.clearSelection();
|
||||
this.tablePromozioni.select(targetTr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {autoBind: !!this.dataVal.value()});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
kendo.ui.grid.commands["ChiusuraAnticipata"] = kendo.ui.grid.GridCommand.extend({
|
||||
exec: async () => {
|
||||
const selectedRows = this.tablePromozioni.select();
|
||||
|
||||
let promozioni = selectedRows
|
||||
.map((i, row) => this.tablePromozioni.dataItem(row).toJSON() as Promozione)
|
||||
.toArray();
|
||||
|
||||
const {dataFine, confirmed} = await this.askDataFinePromo();
|
||||
|
||||
console.log(dataFine, confirmed);
|
||||
|
||||
if (confirmed) {
|
||||
promozioni = promozioni
|
||||
.map(promozione => (promozione.data_fine = dataFine.toDate(), mapKeys(promozione, (v, key) => camelCase(key))));
|
||||
|
||||
if (await this.updateListiniVend(promozioni)) {
|
||||
await this.dataSourcePromozioni.read();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async getPromozioni(data: object = null) {
|
||||
const ret = await this.ajax()
|
||||
.get("getPromozioni")
|
||||
.data(data)
|
||||
.noticeAsModal()
|
||||
.execute();
|
||||
|
||||
return ret?.returnData as {
|
||||
data: Array<Promozione>
|
||||
total: number
|
||||
};
|
||||
}
|
||||
|
||||
async askDataFinePromo(): Promise<{ dataFine: moment.Moment, confirmed: boolean }> {
|
||||
// language=HTML
|
||||
return await new ModalBox()
|
||||
.content(`
|
||||
<div id="dataFine"></div>
|
||||
`)
|
||||
.onBeforeShow(($div) => {
|
||||
const $okBtn = $div.find(".modal-btn-ok");
|
||||
|
||||
$okBtn.disabled(true);
|
||||
|
||||
const today = moment().startOf("day");
|
||||
const yesterday = today.clone().subtract(1, "day").startOf("day");
|
||||
|
||||
$div.find("#dataFine").kendoDropDownList({
|
||||
dataTextField: "text",
|
||||
dataValueField: "value",
|
||||
optionLabel: {
|
||||
text: "Data di chiusura",
|
||||
value: null
|
||||
},
|
||||
dataSource: [
|
||||
{
|
||||
text: `Ieri - ${yesterday.format("DD/MM/YYYY")}`,
|
||||
value: yesterday
|
||||
},
|
||||
{
|
||||
text: `Oggi - ${today.format("DD/MM/YYYY")}`,
|
||||
value: today
|
||||
}
|
||||
],
|
||||
dataBound: (e) => e.sender.list.find(".k-list-optionlabel").hide(),
|
||||
select: (e) => $okBtn.disabled(!e.dataItem.value)
|
||||
} as kendo.ui.DropDownListOptions);
|
||||
})
|
||||
.btOK({
|
||||
text: "Conferma",
|
||||
dismissOnClick: true,
|
||||
onClick(e, $bt, $div) {
|
||||
return {
|
||||
dataFine: $div.find("#dataFine").val(),
|
||||
confirmed: true
|
||||
};
|
||||
}
|
||||
})
|
||||
.gridSize({
|
||||
xs: 12,
|
||||
md: 4
|
||||
})
|
||||
.okCancel()
|
||||
.title("Seleziona la data di chiusura")
|
||||
.show();
|
||||
}
|
||||
|
||||
async updateListiniVend(data: Promozione[]) {
|
||||
const ret = await this.ajax()
|
||||
.post("updateListiniVend")
|
||||
.data({
|
||||
promozioni: data
|
||||
})
|
||||
.noticeAsModal()
|
||||
.waitModal()
|
||||
.execute();
|
||||
|
||||
return ret?.returnId === 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import ChiusuraTagliPrezzo from "./ChiusuraTagliPrezzo.js";
|
||||
|
||||
$(function () {
|
||||
new ChiusuraTagliPrezzo("#app");
|
||||
});
|
||||
@@ -46,9 +46,24 @@ class ContoEconomicoProdotto {
|
||||
return $gestSetup->section("VERIFICA_AGGIORNAMENTO_PREZZI")->keySection("USA_COSTO_MERC")->asBoolean()->defaultValue(false)->get();
|
||||
}
|
||||
|
||||
private static function getTipoRagguppamento() {
|
||||
public static function getFiltroCodMgrp() {
|
||||
$gestSetup = new GestSetup();
|
||||
return $gestSetup->section("CONTO_ECONOMICO_PRODOTTO")->keySection("FILTRO_COD_MGRP")->get();
|
||||
}
|
||||
|
||||
public static function getFiltroTipoMgrp() {
|
||||
$gestSetup = new GestSetup();
|
||||
return $gestSetup->section("CONTO_ECONOMICO_PRODOTTO")->keySection("FILTRO_TIPO_MGRP")->get();
|
||||
}
|
||||
|
||||
public static function getTipoRagguppamento() {
|
||||
$GestSetup = new \GestSetup;
|
||||
return $GestSetup->keySection("TIPO_RAGGRUPPAMENTO")->defaultValue("T")->get();
|
||||
return $GestSetup->section("CONTO_ECONOMICO_PRODOTTO")->keySection("TIPO_RAGGRUPPAMENTO")->defaultValue("T")->get();
|
||||
}
|
||||
|
||||
public static function isPrzBaseDaDist() {
|
||||
$GestSetup = new GestSetup();
|
||||
return $GestSetup->section("CONTO_ECONOMICO_PRODOTTO")->keySection("PRZ_BASE_DA_DIST")->defaultValue(false)->asBoolean()->get();
|
||||
}
|
||||
|
||||
public static function get_contattiListino($codVlis) {
|
||||
@@ -56,11 +71,26 @@ class ContoEconomicoProdotto {
|
||||
return $Query->importSqlFile("list-contatti-listino")->setVar("cod_vlis", $codVlis)->toRet()->execute();
|
||||
}
|
||||
|
||||
private static function get_listini() {
|
||||
public static function get_listini($data = array()) {
|
||||
$Query = new Query;
|
||||
$Ret = $Query->importSqlFile("list-listini")->toRet()->execute();
|
||||
if ($Ret->is_OK()) {
|
||||
$arr_rows = $Ret->get_data();
|
||||
$addNew = array_get($data, "addNew", false);
|
||||
|
||||
if ($addNew) {
|
||||
$arr_rows = array_merge(
|
||||
array(
|
||||
array(
|
||||
"cod_vlis" => "NEW",
|
||||
"descrizione" => ""
|
||||
)
|
||||
),
|
||||
$Ret->get_data()
|
||||
);
|
||||
} else {
|
||||
$arr_rows = $Ret->get_data();
|
||||
}
|
||||
|
||||
foreach ($arr_rows as $i => $row) {
|
||||
$row["descrizione"] = htmlentities($row["descrizione"]);
|
||||
// $Ret = self::get_contattiListino($row["cod_vlis"]);
|
||||
@@ -79,12 +109,55 @@ class ContoEconomicoProdotto {
|
||||
public static function get_dateVariazioni($data) { // DATE VARIAZIONI LISTINO
|
||||
$Query = new Query;
|
||||
$Query->select("data_iniz")->from("vtb_list_data")->where("cod_vlis", $data["cod_vlis"])->orderBy("data_iniz");
|
||||
return $Query->firstColumn()->toRet()->date2ts()->execute();
|
||||
$ret = $Query->firstColumn()->toRet()->date2ts()->execute();
|
||||
|
||||
// if ($ret->is_OK()) {
|
||||
// $dateVariazioni = $ret->get_data();
|
||||
// $today = strtotime("today");
|
||||
//
|
||||
// if (!array_any($dateVariazioni, function ($dataVariazioni) use ($today) {
|
||||
// return $dataVariazioni == $today;
|
||||
// })) {
|
||||
// $dateVariazioni[] = $today;
|
||||
// }
|
||||
//
|
||||
// $ret->set_data($dateVariazioni);
|
||||
// }
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private static function get_articoliAll() {
|
||||
$Query = new Query;
|
||||
return $Query->importSqlFile("list-articoli-all")->toRet()->execute();
|
||||
public static function get_articoliAll($data = array()) {
|
||||
$useKendo = array_get($data, "useKendo", false);
|
||||
|
||||
if ($useKendo) {
|
||||
$query = KendoService::queryInitializerService($data, "list-articoli-all", "2, 1");
|
||||
|
||||
$query
|
||||
->setVar("codVlis", array_get($data, "codVlis"));
|
||||
} else {
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->importSqlFile("list-articoli-all")
|
||||
->setVar("codVlis", array_get($data, "codVlis"));
|
||||
|
||||
$query->sql .= "\nORDER BY 2, 1";
|
||||
}
|
||||
|
||||
$filtroCodMgrp = ContoEconomicoProdotto::getFiltroCodMgrp();
|
||||
|
||||
if (isset($filtroCodMgrp)) {
|
||||
$query
|
||||
->setVar("tipoFiltro", "FILTRO_COD_MGRP")
|
||||
->setVar("joinFiltro", "mtb_aart.cod_mgrp = stp.value_string");
|
||||
} else {
|
||||
$query
|
||||
->setVar("tipoFiltro", "FILTRO_TIPO_MGRP")
|
||||
->setVar("joinFiltro", "mg.tipo_mgrp = stp.value_string");
|
||||
}
|
||||
|
||||
return $query->toRet()->execute();
|
||||
}
|
||||
|
||||
private static function flag_userCanSave() {//return true;
|
||||
@@ -108,13 +181,20 @@ class ContoEconomicoProdotto {
|
||||
}
|
||||
|
||||
public static function get_articoliListino($data) {
|
||||
$dataValidita = if_null($data["data_validita"], Utility\Date::getToday());
|
||||
$codVlis = array_get($data, "cod_vlis");
|
||||
|
||||
if (is_null($codVlis)) {
|
||||
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, "get_articoliListino");
|
||||
}
|
||||
|
||||
$dataValidita = array_get($data, "data_validita", Utility\Date::getToday());
|
||||
|
||||
$queryInterna = new Query;
|
||||
$queryInterna->importSqlFile("list-articoli-listino_interna")
|
||||
->setVar("cod_vlis", $data["cod_vlis"])
|
||||
->setVar("cod_vlis", $codVlis)
|
||||
->setDateVar("data_validita", $dataValidita)
|
||||
->setVar("tipo_ragg", ContoEconomicoProdotto::getTipoRagguppamento());
|
||||
->setVar("tipo_ragg", ContoEconomicoProdotto::getTipoRagguppamento())
|
||||
->setVar("przBaseDaDist", ContoEconomicoProdotto::isPrzBaseDaDist());
|
||||
|
||||
if (isset($data["cod_mart"])) {
|
||||
$queryInterna->setVar("cod_mart", $data["cod_mart"])
|
||||
@@ -123,8 +203,7 @@ class ContoEconomicoProdotto {
|
||||
$queryInterna->setVar("cod_mart", null);
|
||||
}
|
||||
|
||||
$query = new Query;
|
||||
$query->importSqlFile('list-articoli-listino')
|
||||
$query = KendoService::queryInitializerService($data, "list-articoli-listino", "cod_mtip, cod_mstp, cod_mart, da")
|
||||
->setVar("query_interna", $queryInterna->getSql());
|
||||
|
||||
if (array_key_exists("filters", $data)) {
|
||||
@@ -142,7 +221,51 @@ class ContoEconomicoProdotto {
|
||||
}
|
||||
}
|
||||
|
||||
return $query->toRet()->execute();
|
||||
$ret = $query->toRet()->date2ts()->execute();
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$articoliListino = from($ret->get_data())
|
||||
->select(function ($articoloListino) {
|
||||
$listaMisure = array();
|
||||
|
||||
$untMis = array_get($articoloListino, "untMis");
|
||||
$untMis2 = array_get($articoloListino, "untMis2");
|
||||
$untMis3 = array_get($articoloListino, "untMis3");
|
||||
|
||||
if (!is_null($untMis)) {
|
||||
$listaMisure[] = array(
|
||||
"untMis" => $untMis,
|
||||
"rapConv" => 1,
|
||||
"tipoUm" => array_get($articoloListino, "tipoUm")
|
||||
);
|
||||
}
|
||||
|
||||
if (!is_null($untMis2)) {
|
||||
$listaMisure[] = array(
|
||||
"untMis" => $untMis2,
|
||||
"rapConv" => 1,
|
||||
"tipoUm" => array_get($articoloListino, "tipoUm2")
|
||||
);
|
||||
}
|
||||
|
||||
if (!is_null($untMis3)) {
|
||||
$listaMisure[] = array(
|
||||
"untMis" => $untMis3,
|
||||
"rapConv" => 1,
|
||||
"tipoUm" => array_get($articoloListino, "tipoUm3")
|
||||
);
|
||||
}
|
||||
|
||||
$articoloListino["listaMisure"] = $listaMisure;
|
||||
|
||||
return $articoloListino;
|
||||
})
|
||||
->toArray();
|
||||
|
||||
$ret->set_data($articoliListino);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function get_dettaglioListino($data) {
|
||||
@@ -447,25 +570,49 @@ class ContoEconomicoProdotto {
|
||||
}
|
||||
|
||||
public static function delete_artListino($data) {
|
||||
$VtbListData = new EntityItem("vtb_list_data");
|
||||
$VtbListData->insert_or_update()
|
||||
->setDate("dataIniz", $data["data_iniz"])
|
||||
->set("codVlis", $data["cod_vlis"]);
|
||||
$listini = array_get($data, "listini.models");
|
||||
|
||||
$MtbLisvData = new EntityItem("mtb_lisv_data");
|
||||
$MtbLisvData->insert_or_update()
|
||||
->set("tipoVariazione", "D")
|
||||
->set("codMart", $data["cod_mart"])
|
||||
->set("aggiornatoDa", User::get_current_username());
|
||||
if (is_null($listini)) {
|
||||
$listini = array($data);
|
||||
}
|
||||
|
||||
return $VtbListData->set("mtbLisvData", $MtbLisvData)->send();
|
||||
$entityList = new EntityList();
|
||||
|
||||
foreach ($listini as $listino) {
|
||||
$mtbLisvData = new EntityItem("mtb_lisv_data");
|
||||
|
||||
$mtbLisvData
|
||||
->insert_or_update()
|
||||
->set("tipoVariazione", "D")
|
||||
->set("codMart", array_get($listino, "cod_mart"))
|
||||
->set("aggiornatoDa", User::get_current_username());
|
||||
|
||||
$vtbListData = new EntityItem("vtb_list_data");
|
||||
|
||||
$vtbListData
|
||||
->insert_or_update()
|
||||
->setDate("dataIniz", array_get($listino, "data_iniz"))
|
||||
->set("codVlis", array_get($listino, "cod_anag", array_get($listino, "cod_vlis")))
|
||||
->set("mtbLisvData", $mtbLisvData);
|
||||
|
||||
$entityList->push($vtbListData);
|
||||
}
|
||||
|
||||
return $entityList->send();
|
||||
}
|
||||
|
||||
public static function getCondizioniCommLisv($data) {
|
||||
$query = new Query;
|
||||
$codVlis = array_get($data, "codVlis");
|
||||
|
||||
$query->importSqlFile("getCondizioniCommLisv")
|
||||
->setVar("cod_vlis", $data["codVlis"]);
|
||||
if (array_any_null(array($codVlis))) {
|
||||
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, "getCondizioniCommLisv");
|
||||
}
|
||||
|
||||
$query = new Query();
|
||||
|
||||
$query
|
||||
->importSqlFile("getCondizioniCommLisv")
|
||||
->setVar("cod_vlis", $codVlis);
|
||||
|
||||
return $query->toRet()->firstRow()->execute();
|
||||
}
|
||||
@@ -515,6 +662,24 @@ class ContoEconomicoProdotto {
|
||||
|
||||
return $query->toRet()->execute();
|
||||
}
|
||||
|
||||
public static function getSchedaCosti(array $data) {
|
||||
$gestSetup = new GestSetup();
|
||||
$JP = new JasperProcessor();
|
||||
$key = $data["key"];
|
||||
|
||||
$ret = $JP->load($gestSetup->keySection("REPORT_SCHEDA_COSTI"));
|
||||
if ($ret->is_OK()) {
|
||||
$JP->param("cod_vlis", $key["codVlis"])
|
||||
->param("cod_mart", $key["codMart"])
|
||||
->paramDate("data_iniz", $key["dataValidita"])
|
||||
->cacheAs("StampaSchedaCosti");
|
||||
|
||||
$ret = $JP->run();
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists("StdUtils")) {
|
||||
|
||||
@@ -32,6 +32,9 @@ if (isset($_GET["popup-det_articolo"])) {
|
||||
} else if (isset($_POST["saveCondizioniCommerciali"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["saveCondizioniCommerciali"]);
|
||||
ContoEconomicoProdotto::saveCondizioniCommerciali($data)->display();
|
||||
} else if (isset($_GET["getSchedaCosti"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["getSchedaCosti"]);
|
||||
ContoEconomicoProdotto::getSchedaCosti($data)->display();
|
||||
} else if (isset($_GET["popup-condizioni_commerciali"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["popup-condizioni_commerciali"]);
|
||||
include "popup-condizioni_commerciali.php";
|
||||
|
||||
@@ -40,7 +40,7 @@ if ($ret->is_OK()) {
|
||||
</label>
|
||||
|
||||
<textarea name="condizioneCommercialeHtml" id="condizioneCommercialeHtml">
|
||||
<?= $condizioniCommerciali["condizioni_comm"] ?>
|
||||
<?= array_get($condizioniCommerciali, "condizioni_comm") ?>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,8 +40,8 @@ $(function () {
|
||||
let codMart = $tr.getDataAttr("cod_mart");
|
||||
let codVlis = _cep.get_codVlis();
|
||||
let versione = $tr.getDataAttr("versione");
|
||||
let loadJson = true;
|
||||
let dataValidita = $(this).getDataAttr("data_validita");
|
||||
let loadJson = true;
|
||||
|
||||
if ($(this).hasClass("open_edit")) {
|
||||
dataValidita = moment().unix();
|
||||
@@ -51,6 +51,29 @@ $(function () {
|
||||
_cep.load_dettArticolo(codVlis, codMart, dataValidita, versione, loadJson);
|
||||
});
|
||||
|
||||
$(document).on("click", "button.print", function () {
|
||||
const $tr = $(this).closest("tr[data-cod_mart]");
|
||||
const codVlis = _cep.get_codVlis();
|
||||
const codMart = $tr.attr("data-cod_mart");
|
||||
const dataValidita = $(this).attr("data-data_validita");
|
||||
const systemNote = $(this).attr("data-system_note");
|
||||
|
||||
const key = {
|
||||
codVlis,
|
||||
codMart,
|
||||
dataValidita,
|
||||
systemNote
|
||||
}
|
||||
|
||||
new Ajax()
|
||||
.get("getSchedaCosti")
|
||||
.data({key: key})
|
||||
.$button($("#btPdfDettagliOrdine"))
|
||||
.noticeAsModal()
|
||||
.onSuccess({modalBox: {IFrame: true}})
|
||||
.execute();
|
||||
});
|
||||
|
||||
$(document).on("click", "#list-articoli-all tr[data-cod_mart]", function (e) {
|
||||
var $tr = $(this);
|
||||
var codMart = $tr.getDataAttr("cod_mart");
|
||||
@@ -468,6 +491,7 @@ var _cep = {
|
||||
tr += "<td class=''>" + blankIfNull(artListData.descr_pedana) + "</td>";
|
||||
|
||||
tr += "<td class='text-center'>";
|
||||
|
||||
if (artListData.has_storico === "S") {
|
||||
tr += "<button type='button' class='btn btn-default btn-xs open_det' data-data_validita='" + artListData.data_iniz + "'>\n\
|
||||
" + artListData.data_iniz.unixtime_format("DD/MM/YYYY") + "\n\
|
||||
@@ -475,6 +499,7 @@ var _cep = {
|
||||
} else {
|
||||
tr += artListData.data_iniz.unixtime_format("DD/MM/YYYY");
|
||||
}
|
||||
|
||||
tr += "</td>";
|
||||
|
||||
tr += "<td class='text-right text-monospace'>" + number_format(artListData.qta_cnf, 1) + "</td>";
|
||||
@@ -484,11 +509,24 @@ var _cep = {
|
||||
tr += "<td class='text-right text-monospace margine " + ((artListData.margine < 0) ? "text-danger" : "") + "'>" + number_format(artListData.margine, 2) + "</td>";
|
||||
tr += "<td class='text-right text-monospace margine_perc " + ((artListData.margine_perc < 0) ? "text-danger" : "") + "'>" + number_format(artListData.margine_perc, 2) + "% </td>";
|
||||
tr += "<td class='text-right text-monospace'>" + number_format(artListData.prezzo_kg, 2) + "</td>";
|
||||
tr += "<td class='text-center'>\n\
|
||||
<button type='button' class='btn btn-xs btn-default open_edit' data-data_validita='" + artListData.data_iniz + "'>\n\
|
||||
<span class='text-info'><i class='fa fa-pencil'></i> Modifica</span>\n\
|
||||
</button>\n\
|
||||
</td>";
|
||||
tr += `<td class='text-center'>
|
||||
<button type='button' class='btn btn-xs btn-default open_edit' data-data_validita='${artListData.data_iniz}'>
|
||||
<span class='text-info'>
|
||||
<i class='fa fa-pencil'></i> Modifica
|
||||
</span>
|
||||
</button>`;
|
||||
|
||||
const system_note = artListData.system_note;
|
||||
|
||||
if (system_note) {
|
||||
tr += `<button type='button' class='btn btn-xs btn-default print' data-data_validita='${artListData.data_iniz}' data-system_note='${system_note}'>
|
||||
<span class='text-primary'>
|
||||
<i class='fa fa-print'></i> Stampa
|
||||
</span>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
tr += `</td>`;
|
||||
tr += "</tr>";
|
||||
|
||||
$tbody.append(tr);
|
||||
@@ -497,19 +535,16 @@ var _cep = {
|
||||
$listArticoli.show();
|
||||
$noArticoli.hide();
|
||||
d.resolve(true);
|
||||
|
||||
} else {
|
||||
var toast = new Toast();
|
||||
const toast = new Toast();
|
||||
toast.info("Non ci sono articoli disponibili", "Listino " + ret.returnData.descrizione);
|
||||
|
||||
// $listArticoli.hide();
|
||||
$noArticoli.show();
|
||||
d.resolve(false);
|
||||
}
|
||||
|
||||
self.enable_bt_addArticolo(true);
|
||||
|
||||
self.boxDettaglioListino.setData(ret.returnData);
|
||||
|
||||
} else {
|
||||
self.enable_bt_addArticolo(false);
|
||||
$listArticoli.hide();
|
||||
@@ -518,6 +553,7 @@ var _cep = {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return d;
|
||||
},
|
||||
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
SELECT cod_mart,
|
||||
LTRIM(ISNULL(descrizione_estesa, ISNULL(descrizione, ''))) AS descr_art,
|
||||
unt_mis AS unt_mis_ven
|
||||
FROM mtb_aart,
|
||||
( SELECT value_string AS cod_mgrp
|
||||
FROM dbo.parseStringIntoArray(dbo.getGestSetup('PVM', 'CONTO_ECONOMICO_PRODOTTO', 'FILTRO_COD_MGRP'), '|')
|
||||
) stp
|
||||
WHERE mtb_aart.flag_stato = 'A' AND
|
||||
mtb_aart.flag_incl_listino = 'S' AND
|
||||
mtb_aart.cod_mgrp = stp.cod_mgrp
|
||||
ORDER BY 2, 1
|
||||
SELECT mtb_aart.cod_mart,
|
||||
LTRIM(ISNULL(descrizione_estesa, ISNULL(mtb_aart.descrizione, ''))) AS descr_art,
|
||||
unt_mis AS unt_mis_ven,
|
||||
ms.descrizione AS sottogruppo,
|
||||
mt.descrizione AS tipo,
|
||||
mst.descrizione AS sottotipo,
|
||||
mtb_aart.cod_tcol_ui,
|
||||
mtb_aart.qta_cnf,
|
||||
mtb_aart.peso_kg,
|
||||
mtb_aart.marchio,
|
||||
IIF(mtb_aart.data_ult_scar > mtb_aart.data_ult_car, YEAR(mtb_aart.data_ult_scar),
|
||||
YEAR(mtb_aart.data_ult_car)) AS anno_ult_mov
|
||||
FROM mtb_aart
|
||||
INNER JOIN mtb_grup mg ON mtb_aart.cod_mgrp = mg.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ms ON mtb_aart.cod_mgrp = ms.cod_mgrp AND mtb_aart.cod_msgr = ms.cod_msgr
|
||||
INNER JOIN (SELECT value_string
|
||||
FROM dbo.parseStringIntoArray(
|
||||
dbo.getGestSetup('PVM', 'CONTO_ECONOMICO_PRODOTTO', '[tipoFiltro]'), '|')) stp
|
||||
ON [joinFiltro]-- mtb_aart.cod_mgrp = stp.cod_mgrp
|
||||
LEFT OUTER JOIN dbo.getListinoVendita(NULL, ISNULL('[codVlis]', NULL), NULL) listino
|
||||
ON mtb_aart.cod_mart = listino.cod_mart
|
||||
AND listino.tipo_variazione <> 'D'
|
||||
LEFT OUTER JOIN mtb_tipi mt ON mtb_aart.cod_mtip = mt.cod_mtip
|
||||
LEFT OUTER JOIN mtb_stip mst ON mtb_aart.cod_mtip = mst.cod_mtip AND
|
||||
mtb_aart.cod_mstp = mst.cod_mstp
|
||||
WHERE mtb_aart.flag_stato = 'A'
|
||||
AND mtb_aart.flag_incl_listino = 'S'
|
||||
AND listino.cod_mart IS NULL
|
||||
-- ORDER BY 2, 1
|
||||
@@ -1,6 +1,17 @@
|
||||
SELECT t.*,
|
||||
t.prezzo - t.costo AS margine,
|
||||
(t.prezzo - t.costo) / (CASE WHEN prezzo = 0 THEN 1 ELSE prezzo END) * 100 AS margine_perc
|
||||
(t.prz_vend +
|
||||
IIF(t.flag_add_trasp = 1, ISNULL(t.costo_trasp, 0), 0)) *
|
||||
(1 - ISNULL(t.sconto_trasp, 0) / 100) AS prz_vend_trasp,
|
||||
t.prezzo - t.costo AS margine,
|
||||
(t.prezzo - t.costo) / (CASE WHEN prezzo = 0 THEN 1 ELSE prezzo END) * 100 AS margine_perc,
|
||||
CONCAT(
|
||||
t.tipo,
|
||||
IIF(t.cod_tcol_UI IS NOT NULL, ' ' + t.cod_tcol_UI, ''),
|
||||
IIF(t.qta_cnf IS NOT NULL, ' ' + CAST(t.qta_cnf AS FLOAT), ''),
|
||||
' ', 'x', ' ',
|
||||
IIF(t.peso_kg IS NOT NULL, ' ' + CAST(t.peso_kg AS FLOAT), ''),
|
||||
IIF(t.sottotipo IS NOT NULL, ' ' + t.sottotipo, ''),
|
||||
IIF(t.marchio IS NOT NULL, ' ' + t.marchio, '')) AS group_equi
|
||||
FROM ([query_interna]) t
|
||||
WHERE 1 = 1
|
||||
ORDER BY cod_mtip, cod_mstp, cod_mart
|
||||
-- ORDER BY cod_mtip, cod_mstp, cod_mart
|
||||
@@ -1,52 +1,100 @@
|
||||
SELECT case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_aart.cod_mtip, '')
|
||||
when 'G' THEN mtb_aart.cod_mgrp ELSE '' END AS cod_mtip,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_tipi.descrizione, '')
|
||||
when 'G' THEN mtb_grup.descrizione ELSE '' END AS descr_tipi,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_aart.cod_mstp, '')
|
||||
when 'G' THEN mtb_aart.cod_mgrp ELSE '' END AS cod_mstp,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_stip.descrizione, '')
|
||||
when 'G' THEN mtb_sgrp.descrizione ELSE '' END AS descr_stipi,
|
||||
SELECT listino.cod_mart + '-' + listino.cod_vlis + '-' + CAST(listino.versione AS VARCHAR) + '-' +
|
||||
CAST(mlds.da AS VARCHAR) + ':' +
|
||||
CAST(mlds.a AS VARCHAR) AS id,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_aart.cod_mtip, '')
|
||||
when 'G' THEN mtb_aart.cod_mgrp
|
||||
ELSE '' END AS cod_mtip,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_tipi.descrizione, '')
|
||||
when 'G' THEN mtb_grup.descrizione
|
||||
ELSE '' END AS descr_tipi,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_aart.cod_mstp, '')
|
||||
when 'G' THEN mtb_aart.cod_mgrp
|
||||
ELSE '' END AS cod_mstp,
|
||||
case '[tipo_ragg]'
|
||||
when 'T' THEN ISNULL(mtb_stip.descrizione, '')
|
||||
when 'G' THEN mtb_sgrp.descrizione
|
||||
ELSE '' END AS descr_stipi,
|
||||
data_iniz,
|
||||
listino.descrizione AS descr_listino,
|
||||
listino.descrizione AS descr_listino,
|
||||
listino.cod_mart,
|
||||
IsNull(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descr_articolo,
|
||||
listino.cod_mart + ' ' + mtb_aart.descrizione AS info_articolo,
|
||||
IsNull(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descr_articolo,
|
||||
listino.cod_mart + ' ' + mtb_aart.descrizione AS info_articolo,
|
||||
listino.unt_mis_ven,
|
||||
listino.prz_vend,
|
||||
listino.prz_base AS costo,
|
||||
listino.magg_prz_vend,
|
||||
IIF('[przBaseDaDist]' = 0 OR jc.prezzo_base IS NULL OR jc.prezzo_base = 0, listino.prz_base,
|
||||
jc.prezzo_base) AS costo,
|
||||
listino.perc_prov,
|
||||
listino.perc_promo,
|
||||
listino.ricarico,
|
||||
mtb_aart.qta_cnf,
|
||||
mtb_aart.unt_mis,
|
||||
mum.tipo_um,
|
||||
mtb_aart.unt_mis2,
|
||||
mtb_aart.rap_conv2,
|
||||
mum2.tipo_um AS tipo_um2,
|
||||
mtb_aart.unt_mis3,
|
||||
mtb_aart.rap_conv3,
|
||||
mum3.tipo_um AS tipo_um3,
|
||||
mtb_aart.peso_kg,
|
||||
mlds.da,
|
||||
mlds.a,
|
||||
listino.flag_add_trasp,
|
||||
calcoli.costo_trasp AS costo_trasp,
|
||||
mlds.perc_sconto AS sconto_trasp,
|
||||
listino.colli_pedana,
|
||||
listino.cod_tcol_UL,
|
||||
mtb_tcol.descrizione AS descr_pedana,
|
||||
mtb_tcol.descrizione AS descr_pedana,
|
||||
ROUND(listino.prz_vend_netto * (1 - ISNULL(vtb_clie.sconto1, 0) / 100) * (1 - ISNULL(vtb_clie.sconto2, 0) / 100),
|
||||
2) AS prezzo,
|
||||
2) AS prezzo,
|
||||
ROUND(listino.prz_vend_netto * (1 - ISNULL(vtb_clie.sconto1, 0) / 100) *
|
||||
(1 - ISNULL(vtb_clie.sconto2, 0) / 100) / listino.rap_conv /
|
||||
CASE WHEN mtb_aart.peso_kg = 0 THEN 1 ELSE mtb_aart.peso_kg END, 2) AS prezzo_kg,
|
||||
CASE WHEN mtb_aart.peso_kg = 0 THEN 1 ELSE mtb_aart.peso_kg END,
|
||||
2) AS prezzo_kg,
|
||||
ROUND(listino.prz_base / listino.rap_conv / CASE WHEN mtb_aart.peso_kg = 0 THEN 1 ELSE mtb_aart.peso_kg END,
|
||||
2) AS costo_kg,
|
||||
vtb_clie.sconto1 AS sconto_clie,
|
||||
listino.perc_sco1 AS sconto_1,
|
||||
listino.perc_sco2 AS sconto_2,
|
||||
listino.perc_sco3 AS sconto_3,
|
||||
listino.perc_sco4 AS sconto_4,
|
||||
2) AS costo_kg,
|
||||
vtb_clie.sconto1 AS sconto_clie,
|
||||
listino.perc_sco1 AS sconto_1,
|
||||
listino.perc_sco2 AS sconto_2,
|
||||
listino.perc_sco3 AS sconto_3,
|
||||
listino.perc_sco4 AS sconto_4,
|
||||
listino.versione,
|
||||
listino.cod_vlis AS cod_anag,
|
||||
CAST(listino.descrizione_html AS VARCHAR(MAX)) AS descrizione_html,
|
||||
listino.cod_vlis AS cod_anag,
|
||||
CAST(listino.descrizione_html AS VARCHAR(MAX)) AS descrizione_html,
|
||||
listino.note,
|
||||
CASE WHEN listino.system_note IS NULL THEN 'N' ELSE 'S' END AS has_storico
|
||||
listino.system_note,
|
||||
CASE WHEN listino.system_note IS NULL THEN 'N' ELSE 'S' END AS has_storico,
|
||||
(SELECT SUM(IIF(vlp.perc_fat_04 <> 0, vlp.perc_fat_04,
|
||||
(vlp.valore_fisso / IIF(vlp.fatturato_bdg <> 0, vlp.fatturato_bdg, 1)) * 100)) AS premio
|
||||
FROM vtb_list_premi vlp
|
||||
WHERE '[data_validita]' BETWEEN vlp.da_data_fat AND vlp.a_data_fat
|
||||
AND vlp.cod_vlis = listino.cod_vlis) AS premio,
|
||||
mtb_tipi.descrizione AS tipo,
|
||||
mtb_stip.descrizione AS sottotipo,
|
||||
mtb_aart.cod_tcol_ui,
|
||||
mtb_aart.marchio,
|
||||
mtb_aart.flag_incl_listino
|
||||
FROM dbo.getListinoVendita('[data_validita]', '[cod_vlis]', '[cod_mart]') listino
|
||||
INNER JOIN mtb_aart ON listino.cod_mart = mtb_aart.cod_mart
|
||||
INNER JOIN mtb_grup ON mtb_aart.cod_mgrp = mtb_grup.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ON mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp AND mtb_aart.cod_msgr = mtb_sgrp.cod_msgr
|
||||
INNER JOIN mtb_unt_mis mum_vend ON listino.unt_mis_ven = mum_vend.unt_mis
|
||||
INNER JOIN mtb_unt_mis mum ON mtb_aart.unt_mis = mum.unt_mis
|
||||
LEFT OUTER JOIN mtb_unt_mis mum2 ON mtb_aart.unt_mis2 = mum2.unt_mis
|
||||
LEFT OUTER JOIN mtb_unt_mis mum3 ON mtb_aart.unt_mis3 = mum3.unt_mis
|
||||
LEFT OUTER JOIN mtb_lisv_data_spese mlds
|
||||
ON mlds.id IN (SELECT id
|
||||
FROM (SELECT MAX(id) OVER ( PARTITION BY mlds.cod_vlis, cod_spes, da, a) AS max_id,
|
||||
id
|
||||
FROM mtb_lisv_data_spese mlds
|
||||
INNER JOIN vtb_list_data vld
|
||||
ON mlds.cod_vlis = vld.cod_vlis AND mlds.versione = vld.versione
|
||||
WHERE mlds.cod_vlis = listino.cod_vlis
|
||||
AND vld.data_iniz <= GETDATE()) t
|
||||
WHERE id = max_id)
|
||||
LEFT OUTER JOIN mtb_tcol ON listino.cod_tcol_UL = mtb_tcol.cod_tcol
|
||||
LEFT OUTER JOIN (SELECT cod_vlis,
|
||||
MAX(sconto1) AS sconto1,
|
||||
@@ -57,10 +105,13 @@ FROM dbo.getListinoVendita('[data_validita]', '[cod_vlis]', '[cod_mart]') listin
|
||||
AND vtb_clie.flag_stato = 'A'
|
||||
AND (sconto1 <> 0 OR sconto2 <> 0)
|
||||
GROUP BY cod_vlis) vtb_clie ON vtb_clie.cod_vlis = listino.cod_vlis
|
||||
INNER JOIN mtb_grup ON mtb_aart.cod_mgrp = mtb_grup.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ON mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp AND mtb_aart.cod_msgr = mtb_sgrp.cod_msgr
|
||||
LEFT OUTER JOIN mtb_tipi ON mtb_aart.cod_mtip = mtb_tipi.cod_mtip
|
||||
LEFT OUTER JOIN mtb_stip ON mtb_aart.cod_mtip = mtb_stip.cod_mtip AND
|
||||
mtb_aart.cod_mstp = mtb_stip.cod_mstp
|
||||
LEFT OUTER JOIN jtb_cicl jc ON mtb_aart.cod_mart = jc.cod_prod
|
||||
OUTER APPLY (SELECT ROUND(mlds.val_ricarico / listino.colli_pedana /
|
||||
IIF(mum_vend.tipo_um = 'UP', listino.qta_cnf, 1)
|
||||
+ mlds.val_ricarico * mlds.perc_ricarico / 100
|
||||
, 2) AS costo_trasp) AS calcoli
|
||||
WHERE listino.tipo_variazione <> 'D'
|
||||
AND listino.flag_attivo = 'S'
|
||||
@@ -1,4 +1,14 @@
|
||||
SELECT cod_vlis, descrizione
|
||||
FROM vtb_list
|
||||
WHERE flag_attivo = 'S' and cod_vlis_rif is null
|
||||
SELECT cod_vlis,
|
||||
descrizione,
|
||||
cod_divi,
|
||||
flag_add_trasp,
|
||||
(SELECT MAX(versione)
|
||||
FROM vtb_list_data vld
|
||||
WHERE vtb_list.cod_vlis = vld.cod_vlis) AS versione,
|
||||
(SELECT ISNULL(MAX(data_iniz), GETDATE())
|
||||
FROM vtb_list_data vld
|
||||
WHERE vtb_list.cod_vlis = vld.cod_vlis) AS data_iniz
|
||||
FROM vtb_list
|
||||
WHERE flag_attivo = 'S'
|
||||
and cod_vlis_rif is null
|
||||
ORDER BY descrizione
|
||||
@@ -1,8 +1,9 @@
|
||||
SELECT data_iniz,
|
||||
note,
|
||||
porto,
|
||||
descrizione
|
||||
FROM vtb_list_data INNER JOIN vtb_list ON vtb_list_data.cod_vlis = vtb_list.cod_vlis
|
||||
WHERE vtb_list.cod_vlis = '[cod_vlis]' AND
|
||||
data_iniz <= '[data_validita]'
|
||||
SELECT data_iniz,
|
||||
note,
|
||||
porto,
|
||||
descrizione
|
||||
FROM vtb_list_data
|
||||
INNER JOIN vtb_list ON vtb_list_data.cod_vlis = vtb_list.cod_vlis
|
||||
WHERE vtb_list.cod_vlis = '[cod_vlis]'
|
||||
AND data_iniz <= '[data_validita]'
|
||||
ORDER BY data_iniz DESC
|
||||
@@ -107,7 +107,10 @@ ControlloGiacenze.prototype.kendoInitiator = function () {
|
||||
.data(this.columns.map((column) => column.field))
|
||||
.execute();
|
||||
},
|
||||
selectable: "multiple, row",
|
||||
selectable: {
|
||||
mode: "multiple, row",
|
||||
dragToSelect: false
|
||||
},
|
||||
pageable: {
|
||||
refresh: true,
|
||||
pageSize: 25,
|
||||
|
||||
@@ -122,13 +122,14 @@ class DeliveryPlan {
|
||||
return $GestSetup->keySection("VISUALIZZA_RIGHE_LISTINO")->defaultValue("S")->asBoolean()->get();
|
||||
}
|
||||
|
||||
public static function get_articolo($codMart, $codAnag, $codVlis = null) {
|
||||
public static function get_articolo($codMart, $codAnag, $codVlis = null, $lingua = null) {
|
||||
$Query = new Query;
|
||||
|
||||
$Query
|
||||
->importSqlFile("list-articoli")
|
||||
->setVar("cod_anag", $codAnag)
|
||||
->setVar("codAnag", $codAnag)
|
||||
->setVar("codVlis", $codVlis)
|
||||
->setVar("codLingua", $lingua)
|
||||
->where("mtb_aart.cod_mart", $codMart);
|
||||
|
||||
$Ret = $Query->toRet()->firstRow()->execute();
|
||||
@@ -141,24 +142,27 @@ class DeliveryPlan {
|
||||
}
|
||||
|
||||
public static function src_articolo($data) {
|
||||
$Ret = new Ret;
|
||||
$ret = new Ret;
|
||||
$q = trim(strtolower($data["q"]));
|
||||
$_data = $data["data"];
|
||||
|
||||
if (strlen($q) > 0) {
|
||||
$q = str_replace(" ", "_", str_replace("'", "''", $q));
|
||||
$Query = new Query;
|
||||
$Query->importSqlFile("list-articoli")
|
||||
->setVar("cod_anag", $data["data"]["cod_anag"])
|
||||
->setVar("codVlis", isset($data["data"]["cod_vlis"]) ? $data["data"]["cod_vlis"] : null)
|
||||
$query = new Query;
|
||||
$query->importSqlFile("list-articoli")
|
||||
->setVar("codAnag", $_data["cod_anag"])
|
||||
->setVar("codVlis", array_get($_data, "cod_vlis"))
|
||||
->setVar("codLingua", array_get($_data, "lingua"))
|
||||
->where("(SELECT COUNT(id) FROM ParseStringIntoTableID('[Q]', '_') WHERE CHARINDEX(value_string,mtb_aart.descrizione_estesa+' '+mtb_aart.cod_mart)>0) = (SELECT COUNT(id) FROM ParseStringIntoTableID('[Q]', '_'))")
|
||||
->whereNot("mtb_aart.cod_mart", $data["data"]["exclude"])
|
||||
->whereNot("mtb_aart.cod_mart", $_data["exclude"])
|
||||
->setVar("Q", $q);
|
||||
$Ret = $Query->toRet()->execute();
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
} else {
|
||||
$Ret->set_error("Filtro ricerca clienti nullo");
|
||||
$ret->set_error("Filtro ricerca clienti nullo");
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function get_cliente($codAnag) {
|
||||
@@ -434,7 +438,6 @@ class DeliveryPlan {
|
||||
|
||||
public static function aggiungiArticoloListino($data) {
|
||||
$EntityList = new EntityList;
|
||||
|
||||
$MtbLisvData = new EntityItem("mtb_lisv_data");
|
||||
|
||||
$MtbLisvData->insert_or_update()
|
||||
@@ -492,7 +495,8 @@ class DeliveryPlan {
|
||||
->setDateVar("data_validita", $data["data_iniz"])
|
||||
->setVar("gestione", "")
|
||||
->setVar("num_ord", "")
|
||||
->where("mtb_aart.cod_mart", $data["cod_mart"]);
|
||||
->where("mtb_aart.cod_mart", $data["cod_mart"])
|
||||
->setVar("cod_lingua", $data["lingua"]);
|
||||
|
||||
if (isset($data["cod_griglia"])) {
|
||||
$Query->setVar("griglia", sprintf(
|
||||
@@ -680,6 +684,7 @@ class DeliveryPlan {
|
||||
->set("codCab", $data["cod_cab"], true)
|
||||
->set("codBancAzi", $data["cod_banc_azi"], true)
|
||||
->set("termCons", $data["term_cons"], true)
|
||||
->set("mezzo", $data["mezzo"], true)
|
||||
->set("rifNumOrd", $data["rif_num_ord"], true)
|
||||
->setDate("rifDataOrd", $data["rif_data_ord"], true)
|
||||
->set("note", $data["note"], true)
|
||||
@@ -993,22 +998,21 @@ class DeliveryPlan {
|
||||
}
|
||||
|
||||
private static function getRigheOrdini($ordini, $day = null, $considerDataDocForCons = false) {
|
||||
|
||||
$ordersTableValues = self::ordersToValuesString($ordini);
|
||||
$Query = new Query;
|
||||
$Query->importSqlFile("getOrderRows")
|
||||
$query = new Query;
|
||||
$query->importSqlFile("getOrderRows")
|
||||
->setVar("values", implode(",", $ordersTableValues))
|
||||
->setVar("considerDataDocForCons", $considerDataDocForCons);
|
||||
|
||||
if (!is_null($day)) {
|
||||
if ($considerDataDocForCons) {
|
||||
$Query->whereDate("CONVERT(DATE, ISNULL(docs.data_doc,data_cons))", $day);
|
||||
$query->whereDate("CONVERT(DATE, ISNULL(docs.data_doc,data_cons))", $day);
|
||||
} else {
|
||||
$Query->whereDate("CONVERT(DATE, data_cons)", $day);
|
||||
$query->whereDate("CONVERT(DATE, data_cons)", $day);
|
||||
}
|
||||
}
|
||||
|
||||
return $Query->toRet()->execute();
|
||||
return $query->toRet()->execute();
|
||||
}
|
||||
|
||||
public static function completaNotaCliente($cliente) {
|
||||
@@ -1238,7 +1242,7 @@ class DeliveryPlan {
|
||||
|
||||
$wtbJreptSetup->set("codAnag", $ordine["cod_anag"])
|
||||
->set("codMdep", "")
|
||||
->set("reportType", ReportType::WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD);
|
||||
->set("reportType", ReportType::ETICHETTA_SSCC_SPEDIZIONE);
|
||||
|
||||
$Ret = $IMSApi
|
||||
->post("getSetupReportType")
|
||||
@@ -1625,11 +1629,12 @@ class DeliveryPlan {
|
||||
if ($ret->is_OK()) {
|
||||
$riepiloghi = from($ret->get_data())
|
||||
->select(function ($pianificazione) {
|
||||
$pianificazione["id_ord"] = sprintf("%s~%s~%s",
|
||||
$pianificazione["id_ord"] = implode("~", array(
|
||||
$pianificazione["nazionalita_det"],
|
||||
$pianificazione["gestione"],
|
||||
(new DateTime($pianificazione["data_ord"]))->format(DateTime::ATOM),
|
||||
$pianificazione["num_ord"]
|
||||
);
|
||||
));
|
||||
|
||||
$pianificazione["id"] = sprintf("%s-%s-%s-%s",
|
||||
$pianificazione["gestione"],
|
||||
@@ -1695,6 +1700,7 @@ class DeliveryPlan {
|
||||
->set("numOrd", array_get($riepilogo, "num_ord"))
|
||||
->setDate("dataInizTrasp", array_get($riepilogo, "data_ora_iniz_trasp"))
|
||||
->set("note", array_get($riepilogo, "note_ord"), true)
|
||||
->set("postiPallet", array_get($riepilogo, "posti_pallet"), true)
|
||||
->set("dtbOrdr")->append($dtbOrdr);
|
||||
|
||||
$entityList->push($dtbOrdt);
|
||||
@@ -1737,12 +1743,14 @@ class DeliveryPlan {
|
||||
}
|
||||
|
||||
$vtbViaggi
|
||||
->set("codVvet", $codVvet)
|
||||
->set("codVvet", $codVvet, true)
|
||||
->set("codAuto", array_get($data, "codAuto"), true)
|
||||
->set("flagRitirClie", $flagRitirClie)
|
||||
->setDatetime("dataOraInizTrasp", $dataOraInizTrasp)
|
||||
->set("note", array_get($data, "note"))
|
||||
->set("targa", array_get($data, "targa"))
|
||||
->set("numPrenotazione", array_get($data, "num_prenotazione"));
|
||||
->set("note", array_get($data, "note"), true)
|
||||
->set("targa", array_get($data, "targa"), true)
|
||||
->set("numPrenotazione", array_get($data, "num_prenotazione"), true)
|
||||
->set("mezzo", array_get($data, "mezzo"));
|
||||
|
||||
return $vtbViaggi->send();
|
||||
}
|
||||
@@ -1804,15 +1812,39 @@ class DeliveryPlan {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getRiepiloghiGiorno(array $data) {
|
||||
public static function getRiepilogoGiorno(array $data) {
|
||||
$dataCons = array_get($data, "dataCons");
|
||||
|
||||
$query = KendoService::queryInitializerService($data, "get-riepiloghi-giorno", "cod_msgr, articolo");
|
||||
$query = KendoService::queryInitializerService($data, "get-riepiloghi-giorno", "cod_msgr, articolo", false, false);
|
||||
|
||||
$query->setDateVar("dataCons", $dataCons);
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
private static function getJPRiepilogoGiorno() {
|
||||
$gestSetup = (new GestSetup())->keySection("REPORT_NAME_RIEPILOGO");
|
||||
|
||||
return (new JasperProcessor())->load($gestSetup);
|
||||
}
|
||||
|
||||
public static function printRiepilogoGiorno(array $data) {
|
||||
$ret = self::getJPRiepilogoGiorno();
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$jp = $ret->get("JP");
|
||||
|
||||
$dataCons = array_get($data, "dataCons");
|
||||
|
||||
$jp
|
||||
->paramDate("data_cons", $dataCons)
|
||||
->cacheAs("Riepilogo del " . Date::format($dataCons, Format::strftimeDMY));
|
||||
|
||||
$ret = $jp->run();
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
include "Stato.class.php";
|
||||
|
||||
@@ -20,8 +20,8 @@ class DeliveryPlanAjax extends Ajax {
|
||||
} else if (self::get("getRigheListino")) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["getRigheListino"]);
|
||||
DeliveryPlan::getRigheListino($data["cod_vlis"], $data["data_validita"], $data["cod_anag"], $data["cod_mdep"], $data["gestione"], $data["num_ord"], $data["lingua"])->display();
|
||||
} else if (self::post("aggiungi_articolo_listino")) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["aggiungi_articolo_listino"]);
|
||||
} else if (self::post("aggiungiArticoloListino")) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["aggiungiArticoloListino"]);
|
||||
DeliveryPlan::aggiungiArticoloListino($data)->display();
|
||||
} else if (self::post("rimuovi_articolo_listino")) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["rimuovi_articolo_listino"]);
|
||||
|
||||
@@ -32,8 +32,9 @@ $depositi = $ret->is_OK() ? $ret->get_data() : array();
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<ul class="nav nav-tabs nav-justified">
|
||||
<li class="<?= $view === "weeklyPlanner" ? "active" : "" ?>" role="presentation">
|
||||
<a xdata-toggle="pill" href="<?= $_SERVER["PHP_SELF"] ?>" xhref="#tab-wp">Calendario spedizioni
|
||||
settimanale</a>
|
||||
<a xdata-toggle="pill" href="<?= $_SERVER["PHP_SELF"] ?>" xhref="#tab-wp">
|
||||
Calendario spedizioni settimanale
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?= $view === "monthlyPlanner" ? "active" : "" ?>" role="presentation">
|
||||
<a xdata-toggle="pill" href="?mp" xhref="#tab-mp">Calendario spedizioni mensile</a>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
$codMart = $data["cod_mart"];
|
||||
$codAnag = nullIfBlank($data["cod_anag"]);
|
||||
$codVlis = $data["cod_vlis"];
|
||||
$lingua = $data["lingua"];
|
||||
|
||||
$Ret = DeliveryPlan::getScontiCliente($data["cod_anag"]);
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$sconti = $Ret->get_data();
|
||||
$sconto1 = !is_null($sconti) ? $sconti["sconto1"] : 0;
|
||||
$sconto2 = !is_null($sconti) ? $sconti["sconto2"] : 0;
|
||||
|
||||
$Ret = DeliveryPlan::get_articolo($codMart, $codAnag, $codVlis);
|
||||
$Ret = DeliveryPlan::get_articolo($codMart, $codAnag, $codVlis, $lingua);
|
||||
}
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
|
||||
@@ -39,13 +39,16 @@ if (!is_null($key)) {
|
||||
}
|
||||
|
||||
$isNuovoOrdine = is_null($ordine);
|
||||
$arr_vettori = array();
|
||||
$arr_mezzi = array();
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$ret = StdUtils::getResources(array("vettori", "porti"));
|
||||
$ret = StdUtils::getResources(array("vettori", "porti", "mezzi"));
|
||||
if ($ret->is_OK()) {
|
||||
$resources = $ret->get_data();
|
||||
$arr_vettori = $resources["vettori"];
|
||||
$arr_porti = $resources["porti"];
|
||||
$arr_mezzi = $resources["mezzi"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,14 +422,30 @@ if ($ret->is_OK()) {
|
||||
<div class="panel-body collapse <?php if (($isNuovoOrdine || $duplicate) && DeliveryPlan::openPanelShippingOnNewOrder()) { ?> in <?php } ?>"
|
||||
id="panelShipping">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">Mezzo</span>
|
||||
<select name="mezzo" class="form-control input-sm" autocomplete="off">
|
||||
<option value="">Non selezionato</option>
|
||||
<?php foreach ($arr_mezzi as $item) { ?>
|
||||
<option <?= array_get($ordine, "mezzo", null) == array_get($item, "mezzo") ? "selected" : "" ?>
|
||||
value="<?= array_get($item, "mezzo") ?>">
|
||||
<?= array_get($item, "mezzo") ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">Vettore</span>
|
||||
<select name="cod_vvet" class="form-control input-sm" autocomplete="off">
|
||||
<option value="">Non selezionato</option>
|
||||
<?php foreach ($arr_vettori as $item) { ?>
|
||||
<option value="<?= $item["cod_vvet"] ?>"><?= $item["rag_soc"] ?></option>
|
||||
<option value="<?= array_get($item, "cod_vvet") ?>">
|
||||
<?= array_get($item, "rag_soc") ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@ function PopupArticolo() {
|
||||
this._codVlis = null;
|
||||
this._codAnag = null;
|
||||
this._dataIniz = null;
|
||||
this._lingua = null;
|
||||
|
||||
this._modalBox = null;
|
||||
this._anagArticolo = null;
|
||||
@@ -24,11 +25,16 @@ PopupArticolo.prototype.codAnag = function (v) {
|
||||
return this;
|
||||
};
|
||||
|
||||
PopupArticolo.prototype.dataIniz = function(v) {
|
||||
PopupArticolo.prototype.dataIniz = function (v) {
|
||||
this._dataIniz = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
PopupArticolo.prototype.lingua = function (v) {
|
||||
this._lingua = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
PopupArticolo.prototype.onUpdate = function (f) {
|
||||
this._onUpdate = f;
|
||||
return this;
|
||||
@@ -42,7 +48,8 @@ PopupArticolo.prototype.open = function () {
|
||||
.data({
|
||||
cod_mart: self._codMart,
|
||||
cod_anag: self._codAnag,
|
||||
cod_vlis: self._codVlis
|
||||
cod_vlis: self._codVlis,
|
||||
lingua: self._lingua
|
||||
})
|
||||
.noticeAsModal()
|
||||
.onSuccess(function (ret) {
|
||||
@@ -50,7 +57,10 @@ PopupArticolo.prototype.open = function () {
|
||||
|
||||
self._modalBox = new ModalBox();
|
||||
self._modalBox.onBeforeShow(function ($div) {
|
||||
$div.find("[name='data_iniz']").datepicker({dateFormat: "dd/mm/yy", minDate: moment.unix(self._dataIniz).toDate()}).setValue(self._dataIniz || getToday());
|
||||
$div.find("[name='data_iniz']").datepicker({
|
||||
dateFormat: "dd/mm/yy",
|
||||
minDate: moment.unix(self._dataIniz).toDate()
|
||||
}).setValue(self._dataIniz || getToday());
|
||||
|
||||
$div.find(".radio_btn[data-is_um_vend=1]").bs_element_setStyle("primary");
|
||||
$div.find(".radio_btn[data-unt_mis]").btn_radio({active_className: "primary"});
|
||||
@@ -86,30 +96,32 @@ PopupArticolo.prototype.open = function () {
|
||||
};
|
||||
|
||||
PopupArticolo.prototype._save = function () {
|
||||
var self = this;
|
||||
var $div = self._modalBox.$div;
|
||||
const self = this;
|
||||
const $div = self._modalBox.$div;
|
||||
const data = _checkForm.checkData($div);
|
||||
|
||||
var data = _checkForm.checkData($div);
|
||||
if (data !== false) {
|
||||
var $untMis = $div.find(".radio_btn[data-unt_mis].btn-primary");
|
||||
const $untMis = $div.find(".radio_btn[data-unt_mis].btn-primary");
|
||||
|
||||
data.unt_mis_ven = $untMis.exists() ? $untMis.getDataAttr("unt_mis") : null;
|
||||
data.rap_conv = $untMis.exists() ? $untMis.getDataAttr("rap_conv") : null;
|
||||
|
||||
data.cod_anag = self._codAnag;
|
||||
data.cod_vlis = self._codVlis;
|
||||
data.cod_mart = self._codMart;
|
||||
data.lingua = self._lingua;
|
||||
|
||||
new Ajax()
|
||||
.post("aggiungi_articolo_listino")
|
||||
.post("aggiungiArticoloListino")
|
||||
.data(data)
|
||||
.$toDisable($div)
|
||||
.$button(self._modalBox.get$btOK())
|
||||
.noticeAsModal()
|
||||
.onSuccess(function (ret) {
|
||||
var articolo = ret.returnData;
|
||||
const articolo = ret.returnData;
|
||||
|
||||
self._onUpdate(articolo);
|
||||
self._modalBox.close();
|
||||
// delete self;
|
||||
}).execute();
|
||||
|
||||
} else {
|
||||
|
||||
@@ -22,7 +22,7 @@ PopupListino.prototype.onAddToListino = function (f) {
|
||||
};
|
||||
|
||||
PopupListino.prototype._buildModalBox = function () {
|
||||
let self = this;
|
||||
const self = this;
|
||||
|
||||
self._modalBox = new ModalBox();
|
||||
self._modalBox
|
||||
@@ -31,10 +31,11 @@ PopupListino.prototype._buildModalBox = function () {
|
||||
$div.find("#bt_addArticoloLisv").on("click", function () {
|
||||
self._modalBox.onClose(function () {
|
||||
self._onAddToListino();
|
||||
// delete self;
|
||||
});
|
||||
|
||||
self._modalBox.close(true);
|
||||
});
|
||||
|
||||
_.forEach(self._articoli.filter(art => art.art_lisv), articolo => {
|
||||
self._buildTr(articolo);
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@ function PopupOrdine() {
|
||||
this._codAnagFE = [];
|
||||
this._clieData = null;
|
||||
this._codVlis = null;
|
||||
this._linguaListino = null;
|
||||
this._codJsonData = null;
|
||||
this._ordine = null;
|
||||
this._isDuplicate = null;
|
||||
@@ -753,16 +754,17 @@ PopupOrdine.prototype._buildRigheArticolo = function (articoli) {
|
||||
};
|
||||
|
||||
PopupOrdine.prototype._showModalAggiungiAlListino = function () {
|
||||
var self = this;
|
||||
var arr_codMartExcluded = [];
|
||||
const self = this;
|
||||
let arr_codMartExcluded = [];
|
||||
|
||||
if (self._getListino()) {
|
||||
arr_codMartExcluded = _.compact(self._getListino().map(function (item) {
|
||||
return item.isDeleted ? null : item.cod_mart;
|
||||
return item.isDeleted || !item.art_lisv ? null : item.cod_mart;
|
||||
}));
|
||||
}
|
||||
|
||||
var modalBox = new ModalBox();
|
||||
const modalBox = new ModalBox();
|
||||
|
||||
modalBox.onBeforeShow(function ($div) {
|
||||
$div.find("input#src-articolo").bsautocomplete({
|
||||
sourceAjaxAction: "src_articolo",
|
||||
@@ -770,7 +772,8 @@ PopupOrdine.prototype._showModalAggiungiAlListino = function () {
|
||||
ajaxData: {
|
||||
cod_anag: self._getCodAnag(),
|
||||
exclude: arr_codMartExcluded,
|
||||
cod_vlis: self._getCodVlis()
|
||||
cod_vlis: self._getCodVlis(),
|
||||
lingua: self._linguaListino,
|
||||
},
|
||||
item_labelKey: "cod_mart",
|
||||
item_labelSubKey: "descrizione_estesa",
|
||||
@@ -782,6 +785,7 @@ PopupOrdine.prototype._showModalAggiungiAlListino = function () {
|
||||
.codAnag(self._getCodAnag())
|
||||
.codVlis(self._getCodVlis())
|
||||
.dataIniz(self._getDataIniz())
|
||||
.lingua(self._linguaListino)
|
||||
.onUpdate(function (articolo) {
|
||||
self._aggiungiArticoloListino(articolo);
|
||||
var $tr = self._appendRigaListino(articolo);
|
||||
@@ -1067,6 +1071,8 @@ PopupOrdine.prototype._refreshListino = function (callback = null, waitModal = f
|
||||
}
|
||||
|
||||
if (!is_null(self._getCodVlis())) {
|
||||
self._linguaListino = $("[name='lingua']").find(":selected").val();
|
||||
|
||||
const ajax = new Ajax()
|
||||
.get("getRigheListino")
|
||||
.data({
|
||||
@@ -1076,7 +1082,7 @@ PopupOrdine.prototype._refreshListino = function (callback = null, waitModal = f
|
||||
cod_mdep: _.isNil(codMdep) || _.isEmpty(codMdep) ? null : codMdep,
|
||||
gestione: self._clieData.gestione ? self._clieData.gestione : "",
|
||||
num_ord: self._clieData.num_ord ? self._clieData.num_ord : "",
|
||||
lingua: $("[name='lingua']").find(":selected").val(),
|
||||
lingua: self._linguaListino,
|
||||
})
|
||||
.$toDisable($table)
|
||||
.noticeAsModal()
|
||||
@@ -1494,6 +1500,7 @@ PopupOrdine.prototype._onSave = function () {
|
||||
if (self._ordine != null && _.eq(data.posti_pallet, self._ordine.posti_pallet)) {
|
||||
data.posti_pallet = null;
|
||||
}
|
||||
|
||||
const lingua = $("[name='lingua']").find(":selected").val();
|
||||
|
||||
data.lingua = lingua;
|
||||
@@ -2119,8 +2126,8 @@ PopupOrdine.prototype._buildRigaArticolo = function (articolo, rigaOrdine) {
|
||||
// }
|
||||
// });
|
||||
|
||||
self._buildRowEvents($tr, articolo);
|
||||
// ._checkRigaImportoZero($tr);
|
||||
self._buildRowEvents($tr, articolo)
|
||||
._checkRigaImportoZero($tr);
|
||||
|
||||
$tbody.append($tr);
|
||||
self._recalcTotali();
|
||||
@@ -2196,14 +2203,20 @@ PopupOrdine.prototype._buildRowEvents = function ($tr, articolo) {
|
||||
if (!$div.find("#bt_toggleAutoCalcPedane").hasClass("active")) {
|
||||
return;
|
||||
}
|
||||
$numCnf.setValue(blankIfZero(pedane * colliPedana));
|
||||
|
||||
const numCnf = pedane * colliPedana;
|
||||
$numCnf.setValue(blankIfZero(numCnf));
|
||||
|
||||
self.setPeso($peso, qtaMax, articolo.qta_cnf_unt_mis_primaria / rapConv * colliPedana * pedane);
|
||||
} else if ($input.hasClass("numCnf")) {
|
||||
$pedane.setValue(blankIfZero((numCnf / colliPedana).round(2)));
|
||||
const pedane = (numCnf / colliPedana).round(2);
|
||||
|
||||
$pedane.setValue(blankIfZero(pedane));
|
||||
self.setPeso($peso, qtaMax, articolo.qta_cnf_unt_mis_primaria / rapConv * numCnf);
|
||||
} else if ($input.hasClass("peso")) {
|
||||
self.setPeso($peso, qtaMax, peso, false);
|
||||
peso = $peso.getNumericValue();
|
||||
|
||||
$pedane.setValue(blankIfZero((peso / colliPedana / (articolo.qta_cnf_unt_mis_primaria / rapConv)).round(2)));
|
||||
$numCnf.setValue(blankIfZero(_.round(peso / (articolo.qta_cnf_unt_mis_primaria / rapConv), 5)));
|
||||
} else if ($input.hasClass("colliPedana")) {
|
||||
@@ -2277,7 +2290,6 @@ PopupOrdine.prototype._buildRowEvents = function ($tr, articolo) {
|
||||
btNo: "cancel"
|
||||
};
|
||||
}
|
||||
|
||||
} else if (pedane !== 0) {
|
||||
if (self._isModalitaCancellazioneRigaListino()) {
|
||||
confirmModal = {
|
||||
|
||||
@@ -120,16 +120,16 @@ _deliveryPlan.mp = {
|
||||
},
|
||||
|
||||
refreshOrdiniMese: function () {
|
||||
var self = this;
|
||||
var d = $.Deferred();
|
||||
const self = this;
|
||||
const d = $.Deferred();
|
||||
|
||||
self.planner.get$monthPicker().disableAll();
|
||||
|
||||
_deliveryPlan.plannerUtils.filter.reset();
|
||||
_deliveryPlan.plannerUtils.clearListOrdini();
|
||||
self.planner.initDroppables();
|
||||
|
||||
var limitDays = self.planner.getLimitDays();
|
||||
const limitDays = self.planner.getLimitDays();
|
||||
|
||||
_deliveryPlan.plannerUtils.getGiorniUtili(limitDays).done(function (ret) {
|
||||
self.refreshOrdiniGiorni(ret.returnData.days, true).always(function () {
|
||||
d.resolve();
|
||||
@@ -207,22 +207,18 @@ _deliveryPlan.mp = {
|
||||
},
|
||||
|
||||
refreshItems: function (reloadOrders) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
if (reloadOrders) {
|
||||
self.refreshOrdiniMese();
|
||||
} else {
|
||||
const days = self.planner.getDayList();
|
||||
|
||||
var days = self.planner.getDayList();
|
||||
for (var i = 0; i < days.length; i++) {
|
||||
for (let i = 0; i < days.length; i++) {
|
||||
self._showOrdiniGiorno(days[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//var arr_usefulDaysRapportini = ret.returnData.rapportini;
|
||||
//self.planner.getDaysCells().each(function(){
|
||||
// self.initBtViewRapportiniUtente($(this), arr_usefulDaysRapportini);
|
||||
//});
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
|
||||
@@ -315,29 +315,31 @@ _deliveryPlan.plannerUtils = {
|
||||
},
|
||||
|
||||
clearDaysListOrdini: function (days) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
self._listOrdini = _.filter(self._listOrdini, function (x) {
|
||||
return !(_.includes(days, x.data_cons));
|
||||
//return daysDiff(x.data_cons, day) !== 0;
|
||||
});
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
pushOrdini: function (rows) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
self._listOrdini = _.union(self._listOrdini, rows);
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
filterOrdiniGiorno: function (day) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
return _.filter(self._listOrdini, function (x) {
|
||||
var dates = _.map(x.rows, "data_cons");
|
||||
var isSospeso = x.flag_sospeso === "S";
|
||||
var flagIt = x.nazione === "IT";
|
||||
|
||||
var filter = self.filter;
|
||||
const dates = _.map(x.rows, "data_cons");
|
||||
const isSospeso = x.flag_sospeso === "S";
|
||||
const flagIt = x.nazione === "IT";
|
||||
const filter = self.filter;
|
||||
|
||||
return _.includes(dates, day) &&
|
||||
(!filter.show_soloSospesi() || (isSospeso && filter.show_soloSospesi())) &&
|
||||
@@ -350,8 +352,8 @@ _deliveryPlan.plannerUtils = {
|
||||
},
|
||||
|
||||
getListClienti: function () {
|
||||
var self = this;
|
||||
var ret = _.sortBy(
|
||||
const self = this;
|
||||
const ret = _.sortBy(
|
||||
_.uniqBy(
|
||||
_.map(self._listOrdini, function (x) {
|
||||
return _.pick(x, "cod_anag", "rag_soc", "indirizzo_clie", "citta_clie", "prov_clie");
|
||||
@@ -360,6 +362,7 @@ _deliveryPlan.plannerUtils = {
|
||||
),
|
||||
"cod_anag"
|
||||
);
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
@@ -381,17 +384,19 @@ _deliveryPlan.plannerUtils = {
|
||||
$("<thead>")
|
||||
.append(
|
||||
$("<tr>", {class: "bg-primary"})
|
||||
.append("<th colspan='7'>" + duplicateBtn + " " + OrdtTitle.replace("__NUMORD__", ordine.num_ord).replace("__DATAORD__", moment(ordine.data_ord * 1000).format("DD/MM/YY")).replace("__CLIENTE__", ordine.rag_soc).replace("__RIFORD__", blankIfNull(ordine.rif_ord)) + "</th>")
|
||||
.append("<th colspan='9'>" + duplicateBtn + " " + OrdtTitle.replace("__NUMORD__", ordine.num_ord).replace("__DATAORD__", moment(ordine.data_ord * 1000).format("DD/MM/YY")).replace("__CLIENTE__", ordine.rag_soc).replace("__RIFORD__", blankIfNull(ordine.rif_ord)) + "</th>")
|
||||
)
|
||||
.append(
|
||||
$("<tr>", {class: "bg-primary"})
|
||||
.append("<th>Cod. Art.</th>")
|
||||
.append("<th>Descrizione</th>")
|
||||
.append("<th>Peso KG</th>")
|
||||
.append("<th>Colli</th>")
|
||||
.append("<th>Pedane</th>")
|
||||
.append("<th>Tipo Pedana</th>")
|
||||
.append(isGestioneVenditeAbilitata ? "<th>Prezzo</th>" : "")
|
||||
.append(isGestioneVenditeAbilitata ? "<th>Prezzo KG</th>" : "")
|
||||
.append(isGestioneVenditeAbilitata ? "<th>Prezzo a U.M.</th>" : "")
|
||||
.append("<th>Colli Residui</th>")
|
||||
)
|
||||
);
|
||||
|
||||
@@ -401,6 +406,7 @@ _deliveryPlan.plannerUtils = {
|
||||
let isImportoZero = row.val_unt === 0;
|
||||
$tbody.append(
|
||||
$("<tr>", {class: isImportoZero ? "warning" : ""})
|
||||
.append($("<td>", {class: "", text: row.cod_mart}))
|
||||
.append($("<td>", {class: "", text: row.descrizione_estesa}))
|
||||
.append($("<td>", {
|
||||
class: "text-monospace text-right",
|
||||
@@ -420,12 +426,16 @@ _deliveryPlan.plannerUtils = {
|
||||
}))
|
||||
.append(isGestioneVenditeAbilitata ? $("<td>", {
|
||||
class: "text-monospace text-right " + (isImportoZero ? "font-weight-bold text-warning" : ""),
|
||||
text: number_format(row.val_unt, 2, ".", "'") + "/" + row.unt_ord
|
||||
text: number_format(row.val_unt, 3, ".", "'") + "/" + row.unt_ord
|
||||
}) : null)
|
||||
.append(isGestioneVenditeAbilitata ? $("<td>", {
|
||||
class: "text-monospace text-right " + (isImportoZero ? "font-weight-bold text-warning" : ""),
|
||||
text: number_format((row.val_unt / row.rap_conv), 2, ".", "'")
|
||||
text: number_format((row.val_unt / row.rap_conv), 3, ".", "'")
|
||||
}) : null)
|
||||
.append($("<td>", {
|
||||
class: "text-monospace text-right",
|
||||
text: blankIfNull(row.colli_residui)
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
@@ -549,7 +559,7 @@ _deliveryPlan.plannerUtils = {
|
||||
},
|
||||
|
||||
init: function () {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
self.$selectStato().selectpicker({style: "btn btn-default small"}).on("change", function () {
|
||||
self._onChangeCallback();
|
||||
@@ -572,12 +582,14 @@ _deliveryPlan.plannerUtils = {
|
||||
item_labelSmallKey: "cod_anag",
|
||||
item_labelSubKey: ["indirizzo_clie", "citta_clie", "prov_clie"],
|
||||
onSelect: function (e, clie, $this) {
|
||||
$this.blur(); //fix chrome: blur triggera change, e qui resetta
|
||||
self._setCodAnag(clie.cod_anag);
|
||||
$this.val(clie.rag_soc);
|
||||
$this.val(clie.rag_soc).blur();
|
||||
}
|
||||
}).on("change delete", function () {
|
||||
self.codAnag = null;
|
||||
if ($(this).valueIsEmpty()) {
|
||||
self.codAnag = null;
|
||||
}
|
||||
|
||||
self._onChangeCallback();
|
||||
});
|
||||
},
|
||||
@@ -612,7 +624,6 @@ _deliveryPlan.plannerUtils = {
|
||||
|
||||
_setCodAnag: function (codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
this._onChangeCallback();
|
||||
},
|
||||
|
||||
_setCodMdep: function (codMdep) {
|
||||
@@ -622,24 +633,25 @@ _deliveryPlan.plannerUtils = {
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
var self = this;
|
||||
var listOrdini = _deliveryPlan.plannerUtils.getListOrdini();
|
||||
const self = this;
|
||||
const listOrdini = _deliveryPlan.plannerUtils.getListOrdini();
|
||||
const countTutti = listOrdini.length;
|
||||
|
||||
var countTutti = listOrdini.length;
|
||||
self.$selectStato().find("option[value='']").text("Tutti (" + countTutti + ")");
|
||||
self.$selectNazione().find("option[value='']").text("Tutte le nazioni (" + countTutti + ")");
|
||||
|
||||
var suspendedCountWise = _.countBy(listOrdini, {flag_sospeso: "S"});
|
||||
const suspendedCountWise = _.countBy(listOrdini, {flag_sospeso: "S"});
|
||||
const countSospesi = _.isNil(suspendedCountWise.true) ? 0 : suspendedCountWise.true;
|
||||
|
||||
var countSospesi = _.isNil(suspendedCountWise.true) ? 0 : suspendedCountWise.true;
|
||||
self.$selectStato().find("option[value='sospesi']").text("Sospesi (" + countSospesi + ")");
|
||||
|
||||
var countNoSospesi = _.isNil(suspendedCountWise.false) ? 0 : suspendedCountWise.false;
|
||||
const countNoSospesi = _.isNil(suspendedCountWise.false) ? 0 : suspendedCountWise.false;
|
||||
|
||||
self.$selectStato().find("option[value='no-sospesi']").text("Non sospesi (" + countNoSospesi + ")");
|
||||
|
||||
var nationWiseCount = _.countBy(listOrdini, {nazione: "IT"});
|
||||
var countIT = _.isNil(nationWiseCount.true) ? 0 : nationWiseCount.true;
|
||||
var countEstero = _.isNil(nationWiseCount.false) ? 0 : nationWiseCount.false;
|
||||
const nationWiseCount = _.countBy(listOrdini, {nazione: "IT"});
|
||||
const countIT = _.isNil(nationWiseCount.true) ? 0 : nationWiseCount.true;
|
||||
const countEstero = _.isNil(nationWiseCount.false) ? 0 : nationWiseCount.false;
|
||||
|
||||
self.$selectNazione().find("option[value='IT']").text("Italia (" + countIT + ")");
|
||||
self.$selectNazione().find("option[value='ESTERO']").text("Estero (" + countEstero + ")");
|
||||
|
||||
@@ -383,19 +383,19 @@ _deliveryPlan.wp = {
|
||||
|
||||
_isLoading: false,
|
||||
refreshOrdiniGiorni: function (days, showToast) {
|
||||
var self = this;
|
||||
var d = $.Deferred();
|
||||
const self = this;
|
||||
const d = $.Deferred();
|
||||
const toastProgress = new Toast();
|
||||
showToast = !(is_undefined(showToast) || showToast !== true);
|
||||
|
||||
if (days.length > 0) {
|
||||
var daysPlanner = self.get$Planner().weekPlanner("getWeekDates");
|
||||
const daysPlanner = self.get$Planner().weekPlanner("getWeekDates");
|
||||
|
||||
self._isLoading = true;
|
||||
_deliveryPlan.plannerUtils.clearDaysListOrdini(days);
|
||||
_deliveryPlan.plannerUtils.filter.refresh().disable();
|
||||
|
||||
if (showToast) {
|
||||
var toastProgress = new Toast();
|
||||
toastProgress.progress().bottomRight().show("", "Caricamento ordini");
|
||||
}
|
||||
|
||||
@@ -408,10 +408,11 @@ _deliveryPlan.wp = {
|
||||
async.eachSeries(days, function (day, done) {
|
||||
if (daysPlanner.indexOf(day) >= 0) {
|
||||
if (showToast) {
|
||||
var dateFormatted = day.unixtime_format("D") + " " + ucfirst(getMonthName(day.unixtime_format("M"))) + " " + day.unixtime_format("YYYY");
|
||||
var index = days.indexOf(day);
|
||||
const dateFormatted = day.unixtime_format("D") + " " + ucfirst(getMonthName(day.unixtime_format("M"))) + " " + day.unixtime_format("YYYY");
|
||||
const index = days.indexOf(day);
|
||||
toastProgress.bottomRight().progressTime(index, days.length - 1, dateFormatted, "Caricamento ordini");
|
||||
}
|
||||
|
||||
self._refreshOrdiniGiorno(day, _deliveryPlan.plannerUtils.filter.codMdep)
|
||||
.done(function () {
|
||||
self.get$Planner().weekPlanner("enable_dayColumn", day);
|
||||
@@ -426,15 +427,17 @@ _deliveryPlan.wp = {
|
||||
}
|
||||
}, function () {
|
||||
self._isLoading = false;
|
||||
|
||||
_deliveryPlan.plannerUtils.filter.refresh().enable();
|
||||
self.adjustColumnsHeight();
|
||||
|
||||
if (showToast) {
|
||||
toastProgress.remove(500);
|
||||
}
|
||||
|
||||
d.resolve();
|
||||
self.get$Planner().weekPlanner("getSelector").enableAll();
|
||||
});
|
||||
|
||||
} else {
|
||||
d.resolve();
|
||||
}
|
||||
@@ -461,12 +464,13 @@ _deliveryPlan.wp = {
|
||||
},
|
||||
|
||||
_showOrdiniGiorno: function (day) {
|
||||
let self = this;
|
||||
const self = this;
|
||||
const arr_ordiniGiorno = _deliveryPlan.plannerUtils.filterOrdiniGiorno(day);
|
||||
|
||||
self._cleanDayItems(day);
|
||||
let arr_ordiniGiorno = _deliveryPlan.plannerUtils.filterOrdiniGiorno(day);
|
||||
|
||||
if (_deliveryPlan.raggruppaPerCliente()) {
|
||||
let arr_codAnag = Enumerable.From(arr_ordiniGiorno)
|
||||
const arr_codAnag = Enumerable.From(arr_ordiniGiorno)
|
||||
.Distinct(function (x) {
|
||||
return x.cod_anag;
|
||||
})
|
||||
@@ -475,18 +479,17 @@ _deliveryPlan.wp = {
|
||||
})
|
||||
.ToArray();
|
||||
for (let i = 0; i < arr_codAnag.length; i++) {
|
||||
var codAnag = arr_codAnag[i];
|
||||
var arr_ordiniClie = Enumerable.From(arr_ordiniGiorno).Where(function (x) {
|
||||
const codAnag = arr_codAnag[i];
|
||||
const arr_ordiniClie = Enumerable.From(arr_ordiniGiorno).Where(function (x) {
|
||||
return x.cod_anag === codAnag;
|
||||
}).ToArray();
|
||||
|
||||
if (arr_ordiniClie.length === 1) {
|
||||
self._appendOrdineSingolo(day, arr_ordiniClie[0]);
|
||||
|
||||
} else if (arr_ordiniClie.length > 1) {
|
||||
self._appendOrdineMultiplo(day, arr_ordiniClie);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (let i = 0; i < arr_ordiniGiorno.length; i++) {
|
||||
self._appendOrdineSingolo(day, arr_ordiniGiorno[i]);
|
||||
@@ -501,9 +504,9 @@ _deliveryPlan.wp = {
|
||||
},
|
||||
|
||||
_appendOrdineSingolo: async function (day, ordine) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
const $item = await _deliveryPlan.plannerUtils.buildItemSingolo(ordine);
|
||||
|
||||
var $item = await _deliveryPlan.plannerUtils.buildItemSingolo(ordine);
|
||||
_deliveryPlan.plannerUtils.popover.build($item, ordine, day);
|
||||
self._appendItem($item, day);
|
||||
|
||||
|
||||
@@ -1,53 +1,45 @@
|
||||
SELECT mtb_aart.cod_msgr,
|
||||
mtb_sgrp.descrizione AS famiglia,
|
||||
dor.cod_mart,
|
||||
dor.descrizione AS articolo,
|
||||
SUM(FLOOR(dor.num_cnf / IIF(dor.colli_pedana = 0, 1, dor.colli_pedana))) AS num_pedane,
|
||||
dor.colli_pedana AS colli_pedana,
|
||||
SUM(dor.num_cnf - FLOOR(dor.num_cnf / IIF(dor.colli_pedana = 0, 1, dor.colli_pedana)) *
|
||||
dor.colli_pedana) AS colli_extra,
|
||||
SUM(dor.num_cnf) AS tot_colli
|
||||
FROM dtb_ordr dor
|
||||
INNER JOIN dtb_ordt dot
|
||||
ON dor.gestione = dot.gestione
|
||||
AND dor.data_ord = dot.data_ord
|
||||
AND dor.num_ord = dot.num_ord
|
||||
INNER JOIN mtb_aart ON dor.cod_mart = mtb_aart.cod_mart
|
||||
INNER JOIN mtb_grup ON mtb_aart.cod_mgrp = mtb_grup.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ON mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp AND
|
||||
mtb_aart.cod_msgr = mtb_sgrp.cod_msgr
|
||||
WHERE dor.data_cons = '[dataCons]'
|
||||
AND dor.id_viaggio IS NOT NULL
|
||||
AND mtb_grup.tipo_mgrp IN ('PF', 'SL')
|
||||
AND dot.gestione = 'V'
|
||||
GROUP BY mtb_aart.cod_msgr, mtb_sgrp.descrizione, dor.cod_mart, dor.descrizione, dor.colli_pedana
|
||||
UNION ALL
|
||||
SELECT 'Z' AS cod_msgr,
|
||||
'PEDANE MISTE' AS famiglia,
|
||||
'' AS cod_mart,
|
||||
'PEDANE MISTE' AS articolo,
|
||||
COUNT(*) AS num_pedane,
|
||||
q.colliXPedanaMista AS colli_pedana,
|
||||
0 as colli_extra,
|
||||
0 as tot_colli
|
||||
FROM (SELECT dor.gestione,
|
||||
dor.data_ord,
|
||||
dor.num_ord,
|
||||
dor.gruppo_cons,
|
||||
SUM(dor.num_cnf) colliXPedanaMista
|
||||
FROM dtb_ordr dor
|
||||
INNER JOIN dtb_ordt dot
|
||||
ON dor.gestione = dot.gestione
|
||||
AND dor.data_ord = dot.data_ord
|
||||
AND dor.num_ord = dot.num_ord
|
||||
INNER JOIN mtb_aart ON dor.cod_mart = mtb_aart.cod_mart
|
||||
INNER JOIN mtb_grup ON mtb_aart.cod_mgrp = mtb_grup.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ON mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp AND
|
||||
mtb_aart.cod_msgr = mtb_sgrp.cod_msgr
|
||||
WHERE dor.data_cons = '[dataCons]'
|
||||
AND dor.id_viaggio IS NOT NULL
|
||||
AND mtb_grup.tipo_mgrp IN ('PF', 'SL')
|
||||
AND dot.gestione = 'V'
|
||||
AND dor.gruppo_cons IS NOT NULL
|
||||
GROUP BY dor.gestione, dor.data_ord, dor.num_ord, dor.gruppo_cons) q
|
||||
GROUP BY colliXPedanaMista
|
||||
WITH Consegne AS (SELECT mtb_aart.cod_msgr,
|
||||
mtb_sgrp.descrizione AS famiglia,
|
||||
dor.cod_mart,
|
||||
dor.descrizione AS articolo,
|
||||
SUM(FLOOR(dor.num_cnf / IIF(dor.colli_pedana = 0, 1, dor.colli_pedana))) AS num_pedane,
|
||||
dor.colli_pedana AS colli_pedana,
|
||||
SUM(dor.num_cnf - FLOOR(dor.num_cnf / IIF(dor.colli_pedana = 0, 1, dor.colli_pedana)) *
|
||||
dor.colli_pedana) AS colli_extra,
|
||||
SUM(dor.num_cnf) AS tot_colli
|
||||
FROM dtb_ordr dor
|
||||
INNER JOIN dtb_ordt dot
|
||||
ON dor.gestione = dot.gestione
|
||||
AND dor.data_ord = dot.data_ord
|
||||
AND dor.num_ord = dot.num_ord
|
||||
INNER JOIN mtb_aart ON dor.cod_mart = mtb_aart.cod_mart
|
||||
INNER JOIN mtb_grup ON mtb_aart.cod_mgrp = mtb_grup.cod_mgrp
|
||||
INNER JOIN mtb_sgrp ON mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp AND
|
||||
mtb_aart.cod_msgr = mtb_sgrp.cod_msgr
|
||||
WHERE dor.data_cons = '[dataCons]'
|
||||
AND dor.id_viaggio IS NOT NULL
|
||||
AND mtb_grup.tipo_mgrp IN ('PF', 'SL')
|
||||
AND dot.gestione = 'V'
|
||||
GROUP BY mtb_aart.cod_msgr, mtb_sgrp.descrizione, dor.cod_mart, dor.descrizione, dor.colli_pedana),
|
||||
Giacenze AS
|
||||
(SELECT mtb_aart.cod_mart, CONVERT(DECIMAL(20, 5), SUM(qta_esistente / qta_cnf)) AS qta_esistente
|
||||
FROM mtb_part
|
||||
INNER JOIN mtb_aart ON mtb_part.cod_mart = mtb_aart.cod_mart
|
||||
GROUP BY mtb_aart.cod_mart),
|
||||
TempResult AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS row_number,
|
||||
*
|
||||
FROM (SELECT Consegne.*,
|
||||
ISNULL(Giacenze.qta_esistente, 0) AS qta_esistente,
|
||||
ISNULL(Giacenze.qta_esistente, 0) - Consegne.tot_colli AS qta_residua,
|
||||
IIF(Consegne.tot_colli < ISNULL(Giacenze.qta_esistente, 0), 0,
|
||||
Consegne.tot_colli - ISNULL(Giacenze.qta_esistente, 0)) AS ammanco
|
||||
FROM Consegne
|
||||
LEFT OUTER JOIN Giacenze ON Consegne.cod_mart = Giacenze.cod_mart) t
|
||||
WHERE [filter]),
|
||||
TempCount AS (SELECT COUNT(*) AS rows_count
|
||||
FROM TempResult)
|
||||
SELECT TempResult.*,
|
||||
TempCount.*
|
||||
FROM TempResult,
|
||||
TempCount
|
||||
ORDER BY [orderBy]
|
||||
@@ -1,44 +1,65 @@
|
||||
SELECT *
|
||||
FROM (SELECT IIF(vv.id_viaggio IS NULL, 0, 1) AS sort,
|
||||
FROM (SELECT IIF(vv.id_viaggio IS NULL, 0, 1) AS sort,
|
||||
MIN(IIF(ISNULL(vd.nazione, ga.nazione) = (SELECT nazione FROM azienda),
|
||||
'3 - ' + TRIM(ISNULL(vd.nazione, ga.nazione)),
|
||||
IIF(gn.flag_intracee = 'S', '2 - INTRACE', '1 - EXTRACE')))
|
||||
OVER ( PARTITION BY vv.id_viaggio) AS nazionalita,
|
||||
IIF(ISNULL(vd.nazione, ga.nazione) = (SELECT nazione FROM azienda),
|
||||
'1 - ' + ISNULL(vd.nazione, ga.nazione),
|
||||
IIF(gn.flag_intracee = 'S', '2 - INTRACE', '3 - EXTRACE')) AS nazionalita,
|
||||
'3 - ' + TRIM(ISNULL(vd.nazione, ga.nazione)),
|
||||
IIF(gn.flag_intracee = 'S', '2 - INTRACE', '1 - EXTRACE')) AS nazionalita_det,
|
||||
vv.id_viaggio,
|
||||
vv.data_ora_iniz_trasp,
|
||||
vett.cod_vvet,
|
||||
vett.rag_soc AS vettore,
|
||||
vett.rag_soc AS vettore,
|
||||
auto.cod_auto,
|
||||
auto.descrizione AS automezzo,
|
||||
vv.note AS note_viag,
|
||||
vv.flag_ritir_clie,
|
||||
vv.targa,
|
||||
vv.num_prenotazione,
|
||||
vv.note AS note_viag,
|
||||
vv.mezzo,
|
||||
dor.gestione,
|
||||
dor.data_ord,
|
||||
dor.num_ord,
|
||||
dor.riga_ord,
|
||||
dor.pos_riga,
|
||||
su.precode,
|
||||
ga.cod_anag,
|
||||
ga.rag_soc,
|
||||
dot.rif_ord,
|
||||
ISNULL(vd.citta, ga.citta) AS destinazione,
|
||||
dot.note AS note_ord,
|
||||
ISNULL(vd.citta, ga.citta) AS destinazione,
|
||||
dot.note AS note_ord,
|
||||
dor.cod_mart,
|
||||
IIF(dor.cod_mart IS NOT NULL, dor.cod_mart + ' ', '') + dor.descrizione AS descrizione,
|
||||
dor.system_note AS cod_mdep,
|
||||
(
|
||||
-- SELECT mp.cod_mdep, md.descrizione, mp.qta_esistente
|
||||
-- FROM mtb_part mp
|
||||
-- INNER JOIN dbo.mtb_depo md ON mp.cod_mdep = md.cod_mdep
|
||||
-- WHERE cod_mart = dor.cod_mart
|
||||
-- AND mp.qta_esistente <> 0
|
||||
SELECT md.cod_mdep, md.descrizione, SUM(GIA_qta) AS qta_esistente, UPPER(GIA_UM) AS unt_mis
|
||||
FROM RossoGarganoExchange.dbo.WGIACENZE_TAB
|
||||
INNER JOIN rossogargano.dbo.mtb_depo md ON GIA_MAG = cod_mdep AND md.flag_tipo_negozio = 'V'
|
||||
WHERE gia_art = dor.cod_mart
|
||||
GROUP BY md.cod_mdep, md.descrizione, GIA_UM
|
||||
FOR JSON PATH) AS depositi,
|
||||
ROUND(dor.num_cnf /
|
||||
IIF(dor.colli_pedana = 0, 1, dor.colli_pedana),
|
||||
0) AS pedane_ord,
|
||||
IIF(dor.cod_mart IS NOT NULL, dor.cod_mart + ' ', '') +
|
||||
dor.descrizione AS descrizione,
|
||||
dor.system_note AS cod_mdep,
|
||||
(SELECT md.cod_mdep,
|
||||
md.descrizione,
|
||||
SUM(mp.qta_esistente) / art.qta_cnf AS qta_esistente,
|
||||
IIF(art.qta_cnf > 1, 'COL', 'PZ') AS unt_mis
|
||||
FROM mtb_part mp
|
||||
INNER JOIN mtb_depo md ON mp.cod_mdep = md.cod_mdep AND md.flag_tipo_negozio = 'V'
|
||||
INNER JOIN mtb_aart art ON mp.cod_mart = art.cod_mart
|
||||
WHERE mp.cod_mart = dor.cod_mart
|
||||
AND mp.qta_esistente <> 0
|
||||
GROUP BY md.cod_mdep, md.descrizione, art.qta_cnf
|
||||
-- SELECT md.cod_mdep,
|
||||
-- md.descrizione,
|
||||
-- SUM(GIAC_qta) AS qta_esistente,
|
||||
-- IIF(art.qta_cnf > 1, 'COL', 'PZ') AS unt_mis
|
||||
-- FROM RossoGarganoExchange.dbo.GIACENZE gia
|
||||
-- INNER JOIN rossogargano.dbo.mtb_depo md
|
||||
-- ON gia.GIAC_CODMAG = cod_mdep AND md.flag_tipo_negozio = 'V'
|
||||
-- INNER JOIN RossoGargano.dbo.mtb_aart art on gia.GIAC_CODART = art.cod_mart
|
||||
-- WHERE gia.GIAC_CODART = dor.cod_mart
|
||||
-- GROUP BY md.cod_mdep, md.descrizione, art.qta_cnf
|
||||
FOR JSON PATH) AS depositi,
|
||||
dot.posti_pallet,
|
||||
IIF(mg.tipo_mgrp IN ('PF', 'SL'),
|
||||
ROUND(dor.num_cnf /
|
||||
IIF(dor.colli_pedana = 0, 1, dor.colli_pedana),
|
||||
0),
|
||||
0) AS pedane_ord,
|
||||
dor.num_cnf,
|
||||
dor.colli_pedana,
|
||||
dor.note,
|
||||
@@ -48,21 +69,23 @@ FROM (SELECT IIF(vv.id_viaggio IS NULL, 0, 1) AS s
|
||||
FROM drl_ord_attached doa
|
||||
WHERE doa.gestione = dor.gestione
|
||||
AND doa.data_ord = dor.data_ord
|
||||
AND doa.num_ord = dor.num_ord) AS n_allegati
|
||||
AND doa.num_ord = dor.num_ord) AS n_allegati
|
||||
FROM dtb_ordr dor
|
||||
INNER JOIN dtb_ordt dot
|
||||
ON dor.gestione = dot.gestione
|
||||
AND dor.data_ord = dot.data_ord
|
||||
AND dor.num_ord = dot.num_ord
|
||||
INNER JOIN gtb_anag ga ON dot.cod_anag = ga.cod_anag
|
||||
LEFT OUTER JOIN mtb_aart ma ON dor.cod_mart = ma.cod_mart
|
||||
INNER JOIN mtb_aart ma ON dor.cod_mart = ma.cod_mart
|
||||
LEFT OUTER JOIN mtb_grup mg ON ma.cod_mgrp = mg.cod_mgrp
|
||||
LEFT OUTER JOIN vtb_viaggi vv ON dor.id_viaggio = vv.id_viaggio
|
||||
LEFT OUTER JOIN vtb_vett vett ON vv.cod_vvet = vett.cod_vvet
|
||||
LEFT OUTER JOIN vtb_auto auto ON vv.cod_auto = auto.cod_auto
|
||||
LEFT OUTER JOIN stb_user su ON dot.compilato_da = su.full_name
|
||||
LEFT OUTER JOIN vtb_dest vd ON dot.cod_anag = vd.cod_anag AND dot.cod_vdes = vd.cod_vdes
|
||||
LEFT OUTER JOIN gtb_nazi gn ON ISNULL(vd.nazione, ga.nazione) = gn.nazione
|
||||
WHERE --mg.tipo_mgrp IN ('PF', 'SL')
|
||||
dot.gestione = 'V'
|
||||
AND dot.flag_sospeso = 'N'
|
||||
AND dor.data_cons = '[dataCons]') t
|
||||
-- WHERE depositi IS NOT NULL
|
||||
@@ -22,4 +22,4 @@ SELECT vv.id_viaggio,
|
||||
WHERE vvi.id_viaggio = vv.id_viaggio) t) AS destinazioni
|
||||
FROM vtb_viaggi vv
|
||||
LEFT OUTER JOIN dbo.vtb_vett vett ON vv.cod_vvet = vett.cod_vvet
|
||||
WHERE data_ora_iniz_trasp >= '[dataOraInizTrasp]'
|
||||
WHERE data_ora_iniz_trasp = '[dataOraInizTrasp]'
|
||||
@@ -7,7 +7,7 @@ SELECT dtb_ordr.num_ord,
|
||||
dtb_ordr.riga_ord,
|
||||
dtb_ordr.cod_mart,
|
||||
mpm.partita_mag,
|
||||
mpm.flag_stato as stato_partita,
|
||||
mpm.flag_stato AS stato_partita,
|
||||
dtb_ordr.descrizione_estesa,
|
||||
dtb_ordr.val_unt,
|
||||
dtb_ordr.num_cnf,
|
||||
@@ -29,7 +29,8 @@ SELECT dtb_ordr.num_ord,
|
||||
vcv.qta_residua,
|
||||
dtb_ordr.peso_lordo,
|
||||
dtb_ordr.id_viaggio,
|
||||
mg.tipo_mgrp
|
||||
mg.tipo_mgrp,
|
||||
(dtb_ordr.qta_ord - dtb_ordr.qta_evasa) / dtb_ordr.qta_cnf AS colli_residui
|
||||
FROM orders
|
||||
LEFT JOIN dtb_ordr ON dtb_ordr.data_ord = orders.data_ord AND dtb_ordr.num_ord = orders.num_ord AND
|
||||
dtb_ordr.gestione = orders.gestione
|
||||
|
||||
@@ -37,6 +37,7 @@ WITH stato_evasione_righe AS (SELECT DISTINCT dor.data_ord,
|
||||
dtb_ordt_v.data_esportazione,
|
||||
dtb_ordt_v.num_colli,
|
||||
dtb_ordt_v.porto,
|
||||
dtb_ordt_v.mezzo,
|
||||
dtb_ordt_v.flag_sospeso,
|
||||
dtb_ordt_v.cod_jcom,
|
||||
dtb_ordt_v.cod_paga,
|
||||
@@ -92,6 +93,7 @@ WITH stato_evasione_righe AS (SELECT DISTINCT dor.data_ord,
|
||||
dtb_ordt_v.data_esportazione,
|
||||
dtb_ordt_v.num_colli,
|
||||
dtb_ordt_v.porto,
|
||||
dtb_ordt_v.mezzo,
|
||||
dtb_ordt_v.flag_sospeso,
|
||||
dtb_ordt_v.cod_jcom,
|
||||
dtb_ordt_v.cod_paga,
|
||||
@@ -128,6 +130,7 @@ SELECT lista_ordini.cod_anag,
|
||||
lista_ordini.data_esportazione,
|
||||
lista_ordini.num_colli,
|
||||
lista_ordini.porto,
|
||||
lista_ordini.mezzo,
|
||||
lista_ordini.flag_sospeso,
|
||||
lista_ordini.cod_jcom,
|
||||
lista_ordini.cod_paga,
|
||||
|
||||
@@ -23,9 +23,9 @@ FROM mtb_aart
|
||||
ISNULL('[codVlis]', (SELECT dbo.getGestSetup('PVM', 'DELIVERY_PLAN', 'COD_VLIS_BASE'))),
|
||||
NULL) lisv
|
||||
ON mtb_aart.cod_mart = lisv.cod_mart
|
||||
LEFT OUTER JOIN gtb_anag ON '[cod_anag]' = gtb_anag.cod_anag
|
||||
LEFT OUTER JOIN gtb_anag ON '[codAnag]' = gtb_anag.cod_anag
|
||||
LEFT OUTER JOIN mtb_aart_desc
|
||||
ON mtb_aart_desc.cod_mart = mtb_aart.cod_mart AND mtb_aart_desc.cod_lingua = '[cod_lingua]'
|
||||
ON mtb_aart_desc.cod_mart = mtb_aart.cod_mart AND mtb_aart_desc.cod_lingua = '[codLingua]'
|
||||
LEFT OUTER JOIN mtb_aart_anag ON mtb_aart.cod_mart = mtb_aart_anag.cod_mart AND
|
||||
gtb_anag.cod_anag = mtb_aart_anag.cod_anag
|
||||
WHERE mtb_grup.tipo_mgrp IN (SELECT value_string
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET["get_listDepo"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["get_listDepo"]);
|
||||
FileExchangePanel::get_listDepo($data)->display();
|
||||
|
||||
} else if (isset($_POST["transmit"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_POST["transmit"]);
|
||||
$files = array_values($_FILES);
|
||||
$file = $files[0];
|
||||
FileExchangePanel::transmit($data, $file)->display();
|
||||
|
||||
} else if (isset($_GET["get_log"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["get_log"]);
|
||||
FileExchangePanel::get_log($data)->display();
|
||||
|
||||
}
|
||||
@@ -353,12 +353,24 @@ class Impostazioni {
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$rows = $ret->get_data();
|
||||
|
||||
foreach ($rows as $i => $result) {
|
||||
if (strpos(reset($result), '|')) {
|
||||
$implodeResult = explode('|', reset($result));
|
||||
|
||||
$value = array_get($implodeResult, 0);
|
||||
$descrizione = array_get($implodeResult, 1);
|
||||
} else {
|
||||
$value = $result[key($result)];
|
||||
$descrizione = html_entity_decode(\Utility\Str::shortens_words(implode(" - ", array_values($result)), 60));
|
||||
}
|
||||
|
||||
$rows[$i] = array(
|
||||
"value" => $result[key($result)],
|
||||
"descrizione" => html_entity_decode(\Utility\Str::shortens_words(implode(" - ", array_values($result)), 60))
|
||||
"value" => $value,
|
||||
"descrizione" => $descrizione
|
||||
);
|
||||
}
|
||||
|
||||
$ret->set_data($rows);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -115,7 +115,9 @@ const _impostazioni = {
|
||||
|
||||
updatePropValue: function (key, value, $bt, $toDisable, showWaitModal, showConfirmToast) {
|
||||
const d = $.Deferred();
|
||||
|
||||
if (_.isArray(value)) {
|
||||
value = _.join(value, "|");
|
||||
}
|
||||
new Ajax()
|
||||
.post("updatePropValue")
|
||||
.data({key: key, value: value})
|
||||
@@ -950,22 +952,15 @@ const _impostazioni = {
|
||||
|
||||
const $select = $inputGroup.find("select");
|
||||
|
||||
if (value) {
|
||||
// language=HTML
|
||||
const option = `
|
||||
<option value="${value}" selected>${value}</option>
|
||||
`
|
||||
|
||||
$select.append(option);
|
||||
}
|
||||
|
||||
$select.select2({
|
||||
dropdownParent: $inputGroup,
|
||||
allowClear: true,
|
||||
placeholder: "Non configurato",
|
||||
multiple: gestSetup.flag_multi_value,
|
||||
ajax: {
|
||||
dataType: "json",
|
||||
allowClear: true,
|
||||
|
||||
delay: 250,
|
||||
transport: function (params, success, failure) {
|
||||
const ajax = new Ajax();
|
||||
@@ -992,6 +987,25 @@ const _impostazioni = {
|
||||
}).on("select2:select select2:unselect", function (e) {
|
||||
$gestSetup.find(".btSave").trigger("click");
|
||||
});
|
||||
|
||||
if (value) {
|
||||
if (value.includes("|") && gestSetup.flag_multi_value) {
|
||||
const values = _.split(value, "|");
|
||||
_.forEach(values, (a) => {
|
||||
$select.append(`<option value="${a}" selected>${a}</option>`);
|
||||
});
|
||||
} else {
|
||||
// language=HTML
|
||||
const option = `
|
||||
<option value="${value}" selected>${value}</option>
|
||||
`
|
||||
|
||||
$select.append(option);
|
||||
$select.val(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SELECT DISTINCT stb_gest_setup.gest_name,
|
||||
stb_gest_setup.section,
|
||||
stb_gest_setup.key_section,
|
||||
CONVERT(varchar(max), value) AS value,
|
||||
CONVERT(VARCHAR(MAX), value) AS value,
|
||||
stb_gest_setup.description,
|
||||
stb_gest_setup.flag_sync,
|
||||
stb_gest_setup_query.cod_query,
|
||||
@@ -16,6 +16,7 @@ SELECT DISTINCT stb_gest_setup.gest_name,
|
||||
stb_gest_setup.flag_setup_user_web,
|
||||
stb_gest_setup.flag_tipo_json,
|
||||
stb_gest_setup.flag_tipo_colore,
|
||||
stb_gest_setup.flag_multi_value,
|
||||
stb_gest_setup.data_modifica,
|
||||
stb_gest_setup.modificato_da,
|
||||
stb_gest_setup.tipo_setup
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
WITH GerarchiaMenu AS (SELECT sm.cod_opz,
|
||||
sm.descrizione,
|
||||
sm.cod_parent,
|
||||
sm.gest_name,
|
||||
sm.type,
|
||||
so.gest_name,
|
||||
CASE WHEN so.object_type = 'D' THEN 'S' ELSE 'F' END AS type,
|
||||
sm.tipo_azienda,
|
||||
sm.flag_attivo,
|
||||
sm.pos,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo,
|
||||
sa.flag_abil
|
||||
FROM stb_abil sa
|
||||
INNER JOIN stb_menu sm ON sa.cod_opz = sm.cod_opz
|
||||
INNER JOIN stb_menu_opz so on sa.cod_opz = so.cod_opz
|
||||
INNER JOIN stb_menu sm_g ON sm.cod_parent = sm_g.cod_opz AND
|
||||
sm.tipo_azienda = sm_g.tipo_azienda
|
||||
WHERE user_name = '[userName]'
|
||||
@@ -19,16 +20,17 @@ WITH GerarchiaMenu AS (SELECT sm.cod_opz,
|
||||
SELECT sm_c.cod_opz,
|
||||
sm_c.descrizione,
|
||||
sm_c.cod_parent,
|
||||
sm_c.gest_name,
|
||||
sm_c.type,
|
||||
so.gest_name,
|
||||
CASE WHEN so.object_type = 'D' THEN 'S' ELSE 'F' END AS type,
|
||||
sm_c.tipo_azienda,
|
||||
sm_c.flag_attivo,
|
||||
sm_c.pos,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo,
|
||||
gm.flag_abil
|
||||
FROM stb_menu sm_c
|
||||
INNER JOIN GerarchiaMenu gm ON sm_c.cod_parent = gm.cod_opz
|
||||
INNER JOIN stb_menu_opz so on sm_c.cod_opz = so.cod_opz
|
||||
INNER JOIN stb_menu sm_g ON sm_c.cod_parent = sm_g.cod_opz AND
|
||||
sm_c.tipo_azienda = sm_g.tipo_azienda
|
||||
WHERE sm_c.tipo_azienda = gm.tipo_azienda)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
WITH GerarchiaMenu AS (SELECT sm.cod_opz,
|
||||
sm.descrizione,
|
||||
sm.cod_parent,
|
||||
sm.gest_name,
|
||||
sm.type,
|
||||
smo.gest_name,
|
||||
CASE WHEN smo.object_type = 'D' THEN 'S' ELSE 'F' END AS type,
|
||||
sm.tipo_azienda,
|
||||
sm.flag_attivo,
|
||||
sm.pos,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo
|
||||
FROM stb_menu sm
|
||||
INNER JOIN stb_menu_opz smo ON sm.cod_opz = smo.cod_opz AND sm.gest_name = smo.gest_name
|
||||
INNER JOIN stb_menu_opz smo ON sm.cod_opz = smo.cod_opz
|
||||
INNER JOIN stb_menu sm_g ON sm.cod_parent = sm_g.cod_opz AND
|
||||
sm.tipo_azienda = sm_g.tipo_azienda
|
||||
WHERE sm.cod_parent = 'WM002'
|
||||
@@ -18,15 +18,16 @@ WITH GerarchiaMenu AS (SELECT sm.cod_opz,
|
||||
SELECT sm_c.cod_opz,
|
||||
sm_c.descrizione,
|
||||
sm_c.cod_parent,
|
||||
sm_c.gest_name,
|
||||
sm_c.type,
|
||||
smo.gest_name,
|
||||
CASE WHEN smo.object_type = 'D' THEN 'S' ELSE 'F' END AS type,
|
||||
sm_c.tipo_azienda,
|
||||
sm_c.flag_attivo,
|
||||
sm_c.pos,
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo
|
||||
sm_g.pos AS pos_gruppo,
|
||||
sm_g.descrizione AS gruppo
|
||||
FROM stb_menu sm_c
|
||||
INNER JOIN GerarchiaMenu gm ON sm_c.cod_parent = gm.cod_opz
|
||||
INNER JOIN stb_menu_opz smo ON sm_c.cod_opz = smo.cod_opz
|
||||
INNER JOIN stb_menu sm_g ON sm_c.cod_parent = sm_g.cod_opz AND
|
||||
sm_c.tipo_azienda = sm_g.tipo_azienda
|
||||
WHERE sm_c.tipo_azienda = gm.tipo_azienda)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
foreach ($arr_rows as $row) {
|
||||
$idInventario = array_get($row, "idInventario");
|
||||
$dataInventario = array_get($row, "dataInventario");
|
||||
$dataOraInv = array_get($row, "dataOraInv");
|
||||
$filtro = array_get($row, "filtro");
|
||||
$codMdep = array_get($row, "codMdep");
|
||||
$numRighe = array_get($row, "numRighe");
|
||||
@@ -55,6 +56,7 @@
|
||||
<tr data-idInventario="<?= $idInventario ?>"
|
||||
data-codMdep="<?= $codMdep ?>"
|
||||
data-dataInventario="<?= $dataInventario ?>"
|
||||
data-dataOraInv="<?= $dataOraInv ?>"
|
||||
data-profileDb="<?= $profileDb ?>"
|
||||
class="<?= ($focusedRow == $idInventario) ? "focus_fade" : "" ?>">
|
||||
<?php if (!$isPuntoVendita) { ?>
|
||||
|
||||
@@ -40,12 +40,14 @@ $(function () {
|
||||
const idInventario = $tr.getAttr("data-idInventario");
|
||||
const codMdep = $tr.getAttr("data-codMdep");
|
||||
const dataInventario = $tr.getAttr("data-dataInventario");
|
||||
const dataOraInv = $tr.getAttr("data-dataOraInv");
|
||||
const profileDb = $tr.getAttr("data-profileDb");
|
||||
|
||||
const key = {
|
||||
idInventario,
|
||||
codMdep,
|
||||
dataInventario,
|
||||
dataOraInv,
|
||||
profileDb,
|
||||
}
|
||||
|
||||
@@ -176,9 +178,11 @@ const _inventario = {
|
||||
const idInventario = key.idInventario;
|
||||
const codMdep = key.codMdep;
|
||||
const today = moment().startOf("day").unix();
|
||||
const unixDataInv = moment(key.dataInventario, "DD/MM/YYYY").unix();
|
||||
const unixDataInv = key?.dataOraInv ? moment(key.dataOraInv, "DD/MM/YYYY").unix() : null;
|
||||
|
||||
key.isInventarioGiorno = today === unixDataInv;
|
||||
if (unixDataInv) {
|
||||
key.isInventarioGiorno = today === unixDataInv;
|
||||
}
|
||||
|
||||
ajax.get("popup-invenr")
|
||||
.data(key)
|
||||
@@ -193,8 +197,7 @@ const _inventario = {
|
||||
const modalBoxPopup = new ModalBox();
|
||||
|
||||
if (_USER.is_puntoVendita() || !key.isInventarioGiorno) {
|
||||
modalBoxPopup
|
||||
.closeOnly()
|
||||
modalBoxPopup.closeOnly();
|
||||
} else {
|
||||
modalBoxPopup
|
||||
.okClose()
|
||||
@@ -209,7 +212,6 @@ const _inventario = {
|
||||
modalBoxPopup.close();
|
||||
modalBoxWait.close();
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user