147 Commits

Author SHA1 Message Date
Surya Paolo
e8872d69f8 aa 2024-05-29 11:13:48 +02:00
Surya Paolo
aad7822cfd aaa 2024-05-27 21:09:28 +02:00
Surya Paolo
fea61fda7d Merge branch 'develop' of ssh://risosrv:5522/~/repository/freeplanet_serverside into Dev_PDB1 2024-05-27 21:09:10 +02:00
Surya Paolo
b1ff0ee3b7 fix cleanHtmlForTelegram (post di Claudio) 2024-05-10 01:59:54 +02:00
Surya Paolo
87808caadf - fix notifiche 2024-05-10 01:08:49 +02:00
Surya Paolo
1d5002ea0f - fix notifiche 2024-05-10 00:58:38 +02:00
Surya Paolo
3b1b2b9c83 - fix RIS in pendenti, se troppi msg, non compariva piu
- cataloghi, ricerca pickup
2024-05-09 23:36:46 +02:00
Surya Paolo
54443e784e - caaloghi, categorie 2024-05-08 16:07:32 +02:00
Surya Paolo
6834dd1d55 catalogo, avanti, grafica 2024-05-05 19:08:58 +02:00
Surya Paolo
3fcff43af0 Catalogo, versione di libro/ebook, ecc... quantità 2024-05-05 13:55:43 +02:00
Surya Paolo
07973fbf0a - catalogo avanti, parte 1 2024-05-04 14:49:02 +02:00
Surya Paolo
e1f2e799d6 - catalogo macro, importazione dati 2024-04-29 14:58:45 +02:00
Surya Paolo
2cdb83cddf ok 2024-04-26 00:49:05 +02:00
Surya Paolo
7773c2a87b - fix: "Circuito RIS {nomecircuito}" uniformati tutti quanti.
- fix Strette di mano dicitura.
- poter vedere e cliccare sul gruppo telegram della provincia (dalla lista dei circuiti).
2024-04-25 23:26:16 +02:00
Surya Paolo
c79f6e8cc6 - add: poter inviare un messaggi a tutti i partecipanti dei Circuiti RIS (senza perdere la formattazione). 2024-04-24 21:36:47 +02:00
Surya Paolo
49ecb3edea ++ poter inviare un msg telegram ai appartenenti ai Circuiti RIS. 2024-04-23 22:47:20 +02:00
Surya Paolo
68b4403138 - fix invio annuncio Bene, funzioni di getCategoriaSkillByRec non prendevano idapp. 2024-04-19 18:12:10 +02:00
Surya Paolo
11955b3242 - fixed server versioni precedenti (getEnableTokenExpiredByIdApp dava errore perchè confpages non esiste nelle vecchie versioni ...) 2024-04-19 15:44:34 +02:00
Surya Paolo
e6009f66b9 Versione: 1.0.35: Versione Server con Token... 2024-04-18 22:10:36 +02:00
Surya Paolo
e8cd676eef - fix: se inserisco un username telegram di chi mi ha invitato, non facevo il controllo. 2024-04-11 18:55:15 +02:00
Surya Paolo
3e8be18473 - fix quantità corretta sulla email e dimensione dell'immagine 2024-04-11 17:12:21 +02:00
Surya Paolo
c2d76ff10a Gestione Refresh Token Completata ! 2024-04-11 11:43:19 +02:00
Surya Paolo
07c210c59e - aggiornamento refreshtoken (parte 1)
- PCB: fix listino
2024-04-09 21:56:50 +02:00
Surya Paolo
3221cf8d25 -fixed: lista richieste ingresso ai gruppi 2024-04-05 15:49:06 +02:00
Surya Paolo
fef8d0fbc7 - fix: l'admin non riusciva a cambiare il Circuito... 2024-04-04 18:43:17 +02:00
Surya Paolo
970428a359 - fix scelta provincia (il bottone Avanti non veniva disabilitato).
- Se non scelgo la provincia, non deve farmi vedere la App...
2024-03-28 20:25:48 +01:00
Surya Paolo
de13c42f8b - fixed criticità sulla password e su tokens che potevi richiedere sul projection. 2024-03-26 18:11:19 +01:00
Surya Paolo
39687265c8 - aggiunto note 'note_ordine_gas'
- corretto bug
2024-03-26 15:36:49 +01:00
Surya Paolo
bf1e9b83ba - Versione 1.0.33
- Aggiornato le varie librerie package
2024-03-23 00:21:32 +01:00
Surya Paolo
22771c1ea7 - sistemato anche il users/profile ed aggiunto /users/activities 2024-03-21 22:58:46 +01:00
Surya Paolo
bd95e4457f - mappa iniziale
- fix PATCH /chval Json Injections: era possibile cambiare la password !
- ogni giorno sblocca la lista di chi chiede troppe richieste di recupero password.
2024-03-21 21:22:57 +01:00
Surya Paolo
3e0d0bf018 - fixed quantità
- creazione mappa numero utenti per provincia !
2024-03-19 00:21:54 +01:00
Surya Paolo
44b25fdf33 - fix with old_code
- filtro per GAS
2024-03-08 18:57:13 +01:00
Surya Paolo
c94d5dc844 - fix troncamento stringa , i TAG HTML non venivano chiusi. ora li ho tolti 2024-03-06 20:46:00 +01:00
Surya Paolo
b5dbaafa91 - le categorie visibili solo se ci sono prodotti attivi 2024-03-03 14:38:25 +01:00
Surya Paolo
789e3fde41 - posso fare upload dell'immagine del prodotto dalla lista
- corretto import dati
2024-03-02 22:53:29 +01:00
Surya Paolo
1017a3dfe2 - zoom dialog immagine 2024-02-28 23:56:23 +01:00
Surya Paolo
b60f0f9e34 -Quando insersci l'username telegram sul Profilo, devo togliergli la chiocciola !
- anche nella ricerca User
2024-02-28 17:04:28 +01:00
Surya Paolo
e809195f60 - Se inserisco un evento solo "On Line" non dovrebbe comparire obbligatorio il Comune. 2024-02-28 15:02:02 +01:00
Surya Paolo
da9d5f25ea -Circuito Italia raddoppiato sulle Attività 2024-02-28 11:37:29 +01:00
Surya Paolo
4a980aaad2 - fix firstchars 2024-02-28 00:20:02 +01:00
Surya Paolo
6ff9922a29 - Versione 1.0.28
- Bottone "Condividi" permette di creare un post Telegram con l'annuncio selezionato.
- migliorata grafica dell'annuncio.
2024-02-27 22:08:06 +01:00
Surya Paolo
3191312372 - Bitcoin
- Circuito non aggiungere se già esiste
2024-02-23 22:12:36 +01:00
Surya Paolo
204a625e06 - la ricerca trova anche i "On Line" anche se metto la provincia o regione. 2024-02-19 18:51:10 +01:00
Surya Paolo
9a83efaa3c - profilo corretto 2024-02-18 20:13:32 +01:00
Surya Paolo
6d8a5ae137 - FIX: duplicati dei Circuiti e Rimozione ! 2024-02-17 16:04:22 +01:00
Surya Paolo
1268c961cf - corretto saldi pendenti sulla lista circuiti e anche il calcolo 2024-02-17 15:07:21 +01:00
Surya Paolo
8c471c0e81 - Fix: saldo pendenze e totali Transati. 2024-02-17 14:13:39 +01:00
Surya Paolo
e6fd8e1fed - inizio check transazioni RISO 2024-02-16 21:12:53 +01:00
Surya Paolo
1c31543af8 - aggiunto bottone per Confermare tutti gli ordini
- 1 bottone per Consegnare e Pagare
2024-02-16 14:11:03 +01:00
Surya Paolo
5a6c08e908 - corretto cancellazione ordine 2024-02-15 18:59:07 +01:00
Surya Paolo
6e61138fde - corretto cancellazione ordine 2024-02-15 18:58:58 +01:00
Surya Paolo
24f2b46cc8 aggiornamento Ordini GAS filtri 2024-02-13 18:13:26 +01:00
Surya Paolo
26ab024514 inizio_riso 2024-02-11 17:29:58 +01:00
Surya Paolo
9ca9ea6eaa - aggiungo campo "sfuso"
- aggiunto totale al carrello
2024-02-11 16:33:00 +01:00
Surya Paolo
e7b0fd1d95 fixed carrello che scompariva... 2024-02-10 16:42:00 +01:00
Surya Paolo
acbc23e92d corretto bug che alcuni ordini a zero non venivano cancellati... 2024-02-09 22:40:21 +01:00
Surya Paolo
dacfc5a844 - aggiornato sistema per inviare le newsletter ! 2024-02-08 01:34:30 +01:00
Surya Paolo
2151502d30 immagini dei prodotti marocco
visualizzazione di una pagina web su di un q-dialog
2024-02-06 22:39:47 +01:00
Surya Paolo
64bd3cebb3 import products dinamically 2024-02-06 20:12:54 +01:00
Surya Paolo
9fe81713e5 ver 1.0.25 2024-02-03 23:04:56 +01:00
Surya Paolo
0c2a8ecef5 AITools prime cose 2024-01-30 14:00:37 +01:00
Surya Paolo
aeabf96efe agiornamento, sistemazioni varie PCB 2024-01-23 00:10:40 +01:00
Surya Paolo
e4504bcf9e regNameSurnameMandatory
askUSernameTelegramToTheReg
@ davanti all'username
2024-01-19 23:38:08 +01:00
Surya Paolo
dbcdbd689b fix order non si vedeva.. e msg login errato 2024-01-17 21:49:59 +01:00
Surya Paolo
f6a0876178 fix problema sul caricamento della home da offline... 2024-01-17 20:30:07 +01:00
Surya Paolo
1ef3103a9d risolto qtaminima "|" era sbagliato, corretto: product.minBuyQty || 1 2024-01-17 11:13:13 +01:00
Surya Paolo
d7122af70e ciao corretto 2024-01-16 23:09:04 +01:00
Surya Paolo
3d1a330fa2 Poter inserire un Ordine anche per un altra persona... (Modalità Cassa) 2024-01-16 23:00:10 +01:00
Surya Paolo
a2c9dcb38c gasordine 2024-01-16 17:09:55 +01:00
Surya Paolo
d22e808626 aggio gasordine 2024-01-16 16:56:39 +01:00
Surya Paolo
9265e9bfb3 fix_ismanager 2024-01-16 11:22:22 +01:00
Surya Paolo
504e9fd88c fix2 2024-01-16 11:17:48 +01:00
Surya Paolo
4b9fe4d267 fix 2024-01-16 11:16:31 +01:00
Surya Paolo
d81f533ecb fix totqta 2024-01-16 10:49:20 +01:00
Surya Paolo
65d75cb2c5 aggio 2024-01-16 09:05:02 +01:00
Surya Paolo
212f895650 corretto 2024-01-15 22:46:38 +01:00
Surya Paolo
3183825137 possibilità di modificare un ordine, e anche i totali 2024-01-15 22:19:26 +01:00
Surya Paolo
79ca364e84 product 2024-01-13 16:21:07 +01:00
Surya Paolo
7bf549569d - edit campi prodotti
- edit ordini
2024-01-13 00:28:53 +01:00
Surya Paolo
c63e345285 subcatprod 2024-01-12 13:02:59 +01:00
Surya Paolo
9b4a9dbf28 aggio modif 2024-01-10 20:44:43 +01:00
Surya Paolo
a71c487697 email da inviare ai clienti ... 2024-01-09 23:57:30 +01:00
Surya Paolo
3dfb990620 aggiorna 2024-01-09 15:31:59 +01:00
Surya Paolo
4cdc4f7de1 pcb 2024-01-09 08:38:00 +01:00
Surya Paolo
7ea6c2a76b aggio numtransaction 2024-01-09 08:34:28 +01:00
Surya Paolo
db81980046 Corretto il pagato
- fix Group Add link
2024-01-07 17:27:20 +01:00
Surya Paolo
fb16a1729e menu RIS 2024-01-07 16:03:39 +01:00
Surya Paolo
d7ae8baec4 inserimento in Movimenti del Circuito 2024-01-04 15:43:13 +01:00
Surya Paolo
b754492b41 - abilitato circuits e groups 2024-01-03 23:46:31 +01:00
Surya Paolo
0aaa331b3f addOrderToMovement 2024-01-03 23:19:15 +01:00
Surya Paolo
66e4c577c7 addtocash using sendcoins Circuit 2024-01-03 15:46:42 +01:00
Surya Paolo
75ef581635 update 2024-01-02 15:39:29 +01:00
Surya Paolo
4e0c18f47c ++ Cassa - parte 1 2024-01-02 15:24:44 +01:00
Surya Paolo
3fb78ff39a - migliorata grafica prodotti 2023-12-31 14:34:01 +01:00
Surya Paolo
6313476d54 - migliorie grafiche 2023-12-30 23:58:35 +01:00
Surya Paolo
b6204c7612 - Uscita PRIMA VERSIONE PiuCheBuono.app 2023-12-30 21:33:59 +01:00
Surya Paolo
ade9c149c5 - preordinabili corretti + altro 2023-12-29 21:17:17 +01:00
Surya Paolo
633b9a2d8c aggiornato prodotti e scontistica 2023-12-29 15:19:15 +01:00
Surya Paolo
3d1dddba39 - poster 2023-12-29 01:27:47 +01:00
Surya Paolo
db7724cca4 - aggiunta campi Gas data + fix 2023-12-28 23:53:11 +01:00
Surya Paolo
5afe9dd1e2 - aggiunta campi Gas data + fix 2023-12-28 23:48:03 +01:00
Surya Paolo
c001587702 - filtro se GAS o Prodotti 2023-12-28 21:00:02 +01:00
Surya Paolo
ca6d29414a - Email Ordine da template HTML 2023-12-28 15:53:00 +01:00
Surya Paolo
f23047bcd5 - Aggiornamento template mail (tramite i campi in HTML)
- Aggiornato Carrello
2023-12-28 00:50:35 +01:00
Surya Paolo
15d831eecc - Categorie
- ProductInfo
2023-12-27 02:58:15 +01:00
Surya Paolo
f0495d93b3 Seleziona l'ordine GAS e compare sulla email 2023-12-24 00:55:49 +01:00
Surya Paolo
0eb287db06 - Creazione pagina Home logout
- Nuovo Gasordine
- Visualizzazione GAS / BOTTEGA
2023-12-21 15:21:24 +01:00
Surya Paolo
322bfb9738 Merge branch 'Dev_PDB1' of ssh://risosrv:5522/~/repository/freeplanet_serverside into Dev_PDB1 2023-12-21 10:58:18 +01:00
Surya Paolo
428a5ca0e9 modif 2023-12-21 10:58:15 +01:00
Surya Paolo
000e900f48 ++GasOrdini 2023-12-21 02:23:52 +01:00
Surya Paolo
2ab4bd4e2a Corretto incongruenze OrdersCart 2023-12-21 01:34:33 +01:00
Surya Paolo
7af909d2be Aggiornamento modifiche preOrdini 2023-12-20 21:56:15 +01:00
Surya Paolo
0e1fc359a0 Aggiornamento modifiche preOrdini 2023-12-20 21:52:17 +01:00
Surya Paolo
d00c7eccc8 Corretto l'url delle immagini dei prodotti ! 2023-12-18 16:37:26 +01:00
Surya Paolo
7e7d7ca6b4 Aggiungi il codice alla cassa in automatico 2023-12-18 15:21:07 +01:00
Surya Paolo
a3913a4575 corretto totali in attesa 2023-12-18 13:04:38 +01:00
Surya Paolo
7628fb97fc Carrello con scontistica aggiornata 2023-12-18 12:11:12 +01:00
Surya Paolo
56b5bac5f0 Merge branch 'Dev_PDB1' of ssh://risosrv:5522/~/repository/freeplanet_serverside into Dev_PDB1 2023-12-18 08:34:51 +01:00
Surya Paolo
e7021e1f14 aaa 2023-12-18 08:32:03 +01:00
Surya Paolo
139d7ea33c Risolto problema blocco 2023-12-18 08:02:28 +01:00
Surya Paolo
50d610b1b1 aggiornamento... 2023-12-17 19:19:04 +01:00
Surya Paolo
c71f4af370 Abilitazione del BOT 2023-12-17 16:20:44 +01:00
Surya Paolo
4290895a97 aggiornamento scontistica, corretto errori 2023-12-16 18:40:17 +01:00
Surya Paolo
ab3a31d4fb Scontistica- Parte 1 2023-12-16 00:51:03 +01:00
Surya Paolo
1ca72118f1 lista ordini aggiornata 2023-12-15 23:36:43 +01:00
Surya Paolo
4d9eccd1ae Corretto Ordini e visualizzazione dei Totali 2023-12-15 21:50:21 +01:00
Surya Paolo
05ec283882 import dati prodotti + fornitore + produttore 2023-12-15 00:57:14 +01:00
Surya Paolo
ea2b7095c9 aggiornamento ordini 2023-12-14 15:20:21 +01:00
Surya Paolo
d0bf7e1b6a aggiornato stockQta quando l'ordine viene evaso 2023-12-14 00:55:07 +01:00
Surya Paolo
fcdd826c54 Gestione Ordini: evaso... 2023-12-13 19:17:53 +01:00
Surya Paolo
a2bd4f6e97 aggio query 2023-12-12 15:42:41 +01:00
Surya Paolo
5f3c8a65ea corretto abiltiazione fiducia concessa 2023-12-12 00:56:40 +01:00
Surya Paolo
caadbaae5f aggio2 2023-12-11 20:48:52 +01:00
Surya Paolo
296b7b4fb8 modif 2023-12-11 19:06:22 +01:00
Surya Paolo
ff81ab7be3 dev 2023-12-11 11:25:16 +01:00
Surya Paolo
8ce4f66c55 a1p 2023-12-11 10:10:52 +01:00
Surya Paolo
daacde7455 aggiornamento visualizzazione Ordini e Carrello 2023-12-09 19:38:23 +01:00
Surya Paolo
023ba26003 aggiornamento Indici 2023-12-09 11:55:58 +01:00
Surya Paolo
502ed32c42 - Installazione primo Sito Web del server
- Creazione prima pagina Home
2023-12-09 00:19:40 +01:00
Surya Paolo
74c4a829b0 Creazione Sito Web da pagina 2023-12-08 14:07:32 +01:00
Surya Paolo
f7bcb0c361 modif 2023-12-07 11:28:01 +01:00
Surya Paolo
72a7e3fa37 modif 2023-12-07 11:27:30 +01:00
Surya Paolo
4871c2d868 Aggiornata Chiave Segreta per accesso SIGNCODE.
- Inserito autenticazione MongoDB ai database.
-PCB: Aggiunto altri campi a products
2023-12-07 08:34:24 +01:00
Surya Paolo
d5bc76335f - Entri in Circuito Italia solo se hai il fido nel circuito provinciale
- Aggiunta Zona, oltre alla provincia, per visualizzare i vari circuiti della prov
2023-12-06 00:41:50 +01:00
Surya Paolo
6edba03eff Versione 1.0.21 - RIS ITALIA 2023-12-02 15:23:35 +01:00
Surya Paolo
d61808d1dd ignore 2023-11-28 14:18:36 +01:00
156 changed files with 3609395 additions and 5675 deletions

BIN
.DS_Store vendored

Binary file not shown.

41
.env.dev.pcb Normal file
View File

@@ -0,0 +1,41 @@
DATABASE=test_PiuCheBuono
UDB=paofreeplanet
PDB=mypassword@1A
SEND_EMAIL=0
SEND_EMAIL_ORDERS=1
PORT=3000
appTelegram_TEST=["1","17","18"]
appTelegram=["1","17","18"]
DOMAIN=mongodb://localhost:27017/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
ENABLE_PUSHNOTIFICATION=1
URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
PATH_CERT_KEY=localhost.key
PATH_SERVER_CRT=localhost.crt
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
GCM_API_KEY=""
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
SECRTK=prova123prova567ASDADASDAS
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
FTPSERVER_HOST=139.162.166.31
FTPSERVER_PORT=21
FTPSERVER_USER=ftpusrsrv_
FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123

41
.env.dev.riso Normal file
View File

@@ -0,0 +1,41 @@
DATABASE=test_FreePlanet
UDB=paofreeplanet
PDB=mypassword@1A
SEND_EMAIL=0
SEND_EMAIL_ORDERS=1
PORT=3000
appTelegram_TEST=["1","13"]
appTelegram=["1","13"]
DOMAIN=mongodb://localhost:27017/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
ENABLE_PUSHNOTIFICATION=1
URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
PATH_CERT_KEY=localhost.key
PATH_SERVER_CRT=localhost.crt
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
GCM_API_KEY=""
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
SECRTK=prova123prova567ASDADASDAS
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
FTPSERVER_HOST=139.162.166.31
FTPSERVER_PORT=21
FTPSERVER_USER=ftpusrsrv_
FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123

41
.env.development Normal file
View File

@@ -0,0 +1,41 @@
DATABASE=test_FreePlanet
UDB=paofreeplanet
PDB=mypassword@1A
SEND_EMAIL=0
SEND_EMAIL_ORDERS=1
PORT=3000
appTelegram_TEST=["1","13"]
appTelegram=["1","13"]
DOMAIN=mongodb://localhost:27017/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
ENABLE_PUSHNOTIFICATION=1
URLBASE_APP1=https://localhost
PORT_APP1=8080
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
HTTPS_LOCALHOST=true
DEBUG=0
DEBUG=0
TESTING_ON=1
LOCALE=1
DELAY_SENDEMAIL=2000
VAPI_KEY_SUBJECT=mailto:paolo@freeplanet.app
PUBLIC_VAPI_KEY=BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8
PRIVATE_VAPI_KEY=uB2-jQkrbysyDtqN3ziMBDsVn0wdEaDsksX81zoOGQo
PATH_CERT_KEY=localhost.key
PATH_SERVER_CRT=localhost.crt
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
GCM_API_KEY=""
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
SECRTK=prova123prova567ASDADASDAS
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
FTPSERVER_HOST=139.162.166.31
FTPSERVER_PORT=21
FTPSERVER_USER=ftpusrsrv_
FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123

35
.env.prod.pcb Normal file
View File

@@ -0,0 +1,35 @@
DATABASE=PiuCheBuono
UDB=paofreeplanet
PDB=suerteFreePlanet@1A
SEND_EMAIL=1
SEND_EMAIL_ORDERS=1
PORT=3000
appTelegram_TEST=["17","18"]
appTelegram=["17","18"]
ENABLE_PUSHNOTIFICATION=1
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE=www.freeplanet_server
PORT_APP1="0"
DOMAIN=mongodb://localhost:32001/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadminREAL@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
SECRTK=jAxKm02emx5SeJvz2IGmtRf6YqCgope
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNVZZ

34
.env.test.pcb Normal file
View File

@@ -0,0 +1,34 @@
DATABASE=test_PiuCheBuono
UDB=paofreeplanet
PDB=suerteFreePlanet@1A
SEND_EMAIL=1
SEND_EMAIL_ORDERS=1
PORT=3001
appTelegram_TEST=["17","18"]
appTelegram=["17","18"]
ENABLE_PUSHNOTIFICATION=1
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE=test.freeplanet_server
PORT_APP1="0"
DOMAIN=mongodb://localhost:32002/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:surya@riso.app"
PUBLIC_VAPI_KEY="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
PRIVATE_VAPI_KEY="LVpFDJuKscdHuQr5pe20dFuYuWX1-ZRb6x72PP-Pp4I"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV

View File

@@ -4,11 +4,14 @@ PDB=suerteFreePlanet@1A
SEND_EMAIL=1
PORT=3001
ENABLE_PUSHNOTIFICATION=1
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE=test.freeplanet_server
DIRECTORY_SERVER=/var/www/testriso.freeplanet_serverside
SERVERDIR_WEBSITE=testriso.piuchebuono.app
PORT_APP1="0"
DOMAIN=mongodb://localhost:27018/
SIGNCODE=abc123
DOMAIN=mongodb://localhost:32002/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
@@ -23,3 +26,6 @@ PATH_SSL_CHAIN_PEM=chain.pem
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV

32
.env.test2 Normal file
View File

@@ -0,0 +1,32 @@
DATABASE=test_FreePlanet
UDB=paofreeplanet
PDB=suerteFreePlanet@1A
SEND_EMAIL=1
PORT=3001
ENABLE_PUSHNOTIFICATION=1
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE=test2.freeplanet_server
URLBASE_APP1=https://test2.riso.app
PORT_APP1="0"
DOMAIN=mongodb://localhost:27018/
AUTH_MONGODB=1
MONGODB_USER=admin
MONGODB_PWD=mypwadmin@1A
SIGNCODE=SU2134hncaskjdbo231oihJSDNHEI$1@AB
DEBUG=0
LOCALE=0
DELAY_SENDEMAIL=1000
VAPI_KEY_SUBJECT="mailto:paolo@freeplanet.app"
PUBLIC_VAPI_KEY="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnrB9KrSrh0-aDCODXBm7sZ1DDs"
PRIVATE_VAPI_KEY="St9UMzcS76Q9yKG6RInAuYydYjFRliqwHTJY3A5wjO0"
GCM_API_KEY="AIzaSyD7w1jztfVV05mX1iyxoI-r1pZWxuxdUK8"
PATH_CERT_KEY=key.pem
PATH_SERVER_CRT=cert.pem
PATH_SSL_ROOT_PEM=root.pem
PATH_SSL_CHAIN_PEM=chain.pem
PROD=0
PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=iUUb38v23jjDFaosWj92axkBOXCQ
TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV

3
.gitignore vendored
View File

@@ -1,6 +1,5 @@
node_modules/
.env.test
.env.development
.env.production
.env.production.bak
ESEMPI/
@@ -30,3 +29,5 @@ emails/.DS_Store
.DS_Store
.DS_Store
logtrans.txt
yarn.lock
logtrans.txt

37
.vscode/launch.json vendored
View File

@@ -11,15 +11,17 @@
"runtimeArgs": [
"--inspect=9229" // Use "--inspect=0.0.0.0:9229" for remote debugging
],
"args": ["${workspaceFolder}/src/server/server.js"], // Replace with your entry file
"args": [
"${workspaceFolder}/src/server/server.js"
], // Replace with your entry file
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"sourceMaps": true,
"env": {
"NODE_ENV":"development",
"TESTING_ON":"1"
"NODE_ENV": "development",
"TESTING_ON": "1"
},
},
{
@@ -32,33 +34,18 @@
"runtimeArgs": [
"--trace-warnings" // Use "--inspect=0.0.0.0:9229" for remote debugging
],
"args": ["${workspaceFolder}/src/server/server.js"], // Replace with your entry file
"args": [
"${workspaceFolder}/src/server/server.js"
], // Replace with your entry file
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"sourceMaps": true,
"env": {
"NODE_ENV":"development",
"TESTING_ON":"1"
"NODE_ENV": "development",
"TESTING_ON": "1"
},
},
{
"name": "Server Debug",
"request": "launch",
"runtimeArgs": [
"run-script",
"start"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"env": {
"NODE_ENV":"development",
"TESTING_ON":"1"
},
"type": "node"
},
{
"name": "ServerSide",
@@ -69,8 +56,8 @@
],
"type": "node",
"env": {
"NODE_ENV":"development",
"TESTING_ON":"1"
"NODE_ENV": "development",
"TESTING_ON": "1"
}
},
]

View File

@@ -1,3 +1,8 @@
{
"search.useIgnoreFiles": false
"search.useIgnoreFiles": false,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/node_modules/**": true,
"**/src/server/router/upload/**": true
},
}

4
check_permessi_server_test2.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
ssh -p 8855 suryapaolo@servereng "ls -ld /var/www/test2.freeplanet_server"

3592316
comuni_italia.geojson Normal file

File diff suppressed because it is too large Load Diff

18
deploynode_on_prod_pcb.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
source ./.env.prod.pcb
echo "Sincronizzazione in corso PCB PRODUZIONE ... /var/www/$SERVERDIR_WEBSITE/"
echo ""
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' src pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' .env.prod.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/.env.production
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/package.json
echo "Sincronizzazione TERMINATA! - SERVER PCB!"

19
deploynode_on_test_pcb.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
source ./.env.test.pcb
echo "Sincronizzazione in corso PCB TEST ... /var/www/$SERVERDIR_WEBSITE/"
echo ""
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' src pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' .env.test.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/.env.test
rsync -avz -e 'ssh -p 8822' .env.test.pcb pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:/var/www/$SERVERDIR_WEBSITE/package.json
echo "Sincronizzazione TERMINATA! - SERVER PCB!"

View File

@@ -2,15 +2,20 @@
source ./.env.test.risosrv
echo "Sincronizzazione in corso..."
rsync -avz -e 'ssh -p 5522' css root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' docs root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' emails root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' images root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' plugins root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' sass root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' src root@risosrv:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 5522' .env.test.risosrv root@risosrv:/var/www/$SERVERDIR_WEBSITE/.env.test
rsync -avz -e 'ssh -p 5522' package.json root@risosrv:/var/www/$SERVERDIR_WEBSITE/package.json
echo "Sincronizzazione in corso... $DIRECTORY_SERVER"
rsync -avz -e 'scp -p 8822' .env.test.risosrv pcbuser@pcb:$DIRECTORY_SERVER/.env.test
rsync -avz -e 'ssh -p 8822' ecosystem.config.testriso.js pcbuser@pcb:$DIRECTORY_SERVER/ecosystem.config.js
rsync -avz -e 'ssh -p 8822' css pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' docs pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' emails pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' images pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' plugins pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' sass pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' src --exclude 'server/router/upload' pcbuser@pcb:$DIRECTORY_SERVER/
rsync -avz -e 'ssh -p 8822' ecosystem.config.testriso.js pcbuser@pcb:$DIRECTORY_SERVER/ecosystem.config.js
rsync -avz -e 'ssh -p 8822' package.json pcbuser@pcb:$DIRECTORY_SERVER/package.json
echo "Sincronizzazione TERMINATA! - SERVER TEST!"
echo "**************************"
echo "Sincronizzazione TERMINATA! - TESTSRISO.FREEPLANET_SERVER!"
echo "https://testriso.piuchebuono.app"
echo "**************************"

34
deploynodejs_on_test2.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
source ./.env.test2
echo "Directory attuale: $PWD"
msg="*** SERVER DI TEST2 **** SEI SICURO DI INVIARE GLI AGGIORNAMENTI SERVERSIDE (NODE JS) - SUL SERVER $SERVERDIR_WEBSITE (Y/N) ? "
if [ "$1" = "" ]; then
read -p "$msg" risposta
else
echo $msg
risposta=$1
fi
if [[ $risposta == "Y" || $risposta == "y" ]]; then
echo "Sincronizzazione in corso... $SERVERDIR_WEBSITE"
echo "Copiando .env.test2..."
rsync -avz -e 'ssh -p 8855' .env.test2 suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/.env.test
echo "Sincronizzazione in corso... src"
rsync -avz -e 'ssh -p 8855' -a --exclude 'src/router/upload' src suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' package.json suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/package.json
rsync -avz -e 'ssh -p 8855' css suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' docs suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' emails suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' images suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' plugins suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
rsync -avz -e 'ssh -p 8855' sass suryapaolo@servereng:/var/www/$SERVERDIR_WEBSITE/
echo "Sincronizzazione TERMINATA! - SERVER TEST2!"
fi

0
docs/prova.txt Normal file
View File

View File

@@ -4,7 +4,10 @@ module.exports = {
name: "FreePlanetServerSide",
script: "./src/server/server.js",
ignore_watch : ["node_modules"],
interpreter: "/root/.nvm/versions/node/v16.19.0/bin/node",
watch: false,
//autorestart: true,
instances: 1,
env: {
"PORT": 3000,
"NODE_ENV": "development",
@@ -17,9 +20,9 @@ module.exports = {
"PORT": 3000,
"NODE_ENV": "production",
},
log_file: "combined.outerr.log",
error_file: "err.log",
out_file: "out.log",
log_file: "logs/combined.outerr.log",
error_file: "logs/err.log",
out_file: "logs/out.log",
merge_logs: true,
log_date_format: "YYYY-MM-DD HH:mm:ss.SSSS Z"
}

22
ecosystem.config.testriso.js Executable file
View File

@@ -0,0 +1,22 @@
module.exports = {
apps : [
{
name: "TESTRISO2 FreePlanetServerSide",
script: "./src/server/server.js",
ignore_watch : ["node_modules"],
interpreter: "/root/.nvm/versions/node/v16.19.0/bin/node",
watch: false,
//autorestart: true,
instances: 1,
env_test: {
"PORT": 3001,
"NODE_ENV": "test",
},
log_file: "logs/combined.outerr.log",
error_file: "logs/err.log",
out_file: "logs/out.log",
merge_logs: true,
log_date_format: "YYYY-MM-DD HH:mm:ss.SSSS Z"
}
]
};

View File

@@ -19,17 +19,40 @@ html
}
body(yahoofix, style="background: #ffffff")
- var baseimg = baseurl + '/statics/'
- var baseimg = baseurl + '/'
span(id='body_style', style='display:block')
table(cellpadding="10", cellspacing="0", width="600", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
if (orders.items && orders.items.length > 0)
- var mystorehouse = orders.items[0].order.storehouse
else
- var mystorehouse = null
tr
td(class="emailContainer", valign="top")
- var mioheader = mystorehouse.email_html_header
if (mioheader)
p!= mioheader
- var mioname = name
if (!mioname)
- var mioname = user.username
p Ciao #{mioname},
if (orders.items[0].order.quantitypreordered > 0)
- var miomakeorder = mystorehouse.email_html_GAS_makeorder
else
- var miomakeorder = mystorehouse.email_html_makeorder
if (miomakeorder)
p!= miomakeorder
else
p Ti arriverà una email quando i prodotti saranno disponibili per poterli venire a ritirare.
p Il pagamento, se non diversamente comunicato, potrai farlo direttamente in sede.
p Ciao #{username},
p Ti confermiamo che hai appena inviato un'ordine di prenotazione dei seguenti prodotti:
tr
td(class="whitespace", height="10")
@@ -39,12 +62,25 @@ html
- var note = orders.note
- var index = 0
each product in orders.items
- var descr = product.order.product.name
- var img = product.order.product.img
- var price = product.order.price
- var after_price = product.order.after_price
- var qty = product.order.quantity
each rec in orders.items
- var descr = rec.order.product.productInfo.name
- var img = rec.order.product.productInfo.img
- var price = rec.order.price
- var after_price = rec.order.after_price
- var TotalPriceProduct = rec.order.TotalPriceProductstr
if (rec.order.gasordine)
- var gasordine = rec.order.gasordine.name
else
- var gasordine = ''
- var qty = rec.order.quantity
- var qtypreordered = rec.order.quantitypreordered
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
else if (rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
- var unit = rec.order.product.productInfo.unitstr
- index = index + 1
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
@@ -56,28 +92,44 @@ html
table(cellpadding="0", cellspacing="0", summary="", border="0")
tr
td
img(src=baseimg + img, alt="", width="150" height="150")
img(src=baseimg + img, alt="", width="150")
td(class="column", valign="top")
table(cellpadding="0", cellspacing="0", summary="", border="0")
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Gas Ordine: #{gasordine}
p &nbsp;
tr
td(class="sectionContentTitle boldhigh", valign="top")
p #{descr}
tr
td(class="sectionContent", valign="top")
p Prezzo: #{price} € #{after_price}
if (qty > 0)
td(class="sectionContent", valign="top")
p Quantità: #{qty} #{unit}
if (qtypreordered > 0)
td(class="sectionContent", valign="top")
p Quantità Prenotata: #{qtypreordered} #{unit}
tr
td(class="sectionContent", valign="top")
p Quantità: #{qty}
p Totale: #{TotalPriceProduct} €
if (note)
p Note Aggiuntive: #{note}
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
tr
td(class="whitespace", height="10")
p Ti arriverà una email quando i prodotti saranno disponibili per poterli venire a ritirare.
p Il pagamento potrai farlo direttamente in sede.
tr
td
- var miofooter = mystorehouse.email_html_footer
if (miofooter)
p!= miofooter
else
p Grazie Mille
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")

View File

@@ -28,7 +28,12 @@ html
tr
td(class="emailContainer", valign="top")
p Ciao #{name},
- var mioname = name
if (!mioname)
- var mioname = user.username
p Ciao #{mioname},
p L'ordine è stato Cancellato.
p Se è stato un errore, procedi a ripetere l'Ordine, ripartendo dalla lista prodotti.
p Grazie Mille

View File

@@ -1,80 +0,0 @@
doctype html
html
head
title Ordine Completato
//- import css/scss stylesheets
//- these file names will be replace by gulp with proper css file paths
link(rel="stylesheet", href="../sass/basic.scss")
link(rel="stylesheet", href="../sass/one/styles.scss")
//- embdedded css allowed, but not sass
style.
.red {
background-color: #E84C50;
}
.full-width {
width: 100%;
}
body(yahoofix, style="background: #ffffff")
- var baseimg = baseurl + '/statics/'
span(id='body_style', style='display:block')
table(cellpadding="10", cellspacing="0", width="600", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
tr
td(class="emailContainer", valign="top")
p Ciao #{name},
p L'ordine n. #{ordernumber} è stato Completato correttamente !
p Grazie Mille per aver contribuito a far crescere la Comunità
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
tr
td.firma
p!= dataemail.firma
tr
td.disclaimer
p!= dataemail.disclaimer_out
tr
td.bottom
p!= dataemail.disc_bottom_out
tr
td(class="whitespace", height="10")
p &nbsp;
style(type="text/css").
html, body {
padding: 0;
margin: 0;
}
p {
font-size: 1rem;
}
.divbtn {
display: flex;
align-items: center;
justify-content: center;
}
.btn-lg {
padding: 5px;
margin: 5px;
font-size: 26px;
cursor: pointer;
color: white;
background: #027be3 !important;
border-radius: 28px;
}

View File

@@ -1 +0,0 @@
=`Ordine n. ${ordernumber} Completato`

View File

@@ -1,7 +1,7 @@
doctype html
html
head
title Ordine Confermato
title Ordine n. #{ordernumber} Confermato
//- import css/scss stylesheets
//- these file names will be replace by gulp with proper css file paths
@@ -19,32 +19,65 @@ html
}
body(yahoofix, style="background: #ffffff")
- var baseimg = baseurl + '/statics/'
- var baseimg = baseurl + '/';
span(id='body_style', style='display:block')
table(cellpadding="10", cellspacing="0", width="600", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
if (orders.items && orders.items.length > 0)
- var mystorehouse = orders.items[0].order.storehouse
else
- var mystorehouse = null
tr
td(class="emailContainer", valign="top")
p Ciao #{name},
p L'ordine dei seguenti prodotti è stato Confermato:
- var mioheader = mystorehouse.email_html_header
if (mioheader)
p!= mioheader
- var mioname = name
if (!mioname)
- var mioname = user.username
p Ciao #{mioname},
if (orders.items[0].order.quantitypreordered > 0)
- var miordconfirmed = mystorehouse.email_html_GAS_order_confirmed
else
- var miordconfirmed = mystorehouse.email_html_order_confirmed
if (miordconfirmed)
p!= miordconfirmed
else
p Puoi pertanto venire a ritirarli direttamente in sede, negli orari che ti sono stati indicati.
tr
td(class="whitespace", height="10")
p &nbsp;
- var totalPrice = orders.totalPrice
- var note = orders.note
- var index = 0
each product in orders.items
- var descr = product.order.product.name
- var img = product.order.product.img
- var price = product.order.price
- var after_price = product.order.after_price
- var qty = product.order.quantity
each rec in orders.items
- var descr = rec.order.product.productInfo.name
- var img = rec.order.product.productInfo.img
- var price = rec.order.product.price
- var after_price = rec.order.product.after_price
if (rec.order.gasordine)
- var gasordine = rec.order.gasordine.name
else
- var gasordine = ''
- var qty = rec.order.product.quantity
- var qtypreordered = rec.order.quantitypreordered
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
else if (rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
- var unit = rec.order.product.productInfo.unitstr
- var TotalPriceProduct = rec.order.TotalPriceProductstr
- index = index + 1
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
@@ -56,27 +89,46 @@ html
table(cellpadding="0", cellspacing="0", summary="", border="0")
tr
td
img(src=baseimg + img, alt="", width="150" height="150")
img(src=baseimg + img, alt="", width="150")
td(class="column", valign="top")
table(cellpadding="0", cellspacing="0", summary="", border="0")
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Gas Ordine: #{gasordine}
p &nbsp;
tr
td(class="sectionContentTitle boldhigh", valign="top")
p #{descr}
tr
td(class="sectionContent", valign="top")
p Prezzo: #{price} € #{after_price}
if (qty > 0)
tr
td(class="sectionContent", valign="top")
p Quantità: #{qty}
p Quantità: #{qty} #{unit}
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Quantità Prenotata: #{qtypreordered} #{unit}
tr
td(class="sectionContent", valign="top")
p Totale: #{TotalPriceProduct} €
if (note)
p Note Aggiuntive: #{note}
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
tr
td(class="whitespace", height="10")
p Puoi pertanto venire a ritirarli direttamente in sede.
tr
td
- var miofooter = mystorehouse.email_html_footer
if (miofooter)
p!= miofooter
else
p Grazie Mille
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")

View File

@@ -0,0 +1,179 @@
doctype html
html
head
title Ordine n. #{ordernumber} Consegnato
//- import css/scss stylesheets
//- these file names will be replace by gulp with proper css file paths
link(rel="stylesheet", href="../sass/basic.scss")
link(rel="stylesheet", href="../sass/one/styles.scss")
//- embdedded css allowed, but not sass
style.
.red {
background-color: #E84C50;
}
.full-width {
width: 100%;
}
body(yahoofix, style="background: #ffffff")
- var baseimg = baseurl + '/';
span(id='body_style', style='display:block')
table(cellpadding="10", cellspacing="0", width="600", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
if (orders.items && orders.items.length > 0)
- var mystorehouse = orders.items[0].order.storehouse
else
- var mystorehouse = null
tr
td(class="emailContainer", valign="top")
- var mioheader = mystorehouse.email_html_header
if (mioheader)
p!= mioheader
- var mioname = name
if (!mioname)
- var mioname = user.username
p Ciao #{mioname},
p L'ordine n. #{ordernumber} è stato Consegnato correttamente 📦 !
p Grazie per averci scelto 🙏🏻 e alla prossima !
p &nbsp;
if (orders.items[0].order.quantitypreordered > 0)
- var miomakeorder = mystorehouse.email_html_GAS_order_consegnato
else
- var miomakeorder = mystorehouse.email_html_order_consegnato
if (miomakeorder)
p!= miomakeorder
- var totalPrice = orders.totalPrice
- var note = orders.note
- var index = 0
each rec in orders.items
- var descr = rec.order.product.productInfo.name
- var img = rec.order.product.productInfo.img
- var price = rec.order.product.price
- var after_price = rec.order.product.after_price
if (rec.order.gasordine)
- var gasordine = rec.order.gasordine.name
else
- var gasordine = ''
- var qty = rec.order.product.quantity
- var qtypreordered = rec.order.quantitypreordered
if (rec.order.product.productInfo.sfuso && rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered * rec.order.product.productInfo.weight
else if (rec.order.product.productInfo.weight)
- qtypreordered = qtypreordered + ' x ' + rec.order.product.productInfo.weight
- var unit = rec.order.product.productInfo.unitstr
- var TotalPriceProduct = rec.order.TotalPriceProductstr
- index = index + 1
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr
td(class="column", valign="center" width="40")
p.boldhigh #{index}.
td(class="column sectionArticleImage", valign="top" width="150")
table(cellpadding="0", cellspacing="0", summary="", border="0")
tr
td
img(src=baseimg + img, alt="", width="150")
td(class="column", valign="top")
table(cellpadding="0", cellspacing="0", summary="", border="0")
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Gas Ordine: #{gasordine}
p &nbsp;
tr
td(class="sectionContentTitle boldhigh", valign="top")
p #{descr}
tr
td(class="sectionContent", valign="top")
p Prezzo: #{price} € #{after_price}
if (qty > 0)
tr
td(class="sectionContent", valign="top")
p Quantità: #{qty} #{unit}
if (qtypreordered > 0)
tr
td(class="sectionContent", valign="top")
p Quantità Prenotata: #{qtypreordered} #{unit}
tr
td(class="sectionContent", valign="top")
p Totale: #{TotalPriceProduct} €
if (note)
p Note Aggiuntive: #{note}
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
tr
td(class="whitespace", height="10")
tr
td
- var miofooter = mystorehouse.email_html_footer
if (miofooter)
p!= miofooter
else
p Grazie Mille
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr
td(class="whitespace", height="10")
p &nbsp;
tr
td.firma
p!= dataemail.firma
tr
td.disclaimer
p!= dataemail.disclaimer_out
tr
td.bottom
p!= dataemail.disc_bottom_out
tr
td(class="whitespace", height="10")
p &nbsp;
style(type="text/css").
html, body {
padding: 0;
margin: 0;
}
p {
font-size: 1rem;
}
.divbtn {
display: flex;
align-items: center;
justify-content: center;
}
.btn-lg {
padding: 5px;
margin: 5px;
font-size: 26px;
cursor: pointer;
color: white;
background: #027be3 !important;
border-radius: 28px;
}

View File

@@ -0,0 +1 @@
=`Ordine n. ${ordernumber} Consegnato`

View File

@@ -11,15 +11,16 @@
-}
- var urlcal = baseurl + '/calendario-eventi/'
- var imginstagram = baseurl + '/statics/images/images/footer-instagram-icon.png'
- var imgtwitter = baseurl + '/statics/images/images/footer-twitter-icon.png'
- var imgyoutube = baseurl + '/statics/images/images/footer-youtube-icon.png'
- var imgfb = baseurl + '/statics/images/images/footer-facebook-icon.png'
- var baseimg = baseurl + '/statics/'
- var imginstagram = baseurl + '/images/images/footer-instagram-icon.png'
- var imgtwitter = baseurl + '/images/images/footer-twitter-icon.png'
- var imgyoutube = baseurl + '/images/images/footer-youtube-icon.png'
- var imgfb = baseurl + '/images/images/footer-facebook-icon.png'
- var baseimg = baseurl + '/'
doctype html
html
- if (dataemail.title)
head
title Calendario Eventi
title dataemail.subject
//- import css/scss stylesheets
//- these file names will be replace by gulp with proper css file paths
@@ -37,20 +38,15 @@ html
}
body(yahoofix)
span(id='body_style', style='display:block')
table(class="preheader", cellpadding="0", cellspacing="0", width="100%")
tr
td.webversion
p non vedi le immagini?&nbsp;
a(href=urlcal) Apri il Calendario
table(class="topHeader", cellpadding="0", cellspacing="0", width="100%")
- if (dataemail.height_logo)
tr
td
table(cellpadding="0", cellspacing="0", align="center", summary="")
tr
td.logoContainer
a(href=baseurl, title='logo')
img.logo(src=baseurl+"/statics/images/logo.png", height=dataemail.height_logo)
img.logo(src=baseurl+"/images/logo.png", height=dataemail.height_logo)
tr
td.testomail
@@ -201,10 +197,6 @@ html
td(class="whitespace", height="20")
p &nbsp;
tr
td(class="whitespace", height="20")
p &nbsp;
// Social Media
table.socialMedia(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
tr

View File

@@ -93,3 +93,76 @@ Gio 12/10 ORE 15:06: USER [paoloar77]: bottone
Ven 13/10 ORE 11:05: USER [SuryaArena]: bottone
Ven 13/10 ORE 11:40: USER [SuryaArena]: bottone
Dom 17/12 ORE 15:38: USER [admin]: prova
Dom 17/12 ORE 16:18: USER [admin]: vai al sito
Dom 17/12 ORE 16:19: USER [admin]: vai al sito
Dom 17/12 ORE 16:19: USER [admin]: il mio profilo
Dom 17/12 ORE 16:19: USER [admin]: prova
Dom 17/12 ORE 16:19: USER [admin]: link da condividere
Sab 30/12 ORE 20:06: USER [admin]: gruppo di acquisto per le arance:
produttore:
🍊sicilia frutta express (catania)
la piccola azienda a conduzione familiare di giovanni si trova in provincia di catania (sicilia), i frutti vengono prodotti rispettando i principi della biodinamica infatti non viene utilizzato nulla di chimico (niente irrorazioni) e la concimazione avviene tramite concimi naturali (letame).
⚠️ offerta sconto valida solo fino al 3 gennaio 2024, raggiungendo 100 kg totali di ordini di arance:
i prezzi sono compresi di spese di spedizione e di gestione.
🍊 arance tarocco spremuta: 1,20 € / kg
🥑 avocado: 7,80 € / kg
🍋 limoni: 2,40 € / kg
👉🏻 entra sul gruppo telegram piu che buono
per le prenotazioni potete registratevi sul nuovo sito:
👉🏻 piu che buono - gas e bottega (piuchebuono.app)
come funziona:
- registratevi su piuchebuono.app, verificate la email.
- accedete e poi cliccate su "gruppo di acquisto".
- cliccate sul carrello verde 🛒 per aggiungere i kg che desiderate.
- per finire: cliccare su "procedi all'ordine" e confermate.
Dom 21/01 ORE 19:00: USER [paoloar77]: 👉🏻 indietro
Mar 23/04 ORE 22:31: USER [paoloar77]: ciao
Mer 24/04 ORE 20:45: USER [paoloar77]: invia a paolo
Mer 24/04 ORE 20:45: USER [paoloar77]: 📨 invia a paolo
Mer 24/04 ORE 20:58: USER [paoloar77]: grass e prova italic
Mer 24/04 ORE 21:19: USER [paoloar77]: 👍 si
Mer 24/04 ORE 22:02: USER [paoloar77]: ✅ la regolarizzazione può avv
Mer 24/04 ORE 22:15: USER [paoloar77]: ❗importante❗
💚🍚 cari membri dei circuiti ris,
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il regolamento di funzionamento dei circuiti ris.
📖 leggi qui il regolamento (https://riso.app/regolamento)
il gruppo dei facilitatori territoriali di riso ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del regolamento (indicata in corsivo):
➡️ "… ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro * , entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la comunità, in accordo con il gruppo tecnico, deliberi il rientro di alcune posizioni con decisione motivata; lutente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
✅ * la regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
📣 invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel gruppo territoriale, oppure come commento a questo stesso post, pubblicato sul canale progetto riso, entro il giorno 5 maggio
https://t.me/riso_canale/739
in attesa di riscontri, salutiamo! 🍚💚
il gruppo dei facilitatori territoriali riso

View File

@@ -25,3 +25,814 @@ Mar 03/10 ORE 22:49: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
Sab 04/11 ORE 15:17: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
Sab 02/12 ORE 14:15: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
✅ SuryaArena è stato Abilitato correttamente (da paoloar77)!
Dom 21/01 ORE 19:00: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
👉🏻 indietro
Gio 28/03 ORE 18:10: 🤖: Da Sùrya (Paolo) undefined (paoloar77):
✅ prova123 è stato Abilitato correttamente (da paoloar77)!
Mar 23/04 ORE 22:33: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:33: 0 ✉️ Messaggi da Inviare
Mar 23/04 ORE 22:33: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:38: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:41: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:41: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:42: APPARTIENE_CIRCUITO_RIS:
contasolo
Mar 23/04 ORE 22:42: 703 ✉️ Messaggi da Inviare
Mar 23/04 ORE 22:44: APPARTIENE_CIRCUITO_RIS:
nomecognome
Mar 23/04 ORE 22:44: Paolo Surya(paoloar77)
Sergio Mazzanti(sergiomazzanti)
Alberto Sensoli(Alberto)
Fabri (FabriNunzia)
Sabrina Siri(SabrinaCucovaz)
Lorenzo Essente(LorenzoVT)
Gianni Recca(Gianni)
Giovanni (Surfman)
Lucia (Lucente)
(Angerita)
(giancarloscarva)
Fabrizio Erani(fabris64)
(Dena1703)
(Aja)
Max Feraco(Joymax68)
(marcela)
Vittorio Falegname(Falegname.Vittorio)
(Fanny22)
(ostecippa)
Maria Pecoraro(pecorablu)
Talia Felin(Eaglefly)
Barby (Bbarbi)
Vincenzo Demaio(vincidemi)
Loretta (lunaloretta)
Isabella (SognoAltea)
Tempo di Vivere(tempodivivere.it)
(Agotrip)
Camillo Granchelli(Kami66)
Antonio Graziano(Tonygraziano)
(Ambessa)
MarinaA (MarinaA)
Carmine Cozzolino(Cicciomu)
Angela (Angelare)
Valentina Portelli(Nonnapapera)
Andrea Bozzetto(abozzetto)
BCMassimo (BCMassimo)
Denis Vignocchi(Denis1970)
(Ladycocca)
Erica Brunello(Ericabru)
Marina S.(Marina22)
(Serena.Tre.Stelle)
(antonioscioscia)
Irene (IreneVit)
Shakuntala Tiziana Riva(Shakuntala)
(Rosablu)
silvia (silvia7)
(Rosanna)
(Lamary)
Luca Sartini(Sarto1978)
(Fabiozero)
(stefanci87)
Raffaella Bonino(Spirale)
(Paola_Cr)
Elena Turilli(ballerina2909)
Luisa Recchia(LuisaRecchia)
Enrico Cantamessa(Enrico_Cantamessa)
(MariaMasterReiki)
Bianca Prugna(BiancaPrugna)
Silvia Ruggieri(Liberalux)
Erica (erica57)
laura nocera(laura.nocera)
Federico (eremita222)
(Versolaluce)
Alejandro (alecanque)
(Mauro_EL)
Gaetano (GaetanoSant)
Natalia (Natalia)
Stefania (StefaniaSantag)
Giuliana Car(Guglielmina)
Georgia Matteini Palmerini(GeorgiaMP)
(saraprinc)
(iosonoio58)
(Ennepi)
Silvia lorenza (Silvia88)
(Messaggero6)
(Carlos)
Federico Palla(FedePallaLUMEN)
Laura Salvetti(Laura5)
Ciro (Riccardo)
Sabrina (Sabrinap)
Samuele Mastelloni(SamuelMast)
Francesca Puppo(Open.curious)
Simona Teresa Maria(SimonaPt)
(Mila-Roberto)
Antonella Scrittrice ecologia quantica(Antoquantica)
Samuele Canestri(Evoluzionari)
Arcangelo Casavola(arca33)
Roberta Annecchino(Roberlina)
Antonio Daniele(Antonio_N)
(AlessioColombo)
(Varia9)
(MagiaMirtilla)
Emilie Vandecandelaere(Emilie)
(Natasha)
(marino222)
(Moscadri)
Rosanna Fantucci(Roxanne)
(Andrea_Tiziana)
(Ritacam)
Michela (michelaC)
(DomSap)
(L4il4-F)
(Luisaaa)
(Fly89it)
(Annarosa)
Nino (Ninosella)
(Rosedane)
(Marafox)
RitaLuisa (RitaLuisa)
(Frimel)
Sergio (Precisin)
(torneremoaballare)
(pier_luigi_c)
Stella (stella)
Silvia (LaBrighid)
(marcelloaloe)
(Angisan21)
Elena (RosEle70)
(tilliutaio)
Tera (tera0861)
(gradar83)
Alberto Soverchia(ThinkererSan)
Viviana (Viviamarespira)
Fulvio Faro(Fulvio_F)
Valeria Pastorino(Valeriapastorino)
(Robynora)
(FrancyVeg72)
inTuiziana (TiziaKaja)
(rit_ale)
(Cyberobe)
(MaxCerba)
(zelda23)
Flavia (flaviaoak)
Mario Romeo(zacc50)
Samuela (Fioridisole)
(cristianodisotto)
Zeo (ZeoPleiadi)
Ina (lafenjce)
(Almaelena)
(Robertocnm)
(Grazia_22)
(Ebiker2000)
(JulienQ)
Stefania (Metanoeite1973)
(texdb70)
(LauraRosaMarina)
(Francyjones)
(raffaele_costi)
(RobertoCutillo)
(Nicmestre)
(Ellis92)
(RobertoDCC)
(armoniaserena)
(Tris2_0)
Davide (Metonimia)
Elena Esposito(ElenaEspx)
Roberto Nicolè(Bobobasss)
Maria Rosa Favaro(Cheggioya)
(Atmapriya64)
Manuela (calendola)
(santonimarco)
Andrea Roncolini(barbaronx)
(Elisagranello)
Daniela (dania63)
(EtruscanStateless)
(Barbara_Nrd)
(ClaudiaMariaRosaria)
Vivien Russo(vivienru)
(Borgomaestro)
(letiziaferro)
Donatella Parrini(siena1)
Patripadova (patripadova)
(pomps61)
(COFEINA)
Monica (Monicainviaggio)
(Marititti)
(IreneRocca37)
(JwalaRegina)
(An_el_a)
Antonio Ciurlia(joliker)
virna (donnacustodedelfuoco)
Alessandra (ale_21giugno)
(Sante2015)
(Alestrale)
Michele Padula(Michele_pm)
(ritarevathy)
Barbara Bonora(BarbaraBonora)
Claudio Galassi(Jalsha2)
(sganapigi)
(gassuper3)
(Cibuk176)
(Naliber)
Cinzia (cavaioni)
(Riflessivo33)
Erica Rosselli(Erica_Grace)
(Nun988)
(SimonettaSecchi)
(mauribeni)
(Ambrig)
Fritz Baehler(Fritz_Baehler)
(AndreaLemon)
(simonetta63)
(Laura_C61)
Alicia Atzori(aliciaedu)
Fede Faith (FedeFaith)
(ElisV73)
(VentoDiCambiamento)
Concetta (Concyrau)
Claudio (KenHunter)
(danielaw63)
(Antonio_Ferrandes)
Giacomo (Unicorno_Giacomo)
Federica Rizzi(FedericaFezz)
JESSICA SHANTA DEVI (JessicaShantaDevi)
(Alessia17love)
Valeria (Rondinell)
(Sidereo1)
(Maia_73)
Michele (M.Cicl8)
Giusi Uc (ARGOGU)
Giuseppe (iceborg500)
Adriano Lai(AL72MB)
Bodhitara (primotintorosso)
Daniela Enrico(dan7se)
Carmela (carvas5)
Ines (Ineswild)
Mariana (Mepar68)
Fulvio Maresca(Fulvi00)
Barbara M(Mnbo_7198)
(Valentinabiodanzamindfulness)
Luca Moretti(lucamop)
Thor (ThorHammering)
Laura Sc(LadyLauraSC)
(AuryEdy)
Tiziana Rimondi(pioggia8)
Lara (trotttola)
Alessandra Scotti(SulleAliDelCambiamento)
Barbarastefania Ruta(matucnv)
Stefano (step1608)
(avvdona)
Fabioa (fabioa_a)
(MauMac95)
(Millyfor)
(edda47)
Renzo (Renzosan7)
Monia Camillini(monia69)
(ottofeel)
Loretta Rocchi(Blu_ris)
Manuela69 (arcobalen8)
Elizabeth (Elizabeth884)
Silvia M(silvia418)
Patrizia Zucchini(reiki1959)
Francesco Rosa(franz12090)
Susanna L(Susann1na)
(Stonelpluriverso)
Silvia Tog(silviatog)
Loretta Z(Nove_mbre)
Manuel Venturi(Manuel84d)
Massimo Longati(Tranquillio)
Emanuela (mondobiblio)
(salute_yoga)
Angela M.(Quanyin08)
Sokol (LokoSaK)
Nicole (NikkiZilli)
Alberto Mengoni(Alberto_Mengoni)
Jen B(Jenny_B)
Laura Latticini(Lauralatt)
Davide Mazzavillani(MazzavillaniDavide)
Valerio D'alessio(Valerix64)
Anna Bellet(Naanbe)
Laura (lauraghini)
Fabio Panciera(FabioPnc)
Antonio (Napoleone2)
Pianta (Didonemma)
Annarita (TortellinaZen16)
Maria Garofalo(marygary71)
Girolamo (teacarfu)
Erica (ericaalberonido)
Eleonora Mora(EleVegan)
Ciro Famiglietti(cirofamigliettivegan)
Andrea (carpis77)
Sandra Zamboni(alessandramondo)
Federico (FedeSo72)
(Dilu_69)
Sonia Boni(Sonia28358)
Su Fiu(SusanFiu)
(Debbiesole)
(Sole_4gatti)
Ugo Maccaferri(Cavallo1011)
Gabriella (gabriella_bologna)
(Natural_68)
Daniela De Simone(DanielaDeSimone)
Katia (Katia_g83)
David Martinī(Davidcasaviva)
Milvia (Mil2227)
Susi (frida71)
Romina Martini(rominamartini)
Deborah (ilventoeilbambu)
Daniela Rogue5(Rogue571)
Federico Paci(spadroneggio)
Giusy ❤️ (giusylove)
Giovanbattista Romano(Gianni_Romano_Coach)
Ferdy (fernandoaloise)
Laura Galli(Laurastella8)
Leonardo (marconeuno)
Arianna (AriannaTurchi)
(Teresabmt)
Matteo (Gandalf_il_verde)
Alberto (AlbertG11)
(EnryZord)
Genoveffa Chiummo(louis_thelbri)
Vanda (Vandanatalina)
Dino Stella(Dinostella)
Paola (Ubuntu75)
Simone (DottorMaxillo)
Lina Giardina(linagia)
Rosaria (RosariaM23)
Maurizio (mauriziola)
Zacerchiataf (ZacerchiataF)
Tiziana (tiziada)
Nino (Cascant17)
Tom (Tom21me)
Franco Ciccio(Cicciofranco1964)
Elena (Lanatama)
Rossella (Animalibera62)
Caterina (lcaterina)
Adelina (Adelinafo)
Cat (CatCat969)
Lor (Lori_2)
Giancarlo (giancalopresti)
Maria Angela (masavoca)
Francesco Musumeci(francescomusumeci7)
Stefania (cucunci)
Giusy Iam(giusyfashion)
Maria Antonietta (noirginger)
Angelo Spitale(AngeloSPIT)
Sergio (sergiookarte)
Daniele (DanieleSantinoA)
Ermete Trismegisto(Ermete)
Angela Raffaele(Angela_rfl)
Vincenzo Torrisi(V1nce22)
Mimmo Aloisio(Mimmutsu)
Clelia Acireale (Cleocost)
Margherita Fassari(MargheritadiCanalicchioterramore)
Orazio (Orazio369)
Consuelo (Consuelo_Messina)
Daniela (Maemouna)
Max Are(Edificium)
Sebastiano (Vera1169)
Merope (Merope)
Giuli (giuliperilla)
Valentina Pica(AttivacreaVale)
Silvia Grilli(silviagrilli)
Giuseppe (Gilgamesh72)
(irenect)
Alice_zen 🌺 (alice_zen)
totò Grilletto(totogrilletto)
Emilia (Emilia6613)
Lorella (Corivitto)
Giusy (Giuppass)
Pamela (Q709fok)
Salvatore Lo Giudice(Haku_tato)
Giuseppina (Giuscrescim)
Gaetano (Gaetano)
Luigi (IAM09111967)
Roberto (RobertoAudio)
(Michele_Libero)
Monica Sapio(monicasapio)
Armando Lembo(harlem8)
Simona (SimonaTrinart)
Gianpiero (GianpieroC)
Maria (MariaCal14)
Antonio (antonio338)
(RaffaellaBeauty)
Antonino Castronovo(AntonAC)
Andrea (Ubanjix)
Marit (Scineve)
Stefania Castagnozzi(Blue_Lagoon_111)
lorenzo cambria(lorsindi)
Rossella Cazzaniga(canoneinversotappeti)
Antonella Ciucci(lantoanto)
Stefano Viola(stef1269)
Cla (Sesamo)
Dario (Liune64)
Leonardo (leonardoloscalzo)
Giovanni Gorgone(giovannigorgone)
Serena Giudici(mammamago)
m.irene (irene13angeli)
(moretta369)
Damiano Lupezza(Damiano)
Daniele (SistemaCorrotto)
Sara Eligio(sarakey73)
Stefilibera (Stefilibera)
Francesca (es_pery15)
Edel (Passinelsole)
Marco (tyrchyus)
Silvia (sillabasibilla)
Simona Curatolo(Simona_CreaIdeando)
(MarySaraJane)
Monica (Merylav)
Daniela (Jessiremi)
Michela (Cive_13)
Monique (Quattropeli)
Leonardo (ldproma)
Lauram (Laura7117)
Armando Dolcini(adolcini)
Giorgia Rita Zanellato(Giory73)
Stefania (Stefyzann)
Riccardo (RikyBalboa)
Simona Meazzini(SimonAyurveda)
Leda (altre_vie)
Oreste (Forrest81)
Roberta Carluccio(Famcarluccio)
Inge369 (Inge369)
Marzel M(zecastighetor)
(Vetromile1975)
Cinzia (Red_Naomi8)
(natalina_candelo)
Roberta (Ro_by7)
Giovanna Moretti(Giom.VT)
Cristina Marinelli(criss71)
Sabrina (SabrinaStrozzi)
Stefano Francesco Piva(Steve31958)
Giacomo Bortoluzzi(JackBorto)
Ileana Ziani(Ileana63)
Marco (Marketto)
Raffaella (roverella19)
(ptommaso90)
Grace (acia75)
Giuliana B(GiulianaB88)
Mariella (Mariella_Pichi)
Marina Fiori(fiorimarina)
(AngelaEnzingara)
Cucu (Peterin0)
(Eledibe)
David Fogazza(DavFog)
Giulia (julybi)
Federica (Federicas04)
Spyke Jones(SpykeJones)
(ElenaLc)
Ines Carlu(ineesee)
Vivy x BORGO cohousing (vivy_BORGO_cohousing)
(Nocciolo)
Stefano (Stefano_93)
Emilio Costantino Belmonte(iTecnologici)
(ClaudProv)
(CarFlora)
Angelo (cavallo62)
Marco (Marlet)
Donata Guerci(Dona_1971)
(stefanoTS)
Lucie (Lu_Ma_03)
Lorenza Beltrami(Lorenz_Lo)
Claudia Barontini(CB1972)
Paola Medeot(Paolamedeot)
(LiberaValente)
Roberto Sorato(Roby81)
Carla (ribeka786)
Nunzio (Nunzio1980)
Alessandro Cavalli(Alecava496)
Daniela Lazzarotto(daniela1511)
Silvia Santagata(Silvia121Artist)
(Tzilli_0)
Alessandra (alessandrapiani)
Antonia Bianco(biancainot)
Nadia (Speranza10)
Mimmo (MimmoUstica)
Claudio Panicali(ClaudioDellaCoscienza)
Raga (Ragaliliana)
Anna D'acunio(annadac61)
Ippolito (Ippolito)
Sabrina Aguiari(sabracadabrax)
Milena (milly4always)
Damiano Furlan(FurioShin)
Angela Rebeschini(dunia_iride)
Fabio (Fabiobrent)
Anna (AllaLuce)
Chiara (chiara821)
(Silvielli)
Sandra (Ildega)
Marco Campisano(Marcoscimmia)
(Maicolnait)
Nadia T.(Nadia_348)
Alessandro Grasso(tutarancio)
Riccardo Menolotto(riccardomenolotto)
Luisa (luisageromet)
(lollo22k)
Fulvio Tango(AirblueFulvio)
Mattia Bondi(MattiaBondi)
Enza Restuccia(Vinrest22)
(visvital)
Piero Mazza(piterpm)
Valentina Benedetti(ValeCipcip)
Angelo Benedetto (Hamayl)
Laura (PSailormoon)
Gianluca Pavan(loziodm)
Stefania Meda(Stefanya66)
(LiberoEnri)
Patrizia Chiara (TempoYoga)
Miro (shining)
Umberto (Umberto)
Cinzia Cassandro(dollybonbon)
Luciana (travaluci)
Giulio Sassetti(giulsass)
Valeria Civardi(Vallicivardi57)
(Erica80)
Lorena (LoBa82)
Marco Ronzitti(Marco71CB)
Terry (Terry00025)
GiuliaAdele (Ilpontediluce)
Barbara (Gelsomina25)
(Monoinique)
Harry Tallarita(HarryTallarita)
Laurariel (parolainterna)
Marcos Cé(RaccoglitoriEclettici)
(Rosangela)
Robi (robertopigazzi)
Giovanni (Giovanni_1066)
Simona (sichilab)
(gianca1210)
Gloria (Smalll13)
Manuela (Magdaleine76)
(Arc_en_ciel_6)
Barbara (Stelle74)
Jessica BlackMagic(JesBMagic)
Claudio Taroppi(CriptoSophia)
Frank (Frankkk22F)
(Anette)
Emanuele (gemanuele)
Lara Canevese(LaraCanevese)
(Xeniasanvito)
Giuseppe (lupobranco)
Fabiana (fabiale69)
(NickyvanderLaan)
Diana (Diana_ddag)
(Denna4)
Atena (cascinaboccida)
(Diegopinna)
Paolo 8pax(Paolo8PAX)
Gianni (iugola72)
Letizia Gozzini(LetiziaFooFigthers64)
Giacomo Di Fabio(Giacomo_1979)
Franco (francomario)
Lisa Franceschini(Lisa83)
Carola (Carola)
(Fatinaalc)
(SuryaArena)
Ale (Florealefiore)
Alessandra (ale_5679)
Sonia (SoniaCri)
Federico (frixxx)
Anna (biapanna)
Mik (MikelaPi)
(Giovannifruttadisicilia)
Barbara Matteucci(BarbaraMatt)
Ariette (ArietteMorano)
Roberta Civirani (Robynlorien)
Marina (Norminiax)
Elisa Carbonetti(Nonnanena)
Marinella Galletti(marinella964)
Graziana Ungarelli(nonsiemaisoli)
Agnese Ferrari(Agny11)
Giovanna Simoni(Gio8marzo)
Marta (Martasel)
Luca Fraulini(FrauliniLuca)
Maria Valentina Bresciani(Valesolovale)
Onorio (Onorio69)
Cristina (tictac1972)
Cla (Clayoga77)
Massimo Cognome(mcomparin)
Marcola (Marcyfi)
(BarbaraMiz)
(TGuga)
MARCO COPPOLA(MarcoTullioAntonio)
Alessandra Barresi(Alessandra_Barresi)
Paola Tierri(Paola0503)
Gianluca Vannini(Cucca60)
Lorena Benigna(lorenabenigna)
(MF81B)
(maema67)
Miriam Notarangelo(LisandraFatina)
Giulietta Gnutti(Giu_733)
(SismaLux)
Francesca (francescalivorno)
(MarisaConti)
Ale Mare(AlesMare)
Anna Maria (accoglienzaa)
Sebastiano (pielento)
Stefano Giordano(Sankari9)
Leon (Umanolistico)
(Andrea_di_STATO_Calautti)
Calliope (Calliopesca)
Simona Turiano(simoNaturopata)
Paola (alaya562)
Andrea Sturniolo(yosoyvoz)
(albertinamarinelli)
Graziella (mammalella960)
(memorelax)
Francesca Marinelli(FrancescaM68)
Patrizia (PattyChiarissimi)
Marco Rastelli(marcorastelli)
Gianni Bianco(ireteditore)
(ClaudiaCalabria)
Filo (i7specchi)
(Charms64)
(Lore12345670)
Letizia 🌞 (Rissho_Ankoku_Ron)
(AnnitaSpinelli)
Franca Marin(FrancaM33)
(Micbo77)
(danieleduboin)
(IvanoBo81)
Patrizia Alvisi(Paciccia65)
Stefano Baratti(StefanoB)
(Sabrina_Monticelli)
Natascia (Natty_Natty71)
Riccardo Tonelli(crescerelaluce)
(ClaudioFa)
Grazia (GraziaGa)
Giorgio (giorgio_p75)
Massimo Trustee De Vita(Mcgiverbis)
Adriana (AfeWellmade)
(Ceramichedeby)
(Erby66)
Elena Trustee Marino(ALLEANZAdelDONO)
Luca (Lucavernicolo)
(LaraDea)
Marie V(massaiarurale)
Giuseppe Mercone(Enomerc82)
Giovanni Canu(gheo3)
Davide (Pippillino)
(Kia_10)
Leonardo (Leonardo2823)
Fabio (Cecefabene)
Paolo (PaUD70)
(Gnampolo)
franz (franz)
araceli de la parra(liladivineplay)
Mamo Bel(mamo_bel)
Rossella (MazzuRoss)
(Lellagab)
Enzo Fazzino(enzofazzino)
(Joska69)
Pamela (Pami74Veronza)
Iglis (Ziglis)
(Mirella64)
(carmen_bologna)
Emi (EmiEllis)
David Lendaro(dlend80)
(FeelGM)
Daniele Spina(Vincente7)
Gloria Camporesi(picipaci)
(Bibessa)
Ruben Antonio Vladilo(Ruben369)
Stefano Succi(Abbastanza_asociale)
Andrea (Falko2222)
Barbara (bosco2017)
(AntonyHopi)
(elsamoretto)
Michele Ceccarelli(michelececca)
Fabiana Nicoletti(Fabiananico)
(Canacaya)
(marziamoon)
Sara (SaraRiflePla)
Letizia Bergamini(Laetitia73)
Lucia Mistrali(LuciaMistrali)
(Rita_Lila)
Lidia (bjoyautenticipernatura)
Andrea (apasquali)
Laura (Lauratabs)
Noemi (NoemiJosephine)
Ombretta Cecchetti(OmbrettaCecchetti)
(MyGrace)
Sebastiano Parmegiani(ZSeba)
Simona (GiulioLunaLuce)
Sara (sarabaraldi23)
Mirca Forcellini(donnainevoluzione)
(ciccibicci3)
(Donpersival)
Alessia (CentrOlisticoShanti)
Robi G.(robig67)
Cristina (cristina_espo)
(Buc14)
(Paperlella)
Sergio Salutati(Sesarinos)
Arianna (Tricric)
(nikydeva)
(SoloMario)
Anna (Oona79)
Barbara (Barbie)
(ElisabettaTraficante)
Gabriele Daprai(Gabry75)
Massimo Costacurta(ilcosta54)
(Katia)
(isabellina1)
Riccardo (riccaudace)
(Gherarda24)
Antonio Sorbello(antoniosorbello)
Eric Souqi(GAMBERON3)
Fabio Ricci(Fabioricci74)
Daniela Stranieri(isolachenonce)
Roberto (turo951)
Laura (NOGIPPI)
Mer 24/04 ORE 20:44: APPARTIENE_CIRCUITO_RIS:
contasolo
Mer 24/04 ORE 20:44: 703 ✉️ Messaggi da Inviare
Mer 24/04 ORE 20:45: 🤖: Da Sùrya (Paolo) (paoloar77):
invia a paolo
Mer 24/04 ORE 20:45: 🤖: Da Sùrya (Paolo) (paoloar77):
📨 invia a paolo
Mer 24/04 ORE 20:46: PAOLO:
💚🍚 Cari membri dei Circuiti Ris,
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
📖 Leggi qui il Regolamento
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; lutente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
https://t.me/riso_canale/739
In attesa di riscontri, salutiamo! 🍚💚
Il gruppo dei Facilitatori Territoriali RISO
Mer 24/04 ORE 20:46: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 20:48: PAOLO:
PROVA GRASSETTO
Mer 24/04 ORE 20:48: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 20:58: 🤖: Da Sùrya (Paolo) (paoloar77):
grass e prova italic
Mer 24/04 ORE 21:11: PAOLO:
grass e prova italic
Mer 24/04 ORE 21:11: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 21:19: PAOLO:
grass e prova italic
Mer 24/04 ORE 21:19: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 21:32: PAOLO:
IMPORTANTE❗
💚🍚 Cari membri dei Circuiti Ris,
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
📖 Leggi qui il Regolamento
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; lutente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
https://t.me/riso_canale/739
In attesa di riscontri, salutiamo! 🍚💚
Il gruppo dei Facilitatori Territoriali RISO
Mer 24/04 ORE 21:32: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 21:35: PAOLO:
prova
Mer 24/04 ORE 21:35: 1 ✉️ Messaggi Inviati !
Mer 24/04 ORE 21:58: APPARTIENE_CIRCUITO_RIS:
SDADA
Mer 24/04 ORE 22:01: APPARTIENE_CIRCUITO_RIS:
IMPORTANTE❗
💚🍚 Cari membri dei Circuiti Ris,
quando siete entrati nel vostro circuito territoriale, avete dichiarato di avere letto e approvato il Regolamento di funzionamento dei Circuiti Ris.
📖 Leggi qui il Regolamento
Il gruppo dei Facilitatori Territoriali di RISO ha individuato un punto che necessita di chiarimenti, per rendere più esplicito un meccanismo già presente nel testo stesso. Propone dunque di aggiungere una nota esplicativa (vedi asterisco *) alla seguente frase del Regolamento (indicata in corsivo):
➡️ "… Ciascun detentore di un saldo negativo concorda che la sua esposizione funge da garanzia della quantità di Ris equivalenti circolanti nel circuito e che può essere chiamato a regolarizzare con equivalente pagamento in euro *, entro un lasso di tempo ragionevolmente adeguato, nel caso in cui: la Comunità, in accordo con il Gruppo Tecnico, deliberi il rientro di alcune posizioni con decisione motivata; lutente decida di uscire per motivi personali; il circuito chiuda, per decisione deliberata o per motivi di forza maggiore.”
✅ * La regolarizzazione può avvenire con equivalente valore in beni e servizi, oppure, in ultima istanza, con pagamento in euro.
📣 Invitiamo tutti a prendere visione della proposta, e ad esprimere eventuali osservazioni nel Gruppo Territoriale, oppure come commento a questo stesso post, pubblicato sul canale Progetto RISO, entro il giorno 5 maggio!
https://t.me/riso_canale/739
In attesa di riscontri, salutiamo! 🍚💚
Il gruppo dei Facilitatori Territoriali RISO
Mer 24/04 ORE 22:02: 🤖: Da Sùrya (Paolo) (paoloar77):
✅ la regolarizzazione può avv

View File

@@ -117,3 +117,83 @@ Mer 29/11 ORE 17:14: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena
Saldi:
SuryaArena: -13 RIS]
paoloar77: 13 RIS]
Gio 04/01 ORE 14:00: [<b>Euro</b>]: Inviate Monete da PaoloRiso a piuchebuono 44.4 € [causale: Pagato Ordine n.101]
Saldi:
PaoloRiso: -44.4 €]
piuchebuono: 44.4 €]
Dom 07/01 ORE 16:22: [<b>Euro</b>]: Inviate Monete da PaoloRiso a 44.4 € [causale: Pagato Ordine n.101]
Saldi:
PaoloRiso: -44.4 €]
: 44.4 €]
Dom 07/01 ORE 16:24: [<b>Euro</b>]: Inviate Monete da PaoloRiso a 44.4 € [causale: Pagato Ordine n.101]
Saldi:
PaoloRiso: -88.8 €]
: 88.8 €]
Ven 16/02 ORE 13:51: [<b>Euro</b>]: Inviate Monete da PaoloRiso a piuchebuono 9.6 € [causale: Pagato Ordine n.169]
Saldi:
PaoloRiso: -98 €]
piuchebuono: 1109.1799999999998 €]
Ven 16/02 ORE 13:57: [<b>Euro</b>]: Inviate Monete da Barbara a piuchebuono 15.6 € [causale: Pagato Ordine n.171]
Saldi:
Barbara: -61.2 €]
piuchebuono: 1124.7799999999997 €]
Ven 16/02 ORE 14:05: [<b>Euro</b>]: Inviate Monete da Loabati a piuchebuono 6 € [causale: Pagato Ordine n.174]
Saldi:
Loabati: -24.6 €]
piuchebuono: 1130.7799999999997 €]
Sab 17/02 ORE 14:04: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 5 RIS [causale: ]
Saldi:
paoloar77: 31 RIS]
SuryaArena: 5 RIS]
Sab 17/02 ORE 14:10: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 4 RIS [causale: Per Paolo]
Saldi:
SuryaArena: 1 RIS]
paoloar77: 35 RIS]
Sab 17/02 ORE 14:11: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 6 RIS [causale: Per Surya]
Saldi:
paoloar77: 29 RIS]
SuryaArena: 7 RIS]
Sab 17/02 ORE 14:50: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 3 RIS [causale: BBBBAAA]
Saldi:
paoloar77: 26 RIS]
SuryaArena: 10 RIS]
Sab 17/02 ORE 14:53: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 4 RIS [causale: GGGG]
Saldi:
paoloar77: 22 RIS]
SuryaArena: 14 RIS]
Sab 17/02 ORE 15:03: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 2 RIS [causale: ]
Saldi:
paoloar77: 20 RIS]
SuryaArena: 16 RIS]
Gio 11/04 ORE 16:54: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.236]
Saldi:
paoloar77: -246.8 €]
piuchebuono: 2181.0999999999985 €]
Gio 11/04 ORE 16:55: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.235]
Saldi:
paoloar77: -356.8 €]
piuchebuono: 2291.0999999999985 €]
Gio 11/04 ORE 16:57: [<b>Euro</b>]: Inviate Monete da paoloar77 a piuchebuono 110 € [causale: Pagato Ordine n.234]
Saldi:
paoloar77: -466.8 €]
piuchebuono: 2401.0999999999985 €]
Gio 25/04 ORE 11:43: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 1 RIS [causale: ]
Saldi:
SuryaArena: -1 RIS]
paoloar77: 38 RIS]
Gio 25/04 ORE 14:37: [<b>Circuito RIS Bologna</b>]: Inviate Monete da paoloar77 a SuryaArena 38 RIS [causale: ]
Saldi:
paoloar77: 0 RIS]
SuryaArena: 37 RIS]
Gio 09/05 ORE 17:27: [<b>Circuito RIS Catania</b>]: Inviate Monete da paoloar77 a Giovannifruttadisicilia 1.5 RIS [causale: prova]
Saldi:
paoloar77: -1.50 RIS]
Giovannifruttadisicilia: 1.50 RIS]
Mar 28/05 ORE 16:51: [<b>Circuito RIS Italia</b>]: Inviate Monete da ElenaEspx a Giovannifruttadisicilia 14 RIS [causale: Acquisto arance 30genn24 RisoBologna 2]
Saldi:
ElenaEspx: -32.10 RIS]
Giovannifruttadisicilia: 222.50 RIS]
Mar 28/05 ORE 16:51: [<b>Circuito RIS Italia</b>]: Inviate Monete da ElenaEspx a Giovannifruttadisicilia 28 RIS [causale: Acquisto arance 30genn24 RisoBologna 1]
Saldi:
ElenaEspx: -60.10 RIS]
Giovannifruttadisicilia: 250.50 RIS]

47
outout.csv Normal file
View File

@@ -0,0 +1,47 @@
Num|Nome|Peso|Prezzo|Quantita|Totale|Ordini
0|"Acqua distillata di rose di Damasco"|100|8|2|16|1
0|"Artemisia in foglie"|20|1,5|7|10,5|3
0|"Cannella"|100|3|4|12|3
0|"Carruba macinata"|250|3|2|6|2
0|"Cous cous 5 stelle (grano duro, mais, orzo, lenticchie ed avena)"|500|3,5|1|3,5|1
0|"Cous cous d'avena"|500|3|3|9|2
0|"Cous cous d'orzo"|500|3|1|3|1
0|"Cous cous di grano duro (Akka)"|500|3,25|1|3,25|1
0|"Cous cous di lenticchie"|500|3,5|4|14|3
0|"Cous cous di miglio"|500|3|4|12|4
0|"Couscous 5 cereali 1kg"|1|5,5|1|5,5|1
0|"Couscous di grano duro 500g"|500|2,5|1|2,5|1
0|"Curcuma"|100|3|5|15|4
0|"Datteri boufeggous extra 1kg"|1|11|1|11|1
0|"Datteri boufeggous extra 500g"|500|6,5|3|19,5|3
0|"Datteri boustahammi 1kg"|1|5|11|55|6
0|"Datteri boustahammi 500g"|500|3|3|9|3
0|"Datteri bouzagagh 1kg"|1|5,5|2|11|2
0|"Datteri bouzagagh 500g"|500|3,5|7|24,5|6
0|"Farina di segale grigliata 1kg"|1|3,5|1|3,5|1
0|"Fichi secchi bianchi 250g"|250|5|1|5|1
0|"Fichi secchi bianchi 500g"|500|9|1|9|1
0|"Fieno greco"|500|3,5|2|7|1
0|"Ghassoul (pezzetti di argilla saponifera) per capelli"|100|4|2|8|2
0|"Henné"|250|3|2|6|2
0|"Henné (per tatuaggi e capelli)"|200|3,5|1|3,5|1
0|"Henné (per tatuaggi e capelli)"|150|2,5|1|2,5|1
0|"Menta Maachi (autoctona) in foglie"|20|1,5|1|1,5|1
0|"Olio alle rose di Damasco"|60|9|2|18|2
0|"Olio di argan cosmetico 30ml"|30|8|3|24|2
0|"Olio di mandorle dolci"|30|5,5|1|5,5|1
0|"Olio di nigella (cumino nero)"|30|5,5|1|5,5|1
0|"Olio di sesamo"|30|5,5|1|5,5|1
0|"Olive nere"|125|2|1|2|1
0|"Olive nere alle piante aromatiche 1kg"|1|9|1|9|1
0|"Olive nere alle piante aromatiche 500g"|500|5|1|5|1
0|"Olive verdi alle piante aromatiche 1kg"|1|9|1|9|1
0|"Olive verdi alle spezie 500g"|500|5|1|5|1
0|"Paprika dolce senza olio"|100|3|2|6|2
0|"Prugne secche"|250|3|2|6|2
0|"Rose secche di Damasco"|50|2,5|2|5|2
0|"Sapone a base di olio di argan"|80|4|3|12|3
0|"Scrub Naama (rosa, in polvere)"|100|5|2|10|2
0|"Sottopentola medio"|296|2,5|1|2,5|1
0|"Verbena citronella in foglie"|20|1,5|1|1,5|1
0|"Zenzero"|100|3|2|6|2
1 Num Nome Peso Prezzo Quantita Totale Ordini
2 0 Acqua distillata di rose di Damasco 100 8 2 16 1
3 0 Artemisia in foglie 20 1,5 7 10,5 3
4 0 Cannella 100 3 4 12 3
5 0 Carruba macinata 250 3 2 6 2
6 0 Cous cous 5 stelle (grano duro, mais, orzo, lenticchie ed avena) 500 3,5 1 3,5 1
7 0 Cous cous d'avena 500 3 3 9 2
8 0 Cous cous d'orzo 500 3 1 3 1
9 0 Cous cous di grano duro (Akka) 500 3,25 1 3,25 1
10 0 Cous cous di lenticchie 500 3,5 4 14 3
11 0 Cous cous di miglio 500 3 4 12 4
12 0 Couscous 5 cereali 1kg 1 5,5 1 5,5 1
13 0 Couscous di grano duro 500g 500 2,5 1 2,5 1
14 0 Curcuma 100 3 5 15 4
15 0 Datteri boufeggous extra 1kg 1 11 1 11 1
16 0 Datteri boufeggous extra 500g 500 6,5 3 19,5 3
17 0 Datteri boustahammi 1kg 1 5 11 55 6
18 0 Datteri boustahammi 500g 500 3 3 9 3
19 0 Datteri bouzagagh 1kg 1 5,5 2 11 2
20 0 Datteri bouzagagh 500g 500 3,5 7 24,5 6
21 0 Farina di segale grigliata 1kg 1 3,5 1 3,5 1
22 0 Fichi secchi bianchi 250g 250 5 1 5 1
23 0 Fichi secchi bianchi 500g 500 9 1 9 1
24 0 Fieno greco 500 3,5 2 7 1
25 0 Ghassoul (pezzetti di argilla saponifera) per capelli 100 4 2 8 2
26 0 Henné 250 3 2 6 2
27 0 Henné (per tatuaggi e capelli) 200 3,5 1 3,5 1
28 0 Henné (per tatuaggi e capelli) 150 2,5 1 2,5 1
29 0 Menta Maachi (autoctona) in foglie 20 1,5 1 1,5 1
30 0 Olio alle rose di Damasco 60 9 2 18 2
31 0 Olio di argan cosmetico 30ml 30 8 3 24 2
32 0 Olio di mandorle dolci 30 5,5 1 5,5 1
33 0 Olio di nigella (cumino nero) 30 5,5 1 5,5 1
34 0 Olio di sesamo 30 5,5 1 5,5 1
35 0 Olive nere 125 2 1 2 1
36 0 Olive nere alle piante aromatiche 1kg 1 9 1 9 1
37 0 Olive nere alle piante aromatiche 500g 500 5 1 5 1
38 0 Olive verdi alle piante aromatiche 1kg 1 9 1 9 1
39 0 Olive verdi alle spezie 500g 500 5 1 5 1
40 0 Paprika dolce senza olio 100 3 2 6 2
41 0 Prugne secche 250 3 2 6 2
42 0 Rose secche di Damasco 50 2,5 2 5 2
43 0 Sapone a base di olio di argan 80 4 3 12 3
44 0 Scrub Naama (rosa, in polvere) 100 5 2 10 2
45 0 Sottopentola medio 296 2,5 1 2,5 1
46 0 Verbena citronella in foglie 20 1,5 1 1,5 1
47 0 Zenzero 100 3 2 6 2

View File

@@ -14,7 +14,7 @@
"test-watch": "nodemon --exec 'npm test'"
},
"engines": {
"node": "^16.19.0"
"node": "^18.19.0"
},
"author": "Paolo Arena",
"license": "MIT",
@@ -37,6 +37,7 @@
"image-downloader": "^4.3.0",
"internet-available": "^1.0.0",
"jade": "^1.9.2",
"jsdom": "^24.0.0",
"jsonwebtoken": "^9.0.1",
"lodash": "^4.17.21",
"mongodb": "^4.4.1",
@@ -46,19 +47,21 @@
"node-emoji": "^1.11.0",
"node-image-resizer": "^1.0.0",
"node-pre-gyp": "^0.14.0",
"node-telegram-bot-api": "^0.59.0",
"node-telegram-bot-api": "^0.65.1",
"nodemailer": "^6.7.8",
"npm-check-updates": "^16.1.0",
"npm-check-updates": "^16.14.18",
"pem": "^1.14.6",
"preview-email": "^3.0.7",
"pug": "^3.0.2",
"rate-limiter-flexible": "^2.3.9",
"request": "^2.34",
"sanitize-html": "^2.13.0",
"save": "^2.5.0",
"sharp": "^0.30.7",
"superagent": "^8.0.0",
"url-parse": "^1.5.10",
"validator": "^13.7.0",
"web-push": "^3.5.0",
"web-push": "^3.6.7",
"xoauth2": "^1.2.0"
},
"devDependencies": {

View File

@@ -2,7 +2,7 @@
body, #body_style {
margin: 0;
padding: 0;
background: #E9F2F9;
background: #E9F2F9 !important;
color: #5b656e;
}

View File

@@ -10,12 +10,13 @@ var file = `.env.${node_env}`;
// GLOBALI (Uguali per TUTTI)
process.env.LINKVERIF_REG = '/vreg';
process.env.LINK_REQUEST_NEWPASSWORD = '/requestnewpwd';
process.env.ADD_NEW_SITE = '/addNewSite';
process.env.LINK_UPDATE_PASSWORD = '/updatepassword';
process.env.LINK_UPDATE_PWD = '/updatepwd';
process.env.LINK_CHECK_UPDATES = '/checkupdates';
process.env.KEY_APP_ID = 'KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF';
// console.log("Starting Node with : " + file);
console.log("Starting Node with: " + file);
require('dotenv').config({ path: file });
process.env.DATABASE = process.env.DATABASE || 'FreePlanet';

View File

@@ -11,7 +11,7 @@ mongoose.plugin(schema => {
mongoose.set('debug', false);
const options = {
let options = {
// user: process.env.UDB,
// pass: process.env.PDB,
// useMongoClient: true,
@@ -38,22 +38,38 @@ const options = {
// keepAliveInitialDelay: 300000 // keepAliveInitialDelay is the number of milliseconds to wait before initiating keepAlive on the socket.
};
console.log('process.env.AUTH_MONGODB', process.env.AUTH_MONGODB);
if (process.env.AUTH_MONGODB === '1') {
options.auth = {
authSource: "admin",
poolSize: 10,
user: process.env.MONGODB_USER,
password: process.env.MONGODB_PWD,
};
}
if (options.auth && options.auth.user) {
console.log('MongoDb con Authenticazione:', options.auth.user, '******');
} else {
console.log('### MongoDb SENZA Authenticazione !!! ');
}
const db = mongoose.connection;
// mongoose.connect(process.env.MONGODB_URI + '?authSource=admin', { options })
// console.log(' -> PASSAGGIO PARAMETRI MONGOOSE')
console.log('Node Version ' + process.version);
console.log('Mongoose Version ' + mongoose.version);
console.log('Connessione a ' + process.env.MONGODB_URI + ' in corso...');
mongoose.connect(process.env.MONGODB_URI, options);
connectionUrl = process.env.MONGODB_URI;
console.log('Connessione a ' + connectionUrl + ' in corso...');
mongoose.connect(connectionUrl, options);
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {
db.once('open', function () {
// we're connected!
console.log('*** CONNESSIONE EFFETTUATA ! ' + process.env.MONGODB_URI + ' db: ' + process.env.DATABASE)
console.log('*** CONNESSIONE EFFETTUATA ! ' + connectionUrl + ' db: ' + process.env.DATABASE)
});
module.exports = {mongoose};
module.exports = { mongoose };

View File

@@ -1,6 +1,9 @@
{
"Hello": "Ciao",
"Hello %s": "Ciao %s",
"Good": "Bene",
"Service": "Servizio",
"Hosp": "Ospitalità",
"Good: %s": "Bene: %s",
"Service: %s": "Servizio: %s",
"NEW_GOOD": "❇️ <strong>%s</strong> ha aggiunto un nuovo Bene: \n<strong>%s</strong>",
@@ -8,7 +11,9 @@
"NEW_HOSP": "❇️ <strong>%s</strong> ha aggiunto una nuova Ospitalità: \n<strong>%s</strong>",
"NEW_EVENT": "❇️ <strong>%s</strong> ha aggiunto un nuovo Evento: \n%s\n<strong>%s</strong>\n%s",
"NEW_EVENT_TELEGRAM": "%s\n\n❇ <strong>%s</strong>\n\n%s\n\n%s",
"ADDED_FROM": "\n\n<i>(Evento aggiunto da <strong>%s</strong>)</i>",
"NEW_ANNUNCIO_TELEGRAM": "❇️ <strong>%s</strong>\n\n%s\n\n%s",
"EVENT_ADDED_FROM": "\n\n<i>(Evento aggiunto da <strong>%s</strong>)</i>",
"ADDED_FROM": "\n\n<i>(Aggiunto da <strong>%s</strong>)</i>",
"CONTRIB": "\n💠 Contributo richiesto: %s",
"ORGANIZED_BY": "\n<i>Organizzato da <strong>%s</strong></i>",
"SHOW_POST": "👉🏻 vedi post su RISO",
@@ -18,9 +23,10 @@
"<strong>%s</strong> refused your Friendship": "<strong>%s</strong> ha rifiutato l'Amicizia",
"✅ %s accepted your Friendship request !": "✅ %s ha accettato la tua richiesta di Amicizia !",
"✅ You have accepted %s' Friendship request!": "✅ Hai accettato la richiesta di Amicizia di %s !",
"HANDSHAKE_SET": "<strong>%s</strong> ha comunicato che ti conosce personalmente e ha fiducia in te.",
"HANDSHAKE_CONFIRMED": "🤝 Hai contraccambiato la fiducia in <strong>%s</strong>!",
"HANDSHAKE_ACCEPTED": "🤝 <strong>%s</strong> ha contraccambiato la stretta di mano (fiducia) !",
"HANDSHAKE_SET": "<strong>%s</strong> ha comunicato che ti conosce personalmente e ha Fiducia in te (Stretta di mano).",
"HANDSHAKE_SENT_FROM_YOU": "🤝 hai inviato una Stretta di Mano a <strong>%s</strong>, perché la conosci personalmente !",
"HANDSHAKE_CONFIRMED": "🤝 Hai contraccambiato la stretta di mano di <strong>%s</strong>!",
"HANDSHAKE_ACCEPTED": "🤝 <strong>%s</strong> ha contraccambiato la tua stretta di mano !",
"GROUPS_ACCEPTED": "✅ Sei stato accettato a far parte del Gruppo %s (da parte di %s)",
"GROUPS_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Gruppo %s. Se pensi sia un'errore, contatta l'amministratore del Gruppo.",
"GROUPS_REMOVED": "❌ l'utente %s è stato rimosso del Gruppo %s (da parte di %s)",
@@ -43,10 +49,10 @@
"FRIEND_UNBLOCKED_TO_ME": "Sei stato riattivato da %s",
"FRIEND_UNBLOCKED": "E' stato riattivato %s da %s.",
"FRIEND_UNBLOCKED_YOU": "Hai riattivato %s.",
"CIRCUIT_ACCEPT_NEWENTRY": "❇️👥 🧍‍♂️ Abilita fido a %s nel '%s':",
"CIRCUIT_ACCEPT_NEWENTRY_BYGROUP": "❇️👥 🧍‍♂️ Abilita fido nel Circuito al gruppo %s:",
"CIRCUIT_ACCEPT_NEWENTRY": "❇️👥 🧍‍♂️ Abilita Fiducia a %s nel '%s':",
"CIRCUIT_ACCEPT_NEWENTRY_BYGROUP": "❇️👥 🧍‍♂️ Abilita Fiducia nel Circuito al gruppo %s:",
"CIRCUIT_OPEN_RISITALIA": "Apri il Circuito RIS Italia e chiedi di entrare",
"CIRCUIT_REQUEST_TO_ENTER": "%s è entrato nel %s (con %s iscritti) ed è in attesa di essere abilitato al Fido (è stato invitato da %s)",
"CIRCUIT_REQUEST_TO_ENTER": "%s è entrato nel %s (con %s iscritti) ed è in attesa di essere abilitato alla Fiducia\n🙎🏻 Invitato da %s",
"CIRCUIT_ADMINS": "Gli amministratori del circuito sono %s:\n%s",
"CIRCUIT_WHERE_IS_PRESENT": "\nAttualmente è presente in: %s",
"CIRCUIT_REQUEST_TO_ENTER_WITH_GROUP": "il gruppo %s ha chiesto di entrare nel %s (con %s iscritti)",
@@ -58,12 +64,12 @@
"CIRCUIT_REMOVED_ADMIN_YOU": "%s ti è stato rimosso l'incarico di Amministratore del %s da parte di %s",
"RICHIESTA_BLOCCO_CIRCUIT": "Richiesta di bloccare il %s da parte di %s",
"CIRCUIT_ELIMINATO": "Il %s è stato eliminato da parte di %s",
"FIDO_IMPOSTATO_ADMINS_CIRCUIT": "✅ l'utente %s è stato abilitato al Fido (%s RIS) sul '%s' (da parte di %s)",
"FIDO_IMPOSTATO_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto di Gruppo %s è stato abilitato al Fido fino a -%s sul '%s' (da parte di %s)",
"FIDO_IMPOSTATO_ADMINS_CIRCUIT": "✅ l'utente %s è stato abilitato alla Fiducia (%s RIS) sul '%s' (da parte di %s)",
"FIDO_IMPOSTATO_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto di Gruppo %s è stato abilitato alla Fiducia fino a -%s sul '%s' (da parte di %s)",
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT": "✅ l'utente %s è stato accettato a far parte del '%s' (da parte di %s)",
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto di Gruppo %s è stato accettato a far parte del '%s' (da parte di %s)",
"CIRCUIT_ACCEPTED": "✅ Sei stato accettato da %s a far parte del %s.\nApri la APP e clicca in alto a destra sull'icona delle monete, oppure clicca qui: %s",
"FIDO_IMPOSTATO": "✅ Ti è stata attivata la possibilità di utilizzare il fido (Fiducia Concessa) fino a %s RIS da %s sul '%s'.",
"FIDO_IMPOSTATO": "✅ Ti è stata attivata la possibilità di utilizzare la Fiducia Concessa fino a %s RIS da %s sul '%s'.",
"CIRCUIT_ACCEPTED_YOU": "✅ Hai accettato %s a far parte del '%s'",
"CIRCUIT_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del '%s'. Se pensi sia un'errore, contatta l'amministratore del Circuito.",
"CIRCUIT_REMOVED": "❌ l'utente %s è stato rimosso del %s (da parte di %s)",
@@ -97,7 +103,7 @@
"STATUS_SENT": "Inviato",
"STATUS_REFUSED": "Rifiutato",
"SALDO_VARIATO": "[%s] l'utente %s ha variato il Saldo di %s da %s a %s %s",
"FIDOCONCESSO_VARIATO": "[%s] l'utente %s ha variato il Fido Concesso di %s da %s a %s %s",
"FIDOCONCESSO_VARIATO": "[%s] l'utente %s ha variato la Fiducia Concessa di %s da %s a %s %s",
"QTAMAX_VARIATO": "[%s] l'utente %s ha variato la quantità massima concessa di %s da %s a %s %s",
"SET_FAVORITE": "%s ha messo 'Mi Piace' al tuo post: %s",
"SET_FAVORITE_OTHERS": "%s e altre %s persone hanno messo 'Mi Piace' al tuo post: %s",

View File

@@ -13,6 +13,7 @@ const auth_default = (req, res, next) => {
const authenticate = (req, res, next) => {
const token = req.header('x-auth');
//const refreshToken = req.header('x-refrtok');
// console.log('authenticate... ');
@@ -29,65 +30,80 @@ const authenticate = (req, res, next) => {
const access = 'auth';
User.findByToken(token, access).then((user) => {
return User.findByToken(token, access, true).then((ris) => {
if (!user) {
// tools.mylog("TOKEN " + token);
// tools.mylog(" NOT FOUND! (Maybe Connected to other Page) ACCESS: '" + access + "'");
return Promise.reject(server_constants.RIS_CODE_HTTP_INVALID_TOKEN);
// res.status().send();
if (ris && ris.user && !!ris.user.deleted) {
if (ris.user.deleted)
ris.user = null;
}
if (!!user.deleted) {
if (user.deleted)
user = null;
if (ris.code === server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED) {
return Promise.reject(server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED);
}
if (!user) {
if (!ris.user) {
return Promise.reject(server_constants.RIS_CODE_HTTP_INVALID_TOKEN);
}
if (!!user) {
if (!!ris.user) {
// Save last time online
user.lasttimeonline = new Date();
user.useragent = req.get('User-Agent');
ris.user.lasttimeonline = new Date();
ris.user.retry_pwd = 0
ris.user.useragent = req.get('User-Agent');
return user.save().then(() => {
req.user = user;
return ris.user.save().then(() => {
req.user = ris.user;
req.token = token;
// req.refreshToken = refreshToken;
req.access = access;
next();
next(); // Esegui il codice successivo
});
}
// tools.mylog('userid', user._id);
}).catch((e) => {
if (e === server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED) {
return res.status(server_constants.RIS_CODE_HTTP_FORBIDDEN_TOKEN_EXPIRED).send();
}
tools.mylog("ERR authenticate invalid Token =", e);
res.status(server_constants.RIS_CODE_HTTP_INVALID_TOKEN).send();
});
};
const authenticate_noerror = (req, res, next) => {
try {
const token = req.header('x-auth');
const refreshToken = req.header('x-refrtok');
const access = 'auth';
User.findByToken(token, access).then((user) => {
if (!user) {
return User.findByToken(token, access, false).then((ris) => {
if (ris.code !== server_constants.RIS_CODE_OK) {
req.user = null;
req.token = null;
req.access = null;
req.code = ris.code;
} else {
req.user = user;
req.user = ris.user;
req.token = token;
req.refreshToken = refreshToken;
req.access = access;
req.code = ris.code;
}
// Vai avanti ad eseguire il codice, in ogni modo !
next();
}).catch((e) => {
req.user = null;
req.token = null;
req.access = null;
req.code = 0;
// Continua comunque !
next();
});
} catch (e) {
console.error('Err', e);
}
};
module.exports = { authenticate, authenticate_noerror, auth_default };

View File

@@ -30,6 +30,9 @@ const AccountSchema = new Schema({
idapp: {
type: String,
},
numtransactions: {
type: Number,
},
username: {
type: String,
},
@@ -232,10 +235,16 @@ AccountSchema.statics.addtoSaldo = async function (myaccount, amount, mitt) {
myaccount.totTransato = 0;
}
myaccount.totTransato += Math.abs(amount);
if (!myaccount.numtransactions)
myaccount.numtransactions = 0;
myaccount.numtransactions++;
myaccount.date_updated = new Date();
myaccountupdate.saldo = myaccount.saldo;
myaccountupdate.totTransato = myaccount.totTransato;
myaccountupdate.numtransactions = myaccount.numtransactions;
myaccountupdate.date_updated = myaccount.date_updated;
const ris = await Account.updateOne({ _id: myaccount.id },
@@ -243,8 +252,8 @@ AccountSchema.statics.addtoSaldo = async function (myaccount, amount, mitt) {
$set: myaccountupdate
});
await myaccount.calcPending(mitt);
// Calcola Saldo Pendente !
await myaccount.calcPending(true);
return ris;
@@ -272,8 +281,8 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
const { Circuit } = require('../models/circuit');
if (username === undefined)
return false;
// if (username === undefined)
// return false;
let myquery = {
idapp,
@@ -308,6 +317,7 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
fidoConcesso: 0,
qta_maxConcessa: 0,
totTransato: 0,
numtransactions: 0,
totTransato_pend: 0,
});
@@ -636,7 +646,7 @@ AccountSchema.statics.updateQtaMax = async function (idapp, username, groupname,
else
risult = await Account.updateOne({ idapp, username, circuitId }, { $set: paramstoupdate });
return risult;
return risult && risult.nModified > 0;
};
AccountSchema.statics.getAccountsCircuitiNazionali = async function (idapp) {
@@ -725,9 +735,8 @@ AccountSchema.statics.removeAdminOfAccount = async function (idapp, username, ci
// Rimuovi l'account
AccountSchema.statics.removeAccount = async function (accountId) {
const { Circuit } = require('../models/circuit');
return await Circuit.deleteOne({ _id: accountId});
return await Account.deleteOne({ _id: accountId});
};
AccountSchema.statics.updateSaldoAndTransato_AllAccounts = async function (idapp) {
@@ -742,4 +751,8 @@ AccountSchema.statics.updateSaldoAndTransato_AllAccounts = async function (idapp
const Account = mongoose.model('Account', AccountSchema);
Account.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Account };

View File

@@ -64,4 +64,8 @@ AdTypeSchema.statics.executeQueryTable = function(idapp, params) {
const AdType = mongoose.model('AdType', AdTypeSchema);
AdType.createIndexes((err) => {
if (err) throw err;
});
module.exports = {AdType};

View File

@@ -64,4 +64,8 @@ AdTypeGoodSchema.statics.executeQueryTable = function(idapp, params) {
const AdTypeGood = mongoose.model('AdTypeGood', AdTypeGoodSchema);
AdTypeGood.createIndexes((err) => {
if (err) throw err;
});
module.exports = {AdTypeGood};

54
src/server/models/author.js Executable file
View File

@@ -0,0 +1,54 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const AuthorSchema = new Schema({
idapp: {
type: String,
},
name: {
type: String,
},
surname: {
type: String,
},
bio: {
type: String,
},
img: {
type: String,
},
});
var Author = module.exports = mongoose.model('Author', AuthorSchema);
module.exports.getFieldsForSearch = function () {
return [
{ field: 'name', type: tools.FieldType.string },
{ field: 'surname', type: tools.FieldType.string },
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Author.find(myfind).sort({name: 1, surname: 1});
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -122,4 +122,8 @@ bookingSchema.statics.findAllDistinctByBooking = function (idapp) {
const Booking = mongoose.model('Booking', bookingSchema);
Booking.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Booking };

View File

@@ -50,11 +50,11 @@ const BotSchema = new Schema({
},
});
BotSchema.statics.getFieldsForSearch = function() {
BotSchema.statics.getFieldsForSearch = function () {
return [{ field: 'label', type: tools.FieldType.string }]
};
BotSchema.statics.executeQueryTable = function(idapp, params) {
BotSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
@@ -66,14 +66,147 @@ BotSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
};
BotSchema.statics.findAllIdApp = async function(idapp) {
BotSchema.statics.generateBotMenuRecords = async function (idapp) {
try {
let arrrec = [
{
"page": 1,
"index": 1,
"riga": 1,
"active": true,
"label": "Vai al Sito",
"type": 3,
"value": "{host}",
"visibility": 0,
idapp,
"lang": "it",
"main": true
},
{
"page": 1,
"index": 1,
"riga": 2,
"active": true,
"label": "Il mio Profilo",
"type": 3,
"value": "{host}/my/{username}",
"visibility": 1,
idapp,
"lang": "it",
"main": true
},
{
"page": 1,
"index": 1,
"riga": 3,
"active": true,
"label": "Link da Condividere",
"type": 2,
"value": "{host}/registrati/{username}",
"visibility": 1,
idapp,
"lang": "it",
"main": true,
},
{
"page": 1,
"index": 2,
"riga": 1,
"active": true,
"label": "🔮 Help",
"type": 4,
"value": "",
"visibility": 0,
idapp,
"lang": "it",
"main": true,
},
{
"page": 1,
"index": 1,
"riga": 3,
"active": true,
"label": "💁‍♀️ Admin",
"type": 4,
"value": "",
"visibility": 5,
idapp,
"lang": "it",
"main": true
},
{
"page": 1,
"index": 2,
"riga": 2,
"active": true,
"label": "Imposta Foto Profilo",
"type": 4,
"value": "🖼 SetPicProfile",
"visibility": 1,
idapp,
"lang": "it",
"main": true
},
{
"page": 1,
"index": 2,
"riga": 3,
"active": true,
"label": "🛠 Strumenti",
"type": 1,
"value": "2",
"visibility": 1,
idapp,
"lang": "it",
"main": true,
},
{
"page": 2,
"index": 1,
"riga": 1,
"active": true,
"label": "🔑 Cambio Password",
"type": 4,
"value": "🔑 SetResetPwd",
"visibility": 1,
idapp,
"lang": "it",
},
{
"page": 2,
"index": 1,
"riga": 2,
"active": true,
"label": "👉🏻 Indietro",
"type": 1,
"value": "1",
"visibility": 1,
idapp,
"lang": "it",
}];
const ris = await MyBot.insertMany(arrrec);
return ris;
} catch (e) {
console.error('Err:', e);
}
}
BotSchema.statics.findAllIdApp = async function (idapp) {
const Bot = this;
const myfind = {idapp};
const myfind = { idapp };
return await Bot.find(myfind).sort({page: 1, lang: 1, riga: 1, index: 1}).lean();
return await Bot.find(myfind).sort({ page: 1, lang: 1, riga: 1, index: 1 }).lean();
};
const MyBot = mongoose.model('Bot', BotSchema);
module.exports = {MyBot};
MyBot.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyBot };

View File

@@ -76,4 +76,8 @@ CalZoomSchema.statics.getNextZoom = async function (idapp) {
const CalZoom = mongoose.model('CalZoom', CalZoomSchema);
CalZoom.createIndexes((err) => {
if (err) throw err;
});
module.exports = { CalZoom };

View File

@@ -1,9 +1,14 @@
const mongoose = require('mongoose').set('debug', false);
const Schema = mongoose.Schema;
const shared_consts = require('../tools/shared_nodejs');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const Order = require('../models/order');
const CartSchema = new Schema({
idapp: {
@@ -12,6 +17,7 @@ const CartSchema = new Schema({
userId: { type: Schema.Types.ObjectId, ref: 'User' },
totalQty: { type: Number, default: 0 },
totalPrice: { type: Number, default: 0 },
totalPriceCalc: { type: Number, default: 0 },
department: {
type: String, ref: 'Department',
},
@@ -24,6 +30,9 @@ const CartSchema = new Schema({
note: {
type: String,
},
note_ordine_gas: {
type: String,
},
modify_at: {
type: Date,
},
@@ -39,25 +48,38 @@ module.exports.findAllIdApp = async function (idapp, userId) {
module.exports.getCartByUserId = async function (uid, idapp) {
try {
const Order = require('../models/order');
let query = { userId: uid, idapp };
const mycart = await Cart.findOne(query).lean();
if (!!mycart) {
for (const idkey in mycart.items) {
try {
idorder = mycart.items[idkey]._id.toString();
const myorder = mycart.items[idkey].order;
let idorder = mycart.items[idkey]._id.toString();
let myorder = mycart.items[idkey].order;
if (!!myorder) {
idorder = mycart.items[idkey].order._id.toString();
}
const myord = await Order.getTotalOrderById(idorder);
if (idorder) {
let myord = await Order.getTotalOrderById(idorder);
if (myord.length > 0) {
mycart.items[idkey].order = myord[0];
}
}
} catch (e) {
console.log('err', e);
}
}
mycart.newitems = []
for (let item of mycart.items) {
if (item.order && item.order.hasOwnProperty('idapp') && (item.order.quantity > 0 || item.order.quantitypreordered > 0))
mycart.newitems.push(item)
}
mycart.items = [...mycart.newitems]
mycart.newitems = []
return mycart;
}
return null;
@@ -81,6 +103,7 @@ module.exports.updateCartByUserId = function (userId, newCart, callback) {
items: newCart.items,
totalQty: newCart.totalQty,
totalPrice: newCart.totalPrice,
totalPriceCalc: newCart.totalPriceCalc,
userId: userId,
},
},
@@ -99,6 +122,9 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
const items = newCart.items;
const totalQty = newCart.totalQty;
const totalPrice = newCart.totalPrice;
const totalPriceCalc = newCart.totalPriceCalc;
const note = newCart.note;
const note_ordine_gas = newCart.note_ordine_gas;
const modify_at = new Date();
@@ -106,8 +132,11 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
$set: {
items,
totalPrice,
totalPriceCalc,
totalQty,
modify_at,
note,
note_ordine_gas,
modify_at: new Date(),
},
}, { new: false }).lean().then((ris) => {
return ris;
@@ -126,3 +155,7 @@ module.exports.createCart = async function (newCart) {
return await newCart.save();
};
Cart.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -1,127 +0,0 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
const { ObjectID } = require('mongodb');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const CashSchema = new Schema({
idapp: {
type: String,
},
creatorUserId: {
type: String,
},
idCashCategory: {
type: String
},
idSubCashCategory: {
type: String
},
type: { // CashType: TYPE_IN, TYPE_OUT
type: Number
},
date_created: {
type: Date
},
date_payment: {
type: Date
},
descr: {
type: String,
},
price: {
type: Number
},
quantity: {
type: Number
},
total: {
type: Number
},
fromWalletUserId: { // walletCommonCash or any Member
type: String,
},
toWalletUserId: { // walletCommonCash or any Member
type: String,
},
walletStatus: { // WalletFinalStatusType: None: 0, InCommonCash: 1, InMyWallet : 2
type: Number,
},
walletTemporaryToUserId: { // WalletCommonCash
type: String,
},
walletCashId: {
type: String,
},
internal: {
type: Boolean,
default: false,
},
extra: {
type: Boolean,
default: false,
},
notes: {
type: String
},
confirmed: {
type: Boolean,
default: false,
},
});
var Cash = module.exports = mongoose.model('Cash', CashSchema);
module.exports.getFieldsForSearch = function () {
return []
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Cash.find(myfind);
};
module.exports.getAllCash = function (query, sort, callback) {
Cash.find(query, null, sort, callback)
}
module.exports.getCashByUserId = function (userId, sort, callback) {
Cash.find({ userId }, null, sort, callback)
}
module.exports.getCashByID = function (id, callback) {
Cash.findById(id, callback);
}
module.exports.createCash = async function (Cash) {
const CashModel = new Cash(Cash);
return await CashModel.save(Cash)
.then((ris) => {
if (!!ris)
return ris._id;
return null;
});
}
// const Cash = mongoose.model('Cash', CashSchema);
// module.exports = { Cash };

View File

@@ -28,6 +28,10 @@ const CashCategorySchema = new Schema({
var CashCategory = module.exports = mongoose.model('CashCategory', CashCategorySchema);
CashCategory.createIndexes((err) => {
if (err) throw err;
});
module.exports.getFieldsForSearch = function () {
return []
};
@@ -66,3 +70,4 @@ module.exports.createCashCategory = async function (CashCategory) {
return null;
});
}

View File

@@ -69,3 +69,7 @@ module.exports.createCashSubCategory = async function (CashSubCategory) {
return null;
});
}
module.exports.createIndexes((err) => {
if (err) throw err;
});

61
src/server/models/catai.js Executable file
View File

@@ -0,0 +1,61 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
mongoose.Promise = global.Promise;
mongoose.level = "F";
const tools = require('../tools/general');
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const CatAISchema = new Schema({
_id: {
type: Number,
},
name: {
type: String,
},
img: {
type: String,
},
icon: {
type: String,
},
color: {
type: String,
},
});
CatAISchema.statics.getAllCategories = function (callback) {
CatAI.find(callback)
}
CatAISchema.statics.getCatAIById = function (id, callback) {
CatAI.findById(id, callback);
}
CatAISchema.statics.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string }]
};
CatAISchema.statics.executeQueryTable = function (idapp, params) {
return tools.executeQueryTable(this, idapp, params);
};
CatAISchema.statics.findAllIdApp = async function (idapp) {
const myfind = {};
return await CatAI.find(myfind).sort({ name: 1 });
};
const CatAI = mongoose.model('CatAI', CatAISchema);
CatAI.createIndexes((err) => {
if (err) throw err;
});
module.exports = CatAI;

View File

@@ -50,4 +50,9 @@ CategorySchema.statics.findAllIdApp = async function (idapp) {
const Category = mongoose.model('Category', CategorySchema);
Category.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Category };

View File

@@ -80,4 +80,8 @@ CatGrpSchema.statics.executeQueryTable = function (idapp, params) {
const CatGrp = mongoose.model('CatGrp', CatGrpSchema);
CatGrp.createIndexes((err) => {
if (err) throw err;
});
module.exports = { CatGrp };

62
src/server/models/catprod.js Executable file
View File

@@ -0,0 +1,62 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
mongoose.Promise = global.Promise;
mongoose.level = "F";
const tools = require('../tools/general');
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const CatProdSchema = new Schema({
idapp: {
type: String,
},
name: {
type: String,
},
img: {
type: String,
},
icon: {
type: String,
},
color: {
type: String,
},
});
CatProdSchema.statics.getAllCategories = function (callback) {
CatProd.find(callback)
}
CatProdSchema.statics.getCatProdById = function (id, callback) {
CatProd.findById(id, callback);
}
CatProdSchema.statics.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string }]
};
CatProdSchema.statics.executeQueryTable = function (idapp, params) {
return tools.executeQueryTable(this, idapp, params);
};
CatProdSchema.statics.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await CatProd.find(myfind).sort({ name: 1 });
};
const CatProd = mongoose.model('CatProd', CatProdSchema);
CatProd.createIndexes((err) => {
if (err) throw err;
});
module.exports = CatProd;

View File

@@ -43,5 +43,9 @@ CfgServerSchema.statics.findAllIdApp = async function(idapp) {
const CfgServer = mongoose.model('CfgServer', CfgServerSchema);
CfgServer.createIndexes((err) => {
if (err) throw err;
});
module.exports = {CfgServer};

View File

@@ -84,9 +84,6 @@ const CircuitSchema = new Schema({
totCircolante: {
type: Number,
},
showAlways: {
type: Boolean,
},
totTransato: {
type: Number,
},
@@ -227,6 +224,10 @@ const CircuitSchema = new Schema({
type: Number,
default: 0,
},
ignoreLimits: {
type: Boolean,
default: false,
},
});
CircuitSchema.pre('save', async function (next) {
@@ -249,6 +250,18 @@ CircuitSchema.statics.findAllIdApp = async function (idapp) {
return await Circuit.find(myfind, whatToShow).sort({ status: -1, numMembers: -1, name: 1 });
};
CircuitSchema.statics.isCircuitAdmin = async function (idrec, username) {
const Circuit = this;
const mycirc = await Circuit.findOne({ _id: idrec }).lean();
if (mycirc) {
return mycirc.admins.some(admin => admin.username === username);
}
return false;
};
CircuitSchema.statics.getFieldsForSearch = function () {
return [
{ field: 'name', type: tools.FieldType.string },
@@ -592,6 +605,7 @@ CircuitSchema.statics.getUsersSingleCircuit = async function (idapp, username, c
{
$project: {
username: 1,
verified_by_aportador: 1,
name: 1,
surname: 1,
profile: 1,
@@ -669,6 +683,7 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
const esisteDest = await Account.isExistAccountByUsernameAndCircuitId(idapp, extrarec.dest, circuittable._id, extrarec.groupdest, extrarec.contoComDest);
if (!esisteDest) {
// Fallo entrare anche sul Circuito (oltre ad aver creato l'Account).
await User.addCircuitToUser(idapp, usernameOrig, extrarec.circuitname, false, extrarec.groupdest, extrarec.contoComDest);
@@ -694,6 +709,7 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
const circolantePrec = this.getCircolanteSingolaTransaz(accountorigTable, accountdestTable);
if (!circuittable.ignoreLimits) {
// Check if Sender has enough money
if (accountorigTable.saldo - myqty < -accountorigTable.fidoConcesso) {
ris.cansend = false;
@@ -704,11 +720,12 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
ris.cansend = false;
ris.errormsg = i18n.__('CIRCUIT_AMOUNT_EXCEED_QTAMAX', extrarec.dest);
}
}
if (!onlycheck) {
// Add a Transaction !
if (ris.cansend) {
ris.rec = await Movement.addMov(idapp, accountorigTable, accountdestTable, myqty, extrarec.causal, extrarec.notifId);
ris.rec = await Movement.addMov(idapp, accountorigTable, accountdestTable, myqty, extrarec.causal, extrarec.notifId, extrarec.idOrdersCart);
}
if (ris.cansend && ris.rec) {
@@ -726,8 +743,8 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
};
await Circuit.updateOne({ _id: circuittable }, { $set: paramstoupdate });
extrarec.saldoOrig = accountorigTable.saldo;
extrarec.saldoDest = accountdestTable.saldo;
extrarec.saldoOrig = tools.arrotondaA2Decimali(accountorigTable.saldo);
extrarec.saldoDest = tools.arrotondaA2Decimali(accountdestTable.saldo);
let orig = usernameOrig;
if (extrarec.grouporig) {
@@ -1110,7 +1127,7 @@ CircuitSchema.statics.getListCircuitsByUsername = async function (idapp, usernam
if (account.groupname === '') {
mystr += '\n👉🏻 ' + account.circuit.name + '\n';
mystr += ' [Saldo: ' + account.saldo + ' RIS, ';
mystr += ' Fido: ' + account.fidoConcesso + ' RIS, ';
mystr += ' Fiducia: ' + account.fidoConcesso + ' RIS, ';
mystr += ' Transato: ' + account.totTransato + ' RIS]';
}
}
@@ -1121,7 +1138,7 @@ CircuitSchema.statics.getListCircuitsByUsername = async function (idapp, usernam
if (myuser.profile.mycircuits.find((rec) => (rec.circuitname === account.circuit.name))) {
mystr += '\n GRUPPO: 👉🏻 <b>' + account.groupname + '</b> in ' + account.circuit.name + '\n';
mystr += ' [Saldo: ' + account.saldo + ' RIS, ';
mystr += ' Fido: ' + account.fidoConcesso + ' RIS, ';
mystr += ' Fiducia: ' + account.fidoConcesso + ' RIS, ';
mystr += ' Transato: ' + account.totTransato + ' RIS]';
}
}
@@ -1161,12 +1178,15 @@ CircuitSchema.statics.SetDefMinMaxCollettivi = async function (idapp, valmin, va
CircuitSchema.statics.setFido = async function (idapp, username, circuitName, groupname) {
mycircuit = await Circuit.findOne({ idapp, name: circuitName });
try {
mycircuit = await Circuit.findOne({ idapp, name: circuitName }).lean();
if (mycircuit) {
const circuitId = mycircuit._id;
let account = null;
let fido = 0;
let qtamax = 0;
let variato = false;
let variato2 = false;
if (mycircuit.showAlways) {
@@ -1178,7 +1198,7 @@ CircuitSchema.statics.setFido = async function (idapp, username, circuitName, gr
const accountsuser = await Account.getUserAccounts(idapp, username);
if (accountsuser) {
// Se lo trovo della mia provincia, prendo quello
account = accountsuser.find((account) => account.circuit.strProv === myuser.profile.resid_province && account.circuit.card === myuser.profile.resid_card)
account = accountsuser.find((account) => account.circuit.strProv === myuser.profile.resid_province && ((account.circuit.card === myuser.profile.resid_card) || !myuser.profile.resid_card))
if (!account && accountsuser.length > 0) {
// Se non lo trovo, prendo il primo in cui sono entrato !
account = accountsuser[0];
@@ -1194,7 +1214,7 @@ CircuitSchema.statics.setFido = async function (idapp, username, circuitName, gr
}
} else {
// Se non ho Circuiti locali, non applico il Fido !
return false;
return null;
}
} else {
@@ -1207,18 +1227,442 @@ CircuitSchema.statics.setFido = async function (idapp, username, circuitName, gr
if (account) {
if (qtamax > 0) {
await Account.updateQtaMax(idapp, username, groupname, circuitId, qtamax);
variato = await Account.updateQtaMax(idapp, username, groupname, circuitId, qtamax);
}
const ris = await Account.updateFido(idapp, username, groupname, circuitId, fido);
if (ris) {
return { qta_maxConcessa: qtamax, fidoConcesso: fido };
return { qta_maxConcessa: qtamax, fidoConcesso: fido, changed: variato || (ris && ris.nModified > 0) };
}
}
}
return false;
} catch (e) {
console.error('Err:', e);
}
return null;
};
CircuitSchema.statics.CheckTransazioniCircuiti = async function (correggi) {
const { User } = require('../models/user');
const { MyGroup } = require('../models/mygroup');
const { SendNotif } = require('../models/sendnotif');
const idapp = tools.RISO;
try {
console.log('--------- INIZIO CONTROLLO CheckTransazioniCircuiti -----------');
if (correggi)
console.log('CORREZIONE !');
else
console.log('SOLO VERIFICA');
if (correggi) {
// Trova tutti i documenti che contengono circuitname a null nell'array mycircuits
const usersWithNullCircuit = await User.find({ idapp, "profile.mycircuits.circuitname": null });
// Itera su ciascun documento
for (const user of usersWithNullCircuit) {
// Rimuove i campi null dall'array mycircuits
user.profile.mycircuits = user.profile.mycircuits.filter(circuit => circuit.circuitname !== null);
// Salva le modifiche al documento
await User.findOneAndUpdate({ _id: user._id }, { $set: { 'profile.mycircuits': user.profile.mycircuits } });
}
}
let usersWithDuplicateCircuits = await User.aggregate([
{
$unwind: "$profile.mycircuits"
},
{
$group: {
_id: {
userId: "$_id",
username: "$username",
circuitname: "$profile.mycircuits.circuitname"
},
count: { $sum: 1 }
}
},
{
$match: {
count: { $gt: 1 }
}
},
{
$group: {
_id: "$_id.userId",
username: { $first: "$_id.username" },
duplicatedCircuits: {
$push: "$_id.circuitname"
}
}
}
]);
if (usersWithDuplicateCircuits.length > 0) {
console.log("Utenti con circuitname duplicati:");
usersWithDuplicateCircuits.forEach(user => {
console.log("Username:", user.username);
console.log("Circuiti duplicati:", user.duplicatedCircuits);
});
if (correggi) {
// CORREGGI DUPLICATI NEI CIRCUITI
for (const user of usersWithDuplicateCircuits) {
// Troviamo l'utente dal suo _id e aggiorniamo il suo documento
const arraycirc = await User.findOne({ _id: user._id }).lean();
let risdel = await User.updateOne(
{ _id: user._id },
{ $pull: { "profile.mycircuits": { circuitname: { $in: user.duplicatedCircuits } } } }
);
let risadd = await User.updateOne(
{ _id: user._id },
{ $push: { "profile.mycircuits": { $each: user.duplicatedCircuits.map(circuitname => ({ circuitname, date: arraycirc.profile.mycircuits.find((rec) => rec.circuitname === circuitname).date })) } } }
);
console.log('DEL', risdel, 'risadd', risadd);
}
}
console.log("*** FINE DUPLICATI *** ");
} else {
console.log("Nessun utente ha circuitname duplicati.");
}
let numtransazionitot = 0;
const arrcircuits = await Circuit.find({ idapp }).lean();
for (const circuit of arrcircuits) {
let strusersnotinaCircuit = '';
let strusersnotExist = '';
numtransazionitot = 0;
let qta = 0;
let mystr = ''
// 1. Calcola la somma di tutti i Saldi
// prendo la lista di tutti gli account del circuito
let circuitId = circuit._id;
const accounts = await Account.find({ idapp, circuitId }).lean();
// CONTROLLA DUPLICATI !
const usernameCounts = accounts.reduce((acc, curr) => {
if (curr.username !== '') {
acc[curr.username] = (acc[curr.username] || 0) + 1;
}
return acc;
}, {});
const duplicatedUsernames = Object.keys(usernameCounts).filter(username => usernameCounts[username] > 1);
if (duplicatedUsernames.length > 0) {
mystr += ' Esistono username duplicati (escludendo quelli vuoti):' + duplicatedUsernames;
}
let saldotot = 0;
let ris = await User.find({
"profile.mycircuits": { $elemMatch: { circuitname: circuit.name } }
}, "username").lean()
let arrusers_byprofile = ris ? ris.map(user => user.username) : [];
let risgroups = await MyGroup.find({
"mycircuits": { $elemMatch: { circuitname: circuit.name } }
}, "groupname").lean()
let arrgroups_byprofile = risgroups ? risgroups.map(group => group.groupname) : [];
let arrusers_byaccounts = [];
let ind = 0
let stracc = '';
for (const account of accounts) {
let aggiorna = false;
if (account.username && !arrusers_byaccounts.includes(account.username)) {
arrusers_byaccounts.push(account.username);
} else if (account.groupname && !arrusers_byaccounts.includes(account.groupname)) {
arrusers_byaccounts.push(account.groupname);
} else if (account.contocom && !arrusers_byaccounts.includes(account.contocom)) {
arrusers_byaccounts.push(account.contocom);
}
// per ogni Account ricalcolo il numero di transazioni avvenute in Entrata/uscita
let result = await Movement.aggregate([
{
$match: {
$or: [
{ accountFromId: account._id },
{ accountToId: account._id },
]
}
},
{
$group: {
_id: null,
numtransactions: { $sum: 1 },
totTransato: { $sum: { $abs: "$amount" } },
saldo: {
$sum: {
$cond: [
{ $eq: ["$accountToId", account._id] },
"$amount",
{
$cond: [
{ $eq: ["$accountFromId", account._id] },
{ $multiply: ["$amount", -1] },
0
]
}
]
}
}
}
}
]);
let numtransactions = result && result.length > 0 ? result[0].numtransactions : 0;
let totTransato = result && result.length > 0 ? result[0].totTransato : 0;
let saldo = result && result.length > 0 ? result[0].saldo : 0;
// TRANSAZIONI PENDENTI:
let saldo_pend = 0;
let pendingtransactionsMittente = await SendNotif.getSumPendingTransactionsMittente(account.idapp, account.username, circuit.name, account.groupname);
if (pendingtransactionsMittente.length > 0) {
let saldopendingMitt = pendingtransactionsMittente.reduce((sum, rec) => sum + rec.extrarec.qty, 0);
// transatopending = pendingtransactionsMittente.reduce((sum, rec) => sum + Math.abs(rec.extrarec.qty), 0);
saldo_pend = saldo - saldopendingMitt;
} else {
saldo_pend = saldo;
}
let strtemp = '';
if (numtransactions > 0) {
if (correggi)
await Account.findOneAndUpdate({ _id: account._id }, { $set: { numtransactions } })
}
if (saldo !== account.saldo) {
aggiorna = true;
strtemp += ' SALDO DIFFERENTE ! => ' + '\nPRIMA: ' + account.saldo + '\nDOPO: ' + saldo;
if (correggi)
await Account.findOneAndUpdate({ _id: account._id }, { $set: { saldo } })
}
if (account.saldo_pend === undefined) {
await Account.findOneAndUpdate({ _id: account._id }, { $set: { saldo_pend: 0 } })
}
if (saldo_pend !== account.saldo_pend) {
aggiorna = true;
strtemp += ' SALDO_PENDENTE DIFF. ! => ' + '\nPRIMA: ' + account.saldo_pend + '\nDOPO: ' + saldo_pend;
if (correggi)
await Account.findOneAndUpdate({ _id: account._id }, { $set: { saldo_pend } })
}
if (!account.totTransato || (totTransato !== account.totTransato)) {
if (totTransato > account.totTransato || account.totTransato === undefined)
if (correggi)
await Account.findOneAndUpdate({ _id: account._id }, { $set: { totTransato } })
}
saldotot += account.saldo;
// if (account.totTransato === NaN || account.totTransato === undefined)
// stracc += ' TOTTRANSATO => ' + account.totTransato;
if (account.totTransato)
qta += account.totTransato;
if (account.numtransactions)
numtransazionitot += account.numtransactions;
if (aggiorna && strtemp) {
stracc += '\n ** Account ' + account.username + '\n' + strtemp;
}
// await account.calcPending();
ind++;
}
let numaccounts = accounts.length;
let esistecontocom = accounts.find((rec) => (rec.hasOwnProperty('contocom') && rec.contocom !== ''));
let numacc_profile = arrusers_byprofile.length + arrgroups_byprofile.length;
if (esistecontocom && esistecontocom.contocom === circuit.path) {
numacc_profile++;
}
if (numacc_profile !== numaccounts) {
mystr += ' IL NUMERO DI UTENTI NON COINCIDONO ! \n';
mystr += 'Utenti Profilo = ' + numacc_profile + '\n';
mystr += 'Utenti Accounts = ' + arrusers_byaccounts.length + '\n';
}
saldotot = saldotot.toFixed(2);
// mystr += ' numaccounts=' + numaccounts;
if (strusersnotinaCircuit)
mystr += ' Utenti non presenti nel Circuito ! => ' + strusersnotinaCircuit;
if (strusersnotExist)
mystr += ' Utenti non più esistenti ! => ' + strusersnotExist;
// Verifica se saldotot è uguale a ZERO
if (saldotot != 0) {
mystr += '*** ATTENZIONE! ' + circuit.name + ' ha come somma un saldo di ' + saldotot + ' invece che ZERO';
} else {
if (numtransazionitot)
mystr += ' qta=' + qta + ' numtransazionitot ' + numtransazionitot;
}
if (mystr || stracc) {
console.log('************************* ' + circuit.name + ':');
console.log(mystr);
if (stracc)
console.log(stracc);
}
}
console.log('--------- FINE CONTROLLO CheckTransazioniCircuiti -----------', 'Transazioni = ', numtransazionitot)
} catch (e) {
console.error('Err', e);
}
};
CircuitSchema.statics.replaceAllCircuitNames = async function (idapp) {
const Circuit = this;
const { City } = require('../models/city');
const { Province } = require('../models/province');
const { MyGroup } = require('../models/mygroup');
const { User } = require('../models/user');
const myfind = { idapp };
let circuits = [];
try {
circuits = await Circuit.find(myfind);
let quanti = 0;
for (const circuit of circuits) {
if (!circuit || !circuit._id) {
console.error('Error: circuit is null or has no _id property');
continue;
}
const circuitId = circuit._id;
let provincia = '';
if (circuit.idCity && circuit.idCity.length > 0) {
provincia = await City.getProvinceByIdCity(circuit.idCity[0]);
}
if (!provincia)
provincia = circuit.strProv;
if (provincia) {
provincia = await Province.getStrProvinceByProv(provincia);
}
if (!provincia) {
console.log('PROVINCIA NON ESISTENTE !', circuit.name);
}
let path = '';
if (!circuit.showAlways) {
let newname = 'Circuito RIS ' + provincia;
// Se newname contiene 'ROMA', allora non aggiorna
if (circuit.name == 'RIS Roma Sud Est ' || circuit.name === 'Circuito RIS Roma Sud Est') {
newname = 'Circuito RIS Roma Sud Est';
} else if (circuit.name == 'Circuito RIS Roma Sud e Litora') {
newname = 'Circuito RIS Roma Sud e Litora';
} else if (circuit.name.trim() === 'RISO Roma Nord' || circuit.name.trim() === 'Circuito RISO Roma Nord') {
newname = 'Circuito RIS Roma Nord';
} else if (circuit.name == 'Circuito RIS Benevento' || circuit.name == 'Circuito RIS Campania') {
newname = 'Circuito RIS Campania';
path = 'riscampania';
} else if (circuit.name == 'Circuito RIS Milano Est') {
newname = 'Circuito RIS Milano Est';
} else if (circuit.name == 'Circuito RIS Repubblica di San Marino') {
newname = 'Circuito RIS Repubblica di San Marino';
}
if (((newname !== circuit.name) && (newname.indexOf('ROMA') === -1)) || path) {
console.log(`Sostituisci ${circuit.name} con ${newname}`);
quanti++;
if (path) {
// Update path
await Circuit.findOneAndUpdate({ _id: circuitId }, { $set: { path } })
.catch(e => console.error('Err ', e));
}
await Circuit.findOneAndUpdate({ _id: circuitId }, { $set: { name: newname } })
.catch(e => console.error('Err ', e));
// Rename profile.mycircuits.circuitname in User
await User.renameCircuitName(idapp, circuit.name, newname)
.catch(e => console.error('Err ', e));
await MyGroup.renameCircuitName(idapp, circuit.name, newname)
.catch(e => console.error('Err ', e));
}
}
}
console.log('Circuiti aggiornati: ' + quanti);
} catch (e) {
console.error('Err ', e);
return;
}
};
CircuitSchema.statics.addMovementByOrdersCart = async function (ordersCart, usernameDest, groupDest) {
const { User } = require('../models/user');
const idapp = ordersCart.idapp;
let extrarec = {
causal: 'Pagato Ordine n.' + ordersCart.numorder,
circuitname: 'Euro',
idOrdersCart: ordersCart._id,
qty: ordersCart.totalPrice,
dest: usernameDest,
groupdest: groupDest,
contoComDest: '',
};
const usernameOrig = await User.getUsernameById(idapp, ordersCart.userId);
return this.sendCoins(false, idapp, usernameOrig, extrarec);
};
const Circuit = mongoose.model('Circuit', CircuitSchema);
Circuit.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Circuit };

View File

@@ -8,7 +8,9 @@ mongoose.level = 'F';
const tools = require('../tools/general');
const {ObjectID} = require('mongodb');
const { ObjectID } = require('mongodb');
const fs = require('fs-extra');
const shared_consts = require('../tools/shared_nodejs');
@@ -49,11 +51,14 @@ const CitySchema = new Schema({
type: String,
maxlength: 3,
},
geojson: {
type: Object, // Tipo che può contenere le features GeoJSON
},
});
CitySchema.pre('save', async function(next) {
CitySchema.pre('save', async function (next) {
if (this.isNew) {
const myrec = await City.findOne().limit(1).sort({_id: -1});
const myrec = await City.findOne().limit(1).sort({ _id: -1 });
if (!!myrec) {
if (myrec._doc._id === 0)
this._id = 1;
@@ -68,8 +73,8 @@ CitySchema.pre('save', async function(next) {
next();
});
CitySchema.statics.getProvinceByIdCity = async function(idcity) {
const myrec = await City.findOne({_id: idcity}).lean();
CitySchema.statics.getProvinceByIdCity = async function (idcity) {
const myrec = await City.findOne({ _id: idcity }).lean();
if (myrec) {
return myrec.prov;
}
@@ -77,10 +82,10 @@ CitySchema.statics.getProvinceByIdCity = async function(idcity) {
return '';
}
CitySchema.statics.getCircuitNameBystrProv = async function(strProv) {
CitySchema.statics.getCircuitNameBystrProv = async function (strProv) {
const { Circuit } = require('../models/circuit');
const myrec = await Circuit.findOne({strProv}).lean();
const myrec = await Circuit.findOne({ strProv }).lean();
if (myrec) {
return myrec.name;
}
@@ -88,8 +93,8 @@ CitySchema.statics.getCircuitNameBystrProv = async function(strProv) {
return '';
}
CitySchema.statics.getRegionByIdCity = async function(idcity) {
const myrec = await City.findOne({_id: idcity}).lean();
CitySchema.statics.getRegionByIdCity = async function (idcity) {
const myrec = await City.findOne({ _id: idcity }).lean();
if (myrec) {
return myrec.reg;
}
@@ -97,13 +102,13 @@ CitySchema.statics.getRegionByIdCity = async function(idcity) {
return '';
}
CitySchema.statics.findByCity = function(mycity) {
CitySchema.statics.findByCity = function (mycity) {
let myregexp = new RegExp(mycity.trim().replace(' ', '|'), 'ig');
const query = [
{$match: {comune: {$regex: myregexp}}},
{$sort: {descr: 1}},
{ $match: { comune: { $regex: myregexp } } },
{ $sort: { descr: 1 } },
];
return City.aggregate(query).then((arrrec) => {
@@ -112,17 +117,17 @@ CitySchema.statics.findByCity = function(mycity) {
};
CitySchema.statics.getFieldsForSearch = function() {
CitySchema.statics.getFieldsForSearch = function () {
return [
{field: 'comune', type: tools.FieldType.string},
{field: 'prov', type: tools.FieldType.string},
{field: 'reg', type: tools.FieldType.string},
{field: 'pref', type: tools.FieldType.number},
{field: 'cap', type: tools.FieldType.number},
{ field: 'comune', type: tools.FieldType.string },
{ field: 'prov', type: tools.FieldType.string },
{ field: 'reg', type: tools.FieldType.string },
{ field: 'pref', type: tools.FieldType.number },
{ field: 'cap', type: tools.FieldType.number },
];
};
CitySchema.statics.executeQueryTable = function(idapp, params) {
CitySchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
const strfind = params.search;
@@ -134,7 +139,7 @@ CitySchema.statics.executeQueryTable = function(idapp, params) {
return tools.executeQueryTable(this, 0, params);
};
CitySchema.statics.executeQueryPickup = async function(idapp, params) {
CitySchema.statics.executeQueryPickup = async function (idapp, params) {
const strfind = params.search;
@@ -144,19 +149,19 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
let filterfindexact = {};
if (strfind) {
filterfindexact = {comune: strfind};
filterfindexact = { comune: strfind };
}
let limit = 10;
let risexact = [];
let filterfind = {comune: {$regex: '^' + strfind, $options: 'i'}};
let filterfind = { comune: { $regex: '^' + strfind, $options: 'i' } };
let aggr1 = [
{
$match: {comune: strfind},
$match: { comune: strfind },
},
{ $limit : 1 },
{ $limit: 1 },
{
$project: {
comune: { $concat: ["$comune", " (", "$prov", ")"] },
@@ -165,7 +170,7 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
];
if (params.filter) {
filterfind = {...params.filter, ...filterfind};
filterfind = { ...params.filter, ...filterfind };
limit = 200;
} else {
// risexact = await City.find(filterfindexact, {comune: 1, prov: 1, reg: 1}).lean();
@@ -176,7 +181,7 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
{
$match: filterfind,
},
{ $limit : limit },
{ $limit: limit },
{
$project: {
comune: { $concat: ["$comune", " (", "$prov", ")"] },
@@ -192,13 +197,85 @@ CitySchema.statics.executeQueryPickup = async function(idapp, params) {
};
CitySchema.statics.findAllIdApp = async function(idapp) {
CitySchema.statics.findAllIdApp = async function (idapp) {
const myfind = {};
return await City.find(myfind);
};
CitySchema.statics.getGeoJsonByProvince = async function (prov) {
let ris = null;
if (prov)
ris = await City.find({ prov }).lean();
else
ris = await City.find({}).lean();
try {
if (ris) {
const arrjson = ris
.filter(record => record.geojson && typeof record.geojson === 'object' && record.geojson.geometry) // Prima filtra per mantenere solo gli oggetti con "geometry"
.map((record, index) => {
// Crea un nuovo oggetto con gli attributi desiderati da ogni record
const newRecord = {
...record.geojson, // Spread dell'oggetto geojson per prendere tutte le sue proprietà
id: (index + 1).toString(), // Aggiunge un valore "id" incrementale in base all'indice
};
// Aggiungi o aggiorna la proprietà "prov" in "properties" dentro l'oggetto geojson
if (newRecord.properties) {
newRecord.properties.prov = record.prov; // Se "properties" esiste già
} else {
newRecord.properties = { prov: record.prov }; // Crea "properties" se non esiste
}
return newRecord;
});
return arrjson;
}
return [];
} catch (e) {
console.error('Err', e);
}
return null
};
CitySchema.statics.insertGeojsonToMongoDB = async function (nomefilejson) {
try {
// Lettura del file GeoJSON
const geojson = await fs.readJson(nomefilejson); // Sostituisci con il percorso del tuo file GeoJSON
let inseriti = 0;
const numcomuni = geojson.features.length;
for (const citta of geojson.features) {
// Identifica il documento esistente in cui vuoi aggiungere le features
const reccity = await City.findOne({ istat: String(citta.properties.ISTAT).padStart(6, '0') });
if (reccity) {
const ris = await City.updateOne({ _id: reccity._id }, { $set: { geojson: citta } });
if (ris.ok === 1) {
inseriti++;
}
}
}
console.log(`${inseriti} su ${numcomuni} comuni inseriti.`);
} catch (e) {
console.error('Err', e);
}
};
const City = mongoose.model('City', CitySchema);
module.exports = {City};
City.createIndexes((err) => {
if (err) throw err;
});
module.exports = { City };

View File

@@ -25,10 +25,12 @@ const ContribtypeSchema = new Schema({
});
ContribtypeSchema.statics.getFieldsForSearch = function () {
return [{field: 'label', type: tools.FieldType.string}]
};
ContribtypeSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
@@ -47,9 +49,13 @@ ContribtypeSchema.statics.findAllIdApp = async function (idapp) {
return await Contribtype.find(myfind, (err, arrrec) => {
return arrrec
});
}).lean();
};
const Contribtype = mongoose.model('Contribtype', ContribtypeSchema);
Contribtype.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Contribtype };

View File

@@ -26,6 +26,10 @@ const departmentSchema = new Schema({
var Department = module.exports = mongoose.model('Department', departmentSchema);
module.exports.createIndexes((err) => {
if (err) throw err;
});
module.exports.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string },
{ field: 'username', type: tools.FieldType.string }

View File

@@ -106,4 +106,8 @@ DisciplineSchema.statics.DuplicateAllRecords = async function (idapporig, idappd
const Discipline = mongoose.model('Discipline', DisciplineSchema);
Discipline.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Discipline };

View File

@@ -332,6 +332,9 @@ ExtraListSchema.statics.ImportData = async function (locale, idapp, strdata) {
const ExtraList = mongoose.model('ExtraList', ExtraListSchema);
ExtraList.createIndexes((err) => {
if (err) throw err;
});
module.exports = { ExtraList };

View File

@@ -64,4 +64,8 @@ GallerySchema.statics.findAllIdApp = async function (idapp) {
const Gallery = mongoose.model('Gallery', GallerySchema);
Gallery.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Gallery };

83
src/server/models/gasordine.js Executable file
View File

@@ -0,0 +1,83 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const gasordineSchema = new Schema({
active: {
type: Boolean,
},
idapp: {
type: String,
},
name: {
type: String,
},
description: {
type: String,
},
referente: {
type: String,
},
city: {
type: String,
},
img: {
type: String,
},
note_ordine_gas: {
type: String,
},
dataora_chiusura_ordini: {
type: Date,
},
data_arrivo_merce: {
type: Date,
},
dataora_ritiro: {
type: Date,
},
dataora_termine_pagamento: {
type: Date,
},
});
var Gasordine = module.exports = mongoose.model('Gasordine', gasordineSchema);
module.exports.getFieldsForSearch = function () {
return [
{field: 'name', type: tools.FieldType.string},
{field: 'description', type: tools.FieldType.string},
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Gasordine.find(myfind);
};
module.exports.getGasordineByID = function (id, callback) {
Gasordine.findById(id, callback);
}
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -80,4 +80,8 @@ GoodSchema.statics.executeQueryTable = function (idapp, params) {
const Good = mongoose.model('Good', GoodSchema);
Good.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Good };

View File

@@ -415,4 +415,8 @@ GraduatoriaSchema.statics.getPosizioneInGraduatoria = async function (idapp, ind
const Graduatoria = mongoose.model('Graduatoria', GraduatoriaSchema);
Graduatoria.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Graduatoria };

View File

@@ -47,3 +47,6 @@ module.exports.findAllIdApp = async function (idapp) {
return await Group.find(myfind);
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -228,3 +228,6 @@ module.exports.calculateHoursTodo = async function (idtodo) {
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -0,0 +1,63 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
const shared_consts = require('../tools/shared_nodejs');
const { ObjectID } = require('mongodb');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// A1P
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const ImportaMacroSchema = new Schema({
idapp: {
type: String,
},
_id: {
type: String,
},
});
var ImportaMacro = module.exports = mongoose.model('ImportaMacro', ImportaMacroSchema);
ImportaMacroSchema.index({ idapp: 1 });
module.exports.getFieldsForSearch = function () {
return [
{ field: 'name', type: tools.FieldType.string },
{ field: 'description', type: tools.FieldType.string },
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.getImportaMacroByCode = function (idapp, code) {
return ImportaMacro.findAllIdApp(idapp, code);
}
module.exports.getImportaMacroById = async function (id) {
const arrris = await ImportaMacro.findAllIdApp('', '', id);
return arrris && arrris.length > 0 ? arrris[0] : null
}
module.exports.findAllIdApp = async function (idapp) {
const ImportaMacro = this;
const myfind = { idapp, deleted: false };
return await ImportaMacro.find(myfind, (err, arrrec) => {
return arrrec;
});
};

View File

@@ -0,0 +1,59 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
const shared_consts = require('../tools/shared_nodejs');
const { ObjectID } = require('mongodb');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// A1P
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const inventariogmSchema = new Schema({
idapp: {
type: String,
},
});
var Inventariogm = module.exports = mongoose.model('Inventariogm', inventariogmSchema);
inventariogmSchema.index({ idapp: 1 });
module.exports.getFieldsForSearch = function () {
return [
{ field: 'name', type: tools.FieldType.string },
{ field: 'description', type: tools.FieldType.string },
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.getInventariogmByCode = function (idapp, code) {
return Inventariogm.findAllIdApp(idapp, code);
}
module.exports.getInventariogmById = async function (id) {
const arrris = await Inventariogm.findAllIdApp('', '', id);
return arrris && arrris.length > 0 ? arrris[0] : null
}
module.exports.findAllIdApp = async function (idapp) {
const Inventariogm = this;
const myfind = { idapp, deleted: false };
return await Inventariogm.find(myfind, (err, arrrec) => {
return arrrec;
});
};

View File

@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function(idapp) {
return arrrec;
});
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function (idapp) {
return arrrec
});
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -73,4 +73,8 @@ LevelSchema.statics.executeQueryTable = function(idapp, params) {
const Level = mongoose.model('Level', LevelSchema);
Level.createIndexes((err) => {
if (err) throw err;
});
module.exports = {Level};

View File

@@ -6,6 +6,7 @@ const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
const { User } = require('./user');
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
@@ -13,112 +14,85 @@ mongoose.plugin(schema => {
});
const MailingListSchema = new Schema({
idapp: {
type: String,
},
email: {
type: String,
trim: true,
},
hash: {
type: String,
},
name: {
type: String,
trim: true,
},
surname: {
type: String,
trim: true,
},
statesub: {
type: Boolean,
default: true
},
wrongerr: {
type: Boolean,
default: false
},
lastid_newstosent: {
type: String
}
});
MailingListSchema.statics.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string },
{ field: 'surname', type: tools.FieldType.string },
{ field: 'email', type: tools.FieldType.string }]
};
MailingListSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
params.fieldsearch = User.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
MailingListSchema.statics.findAllIdAppSubscribed = function (idapp) {
const MailingList = this;
const myfind = { idapp, statesub: true, wrongerr: { $ne: true } };
const myfind = {
idapp,
news_on: true,
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
$or: [
{ email_errata: { $exists: false } },
{ email_errata: { $exists: true, $ne: true } }],
};
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return MailingList.find(myfind, (err, arrrec) => {
return User.find(myfind, (err, arrrec) => {
return arrrec
});
};
MailingListSchema.statics.getnumSent = async function (idapp, idmailinglist) {
const MailingList = this;
MailingListSchema.statics.getnumSent = async function (idapp, idUser) {
const myfind = { idapp, statesub: true, lastid_newstosent: idmailinglist };
const myfind = { idapp, news_on: true, lastid_newstosent: idUser };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return await MailingList.countDocuments(myfind);
return await User.countDocuments(myfind);
};
MailingListSchema.statics.isOk = async function (idapp, iduser, idmailinglist) {
const MailingList = this;
MailingListSchema.statics.isOk = async function (idapp, iduser, idUser) {
const myfind = { idapp, _id: iduser, statesub: true, lastid_newstosent: { $ne: idmailinglist } };
const myfind = { idapp, _id: iduser, news_on: true, lastid_newstosent: { $ne: idUser } };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return await MailingList.countDocuments(myfind) > 0;
return await User.countDocuments(myfind) > 0;
};
MailingListSchema.statics.findAllIdApp = async function (idapp) {
const MailingList = this;
const myfind = { idapp };
return await MailingList.find(myfind, (err, arrrec) => {
return await User.find(myfind, (err, arrrec) => {
return arrrec
});
};
MailingListSchema.statics.isUnsubscribed = async function (idapp, hash) {
const MailingList = this;
let myperson = await MailingList.findOne({ idapp, hash });
console.log('myperson', myperson);
let myperson = await User.findOne({ idapp, hash });
if (!!myperson) {
return (!myperson.statesub)
return (!myperson.news_on)
}
};
MailingListSchema.statics.findByHash = function (idapp, hash) {
const MailingList = this;
const myfind = { idapp, hash };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return MailingList.findOne(myfind, (err, rec) => {
return User.findOne(myfind, (err, rec) => {
return rec
});
};
const MailingList = mongoose.model('MailingList', MailingListSchema);
User.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MailingList };

View File

@@ -36,6 +36,7 @@ const MovementSchema = new Schema({
accountToId: {
type: String,
},
idOrdersCart: { type: Schema.Types.ObjectId, ref: 'OrdersCart' },
causal_table: {
type: String,
},
@@ -56,6 +57,10 @@ const MovementSchema = new Schema({
expiringDate: {
type: Date,
},
confirmed: {
type: Boolean,
default: false,
},
});
MovementSchema.statics.findAllIdApp = async function (idapp) {
@@ -90,7 +95,7 @@ MovementSchema.statics.executeQueryTable = function (idapp, params) {
return tools.executeQueryTable(this, 0, params);
};
MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId) {
MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId, idOrdersCart) {
try {
// Only positive values
@@ -98,11 +103,11 @@ MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accou
let mymov = await Movement.create(
{
_id: new ObjectID().toString(),
idapp,
transactionDate: new Date(),
accountFromId: accountFromIdTable._id,
accountToId: accountToIdTable._id,
idOrdersCart,
amount,
causal,
residual: 0,
@@ -361,16 +366,20 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
notifId: 1,
'circuitfrom.symbol': 1,
'circuitto.symbol': 1,
'userfrom.verified_by_aportador': 1,
'userfrom.username': 1,
'userfrom.profile.img': 1,
'userto.username': 1,
'userto.profile.img': 1,
'userto.verified_by_aportador': 1,
'groupfrom.groupname': 1,
'groupfrom.verified_by_aportador': 1,
'groupfrom.title': 1,
'groupfrom.photos': 1,
'groupto.groupname': 1,
'groupto.title': 1,
'groupto.photos': 1,
'groupto.verified_by_aportador': 1,
'contocomfrom.path': 1,
'contocomfrom.name': 1,
'contocomto.path': 1,
@@ -693,4 +702,8 @@ MovementSchema.statics.checkIfCoinsAlreadySent = async function (notifId) {
const Movement = mongoose.model('Movement', MovementSchema);
Movement.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Movement };

View File

@@ -125,4 +125,8 @@ MsgTemplateSchema.statics.findAllIdApp = async function (idapp) {
const MsgTemplate = mongoose.model('MsgTemplate', MsgTemplateSchema);
MsgTemplate.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MsgTemplate };

View File

@@ -378,4 +378,8 @@ MyBachecaSchema.statics.getCompleteRecord = function (idapp, id) {
const MyBacheca = mongoose.model('MyBacheca', MyBachecaSchema);
MyBacheca.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyBacheca };

View File

@@ -210,4 +210,8 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
const MyElem = mongoose.model('MyElem', MyElemSchema);
MyElem.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyElem };

View File

@@ -276,4 +276,8 @@ if (tools.INITDB_FIRSTIME) {
const MyEvent = mongoose.model('MyEvent', MyEventSchema);
MyEvent.createIndexes((err) => {
if (err) throw err;
});
module.exports = {MyEvent};

View File

@@ -348,4 +348,8 @@ MyGoodSchema.statics.getProject = function () {
const MyGood = mongoose.model('MyGood', MyGoodSchema);
MyGood.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyGood };

View File

@@ -309,7 +309,6 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
const query = [
{ $match: myfind },
{ $unwind: '$mycircuits' },
{
$lookup: {
from: 'circuits',
@@ -337,6 +336,7 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
];
try {
const ris = await MyGroup.aggregate(query);
@@ -346,7 +346,7 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
return null;
}
return ris;
return null;
};
@@ -507,9 +507,26 @@ MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, ci
// Rimuovo il Circuito all'interno del Gruppo
MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname, circuitname) {
return await this.updateOne({ idapp, groupname },
const ris = await this.updateOne({ idapp, groupname },
{ $pull: { 'mycircuits': { circuitname: { $in: [circuitname] } } } });
const circuitId = await Circuit.getCircuitIdByName(idapp, circuitname);
let remove = false;
// Se il mio account non è stato utilizzato, allora lo cancello anche questo
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, false, groupname, '');
if (myaccount && myaccount.totTransato === 0) {
remove = true;
} else {
remove = true;
}
if (remove) {
await Account.removeAccount(myaccount._id);
}
};
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
@@ -611,6 +628,13 @@ MyGroupSchema.statics.getReceiveRISGroups = async function (idapp) {
};
MyGroupSchema.statics.renameCircuitName = async function (idapp, oldcircuitname, newcircuitname) {
return await this.updateMany({ idapp, 'mycircuits.circuitname': oldcircuitname }, { $set: { 'profile.mycircuits.$.circuitname': newcircuitname } });
};
MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
return await this.findOneAndUpdate({
@@ -626,4 +650,8 @@ MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);
MyGroup.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyGroup };

View File

@@ -348,4 +348,8 @@ MyHospSchema.statics.getProject = function () {
const MyHosp = mongoose.model('MyHosp', MyHospSchema);
MyHosp.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyHosp };

View File

@@ -218,4 +218,8 @@ MyPageSchema.statics.findInternalPages = async function (idapp) {
const MyPage = mongoose.model('MyPage', MyPageSchema);
MyPage.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MyPage };

View File

@@ -354,4 +354,8 @@ MySkillSchema.statics.getCompleteRecord = function (idapp, id) {
const MySkill = mongoose.model('MySkill', MySkillSchema);
MySkill.createIndexes((err) => {
if (err) throw err;
});
module.exports = { MySkill };

View File

@@ -170,4 +170,8 @@ NewstosentSchema.statics.isActivated = async function (_id) {
const Newstosent = mongoose.model('Newstosent', NewstosentSchema);
Newstosent.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Newstosent };

View File

@@ -118,4 +118,8 @@ OperatorSchema.statics.findAllIdApp = function (idapp) {
const Operator = mongoose.model('Operator', OperatorSchema);
Operator.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Operator };

View File

@@ -43,4 +43,8 @@ OpzEmailSchema.statics.findAllIdApp = async function (idapp) {
const OpzEmail = mongoose.model('OpzEmail', OpzEmailSchema);
OpzEmail.createIndexes((err) => {
if (err) throw err;
});
module.exports = { OpzEmail };

View File

@@ -1,13 +1,15 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
const shared_consts = require('../tools/shared_nodejs');
const { ObjectID } = require('mongodb');
mongoose.Promise = global.Promise;
mongoose.level = "F";
const fs = require('fs');
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
@@ -18,23 +20,19 @@ const orderSchema = new Schema({
idapp: {
type: String,
},
userId: {
type: String,
},
userId: { type: Schema.Types.ObjectId, ref: 'User' },
status: {
type: Number,
},
idProduct: {
type: String
},
idProducer: {
type: String
},
idStorehouse: {
type: String
},
idProduct: { type: Schema.Types.ObjectId, ref: 'Product' },
idProducer: { type: Schema.Types.ObjectId, ref: 'Producer' },
idStorehouse: { type: Schema.Types.ObjectId, ref: 'StoreHouse' },
idScontisticas: [{ type: Schema.Types.ObjectId, ref: 'Scontistica' }],
idProvider: { type: Schema.Types.ObjectId, ref: 'Provider' },
idGasordine: { type: Schema.Types.ObjectId, ref: 'Gasordine' },
price: {
type: Number
type: Number,
default: 0,
},
after_price: {
type: String
@@ -46,7 +44,58 @@ const orderSchema = new Schema({
type: String
},
quantity: {
type: Number
type: Number,
default: 0,
},
quantitypreordered: {
type: Number,
default: 0,
},
TotalPriceProduct: {
type: Number,
default: 0,
},
TotalPriceProductstr: {
type: String,
},
TotalPriceProductCalc: {
type: Number,
default: 0,
},
confermato: { // e quindi è stato tolto dal magazzino (aggiornando il campo stockQty)
type: Boolean,
default: false,
},
date_confermato: {
type: Date
},
pagato: {
type: Boolean,
default: false,
},
date_pagato: {
type: Date
},
consegnato: {
type: Boolean,
default: false,
},
date_consegnato: {
type: Date
},
spedito: {
type: Boolean,
default: false,
},
date_spedito: {
type: Date
},
ricevuto: {
type: Boolean,
default: false,
},
date_ricevuto: {
type: Date
},
weight: {
type: Number
@@ -72,18 +121,27 @@ const orderSchema = new Schema({
date_delivered: {
type: Date
},
notes: {
note: {
type: String
}
},
modify_at: {
type: Date
},
});
var Order = module.exports = mongoose.model('Order', orderSchema);
module.exports.createIndexes((err) => {
if (err) throw err;
});
module.exports.getFieldsForSearch = function () {
return []
};
module.exports.executeQueryTable = function (idapp, params) {
const tools = require('../tools/general');
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
@@ -92,26 +150,93 @@ module.exports.findAllIdApp = async function (idapp) {
const query = [
{ $match: { idapp } },
{ "$addFields": { "myidProd": { "$toObjectId": "$idProduct" } } },
{ "$addFields": { "myidProducer": { "$toObjectId": "$idProducer" } } },
{
$lookup: {
from: 'products',
localField: 'myidProd',
localField: 'idProduct',
foreignField: '_id',
as: 'product'
}
},
{
$lookup: {
from: 'productinfos',
localField: 'product.idProduct',
foreignField: '_id',
as: 'product.productInfo'
}
},
{
$unwind: {
path: '$product.productInfo',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'producers',
localField: 'myidProducer',
localField: 'product.idProducer',
foreignField: '_id',
as: 'producer'
}
},
{ $unwind: '$product' },
{ $unwind: '$producer' },
{
$lookup: {
from: 'providers',
localField: 'product.idProvider',
foreignField: '_id',
as: 'provider'
}
},
{
$lookup: {
from: 'gasordines',
localField: 'idGasordine',
foreignField: '_id',
as: 'gasordine'
}
},
{
$unwind: {
path: '$gasordine',
preserveNullAndEmptyArrays: true,
},
},
{
$match: {
$or: [
{ 'gasordine': { $exists: false } },
{ 'gasordine.active': true }
]
}
},
{
$lookup: {
from: 'scontisticas',
localField: 'product.idScontisticas',
foreignField: '_id',
as: 'scontistica'
}
},
{
$unwind: {
path: '$product',
preserveNullAndEmptyArrays: true,
},
},
{
$unwind: {
path: '$producer',
preserveNullAndEmptyArrays: true,
},
},
{
$unwind: {
path: '$provider',
preserveNullAndEmptyArrays: true,
},
},
];
return await Order.aggregate(query)
@@ -132,52 +257,523 @@ module.exports.getOrderByID = function (id, callback) {
}
module.exports.createOrder = async function (order) {
const orderModel = new Order(order);
return await orderModel.save(order)
try {
if (order.idGasordine === '') {
order.idGasordine = undefined;
}
Order.updateTotals(order);
return await Order.create(order)
.then((ris) => {
if (!!ris)
return ris._id;
return null;
});
} catch (e) {
console.error('err', e);
}
}
module.exports.updateStatusOrders = async function (arrOrders, status) {
for (const order of arrOrders) {
let ret = await Order.updateOne({ _id: order.order._id }, { $set: { status } });
}
}
module.exports.updateStatusOrdersElements = async function (arrOrders, myelements) {
for (const order of arrOrders) {
const ret = await Order.findOneAndUpdate({ _id: order.order._id }, { $set: myelements });
}
}
module.exports.updateOrderByParams = async function (idOrder, paramstoupdate) {
const ris = await Order.findOneAndUpdate({ _id: idOrder }, { $set: paramstoupdate });
let myorder = await Order.findOne({ _id: idOrder }).lean();
if (paramstoupdate && !paramstoupdate.hasOwnProperty('TotalPriceProduct')) {
this.updateTotals(myorder);
await Order.findOneAndUpdate({ _id: idOrder }, { $set: myorder });
}
return myorder;
}
module.exports.updateTotals = function (order) {
try {
if (!order) {
return;
}
let mypricecalc = 0;
order.TotalPriceProduct = 0;
order.TotalPriceProductCalc = 0;
order.modify_at = new Date();
// Calcolo Sconto
let sconti_da_applicare = [];
if (order.scontisticas) {
let qtadascontare = order.quantity + order.quantitypreordered
let qtanonscontata = 0
while (qtadascontare > 0) {
let scontoapplicato = null
for (const sconto of order.scontisticas.filter((rec) => !rec.cumulativo)) {
if (qtadascontare >= sconto.qta) {
scontoapplicato = sconto
scontoapplicato.qtadascontare = sconto.qta
}
}
if (scontoapplicato && scontoapplicato.qtadascontare > 0) {
sconti_da_applicare.push(scontoapplicato)
qtadascontare -= scontoapplicato.qtadascontare
} else {
qtanonscontata = qtadascontare
qtadascontare = 0
}
}
/*for (const sconto of order.scontisticas.filter((rec) => rec.cumulativo)) {
if ((sconto.qta % order.quantity) === 0) {
sconti_da_applicare.push(sconto)
}
}*/
if (sconti_da_applicare.length > 0) {
for (const sconto of sconti_da_applicare) {
if (sconto.perc_sconto > 0) {
mypricecalc += (sconto.qtadascontare * order.price) * (1 - (sconto.perc_sconto / 100))
} else {
mypricecalc += sconto.price
}
}
}
if (qtanonscontata > 0) {
mypricecalc += order.price * qtanonscontata;
}
} else {
mypricecalc = (order.price * order.quantity) + (order.price * order.quantitypreordered);
}
order.TotalPriceProductCalc += mypricecalc;
order.TotalPriceProduct += mypricecalc;
order.TotalPriceProductstr = parseFloat(order.TotalPriceProduct.toFixed(2));
return order;
} catch (e) {
console.error('Err:', e);
}
}
module.exports.getTotalOrderById = async function (id) {
const query = [
{ $match: { _id: ObjectID(id) } },
{ "$addFields": { "myidProd": { "$toObjectId": "$idProduct" } } },
{ "$addFields": { "myidProducer": { "$toObjectId": "$idProducer" } } },
{ "$addFields": { "myidStore": { "$toObjectId": "$idStorehouse" } } },
{
$lookup: {
from: 'products',
localField: 'myidProd',
localField: 'idProduct',
foreignField: '_id',
as: 'product'
}
},
{
$unwind: {
path: '$product',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'productinfos',
localField: 'product.idProductInfo',
foreignField: '_id',
as: 'product.productInfo'
}
},
{
$unwind: {
path: '$product.productInfo',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'producers',
localField: 'myidProducer',
localField: 'product.idProducer',
foreignField: '_id',
as: 'producer'
}
},
{
$unwind: {
path: '$producer',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'storehouses',
localField: 'myidStore',
localField: 'idStorehouse',
foreignField: '_id',
as: 'storehouse'
}
},
{ $unwind: '$product' },
{ $unwind: '$producer' },
{ $unwind: '$storehouse' },
{
$unwind: {
path: '$storehouse',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'providers',
localField: 'product.idProvider',
foreignField: '_id',
as: 'provider'
}
},
{
$unwind: {
path: '$provider',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'gasordines',
localField: 'idGasordine',
foreignField: '_id',
as: 'gasordine'
}
},
{
$unwind: {
path: '$gasordine',
preserveNullAndEmptyArrays: true,
},
},
{
$match: {
$or: [
{ 'gasordine': { $exists: false } },
{ 'gasordine.active': true }
]
}
},
{
$lookup: {
from: 'scontisticas',
localField: 'product.idScontisticas',
foreignField: '_id',
as: 'scontisticas'
}
},
{
$lookup: {
from: 'orders',
let: { productId: '$product._id' },
pipeline: [
{
$match: {
$expr: {
$and: [
{ $eq: ['$idProduct', '$$productId'] },
{
$or: [
{
$eq: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT]
},
{
$and: [{ $lt: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT] },
{
$gt: [
'$modify_at',
{ $subtract: [new Date(), 60 * 60 * 1000] } // 1 hour in milliseconds 60 * 60
]
}]
}
]
}
]
}
},
},
{
$group: {
_id: null,
totalQty: { $sum: '$quantity' },
}
}
],
as: 'productOrders'
}
},
{
$lookup: {
from: 'orders',
let: { productId: '$product._id' },
pipeline: [
{
$match: {
$expr: {
$and: [
{ $eq: ['$idProduct', '$$productId'] },
{
$or: [
{
$eq: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT]
},
{
$and: [{ $lt: ['$status', shared_consts.OrderStatus.CHECKOUT_SENT] },
{
$gt: [
'$modify_at',
{ $subtract: [new Date(), 60 * 60 * 1000] } // 1 hour in milliseconds 60 * 60
]
}]
}
]
}
]
}
}
},
{
$group: {
_id: null,
totalQtyPreordered: { $sum: '$quantitypreordered' }
}
}
],
as: 'productPreOrders'
}
},
{
$addFields: {
'product.QuantitaOrdinateInAttesa': {
$ifNull: [
{
$cond: {
if: { $isArray: '$productOrders' },
then: { $arrayElemAt: ['$productOrders.totalQty', 0] },
else: 0
}
},
0
]
},
'product.QuantitaPrenotateInAttesa': {
$ifNull: [
{
$cond: {
if: { $isArray: '$productPreOrders' },
then: { $arrayElemAt: ['$productPreOrders.totalQtyPreordered', 0] },
else: 0
}
},
0
]
},
},
},
{
$addFields: {
'product.quantityAvailable': {
$subtract: ["$product.stockQty", "$product.QuantitaOrdinateInAttesa"],
},
'product.bookableAvailableQty': {
$subtract: ["$product.maxbookableGASQty", "$product.QuantitaPrenotateInAttesa"],
}
}
},
{
$unset: 'productOrders'
},
{
$unset: 'productPreOrders'
},
];
return await Order.aggregate(query);
const ris = await Order.aggregate(query);
return ris;
}
module.exports.RemoveDeletedOrdersInOrderscart = async function () {
try {
const OrdersCart = require('./orderscart');
// Cancella gli Ordini che non esistono in OrdersCart
const arrorders = await OrdersCart.find({}).lean();
for (const rec of arrorders) {
let recordercart = await OrdersCart.getOrdersCartById(rec._id);
let arrord = []
let cambiare = false;
for (const recOrd of recordercart.items) {
if (recOrd.order) {
arrord.push(recOrd)
} else {
cambiare = true;
}
}
if (cambiare) {
await OrdersCart.findOneAndUpdate({ _id: recordercart._id }, { $set: { items: arrord } }, { new: false });
}
}
// Controllo se Order non esiste in OrdersCart
const arrord = await Order.find({}).lean();
for (const ord of arrord) {
const idtofind = ord._id;
await OrdersCart.findOne({ 'items.order': { $in: [idtofind] } })
.then(async (orderCart) => {
if (!orderCart) {
// NON TROVATO ! Allora lo cancello
await Order.findOneAndRemove({ _id: ord._id });
}
})
.catch(err => console.error(err));
}
} catch (e) {
console.error('Err', e);
}
};
module.exports.GeneraCSVOrdineProdotti = async function () {
const myidGasordine = '65c2a8cc379ee4f57e865ee7';
const myquery = [
{ $match: { idGasordine: ObjectID(myidGasordine) } },
{
$lookup: {
from: 'products',
localField: 'idProduct',
foreignField: '_id',
as: 'product'
}
},
{
$unwind: {
path: '$product',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'productinfos',
localField: 'product.idProductInfo',
foreignField: '_id',
as: 'productInfo'
}
},
{
$unwind: {
path: '$productInfo',
},
},
{
$lookup: {
from: 'gasordines',
localField: 'idGasordine',
foreignField: '_id',
as: 'gasordine'
}
},
{
$unwind: {
path: '$gasordine',
preserveNullAndEmptyArrays: true,
},
},
{
$match: {
$or: [
{ 'gasordine.active': true }, // Include documents where gasordines.active is true
{ 'gasordine': { $exists: false } } // Include documents where gasordines array doesn't exist
]
}
},
{
$match: {
$or: [
{ quantity: { $gt: 0 }, },
{ quantitypreordered: { $gt: 0 }, }
]
}
},
{
$group: {
_id: "$product._id",
name: { $first: "$productInfo.name" },
weight: { $first: "$productInfo.weight" },
price_acquistato: { $first: "$product.price_acquistato" },
totalQuantity: { $sum: { $add: ["$quantity", "$quantitypreordered"] } },
totalPrice_acquistato: { $sum: { $multiply: ["$product.price_acquistato", { $add: ["$quantity", "$quantitypreordered"] }] } },
count: { $sum: 1 }
}
},
{
$sort: {
name: 1 // Sort in ascending order based on the "date_created" field
},
}
];
let myorderscart = await Order.aggregate(myquery);
console.log(myorderscart)
return generateCSV(myorderscart, 'outout.csv');
}
function generateCSV(data, outputPath) {
const headers = ['Num', 'Nome', 'Peso', 'Prezzo', 'Quantita', 'Totale', 'Ordini'];
const rows = data.map(item => {
const formattedPrice = item.price_acquistato.toString().replace(/\./g, ','); // Converti "." in ","
const total = item.totalPrice_acquistato.toString().replace(/\./g, ','); // Converti "." in ","
return [
0,
`"${item.name}"`,
item.weight,
formattedPrice,
item.totalQuantity,
total,
item.count
];
});
rows.unshift(headers);
const csvData = rows.map(row => row.join('|'));
fs.writeFile(outputPath, csvData.join('\n'), (err) => {
if (err) {
console.error('Error writing CSV file:', err);
} else {
console.log('CSV file has been successfully generated:', outputPath);
}
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -45,4 +45,8 @@ PaymentTypeSchema.statics.findAllIdApp = async function (idapp) {
const PaymentType = mongoose.model('Paymenttype', PaymentTypeSchema);
PaymentType.createIndexes((err) => {
if (err) throw err;
});
module.exports = { PaymentType };

View File

@@ -57,4 +57,8 @@ PermissionSchema.statics.findAllIdApp = async function () {
const Permission = mongoose.model('Permission', PermissionSchema);
Permission.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Permission };

View File

@@ -100,3 +100,7 @@ module.exports.getProducerByID = function (id, callback) {
// const Producer = mongoose.model('Producer', producerSchema);
// module.exports = { Producer };
module.exports.createIndexes((err) => {
if (err) throw err;
});

File diff suppressed because it is too large Load Diff

221
src/server/models/productInfo.js Executable file
View File

@@ -0,0 +1,221 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const productInfoSchema = new Schema({
idapp: {
type: String,
},
department: {
type: String, ref: 'Department'
},
code: {
type: String,
unique: true,
required: true,
},
id_wp: { // id in wordpress
type: String,
},
codice_EAN: {
type: String,
},
barcode: {
type: String,
},
name: {
type: String,
},
description: {
type: String,
},
short_descr: {
type: String,
},
idCatProds: [{ type: Schema.Types.ObjectId, ref: 'CatProd' }],
idSubCatProds: [{ type: Schema.Types.ObjectId, ref: 'SubCatProd' }],
color: {
type: String
},
size: {
type: String // 11x4x3
},
weight: {
type: Number
},
weight_lordo: {
type: Number
},
unit: {
type: Number,
default: 0,
},
unit_lordo: {
type: Number,
default: 0,
},
sfuso: { // serve se moltiplicare le qta (es: 12 kg) oppure fare (2 x 20 ml)
type: Boolean
},
vegan: {
type: Boolean
},
icon: {
type: String,
},
img: { // Se esiste img (sul server) visualizza questa, altrimenti vedi se esiste image_link
type: String,
},
image_link: {
type: String,
},
link_scheda: {
type: String,
},
link: {
type: String,
},
checkout_link: {
type: String,
},
img2: {
type: String,
},
img3: {
type: String,
},
img4: {
type: String,
},
ingredienti: {
type: String,
},
valori_nutrizionali: {
type: String,
},
note: {
type: String,
},
idAuthors: [{ type: Schema.Types.ObjectId, ref: 'Author' }],
idPublisher: { type: Schema.Types.ObjectId, ref: 'Publisher' },
collezione: {
type: String,
},
date_publishing: {
type: Date,
},
productType: {
type: Number,
},
});
var productInfo = module.exports = mongoose.model('ProductInfo', productInfoSchema);
module.exports.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string }]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp, code, id) {
let myfind = {};
let myqueryadd = {};
let query = [];
try {
if (idapp)
myfind = { idapp };
if (code) {
myfind = { ...myfind, code }
}
if (id) {
myqueryadd = {
$addFields: {
myId1: {
$toObjectId: id,
},
},
}
myfind = {
$expr: {
$eq: ["$_id", "$myId1"],
},
}
query.push(myqueryadd);
}
query.push(
{ $match: myfind },
{
$lookup: {
from: 'catprods',
localField: 'idCatProds',
foreignField: '_id',
as: 'catprods'
}
},
{
$lookup: {
from: 'authors',
localField: 'idAuthors',
foreignField: '_id',
as: 'authors'
}
},
{
$lookup: {
from: 'publishers',
localField: 'idPublisher',
foreignField: '_id',
as: 'publisher'
}
},
{
$lookup: {
from: 'subcatprods',
localField: 'idSubCatProds',
foreignField: '_id',
as: 'subcatprods'
}
},
{
$sort: {
name: 1 // 1 for ascending order, -1 for descending order
}
},
);
let ris = await productInfo.aggregate(query)
return ris;
} catch (e) {
console.error('E', e);
}
};
module.exports.getProductByCode = function (idapp, code) {
return productInfo.findAllIdApp(idapp, code);
}
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -428,5 +428,9 @@ ProjectSchema.pre('save', function (next) {
var Project = mongoose.model('Projects', ProjectSchema);
Project.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Project };

64
src/server/models/provider.js Executable file
View File

@@ -0,0 +1,64 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const providerSchema = new Schema({
idapp: {
type: String,
},
name: {
type: String,
},
description: {
type: String,
},
referent: {
type: String,
},
address: {
type: String,
},
city: {
type: String,
},
region: {
type: String,
},
img: {
type: String,
},
website: {
type: String,
},
});
var Provider = module.exports = mongoose.model('Provider', providerSchema);
module.exports.getFieldsForSearch = function () {
return [{ field: 'name', type: tools.FieldType.string }]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Provider.find(myfind);
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -8,7 +8,7 @@ mongoose.level = 'F';
const tools = require('../tools/general');
const {ObjectID} = require('mongodb');
const { ObjectID } = require('mongodb');
const shared_consts = require('../tools/shared_nodejs');
@@ -35,18 +35,25 @@ const ProvinceSchema = new Schema({
link_grp: {
type: String,
},
card : {
card: {
type: String,
},
link_telegram: {
type: String,
},
}, { _id : false });
lat: {
type: Number,
},
long: {
type: Number,
},
}, { _id: false });
ProvinceSchema.pre('save', async function (next) {
if (this.isNew) {
const myrec = await Province.findOne().limit(1).sort({_id:-1});
const myrec = await Province.findOne().limit(1).sort({ _id: -1 });
if (!!myrec) {
if (myrec._doc._id === 0)
this._id = 1;
@@ -61,8 +68,8 @@ ProvinceSchema.pre('save', async function (next) {
next();
});
ProvinceSchema.statics.getRegionByStrProvince = async function(strprovince) {
const myrec = await Province.findOne({prov: strprovince}).lean();
ProvinceSchema.statics.getRegionByStrProvince = async function (strprovince) {
const myrec = await Province.findOne({ prov: strprovince }).lean();
if (myrec) {
return myrec.reg;
}
@@ -70,8 +77,8 @@ ProvinceSchema.statics.getRegionByStrProvince = async function(strprovince) {
return '';
}
ProvinceSchema.statics.getStrProvinceByProv = async function(prov) {
const myrec = await Province.findOne({prov}).lean();
ProvinceSchema.statics.getStrProvinceByProv = async function (prov) {
const myrec = await Province.findOne({ prov }).lean();
if (myrec) {
return myrec.descr;
}
@@ -79,14 +86,14 @@ ProvinceSchema.statics.getStrProvinceByProv = async function(prov) {
return '';
}
ProvinceSchema.statics.getFieldsForSearch = function() {
ProvinceSchema.statics.getFieldsForSearch = function () {
return [
{field: 'prov', type: tools.FieldType.string},
{field: 'descr', type: tools.FieldType.string},
{ field: 'prov', type: tools.FieldType.string },
{ field: 'descr', type: tools.FieldType.string },
];
};
ProvinceSchema.statics.executeQueryTable = function(idapp, params) {
ProvinceSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
const strfind = params.search;
@@ -98,7 +105,7 @@ ProvinceSchema.statics.executeQueryTable = function(idapp, params) {
return tools.executeQueryTable(this, 0, params);
};
ProvinceSchema.statics.executeQueryPickup = async function(idapp, params) {
ProvinceSchema.statics.executeQueryPickup = async function (idapp, params) {
const strfind = params.search;
@@ -106,12 +113,12 @@ ProvinceSchema.statics.executeQueryPickup = async function(idapp, params) {
return [];
}
let filterfindexact = {descr: strfind};
let filterfindexact = { descr: strfind };
const risexact = await Province.find(filterfindexact).lean();
let filterfind = {};
filterfind = {descr: {$regex: '^' + strfind, $options: 'i'}};
filterfind = { descr: { $regex: '^' + strfind, $options: 'i' } };
const ris = await Province.find(filterfind).lean().limit(10);
@@ -119,12 +126,34 @@ ProvinceSchema.statics.executeQueryPickup = async function(idapp, params) {
};
ProvinceSchema.statics.findAllIdApp = async function(idapp) {
ProvinceSchema.statics.findAllIdApp = async function (idapp) {
const myfind = {};
return Province.find(myfind).sort({descr: 1});
return Province.find(myfind).sort({ descr: 1 });
};
ProvinceSchema.statics.setCoordinatesOnDB = async function () {
const arrprov = await Province.find({}).lean();
// Funzione per ottenere le coordinate di tutte le città
for (const prov of arrprov) {
if (!prov.lat) {
let coord = await tools.getCityCoordinates(prov);
if (coord) {
let ris = await Province.findOneAndUpdate({ _id: prov._id }, { $set: { lat: coord.lat, long: coord.long } }, { new: true });
console.log(' *** Update ', prov.descr, 'lat', ris.lat, 'long', ris.long);
}
}
}
};
const Province = mongoose.model('Province', ProvinceSchema);
module.exports = {Province};
Province.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Province };

50
src/server/models/publisher.js Executable file
View File

@@ -0,0 +1,50 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const PublisherSchema = new Schema({
idapp: {
type: String,
},
name: {
type: String,
},
link: {
type: String,
},
img: {
type: String,
},
});
var Publisher = module.exports = mongoose.model('Publisher', PublisherSchema);
module.exports.getFieldsForSearch = function () {
return [
{ field: 'name', type: tools.FieldType.string },
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Publisher.find(myfind);
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

86
src/server/models/queryai.js Executable file
View File

@@ -0,0 +1,86 @@
const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
mongoose.Promise = global.Promise;
mongoose.level = "F";
const tools = require('../tools/general');
// const CatAI = require('./catai');
const { ObjectID } = require('mongodb');
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const QueryAISchema = new Schema({
idapp: {
type: String,
},
descr: {
type: String,
},
catAI: { type: Schema.Types.ObjectId, ref: 'CatAI' },
query: {
type: String,
},
ask: [
{
descr: {
type: String,
},
value: {
type: Number,
},
}
],
buttons: [
{
type: String, //ButtonCodeAction
},
],
output_type: {
type: String,
},
icon: {
type: String,
},
img: {
type: String,
},
});
QueryAISchema.statics.findAllIdApp = async function (idapp) {
const QueryAI = this;
const query = [
{ $sort: { descr: 1 } }
];
return await QueryAI
.aggregate(query)
.then((arrrec) => {
return arrrec
})
};
QueryAISchema.statics.getFieldsForSearch = function () {
return [{ field: 'descr', type: tools.FieldType.string }]
};
QueryAISchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, 0, params);
};
const QueryAI = mongoose.model('QueryAI', QueryAISchema);
QueryAI.createIndexes((err) => {
if (err) throw err;
});
module.exports = { QueryAI };

View File

@@ -189,10 +189,10 @@ reactionSchema.statics.updateReactionsCounts = async function () {
risupdate = await mytable.updateOne({ _id: rec._id }, {
$set: {
numseen: ris.myreact.numseen | 0,
numfav: ris.myreact.numfav | 0,
numbook: ris.myreact.numbook | 0,
numattend: ris.myreact.numattend | 0,
numseen: ris.myreact.numseen ?? 0,
numfav: ris.myreact.numfav ?? 0,
numbook: ris.myreact.numbook ?? 0,
numattend: ris.myreact.numattend ?? 0,
}
})
}
@@ -433,4 +433,8 @@ reactionSchema.statics.removeBookmark = async function (
const Reaction = mongoose.model('Reaction', reactionSchema);
Reaction.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Reaction };

View File

@@ -0,0 +1,62 @@
mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;
const tools = require('../tools/general');
mongoose.Promise = global.Promise;
mongoose.level = "F";
// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
schema.options.usePushEach = true
});
const scontisticaSchema = new Schema({
idapp: {
type: String,
},
code: {
type: String,
},
description: {
type: String,
},
qta: {
type: Number,
},
perc_sconto: {
type: Number,
},
price: {
type: Number,
},
comulativo: {
type: Boolean,
default: false,
},
});
var Scontistica = module.exports = mongoose.model('Scontistica', scontisticaSchema);
module.exports.getFieldsForSearch = function () {
return [
{ field: 'code', type: tools.FieldType.string },
{ field: 'description', type: tools.FieldType.string }
]
};
module.exports.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
module.exports.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await Scontistica.find(myfind);
};
module.exports.createIndexes((err) => {
if (err) throw err;
});

View File

@@ -20,6 +20,10 @@ const searchSchema = new Schema({
userId: {
type: String,
},
date_created: {
type: Date,
default: Date.now,
},
text: {
type: String,
},
@@ -42,4 +46,8 @@ searchSchema.statics.findAllByUserIdAndIdApp = function (userId, idapp, sall) {
const Search = mongoose.model('Search', searchSchema);
Search.createIndexes((err) => {
if (err) throw err;
});
module.exports = { Search };

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