Compare commits

...

220 Commits

Author SHA1 Message Date
2770279149 Finish Integry_Impostazioni_FixPopupTabella 2024-06-19 10:38:29 +02:00
15cdae061f [Impostazioni]
- Fix popup per tabelle (ingranaggi)
2024-06-19 10:31:08 +02:00
80460b2037 Finish Gramm_MonitoraggioLineeV2_FixPulsante 2024-06-17 17:35:46 +02:00
9a04f4b5ba [Monitoraggio Linee]
- Fix pulsante nuovo
2024-06-17 17:34:55 +02:00
240b068e58 Finish Carelli_Accettazione_FixData 2024-06-17 12:20:39 +02:00
8ae480318b [Accettazione]
- Fix data Doc
- Pulizia codice e modifiche minori
2024-06-17 12:20:15 +02:00
eb2e11725e Finish Biolevante_ListiniEOfferte_FixGrafici 2024-06-17 11:58:59 +02:00
5345dd2ca3 [Conto Economico Prodotto]
- Fix width datePicker
- Rimosso picker data Validità
2024-06-17 11:57:31 +02:00
e3365fe7bf Finish Gramm_MonitoraggioLinee_AbilitaCreaOrdine 2024-06-14 18:33:37 +02:00
8d0b74b7f1 Merge branch 'develop' into feature/Gramm_MonitoraggioLinee_AbilitaCreaOrdine 2024-06-14 18:33:19 +02:00
296c8f69b9 [Listini Vendita]
- Fix freccia indietro
2024-06-14 18:32:56 +02:00
5bd902b42d [Monitoraggio Linee - Gramm]
- Fix controlli qualità in storico ordini
- pulizia codice
2024-06-14 18:32:02 +02:00
615bb23c88 Merge branch 'develop' into feature/Gramm_MonitoraggioLinee_AbilitaCreaOrdine 2024-06-14 18:31:09 +02:00
a0fbda4a09 [Listini e Offerte]
•	Nella data proporre la data dell’ultima variazione fatta sul listino <= oggi e cambiare la label in “Listino del:”

•	Il tasto modifica deve aprire la variazione del giorno selezionato e non proporre la nuova data di inserimento, come fa ora cliccando sulla data, eliminare la funzionalità di modifica dal click sulla data.

•	Aggiungere un picker che permetta di selezionare dal calendario la data per le nuove variazioni
•	Se la data selezionata è diversa dalla data presente sul listino visualizzare il tasto “Nuovo Prezzo”. Questo tasto funzionerà come funziona ora “modifica” l’unica differenza e che non dovrà proporre nella data di validità la data di oggi ma la data selezionata.
•	Se la data del picker coincide con la data validità pulsante modifica se sono diversi pulsante nuovo
•	Pulsante elimina nell’avanti elenco (sempre presente)
•	Esempio testo elimina “L'articolo 202149 verrà rimosso dal listino 07350 a partire dal 01/02/2024, continuare?”
•	Listino del diventa “data inizio validita”
•	In modifica bloccare la data validita
•	All’apertura del listino mi deve consigliare la max(data_listino) <= oggi e non le successive
2024-06-14 18:29:40 +02:00
9e9ed5e0af Migliorata lettura sidebar ordini in campi di raccolta 2024-06-13 12:55:35 +02:00
16bfd252f0 Corretto nome logo per os case sensitive 2024-06-13 11:01:15 +02:00
1779b3bd2b Merge branch 'develop' into feature/Gramm_MonitoraggioLinee_AbilitaCreaOrdine 2024-06-13 10:42:25 +02:00
b128af90af Gestita seconda um in esportazione excel mrp v2 2024-06-12 18:59:50 +02:00
d85910d495 Merge branch 'master' into develop 2024-06-12 12:08:08 +02:00
ca96ca6027 Finish ModifAnalisiBudgetRG 2024-06-12 12:08:07 +02:00
8d2e4d5ae1 Ricreazione tabella in analisi budget rosso gargano
(cherry picked from commit 4864d1d664)
2024-06-12 12:07:56 +02:00
4864d1d664 Ricreazione tabella in analisi budget rosso gargano 2024-06-11 15:27:31 +02:00
003ebedb12 Finish MigliorieListiniVend 2024-06-11 09:54:15 +02:00
064ebcfb56 Merge branch 'master' into develop 2024-06-11 09:54:15 +02:00
a999a3b3a7 Aggiunto componente per cambio versione rapido, migliorato stato editMode e personalizzato avviso cancellazione 2024-06-11 09:54:00 +02:00
553199732a [Monitoraggio Linee]
- Rinominato ABILITA_DUPLICA_ORDINE in ABILITA_CREA_DUPLICA_ORDINE
- Disabilitato il pulsante nuovo ordine in base alla setup
2024-06-10 13:08:17 +02:00
406afafcaf Gestita creazione della commessa direttamente dal preventivo in catalogo 2024-06-10 11:52:11 +02:00
e092b5196f Escape su title note_viag e fix qtaBdgVend 2024-06-07 18:56:57 +02:00
0bf1f24633 Finish RossoGargano_ListiniVendita_StampaListinoRangePedane 2024-06-07 17:34:04 +02:00
bf7be6f85c Merge branch 'develop' into feature/RossoGargano_ListiniVendita_StampaListinoRangePedane 2024-06-07 17:01:17 +02:00
595b82cbc3 Finish Carelli_ChiusuraTagliPrezzo_Modifiche 2024-06-07 16:58:42 +02:00
9d538115a7 Merge branch 'develop' into feature/Carelli_ChiusuraTagliPrezzo_Modifiche 2024-06-07 16:58:30 +02:00
c5051b5f34 Finish Gramm_MonitoraggioLineeV2_ControlliQualitàSLFixSalvataggioData 2024-06-07 16:57:36 +02:00
540c26e566 [Monitoraggio Linee - Gramm]
- Aggiunto campo Operatore
- Fix dimensioni col-md
2024-06-07 16:50:58 +02:00
716f2659e9 Merge branch 'develop' into feature/Gramm_MonitoraggioLineeV2_ControlliQualitàSLFixSalvataggioData 2024-06-07 16:47:25 +02:00
cb89e19ca9 [Report Type]
- Creazione ReportType 'STAMPA_LISTINI_VENDITA_RANGE_PEDANE'

[Report Area]
- Fix Popup nuova configurazione di stampa

[Conto Economico Prodotto]
- getPdfListino gestione flag_range

[Listini Vendita]
- Aggiunto pulsante 'Stampa Listino Range Pedane'
2024-06-07 16:34:16 +02:00
ba18d946ce [Report Area]
- Pulizia codice
2024-06-06 13:17:20 +02:00
29c3c8d657 [Chiusura Tagli Prezzo]
- inserire un contatore delle righe estratte
- valorizzare data validità  = oggi
- nella query prendere le promozioni che terminano il giorno seguente alla data validità
2024-06-06 13:14:42 +02:00
3689a82212 [Monitoraggio Linee]
- Aggiunto pulsante per il salvataggio invece di triggerare il change
2024-06-05 13:33:19 +02:00
d9fe5a79ce [GRAMM - Stato macchine]
corretta visualizzazione contatori double
2024-06-05 12:20:50 +02:00
7b99e03c4e Merge branch 'master' into develop 2024-06-05 11:52:57 +02:00
abff55a767 Finish Hotfix-13 2024-06-05 11:52:56 +02:00
5c3dfed8a9 [ROSSOGARGANO - ACCETTAZIONI]
corretto comando stampa
2024-06-05 11:52:23 +02:00
3951bb30fb Merge branch 'master' into develop 2024-06-05 11:29:12 +02:00
ec682dd321 Finish Hotfix-13 2024-06-05 11:29:11 +02:00
7060739b09 [ROSSOGARGANO - ACCETTAZIONI]
MES
	dimensioni etichtta: 70v X 100h mm
Nuovo carico
-	scambiare scarto da pz a %
- 	controllare calcolo kg netti
Trasporti del giorno
-	!agiungere targa mezzo
-	evidenziare certificati che  hanno ricevuto la tara come "completata"
bollettazione
	campi scarto e variazione prezzo
	salvataggio massivo
	stampa certificati
	certificati non devono sparire per permettere la stampa
	numero di stampe per certificati
2024-06-05 11:25:33 +02:00
28a5c73926 Cancellata gestione contatti_commesse_integry 2024-06-04 12:13:51 +02:00
3b95014998 Aggiunta modalita tabella in ModalAllegati e 2024-06-03 18:35:12 +02:00
ddb1f84ebf Finish ImeBa_ViaggiOrdini_NascondiViaggio 2024-06-03 15:05:49 +02:00
d50da2e9a9 [Consegne]
- Adesso vengono visualizzati solo i viaggi che hanno vtb_viaggi.confermato = 0
- Aggiunto pulsante "Nascondi Viaggio" che imposta il confermato a 1
- Modifiche minori e pulizia codice
2024-06-03 14:59:31 +02:00
efc7cb1bbc Fix lettura value type se numero con virgola 2024-05-31 19:03:20 +02:00
3af0699d24 [Rilevazioni Steup]
- Fix Activity Id
2024-05-31 17:25:59 +02:00
b57b8c026b Finish Carelli_RilevazioniSteup_StampaIspezione 2024-05-31 17:06:09 +02:00
cd9c236e2a Merge branch 'develop' into feature/Carelli_RilevazioniSteup_StampaIspezione 2024-05-31 16:24:09 +02:00
3f8a43fd74 [Impostazioni]
- Adesso se la query va in errore viene comunque aperto l'edit dell'impostazione, in modo da poter correggere la query
- Se il menù a tendina rimane in caricamento, aprire la console, probabilmente la query sarà andata in errore
2024-05-31 16:23:31 +02:00
96b7ed2cc0 Finish Carelli_Accettazione_FixLoopJS 2024-05-31 15:45:08 +02:00
50decf8699 [Rilevazioni Steup]
- Aggiunto pulsante per stampare l'ispezione
- Modifiche minori e pulizia codice
2024-05-31 15:42:14 +02:00
f6e83b4741 [Accettazione]
- Fix loop quando la qta chk non era multipla della qta per conf
- Fix aggiunta di articolo terzo
2024-05-31 15:14:54 +02:00
f86609de61 [ROSSOGARGANO - piano accettazione]
correzioni modulo accettazione da raccolta
2024-05-30 15:51:34 +02:00
386ed3b58a Merge remote-tracking branch 'origin/develop' into develop 2024-05-30 15:22:33 +02:00
e9db25b82b [ROSSOGARGANO - piano accettazione]
correzioni modulo accettazione da raccolta
2024-05-30 15:21:58 +02:00
d968abf895 Finish Integry_Biolevante_GiacenzeArtDaProdurre&FixSetup 2024-05-30 13:22:44 +02:00
04eb0d8a88 Merge branch 'develop' into feature/Integry_Biolevante_GiacenzeArtDaProdurre&FixSetup 2024-05-30 13:22:37 +02:00
4c9a071d58 Finish Follies_CatalogoModa_UpdateGrafico 2024-05-30 13:19:26 +02:00
124e54ad94 Merge branch 'develop' into feature/Follies_CatalogoModa_UpdateGrafico 2024-05-30 13:18:24 +02:00
48b868dc7c [Report]
- Adesso è possibile aprire la modifica del report anche se il JRXML è corrotto, per avere la possibilita di sostituirlo

[IME BA]

- Aggiornamento logo
2024-05-30 13:17:37 +02:00
a00bcd14cf [Catalogo Moda]
- Come da richiesta modificato il layout grafico per vedere le immagini più grandi
2024-05-30 13:16:08 +02:00
6aead1f6c3 [Monitoraggio Linee]
- Aggiunte colonne "Giacenza", "Arrivi", "Impegni" e "Disponibilita" nel popup "Seleziona l'articolo da produrre"
- Fix setup "ABILITA_MODIFICA_ARTICOLI" e "ABILITA_DUPLICA_ORDINE", adesso prende il valore di default della setup se non è specificato per utente
2024-05-30 13:10:46 +02:00
0bf827ccc1 Merge remote-tracking branch 'origin/develop' into develop 2024-05-29 17:54:09 +02:00
6d316a1e3a [ROSSOGARGANO - piano accettazione]
correzioni modulo accettazione da raccolta
2024-05-29 17:53:45 +02:00
b5ddd41555 Fix formato data viaggi ordini 2024-05-29 17:25:26 +02:00
dd644b8027 Merge remote-tracking branch 'origin/develop' into develop 2024-05-29 12:32:47 +02:00
4a24561da4 [ROSSOGARGANO - piano accettazione]
gestione calibri carciofi e etichette
2024-05-29 12:31:42 +02:00
86fe40ea20 Configurazione Farmmes SUIT_PUGLIA 2024-05-29 11:36:06 +02:00
0b5fc4d209 Merge remote-tracking branch 'origin/develop' into develop 2024-05-27 13:11:42 +02:00
b48b82b773 Aggiunto logo ime_ba 2024-05-27 13:10:19 +02:00
2cb21458f8 Merge remote-tracking branch 'origin/develop' into develop 2024-05-27 12:12:33 +02:00
a9aca411bb [ROSSOGARGANO]
Aggiunto suggerimento automatico lotto in creazione ordine di lavoro da modal mrp
2024-05-27 12:12:06 +02:00
65aec5ae36 Merge remote-tracking branch 'origin/develop' into develop 2024-05-24 17:35:54 +02:00
32e208ec69 [MRP]
- Fix getMateriali con i depositi filtrati nell'avanti elenco

[Classes]

- Fix Sodium

[Conto Economico]

- Trasformata chiamata GET in POST per fix ad errore
2024-05-24 17:35:23 +02:00
e5ec708911 Corretto confronto posizione come stringa in popup riep giorno 2024-05-23 16:13:10 +02:00
877556e43c Merge branch 'master' into develop 2024-05-21 12:12:43 +02:00
33ba009024 Finish Hotfix-13 2024-05-21 12:12:42 +02:00
c0ceea3ed4 corretta gestione classe DateTime nelle query
corretta gestione tipo int
2024-05-21 12:08:51 +02:00
bf06ad550e Merge branch 'master' into develop 2024-05-20 16:47:19 +02:00
4900874b25 Finish ModifPopupRiep 2024-05-20 16:47:18 +02:00
dad50ec988 Gestita posizione e stato confermato dei viaggi in popup riep giorno 2024-05-20 16:47:03 +02:00
2a0ca125af Finish Carelli_ProduttivitaAValore_PuliziaCodice 2024-05-20 15:01:19 +02:00
eefbea1490 Merge branch 'develop' into feature/Carelli_ProduttivitaAValore_PuliziaCodice 2024-05-20 15:01:14 +02:00
adfe8d4fc2 Merge tag 'Gramm_Sfrido_FiltroDateBetween' into develop
Finish Gramm_Sfrido_FiltroDateBetween
2024-05-20 15:00:20 +02:00
fdd3cdb580 Finish Gramm_Sfrido_FiltroDateBetween 2024-05-20 15:00:19 +02:00
38e8b611bd [Monitoraggio Linee]
- Adesso gli ordini lavorazione dello sfrido vengono filtrati per range di date (come l'avanti elenco)
2024-05-20 14:59:49 +02:00
5c35150b3f [Impostazioni]
- Fix filtro select2
- Reso getListDefaultValues globale
2024-05-20 13:16:18 +02:00
c20e86b167 [Produttivita a Valore]
- Pulizia codice
2024-05-20 13:14:10 +02:00
75c0b9f3f2 Gestite flag spese per articolo in listini vendita e controllo su part iva in popup ordine 2024-05-20 09:57:04 +02:00
748ed86587 Correzione check stringa unix valido 2024-05-17 12:52:27 +02:00
ae0795295c Fix chiamata setdatetime con stringa di un numero in fromArray 2024-05-17 12:46:19 +02:00
fa388ef7d2 Gestita stampa di più copie nei report e modifiche varie 2024-05-17 10:39:29 +02:00
7ba6a2b3ab [Inventario]
- Aggiunto userName sotto deposito
2024-05-16 12:52:39 +02:00
62e4e49c0a Aggiunto filtro data mancante in fabb_olio_linea 2024-05-15 19:12:29 +02:00
a3a40eb32e [Monitoraggio Linee]
- Fix filtro ordiniLavorazione, adesso controllafiltra per gli ordini che sono attualmente sulla linea (dtb_ord_steps)
2024-05-15 15:50:58 +02:00
8758ec64fa Rimosso controllo su data_iniz in get lotti monitoraggio ordini 2024-05-15 15:38:04 +02:00
169d620330 Cambio ordine per data lotto in monitoraggio ordini 2024-05-15 15:26:17 +02:00
4a53dcd548 Merge remote-tracking branch 'origin/develop' into develop 2024-05-15 12:38:49 +02:00
01853aa727 Fix proxy errato in docker 2024-05-15 12:35:54 +02:00
dfa842748d [Monitoraggio Linee]
- Fix serie collo
2024-05-15 12:33:06 +02:00
24bb01c504 Finish Dulciar_MonitoraggioLineeV2_Tooltip+ControlliQualita 2024-05-15 10:45:10 +02:00
0cfe65eb4b [Monitoraggio Linee]
- Introdotto tooltip sulle linee
- Fix controlli qualità Dulciar
- Fix serie Sfrido
2024-05-15 10:44:22 +02:00
453fc9dcba Fix input vuoto 2024-05-14 15:45:55 +02:00
216df8d4bc Corretta session_start in emailcheck, modificato popup dettagli fabbisogni olio ed aggiunto avviso in caso di errata lettura input crittografati 2024-05-14 15:24:38 +02:00
ed1f732c6f Merge remote-tracking branch 'origin/develop' into develop 2024-05-14 10:38:55 +02:00
fbf00a9556 [CARELLI - STEUP]
segnalata recidiva reparto
gestiti campi priorita e persona riferimento
2024-05-14 10:38:34 +02:00
5c535c1bb5 Merge branch 'master' into develop 2024-05-14 09:58:26 +02:00
f704db460b Finish FixSodium 2024-05-14 09:58:25 +02:00
492650895f Rimossa forzatura encrypt in execute ajax ed aggiunto avviso se sodium non presente 2024-05-14 09:58:10 +02:00
1a79f9dcf5 Merge branch 'master' into develop 2024-05-13 18:32:22 +02:00
7d8ebf1764 Finish FixRientroMES 2024-05-13 18:32:22 +02:00
dc7d4aacd8 Corretto ottenimento data collo in creazione rientro 2024-05-13 18:32:07 +02:00
8676e41f88 Merge branch 'master' into develop 2024-05-13 17:52:26 +02:00
71093d7d16 Finish FixMES 2024-05-13 17:52:25 +02:00
2bb8ac0c50 Correzioni monitoraggio ordini e mes 2024-05-13 17:51:37 +02:00
bec369714a [Monitoraggio Linee]
- Fix messaggio caricamento sfrido
2024-05-13 17:30:31 +02:00
4b286c30dc Finish Gramm_GiacenzaUL_ColonnaAnnotazioni 2024-05-13 16:06:29 +02:00
c2ce76b7ce [Controllo Giacenze]
- Aggiunta colonna Annotazioni

[Monitoraggio Linee]

- Rimossa partita mag fissa
2024-05-13 16:05:17 +02:00
a28711beb8 Merge branch 'master' into develop 2024-05-13 11:12:48 +02:00
fc685af026 Finish Hotfix-13 2024-05-13 11:12:47 +02:00
42eecd60a1 [MONITORAGGIO_LINEE]
corretta condizione per avvio più ordini su linea contemporaneamente
2024-05-13 11:12:08 +02:00
d0b6d6fa3b Finish Gramm_MonitoraggioLineeV2_Sfrido 2024-05-10 18:13:31 +02:00
be648fa00b [Monitoraggio Linee - Controlli Qualità]
- DatePicker editabile a mano

[Monitoraggio Linee]

- Fix suggestDataScadPartitaMag
- Ultime modifiche Sfrido + Stampa Sfrido
- Pulizia codice + modifiche minori

[Report Area]

- Pulizia codice
2024-05-10 18:13:19 +02:00
bc987af9df Merge branch 'develop' into feature/Gramm_MonitoraggioLineeV2_Sfrido 2024-05-10 18:02:52 +02:00
74e18f49cb Finish RossoGargano_MonitoraggioLinee_ControlliQualitaStandard 2024-05-10 18:02:29 +02:00
68ed50e3ec [Monitoraggio Linee]
- Controllo Qualita Standardizzato
2024-05-10 18:00:48 +02:00
89fd42f310 Merge branch 'develop' into feature/Gramm_MonitoraggioLineeV2_Sfrido 2024-05-09 17:36:09 +02:00
955ef2c6be Aggiunto dettaglio articoli in fabb_olio_linea 2024-05-09 17:14:03 +02:00
4751d5d6cf Merge branch 'develop' into feature/Gramm_MonitoraggioLineeV2_Sfrido 2024-05-08 12:30:30 +02:00
087bcd853f Fix trim se cod_tcol_UL null in delivery plan 2024-05-08 10:44:29 +02:00
8a6202414d Finish FabbOlioLinea 2024-05-08 09:35:47 +02:00
15a9db2f48 Nuova gestione Fabbisogno olio per linea 2024-05-08 09:34:50 +02:00
81286e348d Corretta creazione collo rientro se partita non presente 2024-05-07 18:08:52 +02:00
b1308fdb14 Aggiunto avviso in caso di spostamento di un ordine con viaggio in delivery plan 2024-05-07 17:41:53 +02:00
a67477776f Reso viaggio modificabile in PopupRiepGiorno rosso gargano 2024-05-07 16:23:40 +02:00
f54fc328ee Merge branch 'develop' into feature/Gramm_MonitoraggioLineeV2_Sfrido 2024-05-07 12:06:52 +02:00
a0f9056215 Merge tag 'Licor_ConfigAzienda_Fix' into develop
Finish Licor_ConfigAzienda_Fix
2024-05-07 10:50:10 +02:00
9f602e2b1d Finish Licor_ConfigAzienda_Fix 2024-05-07 10:50:09 +02:00
dd2213f5fb [Config Aziende]
- Fix ip nuovo server Licor
2024-05-07 10:45:05 +02:00
636c0cf898 Finish Integry_MRP&PianoArrivi_Fixes&Ottimizzazioni 2024-05-07 10:43:41 +02:00
e31ffeecf3 [MRP]
- Ottimizzazione e pulizia codice
- Aggiunto titolo "Fabbisogno Giornaliero"
- Fix grafico fa-circle in dettaglio articolo (Adesso viene mostrata correttamente la lettera all'interno del pallino)

[Piano Arrivi]

- Fix tabella xdebug dopo la selezione di un articolo da listino
- Aggiunto titolo a pulsante aggiungi pedana
- Pulizia codice
2024-05-07 10:42:38 +02:00
7f1518d5f7 Aggiunto header app token e rimosso file non utilizzato 2024-05-06 19:09:00 +02:00
93bd5047a0 Corretto percorso sodium 2024-05-06 15:45:33 +02:00
1241d1316d Attivazione encryptData se sodium è attivo 2024-05-06 15:27:19 +02:00
a3cfe01bc2 Implementazione sodium in invio dati ajax, migliorie generic in BasePopup e Ajax, definito metodo data("command") in jquery 2024-05-06 12:51:24 +02:00
e3b4edf1e2 Merge branch 'master' into develop 2024-05-06 09:57:33 +02:00
bb5bdd3192 Finish Hotfix-13 2024-05-06 09:57:32 +02:00
002a55019f aggiunte estensioni .js in importazioni moduli ts 2024-05-06 09:57:13 +02:00
0f8c05225d Merge remote-tracking branch 'origin/develop' into develop 2024-05-03 19:37:04 +02:00
10406d94e6 [ROSSOGARGANO]
Correzioni generazione documenti di accettazione carico e scarico materia prima
2024-05-03 19:36:32 +02:00
a51c5a9043 Merge remote-tracking branch 'origin/develop' into develop 2024-05-03 15:39:52 +02:00
831883a175 [Controllo Giacenze]
- Installato nuovamente Sass
- Fix dimensione box elementi per pagina nelle kendogrid (adesso si vedono quattro cifre)
- Ridotto da 5000 a 4000 il max di elementi per pagina
2024-05-03 15:33:02 +02:00
0b40763b3f [ROSSOGARGANO]
Servizio accettazione materia prima ortofrutta
2024-05-02 20:02:10 +02:00
903cf882b2 Info ordine in riga e non testata collo 2024-04-24 17:26:27 +02:00
7c9d13d34d [Monitoraggio Linee]
- Prima parte della gestione dei colli di Sfrido
2024-04-24 17:21:22 +02:00
82743c84ed Passata data validità in riassortimenti in chiusura tagli prezzo 2024-04-24 09:47:37 +02:00
f7b3f00bee Finish Carelli_DocInterni_EliminaRigaCollo 2024-04-22 13:02:52 +02:00
6265f82efe [Doc Interni]
- Aggiunta la possibilità di eliminare la riga del collo
2024-04-22 13:02:26 +02:00
9304fd6832 Finish Carelli_Inventari_FixOrdinamentoERimozionePagination 2024-04-19 16:04:53 +02:00
87b9e66ed0 [Inventario]
- Rimozione pagination
2024-04-19 16:04:28 +02:00
ab8c10b10d [Ordini A Riass Clie]
- Fix condizione di where in list-articoli-preordinati
- $maxCountResoBuco adesso viene nuovamente valorizzata in checkResiAsso (Da controllare perché fosse stato messo a null, dato che così non sarebbe mai entrato in alcuni controlli)
- Pulizia codice e modifiche minori

[Ordini Web Plants]

- Modifiche minori
2024-04-19 12:23:52 +02:00
dea17977d1 Merge branch 'master' into develop 2024-04-19 11:13:56 +02:00
f6db047e67 Finish Hotfix-13 2024-04-19 11:13:56 +02:00
b511ff6374 [DOLCE BONTA]
fix profilo pvm
2024-04-19 11:13:34 +02:00
8700271d1c Merge branch 'master' into develop 2024-04-19 11:04:33 +02:00
325a39101a Finish Hotfix-13 2024-04-19 11:04:33 +02:00
b4841de01c [DOLCE BONTA]
fix profilo pvm
2024-04-19 11:04:04 +02:00
26592f710e [DOLCE BONTA]
fix profilo pvm
2024-04-19 11:03:37 +02:00
1ed11fac86 Merge branch 'master' into develop 2024-04-19 10:12:24 +02:00
14292c5dd7 Finish Hotfix-13 2024-04-19 10:12:24 +02:00
4c8b42737f [DOLCE BONTA]
fix profilo pvm
2024-04-19 10:11:59 +02:00
eed7ee22a0 Merge branch 'master' into develop 2024-04-17 12:46:09 +02:00
e073ca9494 Finish FixGrunt 2024-04-17 12:46:08 +02:00
7771cd7c85 Aggiunti file nascosti in creazione zip _base 2024-04-17 12:45:36 +02:00
0accaf6b48 Merge tag 'Hotfix-12' into develop
Finish Hotfix-12
2024-04-17 12:33:42 +02:00
2a7dcc0453 Finish Hotfix-12 2024-04-17 12:33:42 +02:00
f88f27e392 [Gruntfile]
- abilitata la lettura dei file nascosti (come chiesto da Anthony)
2024-04-17 12:33:04 +02:00
a9afb427f5 Modificato profile MAGGIOSRL 2024-04-16 11:03:58 +02:00
fcb46f6f69 Merge tag 'Hotfix-11' into develop
Finish Hotfix-11
2024-04-15 12:29:00 +02:00
f959d3098e Finish Hotfix-11 2024-04-15 12:28:59 +02:00
bb84844d3b [MRP V2]
- Cambiato "consumi medi" con "media mobile"

[Monitoraggio Linee]

- Fix setup FlagCheckOrdine
2024-04-15 12:28:08 +02:00
09830da2f5 Merge tag 'Gramm_MagazzinoProd_FixDataColloRettifica' into develop
Finish Gramm_MagazzinoProd_FixDataColloRettifica
2024-04-15 12:26:22 +02:00
d3fc893c15 Finish Gramm_MagazzinoProd_FixDataColloRettifica 2024-04-15 12:26:21 +02:00
1af4cd013b [Magazzino Prod]
- Fix createFromFormat dataCollo
2024-04-15 12:25:46 +02:00
9c6ff3985b Merge branch 'master' into develop 2024-04-15 09:47:46 +02:00
4b15884b7e Finish Hotfix-11 2024-04-15 09:47:46 +02:00
3616c2ddc9 [FOLLIE - riassortimento]
Errore nel download degli articoli da rendere
2024-04-15 09:45:36 +02:00
69409f7952 Merge branch 'master' into develop 2024-04-11 17:32:41 +02:00
0bd6a5a01d Finish Hotfix-11 2024-04-11 17:32:40 +02:00
71f136c636 correzione query 2024-04-11 17:32:24 +02:00
55026372b3 [StbActivityFile]
- Fix rearrangeFilesArray
2024-04-10 15:44:57 +02:00
1ca3722d5b [Modal Mrp]
- PopupOrdProd fix chiamate setListMateriali multiple
2024-04-10 15:36:49 +02:00
0a9277d21b [IMSApi > SqlToExcel]
- Pulizia codice
2024-04-10 15:35:35 +02:00
890b307921 [Utility > File]
- Fix rearrangeFilesArray
2024-04-10 15:33:42 +02:00
25ddee8bcb Merge remote-tracking branch 'origin/develop' into develop 2024-04-10 15:32:43 +02:00
c746e48501 [Impostazioni]
- Fix array_get
- Pulizia codice
2024-04-10 15:32:19 +02:00
c83149b8f0 [Monitoraggio Linee]
- Pulizia codice
2024-04-10 15:13:14 +02:00
3044d9c7df Aggiunto pulsante esporta pdf in analisi budget agricoper 2024-04-09 12:08:35 +02:00
0db50c14f5 Aggiustamenti filtri in chiusura tagli prezzo 2024-04-05 13:10:49 +02:00
8ee40a5a96 Fix override open in BasePopup 2024-04-05 10:42:02 +02:00
74411b82e2 Finish Integry_MRP_ListMaterialiDepositi 2024-04-05 10:09:19 +02:00
58a49f9e98 Merge branch 'develop' into feature/Integry_MRP_ListMaterialiDepositi 2024-04-05 10:09:14 +02:00
6baebc9cc4 Finish Integry_MRP_ListMaterialiDepositi 2024-04-05 10:09:06 +02:00
2dc3b6a3c5 [Previsioni Raccolta]
- Fix datapicker doppio anno
- Pulizia codice
2024-04-05 10:00:15 +02:00
22c699f000 [Ordini Riass Clie]
- Fix velocità query
- Ottimizzazione codice
2024-04-05 09:59:09 +02:00
ea1d8d8390 [MRP]
- Adesso la listMateriali considera tutti i depositi presenti nel filtro dell'avantielenco
- Fix doppia chiamata alla setListMateriali
- Modifiche minori e ottimizzazione codice
2024-04-05 09:56:32 +02:00
e52f3e2266 Finish Follie_OrdiniARiassClie_OttimizzazioneVelocitaQuery 2024-04-04 10:38:46 +02:00
5d784a0e30 Merge branch 'develop' into feature/Follie_OrdiniARiassClie_OttimizzazioneVelocitaQuery 2024-04-04 10:38:31 +02:00
c38f9f8e3a Finish Follie_OrdiniARiassClie_OttimizzazioneVelocitaQuery 2024-04-04 10:34:53 +02:00
dadcb105b4 [Riassortimento]
- Ottimizzazione query "list-articoli"
- Modifiche minori e ottimizzazione codice
2024-04-04 10:30:03 +02:00
301d1bd025 [Contratti di Vendita]
- Alla modifica dell'ordine mantiene il paging della tabella
- Aumento delle righe per pagina
- Fix controllo sui dati al salvataggio ($div inesistente per i toast)
2024-04-03 17:21:24 +02:00
6d49dd2840 [INTEGRY]
spostata query retrieve ultima qta cnf in colli di produzione al momento prima di aprire il popup crea udc
2024-04-03 12:28:51 +02:00
31942a9742 Merge tag 'Integry_FileClass_FixFunctionRearrangeFileArray' into develop
Finish Integry_FileClass_FixFunctionRearrangeFileArray
2024-04-02 16:44:51 +02:00
1b952a7339 Merge branch 'master' into develop 2024-04-02 10:57:32 +02:00
391 changed files with 14180 additions and 15239 deletions

View File

@@ -1,6 +0,0 @@
{
"key1":{
"username":"alexs",
"password":"*0081iyAS"
}
}

View File

@@ -30,6 +30,7 @@
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="JSCheckFunctionSignatures" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="TaskProblemsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
</profile>
</component>

3
.idea/misc.xml generated
View File

@@ -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>

View File

@@ -7,7 +7,7 @@ const _arr_aziende = [
{n: "cosmapack"},
{n: "didesi"},
{n: "didonna"},
{n: "dolce_bo"},
{n: "dolce_bonta"},
{n: "dulciar"},
{n: "florapulia"},
{n: "folliesgroup"},
@@ -322,7 +322,8 @@ function compress_getValues() {
expand: true,
cwd: "exports/_base",
src: ["**/*"],
dest: "/"
dest: "/",
dot: true
}
return ret;
}
@@ -472,7 +473,8 @@ function copy_getValues(grunt) {
src: ["**", "!config_aziende/**", "!js/**", "!scss/**", "!css/**", "!gest-lib/**/*.js", "!dist/config_aziende/**"],
dest: "exports/_base", // + nomeAzienda.toUpperCase(),
expand: true,
options: {timestamp: true}
options: {timestamp: true},
dot: true
};
ret.build_folder = {

View File

@@ -4,7 +4,14 @@ 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
<IfModule mod_proxy.c>
ProxyTimeout 259200
<FilesMatch \.php$>
Require all granted
SetHandler proxy:fcgi://php-fpm:9000
</FilesMatch>
</IfModule>
# Set the DocumentRoot for the virtual host
DocumentRoot /var/www/html/

153
package-lock.json generated
View File

@@ -9,6 +9,9 @@
"version": "1.0.0",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"sass": "^1.76.0"
},
"devDependencies": {
"@ihvh/air-datepicker-types": "^2.0.2",
"@types/bootstrap": "^3.3.42",
@@ -237,9 +240,9 @@
}
},
"node_modules/@types/jqueryui": {
"version": "1.12.21",
"resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.21.tgz",
"integrity": "sha512-hsTOaWPg963smNdoHbEN2anu4vVWj9k2xuaZMIajWERPikaBRG49RmaDA/tb2HldX9/a0qHvQYKipXHSLhM3qA==",
"version": "1.12.22",
"resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.22.tgz",
"integrity": "sha512-4r7ROoUJ5gaIWvQa2qAHyrhskJcUNM62Md8M9+4DtabEiIQ9Y0pVlW88ojyXvn4M1HNUc/47KpFJaXhrk8P/rg==",
"dev": true,
"dependencies": {
"@types/jquery": "*"
@@ -580,6 +583,26 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/anymatch/node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/archiver": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-1.3.0.tgz",
@@ -798,6 +821,17 @@
}
]
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/bl": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",
@@ -822,7 +856,6 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"dependencies": {
"fill-range": "^7.0.1"
},
@@ -1002,6 +1035,48 @@
"upper-case-first": "^1.1.0"
}
},
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/chokidar/node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/clean-css": {
"version": "3.4.28",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz",
@@ -1815,7 +1890,6 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
@@ -2029,6 +2103,19 @@
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/ftp-response-parser": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ftp-response-parser/-/ftp-response-parser-1.0.1.tgz",
@@ -3876,6 +3963,11 @@
"node": ">= 4"
}
},
"node_modules/immutable": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz",
"integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw=="
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@@ -4098,6 +4190,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-boolean-object": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
@@ -4163,7 +4266,6 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -4196,7 +4298,6 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
@@ -4226,7 +4327,6 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"engines": {
"node": ">=0.12.0"
}
@@ -5472,7 +5572,6 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
},
@@ -5781,6 +5880,17 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/readline2": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz",
@@ -6069,6 +6179,22 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"node_modules/sass": {
"version": "1.76.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.76.0.tgz",
"integrity": "sha512-nc3LeqvF2FNW5xGF1zxZifdW3ffIz5aBb7I7tSvOoNu7z1RQ6pFt9MBuiPtjgaI62YWrM/txjWlOCFiGtf2xpw==",
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
@@ -6209,6 +6335,14 @@
"node": ">=0.8.0"
}
},
"node_modules/source-map-js": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/spawn-sync": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz",
@@ -6477,7 +6611,6 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"dependencies": {
"is-number": "^7.0.0"
},

View File

@@ -57,5 +57,8 @@
"typescript": "~5.0.3"
},
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"sass": "^1.76.0"
}
}

View File

@@ -1,4 +1,4 @@
<?
<?php
session_start();
include "functions.php";
@@ -10,18 +10,18 @@ include "config.php";
if(!class_exists("Allegati")){
include Controller::current_gestpath_classes("Allegati.class.php");
}*/
include Controller::current_gestpath_include("ajax.php");
(new AllegatiAjax())->checkAjaxRequests();
?>
<!DOCTYPE html>
<!--html manifest="manifest.appcache"-->
<html>
<head>
<? include pvm_tagHead; ?>
<?php include pvm_tagHead; ?>
</head>
<body>
<? include pvm_headerNavbar; ?>
<?php include pvm_headerNavbar; ?>
<div id="content">
<div><?
<div><?php
include pvm_navTab;
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
include pvm_unauthorized;
@@ -30,6 +30,6 @@ include Controller::current_gestpath_include("ajax.php");
} ?>
</div>
</div>
<? include pvm_footerMinimal; ?>
<?php include pvm_footerMinimal; ?>
</body>
</html>

View File

@@ -11,7 +11,8 @@
"lodash",
"moment",
"date-formats",
"animate"
"animate",
"sodium"
]
},
"std-pkg": {
@@ -29,7 +30,8 @@
"date-formats",
"animate",
"firebase",
"navbar"
"navbar",
"sodium"
]
},
"jquery": {
@@ -514,5 +516,13 @@
"js": [
"assets/navbar/navbar.js"
]
},
"sodium": {
"js": [
"node_modules/sodium-plus/dist/sodium-plus.min.js"
],
"ts": [
"node_modules/sodium-plus/dist/sodium-plus.min.js"
]
}
}

View File

@@ -1,87 +1 @@
.leaflet-sidebar {
position: absolute;
height: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
z-index: 1000; }
.leaflet-sidebar.left {
left: -500px;
transition: left 0.5s, width 0.5s;
padding-right: 0; }
.leaflet-sidebar.left.visible {
left: 0; }
.leaflet-sidebar.right {
right: -500px;
transition: right 0.5s, width 0.5s;
padding-left: 0; }
.leaflet-sidebar.right.visible {
right: 0; }
.leaflet-sidebar > .leaflet-control {
height: 100%;
width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 8px 24px;
font-size: 1.1em;
background: white;
box-shadow: 0 1px 7px rgba(0, 0, 0, 0.65);
-webkit-border-radius: 4px;
border-radius: 4px; }
.leaflet-touch .leaflet-sidebar > .leaflet-control {
box-shadow: none;
border: 2px solid rgba(0, 0, 0, 0.2);
background-clip: padding-box; }
@media (max-width: 767px) {
.leaflet-sidebar {
width: 100%;
padding: 0; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 100%; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 100%; }
.leaflet-sidebar.left {
left: -100%; }
.leaflet-sidebar.left.visible {
left: 0; }
.leaflet-sidebar.right {
right: -100%; }
.leaflet-sidebar.right.visible {
right: 0; }
.leaflet-sidebar > .leaflet-control {
box-shadow: none;
-webkit-border-radius: 0;
border-radius: 0; }
.leaflet-touch .leaflet-sidebar > .leaflet-control {
border: 0; } }
@media (min-width: 768px) and (max-width: 991px) {
.leaflet-sidebar {
width: 305px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 315px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 315px; } }
@media (min-width: 992px) and (max-width: 1199px) {
.leaflet-sidebar {
width: 390px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 400px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 400px; } }
@media (min-width: 1200px) {
.leaflet-sidebar {
width: 460px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 470px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 470px; } }
.leaflet-left {
transition: left 0.5s; }
.leaflet-right {
transition: right 0.5s; }
.leaflet-sidebar{position:absolute;height:100%;box-sizing:border-box;padding:10px;z-index:1000}.leaflet-sidebar.left{left:-500px;transition:left .5s,width .5s;padding-right:0}.leaflet-sidebar.left.lg{left:-650px}.leaflet-sidebar.left.visible{left:0}.leaflet-sidebar.right{right:-500px;transition:right .5s,width .5s;padding-left:0}.leaflet-sidebar.right.lg{right:-650px}.leaflet-sidebar.right.visible{right:0}.leaflet-sidebar>.leaflet-control{height:100%;width:100%;overflow:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;padding:8px 24px;font-size:1.1em;background:#fff;box-shadow:0 1px 7px rgba(0,0,0,.65);border-radius:4px}@media(max-width: 767px){.leaflet-sidebar>.leaflet-control{box-shadow:none;border-radius:0}}@media(max-width: 767px){.leaflet-sidebar{width:100%;padding:0}.leaflet-sidebar.left.visible~.leaflet-left{left:100%}.leaflet-sidebar.right.visible~.leaflet-right{right:100%}.leaflet-sidebar.left{left:-100%}.leaflet-sidebar.left.visible{left:0}.leaflet-sidebar.right{right:-100%}.leaflet-sidebar.right.visible{right:0}.leaflet-sidebar>.leaflet-control{box-shadow:none;border-radius:0}.leaflet-touch .leaflet-sidebar>.leaflet-control{border:0}}@media(min-width: 768px)and (max-width: 991px){.leaflet-sidebar{width:305px}.leaflet-sidebar.left.visible~.leaflet-left{left:315px}.leaflet-sidebar.right.visible~.leaflet-right{right:315px}}@media(min-width: 992px)and (max-width: 1199px){.leaflet-sidebar{width:390px}.leaflet-sidebar.left.visible~.leaflet-left{left:400px}.leaflet-sidebar.right.visible~.leaflet-right{right:400px}}@media(min-width: 1200px){.leaflet-sidebar{width:460px}.leaflet-sidebar.lg{width:650px}.leaflet-sidebar.left.visible~.leaflet-left{left:470px}.leaflet-sidebar.left.visible.lg~.leaflet-left{left:660px}.leaflet-sidebar.right.visible~.leaflet-right{right:470px}.leaflet-sidebar.right.visible.lg~.leaflet-right{right:660px}}.leaflet-left{transition:left .5s}.leaflet-right{transition:right .5s}/*# sourceMappingURL=L.Control.Sidebar.css.map */

View File

@@ -0,0 +1,153 @@
$lgWidth: 650px;
.leaflet-sidebar {
position: absolute;
height: 100%;
box-sizing: border-box;
padding: 10px;
z-index: 1000;
&.left {
left: -500px;
transition: left 0.5s, width 0.5s;
padding-right: 0;
&.lg {
left: -$lgWidth;
}
&.visible {
left: 0;
}
}
&.right {
right: -500px;
transition: right 0.5s, width 0.5s;
padding-left: 0;
&.lg {
right: -$lgWidth;
}
&.visible {
right: 0;
}
}
> .leaflet-control {
height: 100%;
width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
box-sizing: border-box;
padding: 8px 24px;
font-size: 1.1em;
background: white;
box-shadow: 0 1px 7px rgba(0, 0, 0, 0.65);
border-radius: 4px;
@media (max-width: 767px) {
box-shadow: none;
border-radius: 0;
}
}
@media (max-width: 767px) {
width: 100%;
padding: 0;
&.left.visible ~ .leaflet-left {
left: 100%;
}
&.right.visible ~ .leaflet-right {
right: 100%;
}
&.left {
left: -100%;
&.visible {
left: 0;
}
}
&.right {
right: -100%;
&.visible {
right: 0;
}
}
> .leaflet-control {
box-shadow: none;
border-radius: 0;
.leaflet-touch & {
border: 0;
}
}
}
@media (min-width: 768px) and (max-width: 991px) {
width: 305px;
&.left.visible ~ .leaflet-left {
left: 315px;
}
&.right.visible ~ .leaflet-right {
right: 315px;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
width: 390px;
&.left.visible ~ .leaflet-left {
left: 400px;
}
&.right.visible ~ .leaflet-right {
right: 400px;
}
}
@media (min-width: 1200px) {
width: 460px;
&.lg {
width: $lgWidth;
}
&.left.visible {
& ~ .leaflet-left {
left: 470px;
}
&.lg ~ .leaflet-left {
left: $lgWidth + 10px;
}
}
&.right.visible {
& ~ .leaflet-right {
right: 470px;
}
&.lg ~ .leaflet-right {
right: $lgWidth + 10px;
}
}
}
}
.leaflet-left {
transition: left 0.5s;
}
.leaflet-right {
transition: right 0.5s;
}

View File

@@ -2,7 +2,10 @@
namespace Api;
use EntityItem;
use EntityList;
use ErrorHandler;
use GestSetup;
use Query;
use Ret;
@@ -50,4 +53,50 @@ class Pvm extends Api {
return $query->firstRowFirstValue()->toRet()->execute();
}
public static function getSetup($data) {
return Ret::data(GestSetup::fromArray($data)->get());
}
public static function processEntity($data) {
if (is_null($data)) {
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, __FUNCTION__);
}
$entityItem = EntityItem::fromArray($data);
$ret = $entityItem->send();
if ($ret->is_OK()) {
$entity = $ret->get_entity();
return Ret::data($entity);
}
return $ret;
}
public static function processEntityList($data) {
if (!is_array($data)) {
return Ret::errorCode(ErrorHandler::MISSING_PARAMS, __FUNCTION__);
}
$entityList = EntityList::fromArray($data);
$ret = $entityList->send();
if ($ret->is_OK()) {
$data = $ret->get_data();
$results = array();
foreach ($data as $result) {
$results[] = $result["entity"];
}
$ret->set_data($results);
}
return $ret;
}
}

View File

@@ -42,17 +42,31 @@ class EntityItem {
$valueType = gettype($value);
switch ($valueType) {
case "number":
case "integer":
case "float":
case "double":
if (!$entityItem->set($key, $value, true)) {
exit;
}
break;
case "string":
if (!$entityItem->setDatetime($key, $value, true)) {
if (!$entityItem->setDatetime($key, $value, true, true)) {
exit;
}
break;
case "array":
if (array_get($value, "0.type")) {
foreach ($value as $entity) {
if (!$entityItem->set($key)->append(EntityItem::fromArray($entity))) {
exit;
}
}
} else {
$entityItem->set($key, $value);
}
break;
}
}
@@ -140,11 +154,14 @@ class EntityItem {
return (self::is_validKey($key) && isset($this->arr_fields[$key])) ? $this->arr_fields[$key] : null;
}
public function setDatetime($key, $value, $setNullConstant = false) {
public function setDatetime($key, $value, $setNullConstant = false, $numberOnly = false) {
$setNullConstant = $setNullConstant === true ? Format::IMS_NULL_TIME : $setNullConstant;
if (isset($value)) {
if (\Utility\Date::isValidUnixtime($value)) {
if ($value instanceof DateTime) {
$type = Format::strtotimeYMDHMS;
$value = $value->format($type);
} else if (\Utility\Date::isValidUnixtime($value, $numberOnly)) {
$value = strftime(Format::strftimeYMDHMS, $value);
} else {
try {
@@ -208,7 +225,7 @@ class EntityItem {
return $this;
} else {
if ($setNullConstant !== false && $value == "") {
if ($setNullConstant !== false && $value === "") {
if (is_bool($setNullConstant)) {
$value = Format::IMS_NULL_STRING;
} else {

View File

@@ -20,6 +20,18 @@ class EntityList {
}
}
public static function fromArray($data) {
$entityList = new EntityList();
foreach ($data as $entity) {
$entityItem = EntityItem::fromArray($entity);
$entityList->push($entityItem);
}
return $entityList;
}
public function __toString() {
return self::get_jsonBody();
}

View File

@@ -35,6 +35,48 @@ class GestSetup {
}
}
public static function fromArray($array) {
$gestSetup = new GestSetup();
$gestName = array_get($array, "gestName");
$section = array_get($array, "section");
$keySection = array_get($array, "keySection");
$required = array_get($array, "required");
$defaultValue = array_get($array, "defaultValue", false);
$gestSetup
->gestName($gestName)
->section($section)
->keySection($keySection)
->required($required)
->defaultValue($defaultValue);
$as = array_get($array, "as", "string");
switch ($as) {
case "string":
$gestSetup->asString();
break;
case "array":
$gestSetup->asArray();
break;
case "json":
$gestSetup->asJson();
break;
case "boolean":
$gestSetup->asBoolean();
break;
case "int":
$gestSetup->asInt();
break;
case "float":
$gestSetup->asFloat();
break;
}
return $gestSetup;
}
public function init() {
$this->_currentModule = Controller::current_module();
$caller = debug_backtrace();

View File

@@ -4,6 +4,7 @@ use Utility\Date;
class IMSApi {
const serviceRootPath = "ems-api/";
const X_APP_TOKEN = "845da2d9-f2f9-4f8d-ad5b-34b65a91eb6d";
private $contentType = null;
private $group = null;
private $serviceName = null;
@@ -266,6 +267,8 @@ class IMSApi {
$Rest = $this->makeRest();
/**** here the body of IMSApi is passed to $Rest; *******/
$Rest->header("X-App-Token", self::X_APP_TOKEN);
$credentials = $this->get_authCredentials();
if (!is_null($credentials)) {
if (array_get($credentials, "username")) {

View File

@@ -65,11 +65,10 @@ class SqlToExcel extends \IMSApi {
}
}
$Query = new \Query($this->_sql);
//$ret = $Query->checkSyntax();
if ($ret->is_OK()) {
$this->body(array("sql" => $this->_sql, "fields" => $this->_arr_fields));
$ret = parent::send();
if ($ret->is_OK()) {
$retData = $ret->get_data();
$content = base64_decode($retData[0]["dto"]);
@@ -85,7 +84,6 @@ class SqlToExcel extends \IMSApi {
}
$ret = \Cache::writeR($fileName . ".xlsx", $content, true, $overwrite);
} else {
$ret->set_byte($content);
}

View File

@@ -3,8 +3,7 @@
use Report\Parameter;
use Utility\Date;
class JasperProcessor
{
class JasperProcessor {
private $_title = null; // non necessario per l'esecuzione, lo carica solo leggendolo dal db
private $_QUERY = null;
private $_REPORT_NAME = null;
@@ -35,13 +34,13 @@ class JasperProcessor
private $profileDb = null;
public function __construct()
{
private $copies = 0;
public function __construct() {
$this->asPdf();
}
private function is_loaded()
{
private function is_loaded() {
$Ret = new Ret;
if (is_null($this->_B64_JRXML) && is_null($this->_REPORT_NAME) && is_null($this->reportType)) {
$Ret->set_error("Risorsa non caricata nel JasperProcessor");
@@ -49,8 +48,7 @@ class JasperProcessor
return $Ret;
}
private function process()
{
private function process() {
$IMSApi = new IMSApi;
$startTime = $endTime = time();
@@ -146,8 +144,7 @@ class JasperProcessor
return $Ret;
}
public function run()
{
public function run() {
$Ret = $this->is_loaded();
if ($Ret->is_KO() && !is_null($this->_report)) {
$Ret = $this->load($this->_report);
@@ -169,8 +166,7 @@ class JasperProcessor
return $Ret;
}
public function sendToPrinter($printerName = null, $numberOfCopies = null)
{
public function sendToPrinter($printerName = null, $numberOfCopies = null) {
$Ret = $this->is_loaded();
if ($Ret->is_KO() && !is_null($this->_report)) {
$Ret = $this->load($this->_report);
@@ -202,8 +198,7 @@ class JasperProcessor
return $Ret;
}
public function loadFromJtbDisegni($codProd, $codDisegno = null, $fileTypes = null)
{
public function loadFromJtbDisegni($codProd, $codDisegno = null, $fileTypes = null) {
$fileTypes = !is_null($fileTypes) ? array($fileTypes) : array(\JtbDisegniFiles::REPORT_JASPER, \JtbDisegniFiles::SUBREPORT_JASPER);
$filters = array("cod_prod" => $codProd, "file_type" => $fileTypes);
if ($codDisegno) $filters["cod_disegno"] = $codDisegno;
@@ -241,8 +236,7 @@ class JasperProcessor
return $Ret;
}
public function load($input, $format = null)
{
public function load($input, $format = null) {
$Ret = new Ret;
if (!is_null($input)) {
if (is_string($input)) { // reportName
@@ -321,65 +315,54 @@ class JasperProcessor
return $Ret;
}
public function getTitle()
{
public function getTitle() {
return $this->_title;
}
public function report($v)
{
public function report($v) {
$this->_report = $v;
return $this;
}
public function asPdf()
{
public function asPdf() {
return $this->asFormat(Format::PDF);
}
public function asFormat($v)
{
public function asFormat($v) {
$this->_FORMATO_EXPORT = $v;
return $this;
}
public function setTitle($v)
{
public function setTitle($v) {
$this->_title = $v;
return $this;
}
public function setReportName($v)
{
public function setReportName($v) {
$this->_REPORT_NAME = $v;
return $this;
}
public function getReportName()
{
public function getReportName() {
return $this->_REPORT_NAME;
}
public function setB64Jrxml($v)
{
public function setB64Jrxml($v) {
$this->_B64_JRXML = $v;
return $this;
}
public function setSubreports($v)
{
public function setSubreports($v) {
$this->_SUBREPORTS = $v;
return $this;
}
public function setQuery($v)
{
public function setQuery($v) {
$this->_QUERY = Utility::isBase64Encoded($v) ? base64_decode($v) : $v;
return $this;
}
public function setJsonSource($v)
{
public function setJsonSource($v) {
if ((is_array($v) || is_object($v)) && !is_string($v)) { // è possibile fornire anche una struttura, la conversione in json string avviene in atuomatico
$v = json_encode($v);
}
@@ -387,19 +370,16 @@ class JasperProcessor
return $this;
}
public function cacheAs($fileName = true)
{
public function cacheAs($fileName = true) {
$this->_cacheAs = $fileName;
return $this;
}
public function paramDate($key, $value)
{
public function paramDate($key, $value) {
return $this->param($key, $value, Format::strftimeYMD);
}
public function param($key, $value, $type = null)
{ // append parametro singolo
public function param($key, $value, $type = null) { // append parametro singolo
if (!is_null($type)) {
if ($type == Format::strftimeYMD || $type == Format::strftimeYMDHMS || $type == Format::strftimeSlashedYMD) {
if (Date::isValidUnixtime($value)) {
@@ -436,8 +416,7 @@ class JasperProcessor
return $this;
}
public function hasParam($paramName)
{
public function hasParam($paramName) {
$param = array_filter($this->_PARAMS, function ($pr) use ($paramName) {
return $pr["name"] === $paramName;
});
@@ -445,30 +424,25 @@ class JasperProcessor
return !empty($param);
}
public function params($v = null)
{ // set tutti parametri (sovrascrive)
public function params($v = null) { // set tutti parametri (sovrascrive)
$this->_PARAMS = $v;
return $this;
}
public function resetParams()
{
public function resetParams() {
return $this->params(array());
}
private function get_where()
{
private function get_where() {
return !is_null($this->_WHERE_COND) ? rtrim($this->_WHERE_COND, " AND ") : null;
}
public function where($fieldname = null, $value = false, $type = null)
{ // si puo settare in onetime o in append
public function where($fieldname = null, $value = false, $type = null) { // si puo settare in onetime o in append
$this->_WHERE_COND = blankIfNull($this->_WHERE_COND) . Query::process_whereParameters($fieldname, $value, $type) . " AND ";
return $this;
}
private function get_queryCompiled()
{
private function get_queryCompiled() {
if (!is_null($this->_QUERY)) {
$query = $this->_QUERY;
foreach ($this->_PARAMS as $param) {
@@ -479,8 +453,7 @@ class JasperProcessor
return null;
}
private function getSubreportDTOList()
{
private function getSubreportDTOList() {
$itemList = null;
if (!is_null($this->_SUBREPORTS) && count($this->_SUBREPORTS) > 0) {
$itemList = array();
@@ -498,16 +471,18 @@ class JasperProcessor
return $itemList;
}
private function getJasperDTO()
{
$JasperDTO = new EntityItem;
$JasperDTO->set("reportName", $this->_REPORT_NAME)
private function getJasperDTO() {
$JasperDTO = new EntityItem();
$JasperDTO
->set("reportName", $this->_REPORT_NAME)
->set("query", $this->get_queryCompiled())
->set("jsonSource", $this->_JSON_SOURCE)
->set("typeExport", $this->getTypeExport())
->set("b64ReportJrxml", $this->_B64_JRXML)
->set("subreports", $this->getSubreportDTOList())
->set("whereCond", $this->get_where());
->set("whereCond", $this->get_where())
->set("copies", $this->getCopies());
foreach ($this->_PARAMS as $item) {
$Param = new EntityItem;
@@ -518,8 +493,7 @@ class JasperProcessor
return $JasperDTO;
}
private function getReportRypeDTO()
{
private function getReportRypeDTO() {
$reportRypeDTO = new EntityItem;
$reportRypeDTO
->set("reportType", $this->reportType->getValue())
@@ -538,8 +512,7 @@ class JasperProcessor
/**
* @return ReportType
*/
public function getReportType()
{
public function getReportType() {
return $this->reportType;
}
@@ -547,8 +520,7 @@ class JasperProcessor
* @param $reportType
* @return $this
*/
public function setReportType($reportType)
{
public function setReportType($reportType) {
$this->reportType = $reportType;
return $this;
}
@@ -556,8 +528,7 @@ class JasperProcessor
/**
* @return string
*/
public function getCodAnag()
{
public function getCodAnag() {
return $this->codAnag;
}
@@ -565,8 +536,7 @@ class JasperProcessor
* @param $codAnag
* @return $this
*/
public function setCodAnag($codAnag)
{
public function setCodAnag($codAnag) {
$this->codAnag = $codAnag;
return $this;
}
@@ -574,21 +544,18 @@ class JasperProcessor
/**
* @return string
*/
public function getCodMdep()
{
public function getCodMdep() {
return $this->codMdep;
}
/**
* @param string $codMdep
*/
public function setCodMdep($codMdep)
{
public function setCodMdep($codMdep) {
$this->codMdep = $codMdep;
}
private function getTypeExport()
{
private function getTypeExport() {
return $this->_FORMATO_EXPORT;
}
@@ -599,4 +566,13 @@ class JasperProcessor
$this->profileDb = $profileDb;
return $this;
}
public function getCopies() {
return $this->copies;
}
public function setCopies($copies) {
$this->copies = $copies;
return $this;
}
}

View File

@@ -144,7 +144,7 @@ class OrdiniWeb {
}
public static function calc_hashOrdine($key) {
$s = $key["data_ord"] . $key["gestione"] . (isset($key["serie"]) ? $key["serie"] : "") . $key["num_ord"];
$s = $key["data_ord"] . $key["gestione"] . array_get($key, "serie") . $key["num_ord"];
return substr(md5($s), 0, 10);
}
}

View File

@@ -223,7 +223,11 @@ class Ajax {
}
public static function get_moduleTemplates($data) {
header("Content-Type: " . \Mime::JSON . "; charset=ISO-8859-1");
if (is_array(error_get_last())) {
@header("Content-Type: " . \Mime::HTML);
} else {
header("Content-Type: " . \Mime::JSON . "; charset=ISO-8859-1");
}
$moduleName = $data["module_name"];
$moduleNameCc = ucfirst(\Utility\Str::camelCaseEncode($moduleName));
include \Controller::module_gestpath_classes($moduleName, "{$moduleNameCc}.class.php");

View File

@@ -696,7 +696,17 @@ class Query {
public function setVar($key, $value, $type = null, $setDefaultConstant = false) {
if (!is_null($this->sql)) {
if (!is_null($value) && ($type == Format::strftimeYMD || $type == Format::strftimeYMDHMS || $type == Format::strftimeSlashedYMD)) {
if (Date::isValidUnixtime($value)) {
if ($value instanceof DateTime) {
if ($type == Format::strftimeYMD) {
$type = Format::strtotimeYMD;
} else if ($type == Format::strftimeYMDHMS) {
$type = Format::strtotimeYMDHMS;
} else if ($type == Format::strftimeSlashedYMD) {
$type = "Y/m/d";
}
$value = $value->format($type);
} else if (Date::isValidUnixtime($value)) {
$value = strftime($type, $value);
} else {
try {

View File

@@ -123,11 +123,19 @@ class Report {
private function load_queryInfo() {
$Ret = new Ret;
$xml = $this->getJrxml();
if (!is_null($xml)) {
$jrxml = simplexml_load_string($xml);
$this->queryString = strtolower(str_replace("\t", " ", str_replace("\n", " ", trim((string)$jrxml->queryString))));
$this->queryLang = strtolower(trim((string)$jrxml->queryString->attributes()->language));
$jrxml = @simplexml_load_string($xml);
if ($jrxml) {
$this->queryString = strtolower(str_replace("\t", " ", str_replace("\n", " ", trim((string)$jrxml->queryString))));
$this->queryLang = strtolower(trim((string)$jrxml->queryString->attributes()->language));
} else {
$this->queryString = null;
$this->queryLang = null;
}
}
return $Ret;
}
@@ -171,7 +179,7 @@ class Report {
private function load_parameters() {
$this->Parameters = array();
$jrxml = simplexml_load_string($this->getJrxml());
$jrxml = @simplexml_load_string($this->getJrxml());
$Query = new \Query(self::get_sql_listParameters());
$Query->setVar("report_id", $this->id);
$Ret = $Query->anonymousAuth()->toRet()->execute();

View File

@@ -7,7 +7,8 @@ class ReportType {
"ETICHETTA_SSCC_LAVORAZIONE" => self::ETICHETTA_SSCC_LAVORAZIONE,
"ETICHETTA_SSCC_SPEDIZIONE" => self::ETICHETTA_SSCC_SPEDIZIONE,
"WMS_SPEDIZIONE_PACKING_LIST_ORD" => self::WMS_SPEDIZIONE_PACKING_LIST_ORD,
"STAMPA_LISTINI_VENDITA" => self::STAMPA_LISTINI_VENDITA
"STAMPA_LISTINI_VENDITA" => self::STAMPA_LISTINI_VENDITA,
"STAMPA_LISTINI_VENDITA_RANGE_PEDANE" => self::STAMPA_LISTINI_VENDITA_RANGE_PEDANE,
);
const ETICHETTA_SSCC_ACCETTAZIONE = 0;
@@ -15,7 +16,7 @@ class ReportType {
const ETICHETTA_SSCC_SPEDIZIONE = 2;
const WMS_SPEDIZIONE_PACKING_LIST_ORD = 4;
const STAMPA_LISTINI_VENDITA = 5;
const STAMPA_LISTINI_VENDITA_RANGE_PEDANE = 6;
private $value;

View File

@@ -28,6 +28,34 @@ class Ret {
}
}
/**
* @param $data
* @return Ret
*/
public static function data($data) {
return (new Ret())->set_data($data);
}
/**
* @param $text
* @param $title
* @return Ret
*/
public static function error($text = null, $title = null) {
return (new Ret())->set_error($text, $title);
}
/**
* @param $errorCode numeric Codice errore presenti in ErrorHandler
* @param $p1
* @param $p2
* @param $p3
* @return Ret
*/
public static function errorCode($errorCode = null, $p1 = null, $p2 = null, $p3 = null) {
return (new Ret())->set_errorCode($errorCode, $p1, $p2, $p3);
}
public function __toString() {
return $this->toJson();
}
@@ -361,21 +389,6 @@ class Ret {
public function getExecutionTime() {
$this->get("executionTime");
}
public static function error($text = null, $title = null) {
return (new Ret())->set_error($text, $title);
}
/**
* @param $errorCode numeric Codice errore presenti in ErrorHandler
* @param $p1
* @param $p2
* @param $p3
* @return Ret
*/
public static function errorCode($errorCode = null, $p1 = null, $p2 = null, $p3 = null) {
return (new Ret())->set_errorCode($errorCode, $p1, $p2, $p3);
}
}
//include "ErrorHandler.class.php";

View File

@@ -3,24 +3,23 @@
class StbActivityFile {
public static function get_items($activityId, $fileName = null, $profileDb = null) {
$Query = new Query;
$query = new Query("SELECT file_name, original_size, descrizione, id AS activity_id, last_upd, sa.activity_type_id
FROM stb_activity_file
INNER JOIN stb_activity sa ON stb_activity_file.id = sa.activity_id");
$fields = array("file_name", "original_size", "descrizione", "id AS activity_id", "last_upd");
$Query->select($fields)
->from("stb_activity_file")
$query
->where("id", $activityId)
->orderBy("file_name");
if (!is_null($fileName)) {
$Query->where("file_name", $fileName);
$query->where("file_name", $fileName);
}
if ($profileDb) {
$Query->profileDB($profileDb);
$query->profileDB($profileDb);
}
$Ret = $Query->toRet()->execute();
$Ret = $query->toRet()->execute();
if ($Ret->is_OK()) {
$arr_rows = $Ret->get_data();
foreach ($arr_rows as $i => $row) {
@@ -35,7 +34,8 @@ class StbActivityFile {
"mime_type" => $mime,
"user_creator" => null,
"icon" => $icon["name"],
"icon_style" => $icon["style"]
"icon_style" => $icon["style"],
"activity_type_id" => $row["activity_type_id"],
));
}
@@ -58,30 +58,33 @@ 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;
$fileItems = \Utility\File::rearrangeFilesArray(array_get($fileItems, "files", $fileItems));
$attachments = array();
if (file_exists($fileItem["tmp_name"])) {
if (is_array($activityId)) {
foreach ($activityId as $id) {
if ($ret->is_KO()) {
break;
}
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);
$ret->set_error("File non trovato");
}
if ($ret->is_OK()) {
$retData = $ret->get_data();
$attachments[] = $retData;
@unlink($fileItem["tmp_name"]);
}
} else {
$ret->set_error("File non trovato");
}
if (count($attachments) > 0) {

View File

@@ -47,9 +47,19 @@ class Utility {
public static function B64JSON_parse($input) { // B64 to JSON STRING to ARRAY (alterego js "B64JSON_parse")
try {
if (extension_loaded("sodium") && array_get($_GET, "encryptData", array_get($_POST, "encryptData", "false")) == "true") {
$input = sodium_crypto_box_seal_open(sodium_hex2bin($input), $_SESSION["keypair"]);
if (is_bool($input) && !$input) {
echo("Errore nella lettura dei dati in input.");
echo("Chiave pubblica: " . sodium_bin2hex(sodium_crypto_box_publickey($_SESSION["keypair"])));
exit;
}
}
return self::JSON_parse(base64_decode($input));
} catch (Exception $e) {
return null;
return self::JSON_parse(base64_decode($input));
}
}
@@ -102,7 +112,15 @@ class Utility {
$output[$var] = self::JSON_values_decode($val);
}
} else {
$output = is_null($input) ? null : (is_string($input) && array_get($_GET, "arrayEncode", array_get($_POST, "arrayEncode", "true")) == "true" ? urldecode($input) : $input);
if (is_null($input)) {
$output = null;
} else {
if (is_string($input) && array_get($_GET, "arrayEncode", array_get($_POST, "arrayEncode", "true")) == "true") {
$output = urldecode($input);
} else {
$output = $input;
}
}
}
return $output;
} catch (Exception $e) {
@@ -112,7 +130,7 @@ class Utility {
public static function js_log($data) {
$data = (is_array($data) || is_object($data)) ? json_encode($data) : $data;
echo "<script>log(\"PHP_LOG: " . str_replace("\"", "'", $data) . " \");</script>";
echo "<script>console.log(\"PHP_LOG: " . str_replace("\"", "'", $data) . " \");</script>";
}
public static function write_log($data, $suffixFile = null, $subfolder = "logs") {
@@ -417,7 +435,7 @@ class Utility {
$hashTrace = md5(json_encode($backtrace));
$fileName = ($unique ? $title : $hashTrace) . ".txt";
if (!array_key_exists("alreadyRunned", $_GLOBAL)) {
if (!array_key_exists("alreadyRunned", $GLOBALS)) {
$_GLOBAL["alreadyRunned"] = array();
}

View File

@@ -1,6 +1,7 @@
<?php
namespace Utility;
use DateTime;
use Exception;
use Format;
@@ -103,12 +104,12 @@ class Date {
return is_number($yy) && (is_number($min) && $yy >= $min) && (is_number($max) && $yy <= $max);
}
public static function isValidUnixtime($t) {
return !is_null($t) && (is_integer($t) || ((string)(int)$t === $t) && ($t <= PHP_INT_MAX) && ($t >= ~PHP_INT_MAX));
public static function isValidUnixtime($t, $numberOnly = false) {
return is_integer($t) || (!$numberOnly && (string)(int)$t === $t && $t >= ~PHP_INT_MAX && $t <= PHP_INT_MAX);
}
public static function isValidWeekDay($day) {
return !is_null($day) && is_numeric($day) && (int)$day >= 1 && (int)$day <= 7;
return is_numeric($day) && (int)$day >= 1 && (int)$day <= 7;
}
public static function isBetween($t, $tFrom, $tTo) {

View File

@@ -0,0 +1,15 @@
<?php
namespace Utility\Entity;
class MtbPartitaMagUtility {
public static function suggestCodePartitaMag($codMart, $partitaMag, $codAnag, $gestione, $dataProd, $numOrd, $codJfas, $len = 5) {
$query = new \Query("SELECT dbo.f_suggestCodePartitaMag('[params]', [len]) AS partita_mag");
$query
->setVar("params", $codMart . ";" . $partitaMag . ";" . $codAnag . ";" . $gestione . ";" . $dataProd . ";" . $numOrd . ";" . $codJfas)
->setVar("len", $len);
return $query->toRet(false)->firstRowFirstValue()->execute();
}
}

View File

@@ -405,10 +405,14 @@ class File {
public static function rearrangeFilesArray($filePost) {
$fileArray = array();
for ($i = 0; $i < count($filePost["name"]); $i++) {
foreach (array_keys($filePost) as $key) {
$fileArray[$i][$key] = $filePost[$key][$i];
if (is_array($filePost["name"])) {
for ($i = 0; $i < count($filePost["name"]); $i++) {
foreach (array_keys($filePost) as $key) {
$fileArray[$i][$key] = $filePost[$key][$i];
}
}
} else {
$fileArray[] = $filePost;
}
return $fileArray;

View File

@@ -42,9 +42,9 @@ class UtilityTextiles {
}
// FOTO DETTAGLI COLORI
$imageListColori = array();
$Ret = self::getColoriArticolo($codStyle);
if ($Ret->is_OK()) {
$imageListColori = array();
$codColList = array_map(function ($x) {
return $x["cod_col"];
}, $Ret->get_data());

View File

@@ -73,7 +73,8 @@
"libs": [
"std-pkg",
"jquery-uiDatepicker",
"jquery-dropzone"
"jquery-dropzone",
"kendo"
],
"requirePermission": false
},
@@ -679,7 +680,6 @@
"std-pkg",
"jquery-uiDatepicker",
"leaflet",
"firebase",
"select2",
"fullcalendar",
"tooltip"
@@ -1070,7 +1070,8 @@
"bootstrap-select",
"jquery-dateRangePicker",
"select2",
"air-datepicker"
"air-datepicker",
"tooltip"
],
"requirePermission": true
},
@@ -1836,231 +1837,6 @@
],
"requirePermission": true
},
"contatti_commesse_integry": {
"title": "Commesse",
"pages": "contatti_commesse_integry.php",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"icon": "icon-c.png",
"libs": [
"std-pkg",
"jquery-uiDatepicker",
"leaflet",
"firebase",
"select2",
"fullcalendar",
"tooltip"
],
"children": [
"catalogo",
"std_utils"
],
"requirePermission": true
},
"contatti_commesse_integry-clienti": {
"title": "Clienti",
"pages": "contatti_commesse_integry.php?clienti",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"libs": [
"std-pkg",
"jquery-uiDatepicker"
],
"requirePermission": true
},
"contatti_commesse_integry-agenda-mensile": {
"title": "Planner mensile",
"pages": "contatti_commesse_integry.php?monthPlanner",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"icon": "icon-calendar.png",
"libs": [
"std-pkg",
"jquery-uiDatepicker"
],
"requirePermission": true
},
"contatti_commesse_integry-agenda-settimanale": {
"title": "Planner settimanale",
"pages": "contatti_commesse_integry.php?weekPlanner",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"icon": "icon-calendar.png",
"libs": [
"std-pkg",
"jquery-uiDatepicker"
],
"requirePermission": true
},
"contatti_commesse_integry-agenda": {
"title": "Planner",
"pages": "contatti_commesse_integry.php?planner",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"icon": "icon-calendar-new.png",
"libs": [
"std-pkg",
"jquery-uiDatepicker"
],
"requirePermission": true
},
"contatti_commesse_integry-attivita": {
"title": "Attivit&agrave;",
"pages": "contatti_commesse_integry.php?attivita",
"position": [
{
"title": "Commesse",
"url": "contatti_commesse_integry.php"
},
{
"title": "Attivit&agrave;",
"url": "contatti_commesse_integry.php?attivita"
},
{
"title": "Clienti",
"url": "contatti_commesse_integry.php?clienti"
},
{
"title": "Planner mensile",
"url": "contatti_commesse_integry.php?monthPlanner"
},
{
"title": "Planner settimanale",
"url": "contatti_commesse_integry.php?weekPlanner"
},
{
"title": "Planner",
"url": "contatti_commesse_integry.php?planner"
}
],
"icon": "icon-a.png",
"sqlNotification": "index-notification.sql",
"libs": [
"std-pkg",
"jquery-uiDatepicker"
],
"requirePermission": true
},
"fabb_linea": {
"title": "Fabbisogno per Linea",
"pages": "fabb_linea.php",
@@ -2219,7 +1995,8 @@
"requirePermission": true
},
"pian_acc_rossg": {
"title": "Pianificazione e Accettazione",
"title": "Accettazione da raccolta in campo",
"shortTitle": "Accettazione da campo",
"pages": "pian_acc_rossg.php",
"position": [],
"children": [],
@@ -2304,5 +2081,17 @@
"visibility"
],
"requirePermission": true
},
"fabb_olio_linea": {
"title": "Fabbisogno olio per linea",
"pages": "fabb_olio_linea.php",
"position": [],
"children": [],
"icon": "icon.png",
"libs": [
"std-pkg",
"kendo"
],
"requirePermission": true
}
}

View File

@@ -147,6 +147,10 @@ if(isset($_SESSION["sqldriver"])){
Utility::write_log($_SESSION["sqldriver"], "sqlDriver");
}*/
if (extension_loaded("sodium") && isset($_SESSION) && !isset($_SESSION["keypair"])) {
$_SESSION["keypair"] = sodium_crypto_box_keypair();
}
//set headers to NOT cache a page
header("Cache-Control: no-cache, no-store, must-revalidate"); //HTTP 1.1
//header("Pragma: no-cache"); //HTTP 1.0

View File

@@ -778,6 +778,15 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
// height: "84vh",
scrollable: false,
editable: true,
pdf: {
fileName: "Budget",
landscape: true,
allPages: true,
margin: {left: "1mm", right: "1mm", top: "1mm", bottom: "1mm"},
paperSize: "A4",
scale: 0.5,
avoidLinks: true
},
toolbar: [
{
// language=HTML
@@ -795,6 +804,10 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
<span class="k-button-text">Annulla modifiche</span>
</button>
`
},
{
text: "Esporta PDF",
name: "pdf"
}
],
dataBound: (e) => {
@@ -886,13 +899,13 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
...options.data
})
.noticeAsToast()
.execute();
.execute<Array<{
id_bdg: number
}>>();
const savedIdBdg = localStorage.getItem(LAST_ID_BDG_KEY) || undefined;
if (savedIdBdg && (ret?.returnData as Array<{
id_bdg
}>).map(bdg => bdg.id_bdg).find(idBdg => idBdg.toString() === savedIdBdg)) {
if (savedIdBdg && ret?.returnData.map(bdg => bdg.id_bdg).find(idBdg => idBdg.toString() === savedIdBdg)) {
this.store.idBdg = savedIdBdg;
}
@@ -921,9 +934,9 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
.get("getAnalisiBudget")
.data(data)
.noticeAsModal()
.execute();
.execute<RetGetAnalisiBudget>();
return ret?.returnData as RetGetAnalisiBudget;
return ret?.returnData;
}
async updateAnalisiBudget(budget: Budget) {

View File

@@ -1,2 +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 */
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 */

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 261 KiB

View File

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 226 KiB

View File

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 324 KiB

View File

@@ -177,29 +177,34 @@ function setRadioOptions($valoreRif) {
<?php } ?>
<?php
foreach ($pesi as $peso) {
$chunksCQR = array_chunk($peso["dtbOrdCQR"], 6, true);
foreach ($chunksCQR as $chunkCQR) { ?>
<tr>
<?php foreach ($chunkCQR as $dtbOrdCQR) { ?>
$i = 0;
$chunkedPesi = array_chunk($pesi, 8, true);
foreach ($chunkedPesi as $pesi) {
?>
<tr>
<?php
foreach ($pesi as $peso) {
foreach ($peso["dtbOrdCQR"] as $dtbOrdCQR) {
$i++;
?>
<td colspan="1" class="td-pesoCQ" style="text-align: center">
<form>
<input type="hidden" name="num_rip" value='1'>
<input type="hidden" name="key" value='<?= Utility::B64JSON_stringify($key) ?>'>
<input type="hidden" name="id_riga" value='<?= $peso["id_riga"] ?>'>
<label for="pesoCQ">Rilev.
del <?= Date::format($dtbOrdCQR["data_ril"], Format::strftimeDMYHM) ?></label>
<label for="pesoCQ">
Rilevazione n. <span style="font-size: 16px;"><?= $i ?></span><br>
del <?= Date::format($dtbOrdCQR["data_ril"], Format::strftimeDMYHM) ?>
</label>
<input style="background-color: #ffffff; color: #555555" type="number" id="pesoCQ"
class="form-control pesoCQ" name="valore_ril"
value='<?= $dtbOrdCQR ? $dtbOrdCQR["valore_ril"] : "" ?>' disabled>
</form>
</td>
<?php } ?>
</tr>
<?php
}
}
?>
<?php } ?>
</tr>
<?php } ?>
<?php if ($conformita) { ?>
<tr class="tr-separatore">
@@ -232,7 +237,6 @@ function setRadioOptions($valoreRif) {
if (!empty($dtbOrdCQR)) {
$valoreRil = $dtbOrdCQR[0]["valore_ril"];
}
?>
<td style="text-align: center;" class="td-conformita">
<form>
@@ -291,6 +295,7 @@ function setRadioOptions($valoreRif) {
<tr>
<?php
$i = 0;
foreach ($manutenzioniImpianti as $manutenzione) {
$i++;
?>
@@ -304,6 +309,7 @@ function setRadioOptions($valoreRif) {
<tr>
<?php
$i = 0;
foreach ($manutenzioniImpianti as $manutenzione) {
$i++;
$dtbOrdCQR = $manutenzione["dtbOrdCQR"];
@@ -313,7 +319,6 @@ function setRadioOptions($valoreRif) {
if (!empty($dtbOrdCQR)) {
$valoreRil = $dtbOrdCQR[0]["valore_ril"];
}
?>
<td style="text-align: center;" <?= $i === 1 ? 'colspan="2"' : '' ?>>
<form>
@@ -347,4 +352,4 @@ function setRadioOptions($valoreRif) {
<?php } ?>
</tr>
</table>
<?
<?php

View File

@@ -62,8 +62,7 @@ AND mr.ser_collo = '[serCollo]'
AND mr.gestione = '[gestione]'
AND mr.cod_mart = '[codMart]'");
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMYHMS, $mtbColKey["dataCollo"]);
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMY, $mtbColKey["dataCollo"]);
$query
->setVar("gestione", $mtbColKey["gestione"])

View File

@@ -62,8 +62,7 @@ AND mr.ser_collo = '[serCollo]'
AND mr.gestione = '[gestione]'
AND mr.cod_mart = '[codMart]'");
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMYHMS, $mtbColKey["dataCollo"]);
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMY, $mtbColKey["dataCollo"]);
$query
->setVar("gestione", $mtbColKey["gestione"])

View File

@@ -62,8 +62,7 @@ AND mr.ser_collo = '[serCollo]'
AND mr.gestione = '[gestione]'
AND mr.cod_mart = '[codMart]'");
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMYHMS, $mtbColKey["dataCollo"]);
$dataC = \DateTime::createFromFormat(\Format::strtotimeDMY, $mtbColKey["dataCollo"]);
$query
->setVar("gestione", $mtbColKey["gestione"])
@@ -71,6 +70,7 @@ AND mr.cod_mart = '[codMart]'");
->setDateVar("dataCollo", $dataC->getTimestamp())
->setVar("serCollo", $mtbColKey["serCollo"])
->setVar("codMart", $codMart);
return $query->toRet(false)->date2ts(true)->firstRow()->execute();
}

View File

@@ -3,15 +3,28 @@
<table class="table table-bordered">
<thead>
<tr class="font-size-15">
<th colspan="3" class="text-center font-weight-bold">Fermi macchina</th>
<th colspan="5" class="text-center font-weight-bold">Fermi macchina</th>
</tr>
<tr class="font-size-15">
<?php foreach ($fermiMacchina as $fermoMacchina) { ?>
<td class="vertical-middle col-sm-4 text-center">
<?php
$i = 0;
foreach ($fermiMacchina as $fermoMacchina) {
$i++;
$colWidth = "3";
if ($i === 3) {
$colWidth = "4";
} else if ($i === 4) {
$colWidth = "2";
}
?>
<td class="vertical-middle col-sm-<?= $colWidth ?> text-center">
<?= $fermoMacchina["controllo"] ?>
</td>
<?php } ?>
<td class="vertical-middle col-sm-4 text-center">
<td class="vertical-middle col-sm-1 text-center">
Pulsanti
</td>
</tr>
@@ -41,7 +54,7 @@
$valoreRil = array_get($ripetizione, "valore_ril", "");
$numRip = array_get($ripetizione, "num_rip", 0);
?>
<td class="vertical-middle col-sm-4 text-center"
<td class="vertical-middle col-sm-3 text-center"
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
data-controllo="<?= $fermoMacchina['controllo'] ?>">
<div class="col-sm-12 input-group mb-6">
@@ -52,7 +65,14 @@
data-num_rip="<?= $i ?>"
data-prev="<?= $valoreRil ?>"
value="<?= $valoreRil ?>"
autocomplete="one-time-code" style="background-color: #fff;" readonly>
autocomplete="one-time-code" style="background-color: #fff;">
<span class="saveDate btn input-group-addon py-0"
style="height: 35px; <?= $i !== end($righePiene) ? "" : "cursor: pointer" ?>"
title="Salva Data">
<span class='p-0'>
<i class="fa fa-save text-success"></i>
</span>
</span>
<?php } else { ?>
<input type="text" class="form-control controlInput"
data-id_riga="<?= $fermoMacchina["id_riga"] ?>"
@@ -62,7 +82,7 @@
</div>
</td>
<?php } ?>
<td class="vertical-middle col-sm-4 text-center" data-repetitions=<?= $maxNumRip ?>>
<td class="vertical-middle col-sm-1 text-center" data-repetitions=<?= $maxNumRip ?>>
<div class="col-sm-12 input-group mb-6">
<span class="plusRow btn input-group-addon py-0 <?= $i !== end($righePiene) ? "disabled" : "" ?>"
style="height: 35px; <?= $i !== end($righePiene) ? "" : "cursor: pointer" ?>"

View File

@@ -89,9 +89,21 @@ CQ_DR03P06.prototype.initButtons = function ($tr) {
$deleteRow.on("click", _.bind(self.onDeleteRowClick, self));
const $dateTimePicker = $tr.find(".dateTimePicker");
const onSelectDateTime = _.debounce((inst) => {
inst.$el.trigger("change");
}, 2000);
const $saveDate = $(".saveDate");
const test = $dateTimePicker.parent().find(".saveDate");
$saveDate.on("click", function (e) {
const $dateTimePicker = $(this).parent().find(".dateTimePicker");
console.log($dateTimePicker)
$dateTimePicker.trigger("change");
})
console.log($saveDate);
console.log(test);
// const onSelectDateTime = _.debounce((inst) => {
// inst.$el.trigger("change");
// }, 5000);
let lastDate;
@@ -105,9 +117,9 @@ CQ_DR03P06.prototype.initButtons = function ($tr) {
onSelect: function (formattedDate, date, inst) {
const value = inst.$el.val();
if (lastDate === "" || lastDate !== value) {
onSelectDateTime(inst);
}
// if (lastDate === "" || lastDate !== value) {
// onSelectDateTime(inst);
// }
},
onShow: function (inst) {
const value = inst.$el.val();

View File

@@ -54,11 +54,12 @@ class CQDR03P06 {
}
}
$processingOrder = $data['key']['num_ord']; /* num. ordine di lavorazione */
$processingDate = $data['key']['data_ord']; /* data unix dell'ordine di lavorazione */
$management = $data['key']['gestione']; /* gestione */
$key = array_get($data, "key");
$processingOrder = $key['num_ord']; /* num. ordine di lavorazione */
$processingDate = $key['data_ord']; /* data unix dell'ordine di lavorazione */
$management = $key['gestione']; /* gestione */
$mtbAart = MonitoraggioLineeV2::getMtbAart($data['key']["cod_prod"]);
$mtbAart = MonitoraggioLineeV2::getMtbAart(array_get($key, "cod_prod"));
$groupedDtbOrdCQ = array();
@@ -187,9 +188,8 @@ $CQDR03P06 = new CQDR03P06($arr_cq);
</table>
<?php } ?>
<?php
if ($mtbAart["cod_mgrp"] === "SL" && count($fermiMacchina) > 0) {
if (array_get($mtbAart, "cod_mgrp") === "SL" && count($fermiMacchina) > 0) {
include "cq_DR03P06-SL.php";
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -14,11 +14,12 @@ class MainHandlerAzienda extends DefaultHandler {
$ret = new Ret();
$codMdep = $order["codMdep"];
$gestSetupDepo = new GestSetupDepo;
$checkOrdine = $gestSetupDepo->keySection("FLAG_CHECK_ORDINE_DI_SCARICO")->cod_mdep($codMdep)->defaultValue(0)->get();
$checkOrdine = intval($gestSetupDepo->keySection("FLAG_CHECK_ORDINE_DI_SCARICO")->cod_mdep($codMdep)->defaultValue(0)->get());
if ($checkOrdine !== 0) {
$ret = \MonitoraggioLineeV2::checkTracciabilita($order, $codJfas);
$arrMateriali = $ret->get_data();
if ($ret->is_OK() && $arrMateriali && count($arrMateriali) > 0) {
$stringMaterialiSenzaPriorita = "";

View File

@@ -886,13 +886,13 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
...options.data
})
.noticeAsToast()
.execute();
.execute<Array<{
id_bdg: number
}>>();
const savedIdBdg = localStorage.getItem(LAST_ID_BDG_KEY) || undefined;
if (savedIdBdg && (ret?.returnData as Array<{
id_bdg
}>).map(bdg => bdg.id_bdg).find(idBdg => idBdg.toString() === savedIdBdg)) {
if (savedIdBdg && ret?.returnData.map(bdg => bdg.id_bdg).find(idBdg => idBdg.toString() === savedIdBdg)) {
this.store.idBdg = savedIdBdg;
}
@@ -921,9 +921,9 @@ export default class AgricoperAnalisiBudget extends AnalisiBudget {
.get("getAnalisiBudget")
.data(data)
.noticeAsModal()
.execute();
.execute<RetGetAnalisiBudget>();
return ret?.returnData as RetGetAnalisiBudget;
return ret?.returnData;
}
async updateAnalisiBudget(budget: Budget) {

View File

@@ -1,3 +1,5 @@
SELECT DISTINCT ART_FAMI_DESC AS famiglia, ART_FAMI_DESC AS label
FROM RossoGarganoExchange.dbo.WARTICOLI_TAB
ORDER BY ART_FAMI_DESC
SELECT DISTINCT ms.descrizione AS famiglia, ms.descrizione AS label
FROM mtb_sgrp ms
INNER JOIN mtb_grup mg ON ms.cod_mgrp = mg.cod_mgrp
WHERE tipo_mgrp IN ('SL', 'PF')
ORDER BY ms.descrizione

View File

@@ -1,4 +1,5 @@
SELECT DISTINCT ART_FORMATOD AS formato, ART_FORMATOD AS label
FROM RossoGarganoExchange.dbo.WARTICOLI_TAB
WHERE ART_CODICE NOT LIKE 'i%'
ORDER BY ART_FORMATOD
SELECT DISTINCT mt.descrizione AS formato, mt.descrizione AS label
FROM mtb_aart ma
INNER JOIN mtb_tipi mt ON ma.cod_mtip = mt.cod_mtip
INNER JOIN mtb_grup mg ON ma.cod_mgrp = mg.cod_mgrp AND mg.tipo_mgrp IN ('SL', 'PF')
ORDER BY mt.descrizione

View File

@@ -1,5 +1,5 @@
import BasePopup from "@js/BasePopup.js";
import {Mezzo, OperationType, VtbVett, VtbViaggi} from "@js/ims/ems-core.module.js";
import {Mezzo, OperationType, ServiceRestResponse, VtbVett, VtbViaggi} from "@js/ims/ems-core.module.js";
import {getListAutomezzi, getListVettori} from "@js/api/stdutils.js";
export class CreaViaggioForm implements kendo.ui.FormData {
@@ -12,6 +12,8 @@ export class CreaViaggioForm implements kendo.ui.FormData {
targa: string;
numPrenotazione: string;
mezzo: Mezzo;
posizione: number;
confermato: boolean;
constructor(data: VtbViaggi = null) {
this.codAuto = data?.codAuto;
@@ -23,17 +25,22 @@ export class CreaViaggioForm implements kendo.ui.FormData {
this.targa = data?.targa;
this.numPrenotazione = data?.numPrenotazione;
this.mezzo = data?.mezzo || Mezzo.VETTORE;
this.posizione = data?.posizione || 0;
this.confermato = data?.confermato || false;
}
}
export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
private readonly isEditable: boolean
private readonly formData: CreaViaggioForm
private kendoForm: kendo.ui.Form
private promise: Promise<VtbViaggi>
constructor(viaggio: VtbViaggi, module: Module | null = null) {
constructor(viaggio: VtbViaggi, isEditable: boolean, module: Module | null = null) {
super("delivery_plan", module);
this.isEditable = isEditable;
this.formData = new CreaViaggioForm(viaggio);
this.formData.dataOraInizTrasp ??= new Date();
@@ -108,6 +115,9 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
title: "Mezzo",
colSpan: 1,
editor: "DropDownList",
attributes: {
disabled: !this.isEditable
},
editorOptions: {
dataTextField: "text",
dataValueField: "value",
@@ -175,7 +185,8 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
title: "Vettore",
colSpan: 1,
attributes: {
class: "hide-form"
class: "hide-form",
disabled: !this.isEditable
},
editor: "DropDownList",
editorOptions: {
@@ -218,6 +229,7 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
return $btn;
},
dataBound: (e) => e.sender.list.find(".k-list-optionlabel").text("Rimuovi"),
autoBind: this.isEditable,
dataSource: {
sort: {
field: "ragSoc",
@@ -276,6 +288,7 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
optionLabel: "Seleziona l'automezzo",
valuePrimitive: true,
dataBound: (e) => e.sender.list.find(".k-list-optionlabel").text("Rimuovi"),
autoBind: this.isEditable,
dataSource: {
sort: {
field: "descrizione",
@@ -334,11 +347,28 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
// }
// } as kendo.ui.SwitchOptions,
// },
{
field: "posizione",
label: "Posizione",
title: "Posizione",
colSpan: 1,
attributes: {
disabled: !this.isEditable
},
editor: "NumericTextBox",
editorOptions: {
selectOnFocus: true,
min: 0,
max: 32767,
decimals: 0,
format: "n0"
}
},
{
field: "dataOraInizTrasp",
label: "Data Inizio Trasporto",
title: "Data Inizio Trasporto",
colSpan: 2,
colSpan: 1,
editor: "DateTimePicker",
editorOptions: {
min: moment(this.formData.dataOraInizTrasp).startOf("day").toDate()
@@ -368,6 +398,10 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
colSpan: 2,
editor: "TextBox",
},
{
field: "confermato",
label: "Confermato",
}
]
}).data("kendoForm");
@@ -411,7 +445,7 @@ export default class PopupCreaViaggio extends BasePopup<VtbViaggi> {
.get("creaViaggio")
.data(data)
.noticeAsModal()
.execute();
.execute<ServiceRestResponse>();
return {
...data,

View File

@@ -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-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 */
[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.text-center{text-align:center !important}[id^=table-].k-grid .k-grid-header .k-table-th.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-grid-header .k-table-row:first-child:has(.confermato),[id^=table-].k-grid .k-grouping-header .k-table-row:first-child:has(.confermato),[id^=table-].k-grid .k-grid-add-row .k-table-row:first-child:has(.confermato),[id^=table-].k-grid .k-grid-footer .k-table-row:first-child:has(.confermato){background-color:#69e56d}[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 */

View File

@@ -7,6 +7,7 @@ import {numberStyle, numberToColor} from "@js/utils.js";
import round from "lodash-es/round.js";
import mapKeys from "lodash-es/mapKeys.js";
import camelCase from "lodash-es/camelCase.js";
import orderBy from "lodash-es/orderBy.js";
export class Riepilogo extends kendo.data.Model.define({
id: "id",
@@ -23,8 +24,13 @@ export class Riepilogo extends kendo.data.Model.define({
vettore: {type: "string"},
cod_auto: {type: "string"},
automezzo: {type: "string"},
flag_ritir_clie: {type: "string"},
note_viag: {type: "string"},
flag_ritir_clie: {type: "string"},
targa: {type: "string"},
num_prenotazione: {type: "string"},
mezzo: {type: "number"},
posizione: {type: "number"},
confermato: {type: "boolean"},
gestione: {type: "string"},
data_ord: {type: "date"},
num_ord: {type: "number"},
@@ -67,6 +73,8 @@ export class Riepilogo extends kendo.data.Model.define({
targa: string
num_prenotazione: string
mezzo: Mezzo
posizione: number
confermato: boolean
gestione: string
data_ord: Date
num_ord: number
@@ -142,6 +150,18 @@ const onSave = async (grid: kendo.ui.Grid) => {
await grid.dataSource.sync();
}
enum MenuTableRiepiloghi {
creaViaggio = "creaViaggio",
assegnaViaggio = "assegnaViaggio",
associaPedana = "associaPedana",
annullaPedana = "annullaPedana"
}
enum MenuViaggio {
modificaViaggio = "modificaViaggio",
cancellaViaggio = "cancellaViaggio"
}
export default class PopupRiepGiorno extends BasePopup {
private readonly dataCons: Moment
private riepiloghi: Record<string, Array<Riepilogo>>
@@ -301,28 +321,17 @@ export default class PopupRiepGiorno extends BasePopup {
const scrollTop = this.modalBox.$div.find(".modal-body").scrollTop();
const riepiloghi = await this.getRiepiloghi({dataCons: this.dataCons.unix()});
const riepiloghi = orderBy(await this.getRiepiloghi({dataCons: this.dataCons.unix()}), ["posizione", "sort", "nazionalita", "id_viaggio", "data_ora_iniz_trasp"]);
this.riepiloghi = groupBy(riepiloghi, (riepilogo: Riepilogo) => `${riepilogo.sort}-${riepilogo.nazionalita || ""}-${riepilogo.id_viaggio || ""}-${riepilogo.data_ora_iniz_trasp || ""}`) as Record<string, Array<Riepilogo>>;
this.riepiloghi = groupBy(riepiloghi, (riepilogo: Riepilogo) => `${riepilogo.posizione}~${riepilogo.sort}~${riepilogo.nazionalita || ""}~${riepilogo.id_viaggio || ""}~${riepilogo.data_ora_iniz_trasp || ""}`) as Record<string, Array<Riepilogo>>;
if (this.tables) {
if (this.tables?.length) {
this.tables.forEach(table => table.grid.destroy());
this.modalBox.$div.find(".panel-body").html("");
}
this.tables = Object.entries(this.riepiloghi)
.sort(([a], [b]) => {
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
})
.map(([title, riepiloghi], index) => {
console.log(riepiloghi);
const firstRiepilogo = riepiloghi[0];
@@ -330,7 +339,7 @@ export default class PopupRiepGiorno extends BasePopup {
const columns = _kendo.setDefaultCellOptions([
{
id: "e2dd706a-ec44-4f69-896b-7330c15e7b2f",
title: firstRiepilogo.data_ora_iniz_trasp && `ID: ${firstRiepilogo.id_viaggio}<br>ORA PARTENZA: ${moment(firstRiepilogo.data_ora_iniz_trasp).format("HH:mm")}` || "",
title: firstRiepilogo.data_ora_iniz_trasp && `<span class='${firstRiepilogo.confermato && "confermato" || ""}'>ID: ${firstRiepilogo.id_viaggio}<br>ORA PARTENZA: ${moment(firstRiepilogo.data_ora_iniz_trasp).format("HH:mm")}</span>` || "",
columns: [
{
id: "7e281934-0241-4f35-98cf-f5e6df253eef",
@@ -437,7 +446,10 @@ export default class PopupRiepGiorno extends BasePopup {
},
{
id: "e761b24b-29bd-40c6-906e-e69971e4b16a",
headerTemplate: numberStyle(Object.values(groupBy(riepiloghi, "id_ord") as Record<string, Array<Riepilogo>>).map(riepiloghi => riepiloghi[0].posti_pallet || riepiloghi.map(riepilogo => riepilogo.pedane_ord).reduce((a, b) => a + b, 0)).reduce((a, b) => a + b, 0), "right"),
headerAttributes: {
class: "text-right"
},
headerTemplate: numberStyle(Object.values(groupBy(riepiloghi, "id_ord") as Record<string, Array<Riepilogo>>).map(riepiloghi => riepiloghi[0].posti_pallet || riepiloghi.map(riepilogo => riepilogo.pedane_ord).reduce((a, b) => a + b, 0)).reduce((a, b) => a + b, 0)),
columns: [
{
id: "eda00bf7-aa54-4675-94db-af1afb71e834",
@@ -492,7 +504,7 @@ export default class PopupRiepGiorno extends BasePopup {
},
{
id: "7e54b38c-2271-424f-8d7f-6e484bae5dca",
title: firstRiepilogo.note_viag && `${firstRiepilogo.note_viag.replaceAll("\n", "<br>")}` || "",
title: firstRiepilogo.note_viag && `${firstRiepilogo.note_viag.replaceAll("\n", "<br>").replaceAll('"', "''")}` || "",
columns: [
{
id: "95c5b224-5725-4011-9b7a-69c5dfa1c737",
@@ -714,6 +726,8 @@ export default class PopupRiepGiorno extends BasePopup {
}
});
e.sender.element.find(".k-group-cell").first().addClass("text-center").text(firstRiepilogo.posizione || "");
// $(".k-grouping-row").each(function () {
// const groupKey = rowGroupKey($(this), e.sender);
//
@@ -784,21 +798,21 @@ export default class PopupRiepGiorno extends BasePopup {
text: "Crea Viaggio",
spriteCssClass: "fa fa-truck",
attr: {
"data-command": "creaViaggio"
"data-command": MenuTableRiepiloghi.creaViaggio
}
},
{
text: "Assegna Viaggio",
spriteCssClass: "fa fa-dolly",
attr: {
"data-command": "assegnaViaggio"
"data-command": MenuTableRiepiloghi.assegnaViaggio
}
},
{
text: "Associa Stessa Pedana",
spriteCssClass: "fa fa-pallet-alt",
attr: {
"data-command": "associaPedana"
"data-command": MenuTableRiepiloghi.associaPedana
}
},
];
@@ -810,7 +824,7 @@ export default class PopupRiepGiorno extends BasePopup {
text: "Annulla Associazione Pedana",
spriteCssClass: "fa fa-minus",
attr: {
"data-command": "annullaPedana"
"data-command": MenuTableRiepiloghi.annullaPedana
}
}
]
@@ -839,15 +853,15 @@ export default class PopupRiepGiorno extends BasePopup {
const riepiloghi = grid.dataItems()
.filter((riepEl: Riepilogo) => selectedDataItems.some(riepilogo => riepEl.id_ord === riepilogo.id_ord)) as Riepilogo[];
const command = $(e.item).data("command");
const command = $(e.item).data<MenuTableRiepiloghi>("command");
try {
switch (command) {
case "creaViaggio": {
case MenuTableRiepiloghi.creaViaggio: {
const {idViaggio, dataOraInizTrasp} = await new PopupCreaViaggio(new VtbViaggi({
type: "vtb_viaggi",
dataOraInizTrasp: this.dataCons.toDate()
}), this.module).open();
}), isEditable, this.module).open();
if (idViaggio) {
riepiloghi.forEach(riepilogo => {
@@ -858,7 +872,7 @@ export default class PopupRiepGiorno extends BasePopup {
break;
}
case "assegnaViaggio": {
case MenuTableRiepiloghi.assegnaViaggio: {
const {
idViaggio,
confirmed
@@ -870,15 +884,15 @@ export default class PopupRiepGiorno extends BasePopup {
break;
}
case "associaPedana": {
case MenuTableRiepiloghi.associaPedana: {
const gruppoCons = Math.max(...grid.dataSource.data().toJSON().map((dataItem: Riepilogo) => parseInt(dataItem.gruppo_cons) || 0)) + 1;
selectedDataItems.forEach(riepilogo => riepilogo.set("gruppo_cons", gruppoCons));
break;
}
case "annullaPedana": {
selectedDataItems.forEach(riepilogo => riepilogo.set("gruppo_cons", null));
case MenuTableRiepiloghi.annullaPedana: {
selectedDataItems.forEach(riepilogo => riepilogo.set("gruppo_cons", ""));
break;
}
@@ -924,7 +938,7 @@ export default class PopupRiepGiorno extends BasePopup {
open: (e) => {
const grid = $(e.target).parents(".k-grid").data("kendoGrid");
if (!isEditable || !grid) {
if (!grid) {
e.preventDefault();
}
@@ -938,16 +952,16 @@ export default class PopupRiepGiorno extends BasePopup {
text: "Modifica Viaggio",
spriteCssClass: "fa fa-truck",
attr: {
"data-command": "modificaViaggio"
"data-command": MenuViaggio.modificaViaggio
}
},
{
...isEditable && [{
text: "Cancella Viaggio",
spriteCssClass: "fa fa-trash",
attr: {
"data-command": "cancellaViaggio"
"data-command": MenuViaggio.cancellaViaggio
}
},
}] || [],
];
e.sender.append(menu);
@@ -966,18 +980,18 @@ export default class PopupRiepGiorno extends BasePopup {
const riepiloghi = grid.dataSource.data().map(item => item) as Riepilogo[];
if (riepiloghi?.length) {
const command = $(e.item).data("command");
const command = $(e.item).data<MenuViaggio>("command");
try {
switch (command) {
case "modificaViaggio": {
case MenuViaggio.modificaViaggio: {
const riepilogo = riepiloghi[0];
const {idViaggio, dataOraInizTrasp} = await new PopupCreaViaggio(new VtbViaggi({
...mapKeys(riepilogo, (_, k) => camelCase(k)),
note: riepilogo.note_viag,
flagRitirClie: riepilogo.flag_ritir_clie === "true"
}), this.module).open();
}), isEditable, this.module).open();
if (idViaggio && dataOraInizTrasp) {
riepiloghi.forEach(riepilogo => {
@@ -989,10 +1003,10 @@ export default class PopupRiepGiorno extends BasePopup {
break;
}
case "cancellaViaggio": {
case MenuViaggio.cancellaViaggio: {
const idViaggio = riepiloghi[0].id_viaggio;
riepiloghi.forEach(riepilogo => riepilogo.set("id_viaggio", null));
riepiloghi.forEach(riepilogo => riepilogo.set("id_viaggio", ""));
await grid.dataSource.sync();
@@ -1255,9 +1269,9 @@ export default class PopupRiepGiorno extends BasePopup {
.get("getRiepiloghi")
.data(data)
.noticeAsModal()
.execute();
.execute<Array<Riepilogo>>();
return ret?.returnData as Array<Riepilogo>;
return ret?.returnData;
}
async updateRiepiloghi(riepilogo: Riepilogo) {
@@ -1275,9 +1289,9 @@ export default class PopupRiepGiorno extends BasePopup {
.get("getViaggi")
.data({dataOraInizTrasp: data.dataOraInizTrasp.unix()})
.noticeAsModal()
.execute();
.execute<Array<Viaggio>>();
return ret?.returnData as Array<Viaggio>;
return ret?.returnData;
}
async deleteViaggio(data: { idViaggio: string }): Promise<boolean> {

View File

@@ -4,7 +4,11 @@
font-weight: bold;
text-align: left !important;
&:has(.text-right) {
&.text-center {
text-align: center !important;
}
&.text-right {
text-align: right !important;
}
}
@@ -13,6 +17,10 @@
& .k-table-row {
&:first-child {
background-color: #bababa;
&:has(.confermato) {
background-color: #69e56d;
}
}
background-color: #dedede;

View File

@@ -1,100 +0,0 @@
<?
$cq = $CQDR03P06->getCqOrdine(\CQDR03P06::PESO);
$idRiga = !is_null($cq) ? $cq["id_riga"] : null;
$valoreRif = !is_null($cq) ? $cq["valore_rif"] : null;
$valoreMin = !is_null($valoreRif) ? $valoreRif / 100 * 99.76 : null;
?>
<div data-cq_panel="peso" class="panel panel-default panel-collapsible xcollapsed" data-id_riga="<?= $idRiga ?>"
data-controllo="<?= \CQDR03P06::PESO ?>" data-valore_rif="<?= $valoreRif ?>" data-valore_min="<?= $valoreMin ?>">
<div class="panel-heading p-4 text-uppercase font-weight-bold">
Controllo Peso
</div>
<div class="panel-body"><?
if (!is_null($cq)) {
$qtaInProd = $ordineLav["qta_prod"] * $ordineLav["rap_conv_prod"];
$numConf = $ordineLav["qta_cnf"] != 0 ? $qtaInProd / $ordineLav["qta_cnf"] : 0;
$untMisRif = "Gr."
?>
<div class="row">
<div class="col-sm-3">
<div class="input-group input-group-sm mb-6">
<span class="input-group-addon bg-white font-weight-bold text-dark">Val. Rif.</span>
<input type="text" class="form-control bg-white text-dark text-center"
value="<?= number_format($valoreRif, 0, ".", "'") . " " . $untMisRif ?>" readonly="">
</div>
</div>
<div class="col-sm-3">
<div class="input-group input-group-sm mb-6">
<span class="input-group-addon bg-white font-weight-bold text-dark">Val. Min.</span>
<input type="text" class="form-control bg-white text-dark text-center"
value="<?= number_format($valoreMin, 0, ".", "'") . " " . $untMisRif ?>" readonly="">
</div>
</div>
<div class="col-sm-3">
<div class="input-group input-group-sm mb-6">
<span class="input-group-addon bg-white font-weight-bold text-dark">Val. Medio</span>
<input type="text" class="valoreRilMedio form-control bg-white font-weight-bold text-center"
value="" readonly="">
</div>
</div>
<div class="col-sm-3">
<div class="input-group input-group-sm mb-6">
<span class="input-group-addon bg-white font-weight-bold text-dark">Unit&agrave; in prod.</span>
<input type="text" class="form-control bg-white text-dark text-center"
value="<?= number_format($numConf, 0, ".", "'") . " " ?>" readonly="">
</div>
</div>
</div>
<hr class="my-10"/>
<table class="table table-bordered table-condensed">
<tbody><?
$numRil = 0;
$numConfCounter = $numConf;
while ($numConfCounter > 0) {
$numRil += $numConfCounter <= 100 ? $numConfCounter : ($numConfCounter > 100 && $numConfCounter <= 500 ? 30 : ($numConfCounter > 500 && $numConfCounter <= 3200 ? 50 : ($numConfCounter > 3200 && $numConfCounter < 10000 ? 80 : 100)));
$numConfCounter -= 10000;
}
if ($numRil > $cq["num_rip"]) {
$numRil = $cq["num_rip"];
}
$maxcols = 8;
for ($numRip = 1, $col = 0; $numRip <= $numRil; $numRip++, $col++) {
$valoreRil = \CQDR03P06::getValoreRil($cq, $numRip);
if ($numRip == 1) {
echo "<tr>";
} else if ($col == $maxcols) {
$col = 0;
echo "</tr><tr>";
} ?>
<td>
<div class="form-group mb-0">
<div class="input-group input-group-sm">
<label class="input-group-addon">
<?= str_pad($numRip, 2, "0", STR_PAD_LEFT) ?>
</label>
<input data-num_rip="<?= $numRip ?>" value="<?= $valoreRil ?>" type="number" min="0"
class="form-control no-spin-buttons text-monospace"/>
</div>
</div>
</td><?
}
if ($maxcols - $col > 0) {
echo "<td colspan='" . ($maxcols - $col) . "'>&nbsp;</td>";
}/*
while($col < $maxcols){
echo "<td>&nbsp;</td>";
$col++;
}*/
echo "</tr>";
?>
</tbody>
</table><?
} else {
$Alert = new BC\Alert;
$Alert->warning()->text("Non previsto in questo ordine di produzione")->_class("m-0")->show();
} ?>
</div>
</div>

View File

@@ -1,56 +0,0 @@
<div data-cq_panel="prodottoConfezionato" class="panel panel-default panel-collapsible xcollapsed">
<div class="panel-heading p-4 text-uppercase font-weight-bold">
Controllo Prodotto Confezionato
</div>
<div class="panel-body">
<table class="table small table-bordered">
<thead>
<tr>
<th>Descrizione controllo</th>
<th>Avvio Confez.</th>
<th>Durante Confez.</th>
<th>Fine Confez.</th>
</tr>
</thead>
<tbody><?
$arr_cqProdottoConfezionato = array(
\CQDR03P06::AVVINAMENTO_LINEA => array("italic", "fasi" => array(1)),
\CQDR03P06::ASSENZA_MATERIALE_PRODUZIONE_PRECEDENTE => array("italic", "fasi" => array(1)),
\CQDR03P06::CONTROLLO_PRESSIONE_SOFFIATRICE => array("fasi" => array(1, 2, 3)),
\CQDR03P06::CORRETTEZZA_ETICHETTA => array("fasi" => array(1, 2, 3)),
\CQDR03P06::CORRETTEZZA_LOTTO_TMC => array("fasi" => array(1, 2, 3)),
\CQDR03P06::ELIMINAZIONE_MATERIALE_FINE_PRODUZIONE => array("italic", "fasi" => array(3)),
);
foreach ($arr_cqProdottoConfezionato as $cqId => $cqOptions) {
$cq = $CQDR03P06->getCqOrdine($cqId);
$idRiga = !is_null($cq) ? $cq["id_riga"] : null;
$numRil = !is_null($cq) ? $cq["num_rip"] : count($cqOptions["fasi"]);
$controllo = !is_null($cq) ? utf8_decode($cq["controllo"]) : ucwords(strtolower(utf8_decode($cqId)));
?>
<tr class="<?= is_null($cq) ? "disabled_all bg-warning" : "" ?>" data-id_riga="<?= $idRiga ?>">
<td><span class="<?= in_array("italic", $cqOptions) ? "font-italic" : "" ?>"><?= $controllo ?></span>
</td>
<?
$countShow = 0;
for ($numRip = 1; $numRip <= 3; $numRip++) {
if (in_array($numRip, $cqOptions["fasi"]) && $countShow < $numRil) {
$countShow++;
$valoreRil = !is_null($cq) ? \CQDR03P06::getValoreRil($cq, $numRip) : null;
?>
<td class="text-center">
<input type="checkbox" data-num_rip="<?= $numRip ?>" data-valore_ril="<?= $valoreRil ?>"
data-label-text="CONFORME"/>
</td><?
} else {
echo "<td class='bg-dark opacity-20'>&nbsp;</td>";
}
} ?>
</tr><?
} ?>
</tbody>
</table>
</div>
</div>

View File

@@ -1,115 +0,0 @@
<div data-cq_panel="rottureBottiglie" class="panel panel-default panel-collapsible">
<div class="panel-heading p-4 text-uppercase font-weight-bold">
Controllo Rotture Bottiglie
</div>
<div class="panel-body">
<table class="table small table-bordered table-striped table-text-middle">
<thead>
<tr>
<th style="Xwidth: 90px;">Ora</th>
<th style="width: 100px;">Num. bottiglie</th>
<th>Dove</th>
<th>Pulizia effettuata</th>
<th>Nominativo verifica</th>
</tr>
</thead>
<tbody>
<?
$arr_cqRotture = array(
\CQDR03P06::NUM_BOTTIGLIE_ROTTE => array(),
\CQDR03P06::DOVE_BOTTIGLIE_ROTTE => array(),
\CQDR03P06::PULIZIA_BOTTIGLIE_ROTTE => array(),
\CQDR03P06::NOMINATIVO_BOTTIGLIE_ROTTE => array()
);
$numRil = null;
foreach ($arr_cqRotture as $cqId => $cqItem) {
$cq = $CQDR03P06->getCqOrdine($cqId);
if (!is_null($cq)) {
if (is_null($numRil)) {
$numRil = $cq["num_rip"];
} else if ($numRil !== $cq["num_rip"]) {
$numRil = null;
break;
}
} else {
$numRil = null;
break;
}
}
if (zeroIfNull($numRil) > 0) {
for ($numRip = 1; $numRip <= $numRil; $numRip++) {
$oraRil = null;
$arr_dataoraRil = array();
$cq = $CQDR03P06->getCqOrdine(\CQDR03P06::NUM_BOTTIGLIE_ROTTE);
$valoreRilNumBot = \CQDR03P06::getValoreRil($cq, $numRip);
$idRigaNumBot = $cq["id_riga"];
$arr_dataoraRil[] = \CQDR03P06::getDataRil($cq, $numRip);
$cq = $CQDR03P06->getCqOrdine(\CQDR03P06::DOVE_BOTTIGLIE_ROTTE);
$valoreRilDovBot = \CQDR03P06::getValoreRil($cq, $numRip);
$idRigaDovBot = $cq["id_riga"];
$arr_dataoraRil[] = \CQDR03P06::getDataRil($cq, $numRip);
$cq = $CQDR03P06->getCqOrdine(\CQDR03P06::PULIZIA_BOTTIGLIE_ROTTE);
$valoreRilPulBot = \CQDR03P06::getValoreRil($cq, $numRip);
$idRigaPulBot = $cq["id_riga"];
$arr_dataoraRil[] = \CQDR03P06::getDataRil($cq, $numRip);
$cq = $CQDR03P06->getCqOrdine(\CQDR03P06::NOMINATIVO_BOTTIGLIE_ROTTE);
$valoreRilNomBot = \CQDR03P06::getValoreRil($cq, $numRip);
$idRigaNomBot = $cq["id_riga"];
$arr_dataoraRil[] = \CQDR03P06::getDataRil($cq, $numRip);
$arr_dataoraRil = array_values(array_filter($arr_dataoraRil, "strlen")); // rimuove elementi nulli/blanked
if (count($arr_dataoraRil) > 0) {
$dataoraRilAvg = array_sum($arr_dataoraRil) / count($arr_dataoraRil);
$oraRil = Utility\Date::format(intval($dataoraRilAvg), \Format::strftimeHM);
} ?>
<tr data-num_rip="<?= $numRip ?>">
<td>
<div class="form-group form-group-sm mb-0">
<input value="<?= $oraRil ?>" type="time" class="form-control"/>
</div>
</td>
<td data-id_riga="<?= $idRigaNumBot ?>">
<div class="form-group form-group-sm mb-0">
<input name="<?= $idRigaNumBot ?>" value="<?= $valoreRilNumBot ?>" type="number" min="0"
class="form-control no-spin-buttons text-monospace"/>
</div>
</td>
<td data-id_riga="<?= $idRigaDovBot ?>">
<div class="form-group form-group-sm mb-0">
<input name="<?= $idRigaDovBot ?>" value="<?= $valoreRilDovBot ?>" type="text"
maxlength="40" class="form-control text-uppercase"/>
</div>
</td>
<td class="text-center" data-id_riga="<?= $idRigaPulBot ?>">
<input name="<?= $idRigaPulBot ?>" data-controllo="<?= \CQDR03P06::PULIZIA_BOTTIGLIE_ROTTE ?>"
data-valore_ril="<?= $valoreRilPulBot ?>" data-checked_value="S" data-unchecked_value="N"
type="checkbox"/>
</td>
<td data-id_riga="<?= $idRigaNomBot ?>">
<div class="form-group form-group-sm mb-0">
<input name="<?= $idRigaNomBot ?>" value="<?= $valoreRilNomBot ?>" type="text"
maxlength="40" class="form-control text-uppercase"/>
</div>
</td>
</tr><?
}
} else {
echo "<td class='warning text-warning font-weight-bold' colspan='5'>L'ordine non &egrave; stato opportunatamente configurato per la registrazione di questo controllo</td>";
} ?>
</tbody>
</table>
</div>
</div>

View File

@@ -1,3 +1,31 @@
[data-modello_cq="cq_DR03P06"] [data-controllo="PESO"] input[disabled] {
color: #000;
}
}
/*
.plusForRepeatedControls {
display:flex !important;
align-content: center !important;
justify-content: center !important;
}
.plusForRepeatedControls >i {
align-self: center !important;
color: #007BFF;
}
*/
.font-size-15 {
font-size: 15px;
}
.colorRed {
color: red;
}
.table-v_aligned tr td {
vertical-align: middle !important;
}
/*.form-group {*/
/* margin-bottom: unset;*/
/*}*/

View File

@@ -6,19 +6,20 @@ function CQ_DR03P06() {
this._$dom = null;
this._order = null;
this._orderKey = null;
this._codProd = null;
this.const = {
PESO: "PESO"
};
this._onCqrChange = null;
this._onTrashClick = null;
this._generatePdf = null;
this._toast = null;
this._allowToast = true;
this._promise = null;
this._parent = null;
this._codProd = null;
}
CQ_DR03P06.prototype.$dom = function ($dom) {
this._$dom = $dom;
return this;
};
CQ_DR03P06.prototype.codProd = function (codProd) {
this._codProd = codProd;
return this;
@@ -39,174 +40,347 @@ CQ_DR03P06.prototype.onCqrChange = function (f) {
return this;
};
/*
@ function tought to avoid the succeding of multiple toasts
*/
CQ_DR03P06.prototype.allowFollowingToast = function (bool) {
this._allowToast = bool;
return this;
};
CQ_DR03P06.prototype.setOnTrashClick = function (f) {
this._onTrashClick = f;
return this;
};
CQ_DR03P06.prototype.generatePdf = function (f) {
this._generatePdf = f;
return this;
};
CQ_DR03P06.prototype._refreshPanelControlloPeso = function () {
var self = this;
var $controlloPeso = self._$dom.find("[data-controllo='" + self.const.PESO + "']");
var valoreMin = $controlloPeso.getFloatDataAttr("valore_min");
var sumValori = 0;
var lastNumRip = 0;
$controlloPeso.find("input[data-num_rip]").each(function () {
var $input = $(this);
// $input.removeClass("text-success text-warning");
var numRip = $input.getIntDataAttr("num_rip");
var valoreRil = $input.getNumericValue();
if (valoreRil > 0) {
lastNumRip = numRip;
sumValori += valoreRil;
_checkForm.markField_warning($input, valoreRil < valoreMin);
//$input.addClass("text-"+style);
}
});
$controlloPeso.find("input[data-num_rip]").each(function () {
var $input = $(this);
var numRip = $input.getIntDataAttr("num_rip");
$input.enabled(numRip == lastNumRip + 1 || numRip == lastNumRip);
});
var valoreMedio = null, style = "success";
if (sumValori > 0) {
valoreMedio = sumValori / lastNumRip;
var valoreRif = $controlloPeso.getFloatDataAttr("valore_rif");
style = valoreMedio >= valoreRif ? "success" : "warning";
valoreMedio = number_format(valoreMedio, 0, "", "'") + " Gr.";
}
$controlloPeso.find("input.valoreRilMedio").val(valoreMedio).removeClass("text-success text-warning").addClass("text-" + style);
return self;
};
CQ_DR03P06.prototype.init = function () {
CQ_DR03P06.prototype.init = function (o) {
var self = this;
var $dom = self._$dom;
var orderKey = self._orderKey;
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*/
self._refreshPanelControlloPeso();
$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 $controlloPeso = $dom.find("[data-controllo='" + self.const.PESO + "']");
var valoreMin = $controlloPeso.getFloatDataAttr("valore_min");
var $trash = $dom.find("div.input-group > span.trash:not('disabled')");
$trash.on("click", _.bind(self.onTrashClick, self));
}
};
$controlloPeso.find("input[data-num_rip]")
.on("change", function () {
var $input = $(this);
if (!is_null(orderKey) && is_function(self._onCqrChange)) {
var cqr = {
id_riga: $input.closest("[data-id_riga]").getIntDataAttr("id_riga"),
num_rip: $input.getIntDataAttr("num_rip"),
valore_ril: $input.getNumericValue(false),
data_ril: getNow()
};
self._onCqrChange([cqr]).then(function (updateOK) {
if (updateOK) {
self._refreshPanelControlloPeso();
} else {
$input.val("");
}
});
}
})
.on("dblclick", function () {
var $input = $(this);
var valoreRif = $input.closest("[data-valore_rif]").getFloatDataAttr("valore_rif");
$input.val(valoreRif).blur().trigger("change");
})
.on("blur", function () {
var $input = $(this);
var valoreRil = $input.getNumericValue(false);
if (!is_null(valoreRil)) {
_checkForm.markField_warning($input, valoreRil < valoreMin);
}
});
/*
@ adds subsequent input boxes and the relative onclick listeners
*/
CQ_DR03P06.prototype.onPlusClick = function (event) {
var self = this;
var $input = $(event.currentTarget).siblings("input.controlInput");
/**************** if the first measure is empty, don't allow to accede to the second one ************************/
if (!_.isEmpty($input.val())) {
var $td = $(event.currentTarget).closest("td");
/************************ totalRepetitions is the maximum number of inputs allowed ************************************/
var totalRepetitions = parseInt($td.data("repetitions")) + 1;
/*childElementCount corresponds to the number of children of $td, which is the number of input groups*/
var repetitionsLeft = totalRepetitions - $td.find("input.controlInput").length;
$dom.find("input[type='checkbox']").bootstrapSwitch({
size: "mini",
onColor: "success",
offColor: "danger",
onText: "<span class='font-weight-bold'>SI</span>",
offText: "<span class='font-weight-bold'>NO</span>"
});
if (repetitionsLeft > 0) {
var 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>
</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>
</div>`;
var $html = $(html);
$dom.find("[data-cq_panel='prodottoConfezionato'] input[type='checkbox']").on("switchChange.bootstrapSwitch", function (e, checked) {
if (is_function(self._onCqrChange)) {
var $input = $(this);
var cqr = {
id_riga: $input.closest("[data-id_riga]").getIntDataAttr("id_riga"),
num_rip: $input.getIntDataAttr("num_rip"),
valore_ril: checked ? "S" : "N",
data_ril: getNow()
};
self._onCqrChange([cqr]).then(function (updateOK) {
if (updateOK) {
self._refreshPanelControlloPeso();
} else {
$input.val("");
}
});
}
});
/*************** 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 *****************/
$dom.find("input[type='checkbox']").each(function () {
var $input = $(this);
var valoreRil = $input.getDataAttr("valore_ril");
if (is_null(valoreRil) || ["S", "N"].indexOf(valoreRil) < 0) {
$input.bootstrapSwitch("toggleIndeterminate", true);
} else {
$input.bootstrapSwitch("state", valoreRil == "S", true);
}
});
$html.find(".plus:not('disabled')").on("click", _.bind(self.onPlusClick, self));
$html.find("input.controlInput").on("change", _.bind(self.saveSingleInput, self));
$html.find("span.trash:not('disabled')").on("click", _.bind(self.onTrashClick, self));
$td.append($html);
}
repetitionsLeft = totalRepetitions - $td.find("input.controlInput").length;
if (repetitionsLeft <= 0) { /* it means that we have to insert the last input box */
$td.find(".plus")
.addClass("disabled").removeClass("cursor-pointer")
.attr("title", "non sono previste altre misurazioni per questo controllo");
}
} else {
$input.focus();
self._toast.warning("inserisci la prima misurazione");
}
};
CQ_DR03P06.prototype.enablePlus = function ($context) {
var self = this;
/********* we don't need to block all the trashes but only the ones in the same td ************/
var $allPlus = $context.closest("td[data-repetitions]").find("span.plus");
var totalRepetitions = $context.closest("td[data-repetitions]").data("repetitions");
var repetitionsLeft = totalRepetitions - $context.closest("td[data-repetitions]").find("input.controlInput").length;
/******** if repetitionsLeft == 0, we have to cycle one time ***********/
$allPlus.each((index, singlePlus) => {
var $singlePlus = $(singlePlus);
if (repetitionsLeft >= index) {
$singlePlus.removeClass("disabled").addClass("cursor-pointer").prop("title", "aggiungi ulteriore misurazione");
}
});
};
CQ_DR03P06.prototype.disablePlus = function ($context) {
var self = this;
var $allPlus = $context.closest("td[data-repetitions]").find("span.plus");
$allPlus.addClass("disabled").removeClass("cursor-pointer");
};
var $panelRotture = $dom.find("[data-cq_panel='rottureBottiglie']");
$panelRotture.find("input").on("change switchChange.bootstrapSwitch", function () {
var $tr = $(this).closest("tr");
var rigaRottura = _checkForm.checkData($tr);
if (rigaRottura !== false) {
if (is_function(self._onCqrChange)) {
var numRip = $tr.getIntDataAttr("num_rip");
var oraRil = $tr.find("input[type='time']").getValue();
var arr_cqr = [];
for (var idRiga in rigaRottura) {
var valoreRil = rigaRottura[idRiga];
arr_cqr.push({
id_riga: idRiga,
num_rip: numRip,
valore_ril: valoreRil,
ora_ril: oraRil
});
}
self._onCqrChange(arr_cqr);
}
}
});
$dom.find("input[type='time']").on("dblclick", function () {
$(this).val(getNow("HH:mm")).trigger("change");
});
$dom.find(".bt_pdfOrdCq").on("click", function () {
if (!is_null(orderKey) && is_function(self._generatePdf)) {
self._generatePdf($(this));
}
});
/************************************** RESET INPUT IF USER DELETES IT SIMPLY CANCELING THE STRING **********************************/
CQ_DR03P06.prototype.resetInput = function (event) {
var self = this;
if (!(typeof event.currentTarget === "undefined")) {
/****** passed parameter is an event **********/
var $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");
}
if (!is_null($input.attr("data-prev")) && !_.isEmpty($input.attr("data-prev"))) {
$input.val($input.data("prev"));
}
};
/************************************** DATA SAVING *******************************************/
/*
CQ_DR03P06.prototype._generatePdf = function(){
@ param: event - the onchange done on interested input
*/
CQ_DR03P06.prototype.saveSingleInput = function (event, finalEnableTrash = true, origin = "input-value") {
var myUpdateOK;
var self = this;
var orderKey = self._orderKey;
log(orderKey);
};*/
if (!(typeof event.currentTarget === "undefined")) {
/****** passed parameter is an event **********/
var $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.prop("disabled", true);
var $td = $input.closest("td[data-repetitions]");
/************ meanwhile disable alle delete operations ****************/
var 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"])) {
/************** 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"]);
/********* if enable is activated it catches all trash in td *********/
finalEnableTrash ? (self.enableTrash($td)) : ({});
self._allowToast ? self._toast.success("Dati salvati correttamente") : self.allowFollowingToast(true);
savePromise.resolve(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");
$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"])) {
self.resetInput(event);
}
return savePromise;
};
CQ_DR03P06.prototype.enableTrash = function ($context) {
var $context = $context;
var self = this;
/********* we don't need to block all the trashes but only the ones in the same td ************/
var $allTrash = $context.closest("td[data-repetitions]").find("span.trash");
$allTrash.each((index, singleTrash) => {
var $singleTrash = $(singleTrash);
if (!_.isNil($singleTrash.siblings("input.controlInput").val().trim()) && !_.isEmpty($singleTrash.siblings("input.controlInput").val().trim())) {
$singleTrash.removeClass("disabled").addClass("cursor-pointer"); //remove class disabled, add cursor-point
}
});
};
CQ_DR03P06.prototype.disableTrash = function ($context) {
var $context = $context;
var self = this;
var $allTrash = $context.closest("td[data-repetitions]").find("span.trash");
$allTrash.addClass("disabled").removeClass("cursor-pointer");
};
CQ_DR03P06.prototype.onTrashClick = function (event) {
var self = this;
var $trash = $(event.currentTarget).closest("span.trash");
var $input = $trash.siblings("input.controlInput");
if (!$trash.hasClass("disabled") && !is_null(self._orderKey) && is_function(self._onTrashClick) && !_.isEmpty($input.val().trim())) {
var $td = $input.closest("td");
var totalRepetitions = parseInt($td.attr("repetitions")) + 1;
var lengthBeforeDel = $td.find("input.controlInput").length;
var inputVal = $input.val().trim();
/*********** first of all disable other delete call that connect to DB and other input insertion while deleting **************/
self.disablePlus($td);
self.disableTrash($td);
$input.closest("td[data-id_riga]").find("input.controlInput").prop("disabled", true);
var deletedRow = $input.getIntDataAttr("num_rip");
/***************************** delete data **************************************/
var cqr = {
id_riga: $input.getIntDataAttr("id_riga"),
num_rip: $input.getIntDataAttr("num_rip"),
valore_ril: inputVal,
data_ril: getNow()
};
/************ if valore_ril is not null, then it has already been memorized in db ****************/
/*********************************** DELETE DATA *************************************************/
if (!_.isNil(cqr["valore_ril"]) && !_.isEmpty(cqr["valore_ril"])) {
self._onTrashClick([cqr]).then((updateOK) => {
if (updateOK) {
/**************************** IF DELETION HAS CORRECTLY OCCURRED *******************************************/
/******************** THE FIRST ROW REMAINS UNHANDLED??? **********/
/***************** if there is more than one input and we have deleted the first row or one in the middle ****************************/
if (lengthBeforeDel > 1 && deletedRow !== lengthBeforeDel) {
$input.closest(".input-group").remove();
/******************** for the inputs that remain ***********************/
$td.find(".input-group").each((index, ele) => {
var $inputGroup = $(ele);
/***** previousRow number is the Row number that the data had before being deleted *****************/
var previousRowNumber = parseInt($inputGroup.find("input.controlInput").attr("data-num_rip"));
/****************** if the considered input is BELOW the deleted one ************************/
if (previousRowNumber > deletedRow) {
self.allowFollowingToast(false);
$inputGroup.find("input.controlInput").attr("data-num_rip", previousRowNumber - 1);
/********************************** save cells to move up in DB **********************************************/
if (!_.isNil($inputGroup.find("input.controlInput").data("prev")) && !_.isEmpty($inputGroup.find("input.controlInput").data("prev"))) {
self.saveSingleInput($inputGroup, false, "data-prev").then((value) => {
if (value) {
/************ saving of new rows correctly happened: now only the last input has to be deleted from DB - others will be overwritten ***********************/
if (previousRowNumber === lengthBeforeDel && !_.isNil($inputGroup.find("input.controlInput").data("prev")) && !_.isEmpty($inputGroup.find("input.controlInput").data("prev"))) {
/*************** if the considered input is the last and it contains data, delete it from db *********************/
var remainedCqr = {
id_riga: parseInt($inputGroup.find("input.controlInput").attr("data-id_riga")),
num_rip: previousRowNumber,
valore_ril: $inputGroup.find("input.controlInput").data("prev"),
data_ril: getNow()
};
/****************** DELETION OF LAST ROW *****/
self._onTrashClick([remainedCqr]).then((updateOK) => {
if (updateOK) {
self._toast.success("misurazione cancellata correttamente");
self.resetInput($inputGroup);
$td.find("input.controlInput").prop("disabled", false);
self.enableTrash($td);
self.enablePlus($td);
} else {
/********************** last row has not been deleted properly from DB *************************/
self._toast.danger("ultima misurazione non aggiornata, si prega di chiudere e riaprire i Dettagli - controllare DB");
/******* if this happens, in the DB there could be a measurement that is not loaded in the modal by php *****/
}
});
}
}
}, (error) => {
console.log(error);
}
);
} else {
/************* last input is empty *************************/
self._toast.success("misurazione cancellata correttamente");
$td.find("input.controlInput").prop("disabled", false);
self.enableTrash($td);
self.enablePlus($td);
}
}
});
} else if (lengthBeforeDel > 1 && deletedRow === lengthBeforeDel) {
/************** if we clicked on the last input, simply remove it, because it has been already deleted from DB *******************/
$input.closest("div.input-group").remove();
$td.find("input.controlInput").prop("disabled", false);
self.enableTrash($td);
self.enablePlus($td);
self._toast.success("misurazione cancellata correttamente");
} else {
/***** the clicked input is the first and the last remained *****************/
$input.closest("td[data-id_riga]").find("input.controlInput").prop("disabled", false);
$input.val("");
self.enableTrash($td);
self.enablePlus($td);
self._toast.success("misurazione cancellata correttamente");
}
} else {
self._toast.danger("misurazione non cancellata, si prega di chiudere e riaprire i Dettagli");
$input.closest("td[data-id_riga]").find("input.controlInput").prop("disabled", false);
self.enableTrash($td);
$input.val(""); /***** otherways the user could go to second input ********/
}
});
}
} else if (!$trash.hasClass("disabled") && !is_null(self._orderKey) && is_function(self._onTrashClick) && _.isEmpty($input.val().trim())) {
self.resetInput(event);
self._toast.warning("non cancellare le misurazioni da tastiera", "per favore utilizza solo il cestino per eliminare i dati");
}
/********* if trash is disabled *************/
else if (!_.isNil($input.val()) && !_.isEmpty($input.val())) {
self._toast.warning("ritenta la cancellazione tra un attimo");
}
};
CQ_DR03P06.prototype.saveCaratInput = function (e) {
var self = this;
var $input = $(e.currentTarget);
var idRiga = $input.data("id_riga");
var carat = $input.data("carat");
var val = $input.val();
var ajax = new Ajax();
ajax.post("save_carat").data({
idRiga: idRiga,
carat: carat,
val: val,
order: self._orderKey
})
.noticeAsToast()
.waitToast()
.$toDisable($input)
.onSuccess(function (ret) {
var toast = new Toast();
toast.success("Caratteristica salvata correttamente!");
self._parent._refreshModalDetails(self._orderKey, self._codProd, $input);
})
.execute();
};

View File

@@ -1,19 +1,9 @@
<?
<?php
/*************************************** LICOR QUALITY CONTROL CUSTOMIZED VERSION *********************************************
* /public_html/config_aziende/LICOR */
class CQDR03P06 {
const PESO = "PESO";
const ASSENZA_MATERIALE_PRODUZIONE_PRECEDENTE = "ASSENZA ETICHETTA E BOTTIGLIE PRODUZIONE PRECEDENTE";
const CORRETTEZZA_ETICHETTA = "CONTROLLO CORRETTEZZA ETICHETTA";
const CORRETTEZZA_LOTTO_TMC = "CORRETTEZZA E LEGGIBILITÀ LOTTO E TMC";
const ELIMINAZIONE_MATERIALE_FINE_PRODUZIONE = "ELIMINAZIONE ETICHETTA E BOTTIGLIE DALLA LINEA";
const NUM_BOTTIGLIE_ROTTE = "N. BOTTIGLIE";
const DOVE_BOTTIGLIE_ROTTE = "DOVE";
const PULIZIA_BOTTIGLIE_ROTTE = "PULIZIA EFFETTUATA";
const NOMINATIVO_BOTTIGLIE_ROTTE = "FIRMA VERIFICA PULIZIA";
const CONTROLLO_PRESSIONE_SOFFIATRICE = "CONTROLLO DELLA PRESSIONE SOFFIATRICE";
const AVVINAMENTO_LINEA = "AVVINAMENTO LINEA";
private $_cqOrdine = null;
public function __construct($cqOrdine) {
@@ -29,12 +19,13 @@ class CQDR03P06 {
public function getCqOrdine($controllo) {
if (!is_null($this->_cqOrdine)) {
$result = array_values(from($this->_cqOrdine)
->where(function ($x) use ($controllo) {
$s1 = \Utility\Str::alphanumericFilter($x["controllo"], false);
$s2 = \Utility\Str::alphanumericFilter($controllo, false);
return \Utility\Str::ciEquals($s1, $s2);
})->toArray()
$result = array_values(
from($this->_cqOrdine)
->where(function ($x) use ($controllo) {
$s1 = \Utility\Str::alphanumericFilter($x["controllo"], false);
$s2 = \Utility\Str::alphanumericFilter($controllo, false);
return \Utility\Str::ciEquals($s1, $s2);
})->toArray()
);
if (count($result) > 0) {
@@ -44,8 +35,9 @@ class CQDR03P06 {
return null;
}
/************************** this function returns null for measurements with single repetition ***************************/
private static function getRipRecord($cq, $numRip) {
$result = !is_null($cq) && !is_null($cq["rip"]) ? array_values(from($cq["rip"])->where(function ($x) use ($numRip) {
$result = (!is_null($cq) && !is_null($cq["rip"])) ? array_values(from($cq["rip"])->where(function ($x) use ($numRip) {
return $x["num_rip"] === $numRip;
})->toArray()) : array();
return count($result) > 0 ? $result[0] : null;
@@ -60,19 +52,136 @@ class CQDR03P06 {
$ripRecord = self::getRipRecord($cq, $numRip);
return !is_null($ripRecord) ? $ripRecord["data_ril"] : null;
}
/************************ USELESS AT THE MOMENT ***************************
*
* public function retrieveQualityInfo($processingOrder=null,$processingDate=null,$management=null)
* {
* $Query = new Query();
* $Query->importSqlFile("retrieveQualityInfo")
* ->setVar("num_ord",$processingOrder)
* ->setDateVar("data_ord",$processingDate)
* ->setVar("gestione",$management);
*
* return $Query->toRet()->date2ts(false)->execute();
* }*/
}
$processingOrder = $data['key']['num_ord']; /*num. ordine di lavorazione*/
$processingDate = $data['key']['data_ord']; /*data unix dell'ordine di lavorazione*/
$management = $data['key']['gestione']; /*gestione*/
$CQDR03P06 = new CQDR03P06($arr_cq);
?>
<div class="row">
<div class="col-xs-12">
<button class="bt_pdfOrdCq btn btn-lg btn-default pull-right mb-6" type="button">
<div class="col-xs-12 hidden">
<button class="bt_pdfOrdCq btn btn-lg btn-default pull-right m-3 p-2 vertical-middle" type="button">
<i class="fas fa-file-pdf text-danger"></i> Genera PDF
</button>
</div>
</div><?
<div class="col-xs-12 panel-default panel-collapsible xcollapsed" data-cq_panel="prodottoConfezionato">
<div class="panel-body">
<table class="table table-bordered">
<thead>
<tr class="font-size-15">
<th class="col-sm-4 text-center font-weight-bold">Descrizione controllo</th>
<th class="col-sm-4 text-center font-weight-bold">Valore di rif.</th>
<th class="col-sm-4 text-center font-weight-bold">Valore rilevato</th>
</tr>
</thead>
<tbody>
<?php foreach ($arr_cq as $singleControl) { ?>
<tr class="">
<td class="vertical-middle col-sm-4 text-center">
<?= $singleControl['controllo'] ?>
</td>
<td class="vertical-middle col-sm-4 text-center">
<?= $singleControl['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'] ?>>
<?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 */
?>
<!--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-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") ?>">
<div class='p-0'><i class="fa fa-plus text-success"></i></div>
</span>
<span class=" trash btn input-group-addon py-0 cursor-pointer"
title="elimina dato">
<div class='p-0'><i class="fa fa-trash-alt text-danger"></i></div>
</span>
</div>
<?php
}
} 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">
<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>
</div>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if (!empty($caratPartita)) { ?>
<table class="table table-bordered"> <!-- class "small" deleted to have bigger font-size -->
<thead>
<tr class="font-size-15">
<th colspan="2" class="text-center font-weight-bold">Caratteristiche partita mag.</th>
</tr>
<tr class="font-size-15">
<th class="col-sm-4 text-center font-weight-bold">Caratteristica</th>
<th class="col-sm-8 text-center font-weight-bold">Valore rilevato</th>
</tr>
</thead>
<tbody>
<?php foreach ($caratPartita as $carat) { ?>
<tr class="">
<td class="vertical-middle col-sm-4 text-center">
<?= $carat['carat'] ?>
</td>
<td class="col-sm-4 text-center m-0" data-id_riga="<?= $carat["id_riga"] ?>">
<div class="col-sm-12 input-group mb-6">
<input type="text" class="form-control caratInput"
data-id_riga="<?= $carat["id_riga"] ?>"
data-carat="<?= $carat["carat"] ?>"
value="<?= $carat["val_carat"] ?: "" ?>">
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
</div>
</div>
</div>
<?php
include "cq_DR03P06-peso.php";
include "cq_DR03P06-prodottoConfezionato.php";
include "cq_DR03P06-rottureBottiglie.php";
/*
* WE SHOULD GENERATE A COMMON PAGE FOR ALL COMPANIES
**/

View File

@@ -27,29 +27,6 @@
"name": "pdf_utilities-split",
"group": "Utilità"
},
{
"name": "contatti_commesse_integry",
"group": "Commesse e attività",
"usergroups": [
"2"
]
},
{
"name": "contatti_commesse_integry-attivita",
"group": "Commesse e attività",
"usergroups": [
"2",
"5",
"22"
]
},
{
"name": "contatti_commesse_integry-agenda",
"group": "Commesse e attività",
"usergroups": [
"2"
]
},
{
"name": "weather",
"group": "NULL",

View File

@@ -23,8 +23,8 @@
"endPointRemote": null,
"public_url": "http://www.studioml.it/pvm/"
},
"dbNameWeb": "DOLCE_BO",
"azienda": "DOLCE_BO",
"dbNameWeb": "DOLCE_BONTA",
"azienda": "DOLCE_BONTA",
"sc_project": null,
"sc_security": null
}

View File

@@ -25,7 +25,7 @@
},
"dbNameWeb": "IME_BA",
"azienda": "IME_BA",
"logo_azienda": "logo_imeba.jpg",
"logo_azienda": "logo_imeba.png",
"sc_project": "11594528",
"sc_security": "27d4dd74"
}

View File

@@ -14,12 +14,12 @@
"cliente": {
"db": {
"driver": "mssql",
"hostName": "194.0.0.8",
"hostName": "194.0.0.5",
"dbName": "licor",
"userName": "sa",
"password": "sa"
},
"endPoint": "194.0.0.8:8080",
"endPoint": "194.0.0.5:8080",
"endPointRemote": null,
"public_url": "http://194.0.2.12/portale/"
},

View File

@@ -23,7 +23,7 @@
"endPointRemote": null,
"public_url": ""
},
"dbNameWeb": "Maggio SRL",
"dbNameWeb": "MaggioSRL",
"azienda": "MaggioSRL",
"sc_project": null,
"sc_security": null

View File

@@ -0,0 +1,30 @@
{
"studioml": {
"db": {
"driver": "pdosqlsrv",
"hostName": "192.168.2.214",
"dbName": "SUIT_PUGLIA",
"userName": "sa",
"password": "sa"
},
"endPoint": "192.168.3.15:8080",
"endPointRemote": "https://www2.studioml.it",
"public_url": "https://www.studioml.it/pvm/"
},
"cliente": {
"db": {
"driver": "mssql",
"hostName": "192.168.20.220",
"dbName": "SUIT_PUGLIA",
"userName": "sa",
"password": "sa"
},
"relative_img_path": "",
"endPoint": "192.168.20.220:8080",
"public_url": "https://www.studioml.it/pvm/"
},
"dbNameWeb": "SUIT_PUGLIA",
"azienda": "SUIT",
"sc_project": "10496649",
"sc_security": "6309901d"
}

View File

@@ -14,12 +14,12 @@
"cliente": {
"db": {
"driver": "mssql",
"hostName": "192.168.0.6",
"hostName": "192.168.0.16",
"dbName": "vinella",
"userName": "sa",
"password": "sa"
},
"endPoint": "192.168.0.6:8080",
"endPoint": "192.168.0.16:8080",
"endPointRemote": null,
"public_url": "http://95.229.223.66/portale/"
},

View File

@@ -0,0 +1 @@
.k-pager-md .k-pager-sizes .k-dropdownlist{width:6em !important}/*# sourceMappingURL=kendoCustom.css.map */

View File

@@ -1,4 +1,5 @@
<?php
session_start();
include "functions.php";
include "config.php";
@@ -14,7 +15,7 @@ if ($Ret->is_OK()) {
<script>
var _moduleName = "<?=Controller::current_module()?>";
</script>
<?
<?php
include Controller::module_gestpath_include($moduleName, "mail-actions.php");
exit;
}
@@ -23,16 +24,16 @@ if ($Ret->is_OK()) {
<!--html manifest="manifest.appcache"-->
<html>
<head>
<? include pvm_tagHead; ?>
<?php include pvm_tagHead; ?>
</head>
<body>
<? include pvm_headerNavbar; ?>
<?php include pvm_headerNavbar; ?>
<div id="content" class="invalid">
<div><?
<div><?php
//include pvm_navTab;
include Controller::current_gestpath_mainPage(); ?>
</div>
</div>
<? //include pvm_footerMinimal; ?>
<?php //include pvm_footerMinimal; ?>
</body>
</html>

View File

@@ -16,13 +16,17 @@ include Controller::current_gestpath_include("ajax.php");
</head>
<body>
<?php include pvm_headerNavbar; ?>
<?php
include pvm_navTab;
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
include pvm_unauthorized;
} else {
include Controller::current_gestpath_mainPage();
} ?>
<div id="content">
<div class="no-padding">
<?php
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
include pvm_unauthorized;
} else {
include Controller::current_gestpath_mainPage();
}
?>
</div>
</div>
<?php include pvm_footerMinimal; ?>
</body>
</html>

View 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 Ajax())->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>

View File

@@ -63,7 +63,7 @@ function array_orderby() {
if (is_string($field)) {
$tmp = array();
foreach ($data as $key => $row) {
$tmp[$key] = $row[$field];
$tmp[$key] = array_get($row, $field);
}
$args[$n] = $tmp;
}

View File

@@ -181,7 +181,8 @@ class Accettazione {
$descrizione = $qs;
$codMart = $codArtFor = "";
$arr_attributes = array_merge($attributes_std, array("descrizione" => $qs));
$bindToMultiple = false;
ob_start();
include Controller::current_gestpath_include("list-articoli_tr.php");
$html = base64_encode(Utility\Str::remove_multiple_spaces(@ob_get_clean()));

View File

@@ -19,7 +19,7 @@ foreach ($arr_attributes as $key => $value) {
<td>
<input type="number" step="any" lang="en" class="qtaChk form-control input-xs" value="<?= $qtaCollo ?>" min="0"
<?php if ($bindToMultiple) { ?> data-qta_cnf="<?= $qtaCnfOrd ?>" <?php } ?>
<?php if (count($data["colli"]) > 0) { ?> disabled <?php } ?>
<?php if (count(array_get($data, "colli", array())) > 0) { ?> disabled <?php } ?>
/>
</td>
<td class="text-center">

View File

@@ -3,12 +3,14 @@
<b>Documenti di consegna</b>
</div>
<?php
$Query = new Query;
$Query->importSqlFile("get_documenti")
$query = new Query;
$query->importSqlFile("get_documenti")
->setVar("cod_mdep", User::get_current_userCodMdep());
$Ret = $Query->toRet()->date2ts()->execute();
if ($Ret->is_OK()) {
$arr_documenti = $Ret->get_data();
$ret = $query->toRet()->date2iso()->execute();
if ($ret->is_OK()) {
$arr_documenti = $ret->get_data();
if (count($arr_documenti) > 0) {
?>
<div class="list-group" data-list="documenti">
@@ -34,7 +36,7 @@
</div>
<div class="col-xs-5 text-right">
<?= $item["cod_dtip"] ?> <?= $item["num_doc"] ?>
del <?= strftime(Format::strftimeDMY, $item["data_doc"]) ?>
del <?= date('d/m/Y', strtotime($item["data_doc"])); ?>
</div>
</div>
</a>

View File

@@ -13,13 +13,13 @@
</div>
<div class="row">
<div class="col-xs-5">
<? include "step1-lista_ordini.php"; ?>
<?php include "step1-lista_ordini.php"; ?>
</div>
<div class="col-xs-5">
<? include "step1-lista_documenti.php"; ?>
<?php include "step1-lista_documenti.php"; ?>
</div>
<div class="col-xs-2">
<? include "step1-lista_colli.php"; ?>
<?php include "step1-lista_colli.php"; ?>
</div>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<?php
$Ret = new Ret;
$ret = new Ret;
$codAnag = $codAlis = null;
$COND_COLLI = $COND_ORD = $COND_DOC = "";
@@ -28,7 +28,7 @@ foreach ($data["documenti"] as $item) {
$COND_DOC = " $COND_DOC OR ";
}
$COND_DOC .= " (Wdtb_doct.data_doc = '" . strftime(Format::strftimeYMD, $item["data_doc"]) . "' AND Wdtb_doct.num_doc = {$item["num_doc"]} AND Wdtb_doct.ser_doc = '{$item["ser_doc"]}' AND Wdtb_doct.cod_anag = '{$item["cod_anag"]}' AND Wdtb_doct.cod_dtip = '{$item["cod_dtip"]}') ";
$COND_DOC .= " (Wdtb_doct.data_doc = '" . date('Y-m-d', strtotime($item["data_doc"])) . "' AND Wdtb_doct.num_doc = {$item["num_doc"]} AND Wdtb_doct.ser_doc = '{$item["ser_doc"]}' AND Wdtb_doct.cod_anag = '{$item["cod_anag"]}' AND Wdtb_doct.cod_dtip = '{$item["cod_dtip"]}') ";
}
foreach ($data["colli"] as $item) {
@@ -43,30 +43,33 @@ if (isset($codAlis)) {
$SELECT_qtaDoc = ((strlen($COND_DOC) > 0) ? "ISNULL(documenti.qta_doc, 0)" : ((strlen($COND_COLLI) > 0) ? " ISNULL(colli.qta_col, 0)" : "ISNULL(ordini.qta_ord, 0)"));
$SELECT_qtaCollo = ((strlen($COND_COLLI) > 0) ? "ISNULL(colli.qta_col, 0)" : ((strlen($COND_DOC) > 0) ? " ISNULL(documenti.qta_doc, 0)" : "ISNULL(ordini.qta_ord, 0)"));
$Query = new Query;
$Query->importSqlFile("step2_griglia")
$datDoc = $data["documenti"][0]["data_doc"];
$dataOrd = isset($dataOrd) ? strftime(Format::strftimeYMD, $dataOrd) : date('Y-m-d', strtotime($datDoc));
$query = new Query;
$query->importSqlFile("step2_griglia")
->setVar("SELECT_qtaDoc", $SELECT_qtaDoc)
->setVar("SELECT_qtaCollo", $SELECT_qtaCollo)
->setVar("COND_ORD", ((strlen($COND_ORD) > 0) ? $COND_ORD : "1>1"))
->setVar("COND_DOC", ((strlen($COND_DOC) > 0) ? $COND_DOC : "1>1"))
->setVar("COND_COLLI", ((strlen($COND_COLLI) > 0) ? $COND_COLLI : "1>1"))
->setVar("cod_mdep", User::get_current_userCodMdep())
->setDateVar("data_ord", isset($dataOrd) ? $dataOrd : $data["documenti"][0]["data_doc"])
->setDateVar("data_ord", $dataOrd)
->setVar("cod_alis", $codAlis);
$Ret = $Query->toRet()->date2ts()->execute();
$ret = $query->toRet()->date2iso()->execute();
$GestSetup = new GestSetup;
$forceIdSegnalazione = $GestSetup->section("ACCETTAZIONE")->keySection("SET_ID_SEGNALAZIONE")->asArray()->get();
$setIdSegnalazione = in_array($codAlis, $forceIdSegnalazione);
if ($Ret->is_OK()) {
$arr_rows = $Ret->get_data();
$Query = new Query;
$Ret = $Query->select("rag_soc")->from("gtb_anag")->where("cod_anag", $codAnag)->firstRowFirstValue()->toRet()->execute();
if ($ret->is_OK()) {
$arr_rows = $ret->get_data();
$query = new Query;
$ret = $query->select("rag_soc")->from("gtb_anag")->where("cod_anag", $codAnag)->firstRowFirstValue()->toRet()->execute();
}
if ($Ret->is_OK()) {
$ragSoc = $Ret->get_data();
if ($ret->is_OK()) {
$ragSoc = $ret->get_data();
ob_start();
?>
<div class="panel panel-default">
@@ -95,7 +98,7 @@ if (isset($codAlis)) {
<?php
if (count($data["documenti"]) > 0) {
foreach ($data["documenti"] as $item) {
echo "<small>" . $item["cod_dtip"] . " " . $item["num_doc"] . " " . $item["ser_doc"] . " del " . strftime("%d/%m/%Y", $item["data_doc"]) . "</small><br/>";
echo "<small>" . $item["cod_dtip"] . " " . $item["num_doc"] . " " . $item["ser_doc"] . " del " . date('d/m/Y', strtotime($item["data_doc"])) . "</small><br/>";
}
} else {
$serDocNew = Accettazione::get_serDocDepo();
@@ -223,7 +226,7 @@ if (isset($codAlis)) {
$qtaOrd = (double)$row["qta_ord"];
$qtaDoc = (double)$row["qta_doc"];
$qtaCollo = (double)$row["qta_collo"];
$dataOrd = $row["data_ord"];
$dataOrd = $row["data_ord"] ? date('d/m/Y', strtotime($row["data_ord"])) : "";
$qtaInevasa = ($qtaOrd - $qtaCollo > 0) ? ($qtaOrd - $qtaCollo) : 0;
$num_ord = $row["num_ord"];
$rigaOrd = $row["riga_ord"];
@@ -235,7 +238,7 @@ if (isset($codAlis)) {
$qtaCnf = $row["qta_cnf"];
$qtaCnfOrd = $row["qta_cnf_ord"];
$bindToMultiple = $row["flag_dig"] == "S" && $row["tipo_um"] == "UP" && in_array($codAlis, $chkDiffMultCnf);
$dataDoc = $row["data_doc"];
$dataDoc = $row["data_doc"] ? date('d/m/Y', strtotime($row["data_doc"])) : "";
$serDoc = $row["ser_doc"];
$numDoc = $row["num_doc"];
$tolleranza = (double)$row["tolleranza"];
@@ -307,9 +310,9 @@ if (isset($codAlis)) {
</div>
<?php
$html = Utility\Str::remove_multiple_spaces(@ob_get_clean());
$Ret->set_data()->set_string(utf8_encode($html));
$ret->set_data()->set_string(utf8_encode($html));
}
} else {
$Ret->set_error("Data ordine o listino non pervenuti");
$ret->set_error("Data ordine o listino non pervenuti");
}
$Ret->display();
$ret->display();

View File

@@ -304,24 +304,27 @@ _accettazione.validate_dataSelezioni = function () {
if ($("[data-list='ordini']").children("a.active").exists() && $("[data-list='documenti']").children("a.active").exists()) {
// to do: controllo + smart
var arr_date = {ordini: [], documenti: []};
const arr_date = {ordini: [], documenti: []};
$("[data-list='documenti'], [data-list='ordini']").children("a.active").each(function () {
var $item = $(this);
var key = _ojbc.B64JSON_parse($item.attr("data-key"));
var list = $item.closest("[data-list]").attr("data-list");
arr_date[list].push(list == "ordini" ? key.data_ord : key.data_doc);
const $item = $(this);
const key = _ojbc.B64JSON_parse($item.attr("data-key"));
const list = $item.closest("[data-list]").attr("data-list");
arr_date[list].push(list === "ordini" ? key.data_ord : key.data_doc);
});
for (var i in arr_date.documenti) {
var dataDoc = arr_date.documenti[i];
for (var j in arr_date.ordini) {
var dataOrd = arr_date.ordini[j];
_.each(arr_date.documenti, function (documento) {
const dataDoc = moment(documento).unix();
_.each(arr_date.ordini, function (ordine) {
const dataOrd = ordine;
if (dataOrd > dataDoc) {
log("ko " + dataDoc.unixtime_format("DD/MM/YYYY") + " " + dataOrd.unixtime_format("DD/MM/YYYY"));
return true;
}
}
}
});
});
}
return false;
};

View File

@@ -121,7 +121,7 @@ _accettazione.onchange_qta = function ($input, eType) {
const toast = new Toast();
toast.warning("<b>Q.t&agrave; chk</b> dev'essere multipla della q.t&agrave; per conf. (" + qtaCnf + ")");
$tr.find("input.qtaChk").val(qtaCollo).change().focus();
$tr.find("input.qtaChk").val(qtaCollo).focus();
return;
}
@@ -182,9 +182,10 @@ _accettazione.onchange_qta = function ($input, eType) {
_accettazione.validate_formStep2 = function () {
const modalBox = new ModalBox();
const $dataDocNew = $("#data_doc_new");
if ($("#data_doc_new").exists()) {
if ($("#data_doc_new").valueIsEmpty() || $("#num_doc_new").valueIsEmpty() || $("#ser_doc_new").valueIsEmpty()) {
if ($dataDocNew.exists()) {
if ($dataDocNew.valueIsEmpty() || $("#num_doc_new").valueIsEmpty() || $("#ser_doc_new").valueIsEmpty()) {
modalBox.warning("Si prega di definire tutti gli estremi del documento");
return false;
}
@@ -297,11 +298,13 @@ _accettazione.prepareSaveData = function () {
});
});
if ($("#data_doc_new").exists()) {
const $dataDocNew = $("#data_doc_new");
if ($dataDocNew.exists()) {
data.documento.push({
codAnag: $("#cod_anag_new").val(),
codDtip: null,
dataDoc: $("#data_doc_new").val(),
dataDoc: $dataDocNew.val(),
numDoc: parseInt($("#num_doc_new").val()),
serDoc: $("#ser_doc_new").val()
});
@@ -311,7 +314,7 @@ _accettazione.prepareSaveData = function () {
data.documento.push({
codAnag: item.cod_anag,
codDtip: item.cod_dtip,
dataDoc: item.data_doc.unixtime_format("DD/MM/YYYY"),
dataDoc: moment(item.data_doc).format("DD/MM/YYYY"),
numDoc: item.num_doc,
serDoc: item.ser_doc,
listino: codAlis,
@@ -330,7 +333,7 @@ _accettazione.prepareSaveData = function () {
$("table#list-articoli > tbody > tr").each(function () {
const $tr = $(this);
const row = {
dataOrd: !is_null(nullIfEmpty($tr.attr("data-data_ord"))) ? $tr.attr("data-data_ord").unixtime_format("DD/MM/YYYY") : null,
dataOrd: $tr.attr("data-data_ord"),
numOrd: nullIfEmpty($tr.attr("data-num_ord")),
rigaOrd: $tr.attr("data-riga_ord"), // a volte è vuoto, ma non mandava null
codMart: nullIfEmpty($tr.attr("data-cod_mart")),
@@ -345,7 +348,7 @@ _accettazione.prepareSaveData = function () {
qtaRicNoFatResa: $tr.find("input.ricNonFatResa").getNumericValue(),
qtaInevasa: $tr.find("input.qtaInevasa").getNumericValue(),
rigaMod: $tr.attr("data-riga_mod"),
dataDoc: !is_null(nullIfEmpty($tr.attr("data-data_doc"))) ? $tr.attr("data-data_doc").unixtime_format("DD/MM/YYYY") : null,
dataDoc: $tr.attr("data-data_doc"),
serDoc: nullIfEmpty($tr.attr("data-ser_doc")),
numDoc: nullIfEmpty($tr.attr("data-num_doc")),
lotti: nullIfEmpty($tr.attr("data-lotti"))
@@ -353,6 +356,7 @@ _accettazione.prepareSaveData = function () {
data.articoli.push(row);
});
self.save(data);
});
}

View File

@@ -41,12 +41,13 @@ class Allegati {
$Ret = new \Ret;
$filter = array_key_exists("filter", $data) ? $data["filter"] : array();
$filter["onlyCurrentUser"] = in_array("onlyCurrentUser", $data) && $data["onlyCurrentUser"];
$tableMode = array_get($data, "tableMode");
if (isset($data["activity_id"])) {
$activityId = $data["activity_id"];
$Ret = \Allegati\Attivita::get_filelist($activityId);
} else if (isset($data["cod_jcom"])) {
$Ret = \Allegati\Commessa::get_filelist($data["cod_jcom"], $data["depth"], $filter);
$Ret = \Allegati\Commessa::get_filelist($data["cod_jcom"], $data["depth"], $filter, $tableMode);
} else if (isset($data["cod_alis"])) {
$key = array(
"cod_alis" => $data["cod_alis"],
@@ -79,6 +80,18 @@ class Allegati {
$Ret->set_error("Richiesta non valida");
}
if ($Ret->is_OK()) {
$data = from($Ret->get_data())
->select(function ($item) {
$item["is_image"] = isset($item["mime_type"]) && Utility\File::isImageFromMimeType($item["mime_type"]);
return $item;
})
->toArray();
$Ret->set_data($data);
}
return $Ret;
}
@@ -195,18 +208,18 @@ class Allegati {
return $Ret->set_error("Source non supportato");
}
public static function uploadFromModal($filter, $fileItem) {
public static function uploadFromModal($data, $fileItem) {
$ret = new \Ret;
$sourceTypesDict = Allegati\SourceType::get_dictionary();
$sourceType = $filter["source_type"];
$arr_editableDescrSourceType = $filter["editableDescriptionSourceTypes"];
$arr_deletableSourceTypes = $filter["deletableSourceTypes"];
$sourceType = $data["source_type"];
$arr_editableDescrSourceType = $data["editableDescriptionSourceTypes"];
$arr_deletableSourceTypes = $data["deletableSourceTypes"];
$activityId = null;
switch ($sourceType) {
case SourceType::LIS_A:
$ret = Allegati\ListinoAcquisto::upload($filter, $fileItem);
$ret = Allegati\ListinoAcquisto::upload($data, $fileItem);
if ($ret->is_OK()) {
$reta = $ret->get_data();
$item = $reta["item"];
@@ -222,17 +235,17 @@ class Allegati {
}
break;
case SourceType::ATTIVITA:
$activityId = $filter["activity_id"];
$activityId = $data["activity_id"];
break;
case SourceType::COMMESSA:
$codJcom = $filter["cod_jcom"];
$codJcom = $data["cod_jcom"];
$ret = \Allegati\Commessa::get_activityId($codJcom);
if ($ret->is_OK()) {
$activityId = $ret->get_string();
}
break;
case SourceType::PARTITAMAG:
$ret = Allegati\PartitaMag::upload($filter, $fileItem);
$ret = Allegati\PartitaMag::upload($data, $fileItem);
if ($ret->is_OK()) {
$reta = $ret->get_data();
$item = $reta["item"];
@@ -248,7 +261,7 @@ class Allegati {
}
break;
case SourceType::ORDCOM:
$ret = Allegati\Ordine::upload($filter, $fileItem);
$ret = Allegati\Ordine::upload($data, $fileItem);
if ($ret->is_OK()) {
$attachments = $ret->get_data();
$html = "";
@@ -269,7 +282,7 @@ class Allegati {
}
break;
case SourceType::ATBOFFT:
$ret = Allegati\ContrattoAcquisto::upload($filter, $fileItem);
$ret = Allegati\ContrattoAcquisto::upload($data, $fileItem);
if ($ret->is_OK()) {
$reta = $ret->get_data();
$item = $reta["item"];
@@ -455,6 +468,70 @@ class Allegati {
return "allegati.php?render=" . \Utility::B64JSON_stringify($data);
}
public static function createZipFromFiles($data) {
$files = array_get($data, "files", array());
$entityToSaveTo = array_get($data, "entityToSaveTo");
if (empty($files) || is_null($entityToSaveTo)) {
return Ret::errorCode(ErrorHandler::MISSING_PARAMS);
}
$listIdAttach = array();
$listStbActivityFile = new EntityArray();
foreach ($files as $file) {
switch ($file["sourceType"]) {
case SourceType::ORDCOM:
case SourceType::ORDACQCOM:
case SourceType::ORDLAVCOM:
case SourceType::ORDVENCOM:
case SourceType::DOCCOM:
case SourceType::PARTITAMAG:
case SourceType::LIBERO:
case SourceType::LIS_A:
case SourceType::ATBOFFT:
$idAttach = array_get($file, "id_attach");
if (isset($idAttach)) {
$listIdAttach[] = $idAttach;
}
break;
case SourceType::COMMESSA:
$id = array_get($file, "activity_id");
$fileName = array_get($file, "file_name");
if (isset($id)) {
$stbActivityFile = new EntityItem("stb_activity_file");
$stbActivityFile
->set("id", $id)
->set("fileName", $fileName);
$listStbActivityFile->append($stbActivityFile);
}
break;
}
}
$body = new EntityItem();
$body
->set("listIdAttach", $listIdAttach, false, true)
->set("listStbActivityFile", $listStbActivityFile, false, true)
->set("fileName", array_get($data, "fileName"))
->set("saveMode", 1)
->set("entityToSaveTo", $entityToSaveTo);
$imsApi = new IMSApi();
$imsApi
->post("createZipFromFiles")
->body($body);
return $imsApi->send();
}
}
//include "TableName.class.php";

View File

@@ -8,7 +8,7 @@ class Attivita {
if ($Ret->is_OK()) {
$arr_rows = $Ret->get_data();
foreach ($arr_rows as $i => $row) {
$arr_rows[$i] = array_pick($row, "file_name", "descrizione", "icon", "icon_style", "activity_id", "mime_type", "last_upd", "size");
$arr_rows[$i] = array_pick($row, "file_name", "descrizione", "icon", "icon_style", "activity_id", "mime_type", "last_upd", "size", "activity_type_id");
$arr_rows[$i]["key"] = array_pick($row, "file_name", "activity_id");
$arr_rows[$i]["source_type"] = $sourceType;
}

View File

@@ -3,7 +3,7 @@
namespace Allegati;
class Commessa {
public static function get_filelist($codJcom, $depth = 0, $filter = array()) {
public static function get_filelist($codJcom, $depth = 0, $filter = array(), $tableMode = false) {
$arr_files = array();
$depth = zeroIfNull($depth);
@@ -49,6 +49,10 @@ class Commessa {
}
if ($Ret->is_OK()) {
if ($tableMode && empty($arr_files)) {
$arr_files[] = array("source_type" => SourceType::COMMESSA);
}
$Ret->set_data(array_orderby($arr_files, "file_name"));
}

View File

@@ -0,0 +1,64 @@
<?php
class AllegatiAjax extends Ajax {
protected function checkCustomRequests() {
if (isset($_GET["popup-main"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["popup-main"]);
include "popup-main.php";
} else if (isset($_POST["uploadFromModal"])) {
$Ret = new Ret;
if (count($_FILES) > 0) {
$data = Utility::B64JSON_parse($_POST["uploadFromModal"]);
$Ret = Allegati::uploadFromModal($data, $_FILES);
} else {
$Ret->set_error("File non pervenuto");
}
$Ret->display();
} else if (isset($_GET["getItemList"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["getItemList"]);
Allegati::getSourceFileList($data)->display();
} else if (isset($_GET["get"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["get"]);
Allegati::get($data)->display();
} else if (isset($_GET["download"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["download"]);
Allegati::download($data);
} else if (isset($_GET["get_all"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["get_all"]);
Allegati::download_all($data)->display();
} else if (isset($_POST["remove"])) {
$data = Utility::sanitizeB64JSON_parse($_POST["remove"]);
Allegati::remove($data)->display();
} else if (isset($_POST["updateDescrizione"])) {
$data = Utility::sanitizeB64JSON_parse($_POST["updateDescrizione"]);
Allegati::updateDescrizione($data)->display();
} else if (isset($_GET["render"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["render"]);
Allegati::render($data)->display();
} else if (isset($_GET["cache"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["cache"]);
Allegati::cache($data)->display();
} else if (isset($_POST["upload"])) {
$Ret = new Ret;
if (count($_FILES) > 0) {
$data = Utility::B64JSON_parse($_POST["upload"]);
$Ret = Allegati::upload($data, $_FILES);
} else {
$Ret->set_error("File non pervenuti");
}
$Ret->display();
} else if (isset($_GET["buildTableRow"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["buildTableRow"]);
$item = $data["item"];
ob_start();
include \Controller::current_gestpath_include("main-tr.php");
$html = \Utility\Str::remove_multiple_spaces(@ob_get_clean());
$Ret = new Ret;
$Ret->set_string($html)->display();
} else if (isset($_GET["getAllegatiAttivita"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["getAllegatiAttivita"]);
Allegati\ContattiCommesse::get_filelist($data)->display();
}
}
}

View File

@@ -1,62 +0,0 @@
<?php
if (isset($_GET["popup-main"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["popup-main"]);
include "popup-main.php";
} else if (isset($_POST["uploadFromModal"])) {
$Ret = new Ret;
if (count($_FILES) > 0) {
$data = Utility::B64JSON_parse($_POST["uploadFromModal"]);
$Ret = Allegati::uploadFromModal($data, $_FILES);
} else {
$Ret->set_error("File non pervenuto");
}
$Ret->display();
} else if (isset($_GET["getItemList"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["getItemList"]);
Allegati::getSourceFileList($data)->display();
} else if (isset($_GET["get"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["get"]);
Allegati::get($data)->display();
} else if (isset($_GET["download"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["download"]);
Allegati::download($data);
} else if (isset($_GET["get_all"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["get_all"]);
Allegati::download_all($data)->display();
} else if (isset($_POST["remove"])) {
$data = Utility::sanitizeB64JSON_parse($_POST["remove"]);
Allegati::remove($data)->display();
} else if (isset($_POST["updateDescrizione"])) {
$data = Utility::sanitizeB64JSON_parse($_POST["updateDescrizione"]);
Allegati::updateDescrizione($data)->display();
} else if (isset($_GET["render"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["render"]);
Allegati::render($data)->display();
} else if (isset($_GET["cache"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["cache"]);
Allegati::cache($data)->display();
} else if (isset($_POST["upload"])) {
$Ret = new Ret;
if (count($_FILES) > 0) {
$data = Utility::B64JSON_parse($_POST["upload"]);
$Ret = Allegati::upload($data, $_FILES);
} else {
$Ret->set_error("File non pervenuti");
}
$Ret->display();
} else if (isset($_GET["buildTableRow"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["buildTableRow"]);
$item = $data["item"];
ob_start();
include \Controller::current_gestpath_include("main-tr.php");
$html = \Utility\Str::remove_multiple_spaces(@ob_get_clean());
$Ret = new Ret;
$Ret->set_string($html)->display();
} else if (isset($_GET["getAllegatiAttivita"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["getAllegatiAttivita"]);
Allegati\ContattiCommesse::get_filelist($data)->display();
} else if (Controller::is_ajaxRequest()) {
$Ret = new Ret;
$Ret->set_errorCode(ErrorHandler::UNEXPECTED_AJAX_METHOD)->display();
}

View File

@@ -1,7 +1,8 @@
<?php
$tableMode = array_get($data, "tableMode", false);
$sourceType = $item["source_type"];
$key = Allegati\SourceType::getFileKey($sourceType, $item);
$fileName = $item["file_name"];
$fileName = array_get($item, "file_name");
$fileNameTruncated = Utility\File::nameTruncated($fileName, 15);
$isDescrizioneEditabile = in_array($sourceType, $arr_editableDescrSourceType);
$isEliminabile = in_array($sourceType, $arr_deletableSourceTypes);
@@ -12,6 +13,10 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
?>
<tr title="Doppio click per scaricare <?= $fileNameTruncated ?>" data-source_type="<?= $sourceType ?>"
data-key="<?= $b64Key ?>" data-file_name="<?= $fileName ?>">
<?php if ($tableMode) { ?>
<td><?= $sourceType ?></td>
<td><?= Utility::B64JSON_stringify($item) ?></td>
<?php } ?>
<td class="vertical-middle" style="width: 30px;">
<?php
if ($isImage) {
@@ -21,7 +26,7 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
<img class="img-rounded image-thumbnail cursor-pointer" src="<?= $urlThumb ?>"
data-url="<?= $urlOriginal ?>"/>
<?php } else { ?>
<i class="fa fa-2x fa-<?= $item["icon"] ?> <?= $item["icon_style"] ?>"></i>
<i class="fa fa-2x fa-<?= array_get($item, "icon") ?> <?= array_get($item, "icon_style") ?>"></i>
<?php } ?>
</td>
<td class="vertical-middle" style="<?= $isDescrizioneEditabile ? "max-width: 110px;" : "max-width: 150px;" ?>">
@@ -50,22 +55,24 @@ $item["last_upd"] = isset($item["last_upd"]) ? $item["last_upd"] : null;
</div>
<?php
} else {
echo $item["descrizione"];
echo array_get($item, "descrizione");
}
?>
</td>
<td class="text-center text-muted vertical-middle">
<small><?= Utility\File::formatSize($item["size"]) ?></small></td>
<small><?= isset($item["size"]) ? Utility\File::formatSize($item["size"]) : "" ?></small>
</td>
<td class="text-center text-muted vertical-middle"
title="<?= \Utility\Date\Format::DMYHMS($item["last_upd"]) ?>">
<small><?= \Utility\Date::format($item["last_upd"], Format::strftimeDMy) ?></small></td>
<small><?= isset($item["last_upd"]) ? \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::ORDCOM)) { ?>
<span class="btn-group btn-group-sm">
<?php if (isset($fileName) && $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 } ?>
</div>
</span>
</td>
</tr>

View File

@@ -4,6 +4,8 @@ if ($Ret->is_OK()) {
$arr_files = $Ret->get_data();
ob_start();
$tableMode = array_get($data, "tableMode", false);
$arr_uploadableSourceType = $data["uploadable_sourceTypes"];
$arr_editableDescrSourceType = $data["editableDescriptionSourceTypes"];
$arr_deletableSourceTypes = $data["deletableSourceTypes"];
@@ -23,38 +25,46 @@ if ($Ret->is_OK()) {
$arr_sourceType = array_unique(array_merge($arr_sourceType, $arr_uploadableSourceType));
?>
<main>
<section class="droparea m_btAllega">
<i style="font-size: 40px" class="fad fa-upload"></i>
<span>Trascina i file qui per caricarli</span>
<p>oppure clicca nel riquadro</p>
</section>
</main>
<input type="file" id="m_fileAllegato" class="hidden" multiple/>
<?php if (!$tableMode) { ?>
<main>
<section class="droparea m_btAllega">
<i style="font-size: 40px" class="fad fa-upload"></i>
<span>Trascina i file qui per caricarli</span>
<p>oppure clicca nel riquadro</p>
</section>
</main>
<input type="file" id="m_fileAllegato" class="hidden" multiple/>
<?php } ?>
<?php if (!$tableMode) { ?>
<ul class="nav nav-tabs mb-8">
<?php
$sourceTypesDict = Allegati\SourceType::get_dictionary();
foreach ($arr_sourceType as $i => $sourceType) {
$title = Allegati\SourceType::getTitle($sourceType);
$isUploadable = in_array($sourceType, $arr_uploadableSourceType);
?>
<li class="<?= $i == 0 ? "active" : "" ?>">
<a data-tab="<?= $sourceType ?>">
<?php echo $title; ?>
</a>
</li>
<?php } ?>
</ul>
<?php } ?>
<ul class="nav nav-tabs">
<?php
$sourceTypesDict = Allegati\SourceType::get_dictionary();
foreach ($arr_sourceType as $i => $sourceType) {
$title = Allegati\SourceType::getTitle($sourceType);
$isUploadable = in_array($sourceType, $arr_uploadableSourceType);
?>
<li class="<?= $i == 0 ? "active" : "" ?>">
<a data-tab="<?= $sourceType ?>">
<?php echo $title; ?>
</a>
</li>
<?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">
<table id="m_tbAllegati" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th colspan="2">File</th>
<th class="hidden" data-field="source_type">Source Type</th>
<th class="hidden" data-field="data">Data</th>
<th><?= $tableMode ? "Icona" : "" ?></th>
<th>File</th>
<th>Descrizione</th>
<th class="small">Dimensioni</th>
<th class="small" style="width: 80px;">Modificato il</th>
<th style="width: 50px;">&nbsp;</th>
<th style="width: 50px;" data-field="btn"><?= $tableMode ? "Azioni" : "" ?></th>
</tr>
</thead>
<tbody>

View File

@@ -12,6 +12,9 @@ function ModalAllegati() {
this._dataOrd = null;
this._numOrd = null;
this._idContratto = null;
this._onBeforeChanging = null;
this._onBeforeCommand = null;
this._createZipFromFilesData = null;
this._flagOnlyCurrentUser = false; // filtro su commessa, true: solo attivita agganciate a utente corrente
this._waitLoader = false;
@@ -23,6 +26,9 @@ function ModalAllegati() {
this._uploadableSourceTypes = [];
this._editableDescriptionSourceTypes = [];
this._tableMode = false;
this.grid = null;
this.costructor();
this.waitLoader(false).draggable().gridSize({xs: 12, md: 8}).backhash().okCancel();
}
@@ -58,6 +64,11 @@ ModalAllegati.prototype.editableDescription = function (v) {
return this;
};
ModalAllegati.prototype.tableMode = function (v = true) {
this._tableMode = v;
return this;
}
ModalAllegati.prototype.onUpload = function (f) {
this._onUpload = f;
return this;
@@ -138,15 +149,31 @@ ModalAllegati.prototype.idContratto = function (v) {
return this;
};
ModalAllegati.prototype._getFilter = function () {
ModalAllegati.prototype.onBeforeChanging = function(f) {
this._onBeforeChanging = f;
return this;
}
ModalAllegati.prototype.onBeforeCommand = function(f) {
this._onBeforeCommand = f;
return this;
}
ModalAllegati.prototype.createZipFromFilesData = function (v) {
this._createZipFromFilesData = v;
return this;
}
ModalAllegati.prototype._getFilter = function (sourceType = null) {
const self = this;
const filter = {
filter: self._filter,
source_type: self._getCurrentSourceType(),
source_type: sourceType || self._getCurrentSourceType(),
visible_sourceTypes: self._visibleSourceTypes,
uploadable_sourceTypes: self._uploadableSourceTypes,
deletableSourceTypes: self._deletableSourceTypes,
editableDescriptionSourceTypes: self._editableDescriptionSourceTypes
editableDescriptionSourceTypes: self._editableDescriptionSourceTypes,
tableMode: self._tableMode
};
if (!is_null(self._idContratto)) {
@@ -204,8 +231,8 @@ ModalAllegati.prototype.open = async function () {
const self = this;
const filter = self._getFilter();
const ajax = new Ajax();
const ret = await ajax.get("popup-main")
const ret = await new Ajax()
.get("popup-main")
.module("allegati")
.data(filter)
.$button(self._$button)
@@ -227,21 +254,207 @@ ModalAllegati.prototype.open = async function () {
await self
.onBeforeShow(function ($div) {
self._onRefreshSourceTypeTab();
$div.addClass("ModalAllegati");
const $table = self._getShowedTable();
self.get$btOK().enabled($table.find("tbody > tr").length > 0); // downloadAll
$table.find("tbody > tr").each(function () {
self._setRowEvents($(this));
if (self._tableMode) {
self.grid = $div.find("#m_tbAllegati").kendoGrid({
dataSource: {
group: [
{
field: "source_type"
}
]
},
pageable: false,
scrollable: false,
selectable: {
mode: "multiple, row",
dragToSelect: false
},
contextMenu: {
body: [
{
name: "CreateZipFromFiles",
text: "Crea zip",
icon: "- fas fa-archive",
command: "CreateZipFromFiles"
}
],
open: (e) => {
const grid = $(e.target).parents(".k-grid-table").data("kendoGrid");
const $target = $(e.target);
if (!grid) {
e.preventDefault();
return;
}
if ($target.parents(".k-grouping-row").length) {
e.preventDefault();
return;
}
const selectedRows = self.grid.select();
const targetTr = $target.parents("tr").get(0);
if (!selectedRows.toArray().some(selectedRow => selectedRow === targetTr)) {
self.grid.clearSelection();
self.grid.select(targetTr);
}
},
select: async (e) => {
if (!e.item) {
return;
}
const $target = $(e.target);
const grid = $target.parents(".k-grid-table").data("kendoGrid");
if (!grid?.length) {
e.preventDefault();
}
const allegati = grid.select().toArray().map(item => grid.dataItem(item));
if (!allegati.length) {
e.preventDefault();
return;
}
try {
const command = $(e.item).data("command");
let ret = null;
if (command && self._onBeforeCommand) {
await self._onBeforeCommand(command, allegati, grid);
}
switch (command) {
case "CreateZipFromFiles": {
ret = await self.createZipFromFiles({
...self._createZipFromFilesData,
files: allegati.map(allegato => ({
sourceType: allegato.source_type,
...allegato.data.key
}))
});
break;
}
}
if (ret?.returnId === 1) {
self.close();
await self.open();
}
} catch (e) {
console.error(e);
}
}
},
changing: (e) => {
const allegato = e.sender.dataItem(e.target);
if (!allegato) {
e.preventDefault();
return;
}
self._onBeforeChanging && self._onBeforeChanging(e, allegato);
},
dataBound: (e) => {
e.sender.tbody.find("tr.k-master-row")
.each((i, row) => {
const $row = $(row);
const dataItem = e.sender.dataItem(row);
if (dataItem.data) {
if (dataItem.eventsSet) {
return;
}
dataItem.data = _ojbc.B64JSON_parse(dataItem.data);
dataItem.eventsSet = true;
self._setRowEvents($row);
} else {
$row.hide();
}
});
},
}).data("kendoGrid");
const columnSourceType = self.grid.columns.find(col => col.field === "source_type");
if (columnSourceType) {
columnSourceType.hidden = true;
columnSourceType.groupHeaderTemplate = (data) => `${data.value}${self._uploadableSourceTypes.includes(data.value) ?
` <button type="button" class="btnUploadFile ml-1"></button>` : ""}`;
}
self.grid.columns.find(col => col.field === "data").hidden = true;
self.grid.columns.find(col => col.field === "Icona").attributes = {
class: "!k-text-center"
};
self.grid.refresh();
}
self.$div.find(".btnUploadFile").kendoButton({
icon: "- far fa-plus !k-text-success m-0",
themeColor: "success",
fillMode: "flat",
click: (e) => {
const $tr = e.sender.element.closest("tr").next();
const dataItem = self.grid.dataItem($tr);
const modalBox = new ModalBox();
let dropzone = null;
modalBox
.content(`<div id="dropzone"></div>`)
.title("Caricamento allegati")
.gridSize(this._gridSize)
.onBeforeShow(($div) => {
dropzone = $div.find("#dropzone").dropzone({
onDrop: async (e, files) => {
const ret = await self._upload(files, dataItem.source_type);
if (ret.returnId === 1) {
modalBox.close();
self.close();
await this.open();
}
return ret.returnId === 1;
},
});
})
.onClose(() => {
dropzone?.destroy();
})
.show();
}
});
$div.find("ul.nav-tabs > li > a[data-tab]").on("tabChange", function () {
if (!self._tableMode) {
$table.find("tbody > tr").each(function () {
self._setRowEvents($(this));
});
$div.find("ul.nav-tabs > li > a[data-tab]").on("tabChange", function () {
self._onRefreshSourceTypeTab();
});
self._onRefreshSourceTypeTab();
});
self.initDropzone();
self.initDropzone();
}
})
.onClose(function () {
$(document).off("paste");
@@ -316,6 +529,11 @@ ModalAllegati.prototype._onRefreshSourceTypeTab = function () {
$table.find("tr[data-source_type]").hide();
$table.find("tr[data-source_type='" + sourceType + "']").show();
if (self._uploadableSourceTypes?.length) {
$(".droparea").toggleClass("hidden", !self._uploadableSourceTypes.includes(sourceType));
}
return self;
};
@@ -324,33 +542,32 @@ ModalAllegati.prototype._getCurrentSourceType = function () {
return $active.exists() ? $active.attr("data-tab") : null;
};
ModalAllegati.prototype._upload = function (files) {
const d = $.Deferred();
ModalAllegati.prototype._upload = async function (files, sourceType = null) {
const self = this;
const filter = self._getFilter();
const filter = self._getFilter(sourceType);
const formData = new FormData();
Array.from(files).forEach(file => formData.append("files[]", file));
var ajax = new Ajax();
ajax.post("uploadFromModal")
const ret = await new Ajax()
.post("uploadFromModal")
.module("allegati")
.data(filter)
.formData(formData)
.deferred(d)
.$toDisable(self)
.noticeAsModal()
.onSuccess(function (ret) {
const $tbody = self._getShowedTable().children("tbody");
const $tr = $(ret.returnString);
$tbody.append($tr);
$tr.highlightRow();
$tr.each((_, row) => self._setRowEvents($(row)));
})
.execute();
return d;
if (!self._tableMode) {
const $tbody = self._getShowedTable().children("tbody");
const $tr = $(ret.returnString);
$tbody.append($tr);
$tr.highlightRow();
$tr.each((_, row) => self._setRowEvents($(row)));
}
return ret;
};
ModalAllegati.prototype._getShowedTable = function () {
@@ -368,10 +585,22 @@ ModalAllegati.prototype._refresh_btDownload = function () {
};
ModalAllegati.prototype._setRowEvents = function ($tr) {
var self = this;
const self = this;
$tr.on("dblclick", function () {
_allegati.download($(this));
let source_type = $tr.getDataAttr("source_type");
let key = $tr.getDataAttr("key");
let file_name = $tr.getDataAttr("file_name");
if (self._tableMode) {
const dataItem = self.grid.dataItem($tr);
source_type = dataItem.source_type;
key = _ojbc.B64JSON_parse(dataItem.key);
file_name = dataItem.data.file_name;
}
_allegati.download({source_type, key, file_name, $tr});
});
$tr.find(".btDownloadAllegato").on("click", function (e) {
@@ -380,8 +609,22 @@ ModalAllegati.prototype._setRowEvents = function ($tr) {
return false;
});
$tr.find(".btRemoveAllegato").on("click", function () {
_allegati.remove($tr).then(function () {
$tr.find(".btRemoveAllegato").on("click", function (e) {
e.stopPropagation();
let source_type = $tr.getDataAttr("source_type");
let key = $tr.getDataAttr("key");
let file_name = $tr.getDataAttr("file_name");
if (self._tableMode) {
const dataItem = self.grid.dataItem($tr);
source_type = dataItem.source_type;
key = _ojbc.B64JSON_parse(dataItem.key);
file_name = dataItem.data.file_name;
}
_allegati.remove({source_type, key, file_name, $tr}).then(function () {
self._refresh_btDownload();
if (is_function(self._onRemove)) {
self._onRemove(self._countRows());
@@ -461,6 +704,7 @@ ModalAllegati.prototype._updateDescrizione = function ($input) {
var $tr = $input.closest("tr");
var sourceType = $tr.getDataAttr("source_type");
var key = $tr.getDataAttr("key");
if (sourceType === _allegati.sourceTypes.ATTIVITA) {
var activityId = key.activity_id;
var fileName = key.file_name;
@@ -483,4 +727,25 @@ ModalAllegati.prototype._updateDescrizione = function ($input) {
})
.execute();
}
};
};
ModalAllegati.prototype.getFileList = async (data) => {
const ret = await new Ajax()
.get("get_fileList")
.module("allegati")
.data(data)
.noticeAsModal()
.execute();
return ret?.returnData;
}
ModalAllegati.prototype.createZipFromFiles = async (data) => {
return await new Ajax()
.post("createZipFromFiles")
.module("allegati")
.data(data)
.waitModal()
.noticeAsModal()
.execute();
}

View File

@@ -118,8 +118,8 @@ let _allegati = {
.execute();
},
download: function ($tr) {
this.getCachePath($tr, function (ret) {
download: function (data) {
this.getCachePath(data, function (ret) {
_APP.download_file(ret.returnString);
});
},
@@ -149,14 +149,14 @@ let _allegati = {
.execute();
},
getCachePath: function ($tr, onSuccess) {
getCachePath: function (data, onSuccess) {
new Ajax()
.get("get")
.data({
source_type: $tr.getDataAttr("source_type"),
key: $tr.getDataAttr("key")
source_type: data.source_type,
key: data.key
})
.$toDisable($tr)
.$toDisable(data.$tr)
.module("allegati")
.noticeAsToast()
.onSuccess(function (ret) {
@@ -165,13 +165,13 @@ let _allegati = {
.execute();
},
remove: function ($tr) {
remove: function (data) {
let self = this;
let d = $.Deferred();
let sourceType = $tr.getDataAttr("source_type");
let key = $tr.getDataAttr("key");
let fileName = $tr.getDataAttr("file_name");
let sourceType = data.source_type;
let key = data.key;
let fileName = data.file_name;
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);
@@ -179,7 +179,7 @@ let _allegati = {
let messageFileDelete = "Stai eliminando <b>" + shortenFilename + "</b>";
let yesText = "Continua";
if ($tr.find("img.image-thumbnail").exists()) {
if (data.isImage) {
let imgResizedUri = _allegati.getRenderedFileUrl(key, sourceType, {
renew: false,
resize: [200, 200],
@@ -201,11 +201,11 @@ let _allegati = {
btYes: {text: yesText, icon: "trash", size: {sm: 5}},
style: "danger"
})
.$toDisable($tr)
.$button($tr.find(".btRemoveAllegato"))
.$toDisable(data.$tr)
// .$button($tr.find(".btRemoveAllegato"))
.noticeAsModal()
.onSuccess(function () {
$tr.remove();
data.$tr?.remove();
d.resolve();
})
.execute();

View File

@@ -1,15 +1,13 @@
SELECT *
FROM (
SELECT activity_id
FROM stb_activity inner join stb_activity_file on stb_activity.activity_id = stb_activity_file.id
WHERE stb_activity.cod_jcom = '[cod_jcom]'
AND activity_type_id IN (
SELECT activity_type_id
FROM srl_activity_type_user
INNER JOIN jrl_flav_users ON srl_activity_type_user.user_name = jrl_flav_users.user_name
INNER JOIN wtb_users ON wtb_users.User_name = jrl_flav_users.user_name AND
wtb_users.user_name = '[user_name]'
)
AND '[user_name]' IN (stb_activity.user_creator, stb_activity.user_name)
) t
FROM (SELECT DISTINCT activity_id
FROM stb_activity
inner join stb_activity_file on stb_activity.activity_id = stb_activity_file.id
WHERE stb_activity.cod_jcom = '[cod_jcom]'
AND activity_type_id IN (SELECT activity_type_id
FROM srl_activity_type_user
INNER JOIN jrl_flav_users
ON srl_activity_type_user.user_name = jrl_flav_users.user_name
INNER JOIN wtb_users ON wtb_users.User_name = jrl_flav_users.user_name AND
wtb_users.user_name = '[user_name]')
AND '[user_name]' IN (stb_activity.user_creator, stb_activity.user_name)) t
WHERE 1 = 1

View File

@@ -43,7 +43,7 @@ class AnalisiBudget {
->set("idRow", array_get($budget, "id_row"))
->set("codAnag", array_get($budget, "cod_anag"))
->set("codMart", array_get($budget, "cod_mart"))
->set("qtaBudget", array_get($budget, "qtaBdgVend"));
->set("qtaBudget", array_get($budget, "QtaBdgVend"));
$vtbBdgt = new EntityItem("vtb_bdgt");

View File

@@ -1,2 +1 @@
.number-ticker{display:block;position:absolute;line-height:1em;height:1em;opacity:0;transition:0.5s linear;z-index:1;color:#000}.number-ticker-wrapper{position:relative;display:flex;user-select:none;pointer-events:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.number-ticker-wrapper .ticker-columns{display:flex;height:1em;line-height:1em;color:#000}.number-ticker-wrapper .ticker-columns .splited-column{display:flex}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper{height:1em;text-align:center;overflow:hidden;color:#000;transition:color .15s;width:1ch}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper.increase{color:springgreen}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper.decrease{color:tomato}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column{position:relative;height:1em;display:block}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column>span,.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column .char{position:absolute;left:0;line-height:1em;text-align:center;width:100%}.number-ticker-wrapper .ticker-columns .decimal{width:1ch;text-align:center}.number-ticker-wrapper .ticker-columns.auto-width .decimal{width:auto}.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper{width:0}.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper .column>span,.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper .column .char{width:auto}body{min-width:min-content}div#content{margin:1rem 1rem 5rem}@media (max-width: 800px){.flex{flex-direction:column}div.number-box.border-left-side{border-radius:0}div.number-box.border-right-side{border-radius:0}}.number-box{background-color:#dbdbdb;padding:15px;min-width:15vw}.number-box.border-left-side{border-radius:10px 0 0 10px}.number-box.border-right-side{border-radius:0 10px 10px 0}.number-box span{font-family:"Courier New", Courier, monospace}#tableAnalisiBudget{flex-wrap:wrap;border-width:0}#tableAnalisiBudget .k-loading-mask{max-width:98vw !important;max-height:72vh !important}#tableAnalisiBudget td:has(.text-vend)>.text-vend{color:#009900}#tableAnalisiBudget td:has(.text-racc)>.text-racc{color:red}#tableAnalisiBudget td:has(.text-positive)>.text-positive{color:#009900}#tableAnalisiBudget td:has(.text-negative)>.text-negative{color:red}#tableAnalisiBudget td{overflow:hidden;text-overflow:ellipsis}#tableAnalisiBudget .k-detail-row{background-color:#ffffb3}#tableAnalisiBudget .k-grid-toolbar-sticky{position:sticky;top:51px;z-index:3}#tableAnalisiBudget .k-grid-header-sticky{position:sticky;top:calc(51px + 48px);z-index:3}#tableAnalisiBudget .k-header .k-link .k-column-title{margin-left:auto !important;margin-right:auto !important}#tableAnalisiBudget .toolbar-item{flex:1 0 20%}#tableAnalisiBudget .k-grouping-row{text-align:right}#tableAnalisiBudget.k-grid .k-grouping-row td{border-bottom-width:1px}
/*# sourceMappingURL=main.css.map */
.number-ticker{display:block;position:absolute;line-height:1em;height:1em;opacity:0;transition:.5s linear;z-index:1;color:#000}.number-ticker-wrapper{position:relative;display:flex;user-select:none;pointer-events:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.number-ticker-wrapper .ticker-columns{display:flex;height:1em;line-height:1em;color:#000}.number-ticker-wrapper .ticker-columns .splited-column{display:flex}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper{height:1em;text-align:center;overflow:hidden;color:#000;transition:color .15s;width:1ch}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper.increase{color:#00ff7f}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper.decrease{color:tomato}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column{position:relative;height:1em;display:block}.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column>span,.number-ticker-wrapper .ticker-columns .splited-column .column-wrapper .column .char{position:absolute;left:0;line-height:1em;text-align:center;width:100%}.number-ticker-wrapper .ticker-columns .decimal{width:1ch;text-align:center}.number-ticker-wrapper .ticker-columns.auto-width .decimal{width:auto}.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper{width:0}.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper .column>span,.number-ticker-wrapper .ticker-columns.auto-width .column-wrapper .column .char{width:auto}body{min-width:min-content}div#content{margin:1rem 1rem 5rem}@media(max-width: 800px){.flex{flex-direction:column}div.number-box.border-left-side{border-radius:0}div.number-box.border-right-side{border-radius:0}}.number-box{background-color:#dbdbdb;padding:15px;min-width:15vw}.number-box.border-left-side{border-radius:10px 0 0 10px}.number-box.border-right-side{border-radius:0 10px 10px 0}.number-box span{font-family:"Courier New",Courier,monospace}#tableAnalisiBudget{flex-wrap:wrap;border-width:0}#tableAnalisiBudget .k-loading-mask{max-width:98vw !important;max-height:72vh !important}#tableAnalisiBudget td:has(.text-vend)>.text-vend{color:#090}#tableAnalisiBudget td:has(.text-racc)>.text-racc{color:red}#tableAnalisiBudget td:has(.text-positive)>.text-positive{color:#090}#tableAnalisiBudget td:has(.text-negative)>.text-negative{color:red}#tableAnalisiBudget td{overflow:hidden;text-overflow:ellipsis}#tableAnalisiBudget .k-detail-row{background-color:#ffffb3}#tableAnalisiBudget .k-grid-toolbar-sticky{position:sticky;top:51px;z-index:3}#tableAnalisiBudget .k-grid-header-sticky{position:sticky;top:99px;z-index:3}#tableAnalisiBudget .k-header .k-link .k-column-title{margin-left:auto !important;margin-right:auto !important}#tableAnalisiBudget .toolbar-item{flex:1 0 20%}#tableAnalisiBudget .k-grouping-row{text-align:right}#tableAnalisiBudget .k-grouping-row:has(td[colspan="4"]) td{background-color:#d9d9d9}#tableAnalisiBudget .k-grouping-row td{border-bottom-width:1px}#tableAnalisiBudget .k-grouping-row+.k-table-row td,#tableAnalisiBudget .k-grouping-row+.k-table-row .k-table-td{border-top-width:0}.k-pdf-export .k-grid-toolbar,.k-pdf-export .k-grouping-header,.k-pdf-export .k-pager{display:none}.k-pdf-export .k-grid-header{font-size:12px}.k-pdf-export #tableAnalisiBudget .k-grid-header-sticky{position:unset}.k-pdf-export #tableAnalisiBudget .k-header .k-link .k-column-title{min-width:100%}.k-pdf-export .k-filterable .k-grid-filter-menu{display:none}.k-pdf-export td{font-size:12px}.k-pdf-export .k-i-caret-alt-right::before{content:">";font-family:initial}.k-pdf-export .k-i-caret-alt-down::before{content:">";font-family:initial}/*# sourceMappingURL=main.css.map */

View File

@@ -102,9 +102,59 @@ div#content {
.k-grouping-row {
text-align: right;
&:has(td[colspan="4"]) td {
background-color: #d9d9d9;
}
td {
border-bottom-width: 1px;
}
& + .k-table-row td, & + .k-table-row .k-table-td {
border-top-width: 0;
}
}
}
$exportFontSize: 12px;
.k-pdf-export {
.k-grid-toolbar,
.k-grouping-header,
.k-pager {
display: none;
}
&.k-grid .k-grouping-row td {
border-bottom-width: 1px;
.k-grid-header {
font-size: $exportFontSize;
}
#tableAnalisiBudget {
.k-grid-header-sticky {
position: unset;
}
.k-header .k-link .k-column-title {
min-width: 100%;
}
}
.k-filterable .k-grid-filter-menu {
display: none;
}
td {
font-size: $exportFontSize;
}
.k-i-caret-alt-right::before {
content: "\003E";
font-family: initial;
}
.k-i-caret-alt-down::before {
content: "\003E";
font-family: initial;
}
}

View File

@@ -309,6 +309,40 @@ class Catalogo {
return $Ret;
}
public static function src_commessa($data) {
$q = trim(strtolower($data["q"]));
$Ret = new Ret;
if (strlen($q) > 0) {
$Ret = ContattiCommesse::getListCommesse(array("q" => $q));
if ($Ret->is_OK()) {
$arr_commesse = array_values(from($Ret->get_data())
->where(function ($x) {
return !is_null($x["tipo_anag"]);
})
->select(function ($x) {
return array_pick($x, "cod_jcom", "activity_id", "descrizione", "tipo_anag", "cod_anag", "cod_vdes", "user_name_tec", "user_name_agen");
})
->toArray());
$arr_commesse = array_slice(array_unique_key($arr_commesse, "cod_jcom"), 0, 30);
foreach ($arr_commesse as $i => $row) {
$arr_commesse[$i]["subtext"] = "COMMESSA " . $row["cod_jcom"];
$Ret = ContattiCommesse::getInfoCliente($row["tipo_anag"], $row["cod_anag"]);
$arr_commesse[$i]["clie"] = $Ret->is_OK() ? $Ret->get_data() : null;
$arr_commesse[$i]["process_activity_id"] = $row["activity_id"];
unset($arr_commesse[$i]["activity_id"]);
}
$Ret->set_OK()->set_data($arr_commesse);
}
}
return $Ret;
}
public static function get_architetti() {//TODO (migliorabile)
$Query = new Query;
return $Query->select("cod_vage", "rag_soc")->from("vtb_agen")->where("cod_vage LIKE 'A%'")->orderBy("rag_soc")->toRet()->execute();

View File

@@ -508,10 +508,10 @@ class Ordine {
->set("gestione", $key["gestione"])
->set("numOrd", $key["num_ord"])
->set("serie", $key["serie"])
->set("codJcom", $data["cod_jcom"])
->set("codJcom", $data["codJcom"])
->set("codAnag", $cliente["cod_anag"])
->set("tipoAnag", $cliente["tipo_anag"])
->set("codVdes", null, true)
->set("codVdes", "", true)
->set("codPaga", $data["cod_paga"], true)
->set("descrizionePaga", $data["descrizione_paga"], true)
->set("mezzo", $data["mezzo"], true)
@@ -565,7 +565,7 @@ class Ordine {
$Body->set("codVdes", $destData["cod_vdes"])
->detail("CRMDestinazione", $Dest);
} else {
$Body->set("codVdes", null, true);
$Body->set("codVdes", "", true);
}
$Body->set("CRMPersRif");
@@ -582,6 +582,33 @@ class Ordine {
}
}
$codJflav = $data["codJflav"];
if (is_null($data["processActivityId"])) {
// INSERT NUOVA COMMESSA E PROCESSO (TRATTATIVA)
$commessa = new \EntityItem();
$commessa
->set("descrizione", $data["descrizione"], true)
->set("descrizioneEstesa", $data["descrizione"], true)
->set("note", $data["noteComm"], true)
->set("codJflav", $codJflav)
->set("codJfas", $data["codJfas"])
->set("statoCommessa", $data["statoCommessa"]);
$Body->detail("CRMCommessa", $commessa);
// TODO??
// $Attivita = new \ContattiCommesse\Attivita();
// $Attivita->activityTypeId(self::get_activityTypePreventivazione())
// ->flagTipologia("P")
// ->activityDescription($data["descrizione"], true)
// ->userName($userName)
// ->userCreator(User::get_current_username())
// ->estimatedTimestamp(\Utility\Date::getNow());
// $Body->set("CRMAttivita", $Attivita->to_entityItem());
}
$IMSApi = new \IMSApi;
return $IMSApi->post()->service("completaOffertaCRM")->body($Body)->send()->set_data(null);
}
@@ -629,11 +656,11 @@ class Ordine {
if (!is_null($activityId)) {
$StbActivity = new \EntityItem("stb_activity");
$StbActivity->set("activityId", $activityId)
->set("activityResultId", null, true)
->set("activityResultId", "", true)
->set("userModifier", \User::get_current_username())
->setDatetime("oraModAct", \Utility\Date::getNow())
->setDatetime("effectiveEnddate", null, true)
->setDatetime("effectiveEndtime", null, true)
->setDatetime("effectiveEnddate", "", true)
->setDatetime("effectiveEndtime", "", true)
->update();
$EntityList->push($StbActivity->update());
}
@@ -829,6 +856,12 @@ class Ordine {
return "PREVENTIVO " . $key["num_ord"] . " DEL " . strftime("%d-%m-%Y", $key["data_ord"]);
}
public static function getIdPdfInformativaPrivacy() {
$gestSetup = new GestSetup();
return $gestSetup->section("CATALOGO")->keySection("PDF_INFORMATIVA_PRIVACY")->get();
}
private static function getBlobPdfInformativa() {
$GestSetup = new \GestSetup;
$idAttach = $GestSetup->keySection("PDF_INFORMATIVA_PRIVACY")->get();

View File

@@ -1,5 +1,8 @@
<?php
if (isset($_GET["load_filters"])) {
if (isset($_GET["src_commessa"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["src_commessa"]);
ContattiCommesse::src_commessa($data)->display();
} else if (isset($_GET["load_filters"])) {
$data = Utility::sanitizeB64JSON_parse($_GET["load_filters"]);
Catalogo\Filtro::filter($data)->display();
} else if (isset($_GET["get_filteredProducts"])) {

Some files were not shown because too many files have changed in this diff Show More