';
+$map_load_message = '
'.tr('Clicca per visualizzare').'
';
if (empty($google)) {
echo '
@@ -105,7 +101,9 @@ if (empty($google)) {
';
} elseif (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($sede_cliente->lng))) {
echo '
-
+
+ '.$map_load_message.'
+
';
@@ -177,32 +175,39 @@ echo '
return lat + "," + lng;
}
- $(document).ready(function() {
- const map_element = $("#map-edit")[0];
- const lat = parseFloat("'.$sede_cliente->lat.'");
- const lng = parseFloat("'.$sede_cliente->lng.'");
+ function caricaMappa() {
+ const map_div = $("#map-edit");
+ if (map_div.html().trim() !== "'.$map_load_message.'"){
+ return;
+ }
- if (!lat || !lng) return;
- const position = new google.maps.LatLng(lat, lng);
+ $.getScript("//maps.googleapis.com/maps/api/js?libraries=places&key='.$google.'", function() {
+ const map_element = map_div[0];
+ const lat = parseFloat("'.$sede_cliente->lat.'");
+ const lng = parseFloat("'.$sede_cliente->lng.'");
- // Create a Google Maps native view under the map_canvas div.
- const map = new google.maps.Map(map_element, {
- zoom: 14,
- scrollwheel: false,
- mapTypeControl: true,
- mapTypeId: "roadmap",
- mapTypeControlOptions: {
- style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
- mapTypeIds: ["roadmap", "terrain"],
- }
- });
+ if (!lat || !lng) return;
+ const position = new google.maps.LatLng(lat, lng);
- map.setCenter(position);
- const marker = new google.maps.Marker({
- position: position,
- map: map,
- });
- });
+ // Create a Google Maps native view under the map_canvas div.
+ const map = new google.maps.Map(map_element, {
+ zoom: 14,
+ scrollwheel: false,
+ mapTypeControl: true,
+ mapTypeId: "roadmap",
+ mapTypeControlOptions: {
+ style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
+ mapTypeIds: ["roadmap", "terrain"],
+ }
+ });
+
+ map.setCenter(position);
+ const marker = new google.maps.Marker({
+ position: position,
+ map: map,
+ });
+ });
+ }
';
?>
diff --git a/modules/ordini/quantita_impegnate.php b/modules/ordini/quantita_impegnate.php
index 45f2b9e2b..d10754742 100644
--- a/modules/ordini/quantita_impegnate.php
+++ b/modules/ordini/quantita_impegnate.php
@@ -40,8 +40,8 @@ foreach ($articoli as $elenco) {
WHERE or_ordini.id != '.prepare($ordine->id).'
AND idstatoordine = (SELECT id FROM or_statiordine WHERE descrizione = 'Bozza')
AND idtipoordine IN (SELECT id FROM or_tipiordine WHERE dir = 'entrata')
- AND idarticolo=".prepare($articolo->id)."
- GROUP BY idarticolo")['qta'];
+ AND idarticolo=".prepare($articolo->id).'
+ GROUP BY idarticolo')['qta'];
$qta_impegnata = floatval($qta_impegnata);
$class = $qta_impegnata + $qta > $articolo->qta ? 'danger' : 'success';
diff --git a/plugins/receiptFE/src/Ricevuta.php b/plugins/receiptFE/src/Ricevuta.php
index d6d79c3ac..5fe7a0357 100755
--- a/plugins/receiptFE/src/Ricevuta.php
+++ b/plugins/receiptFE/src/Ricevuta.php
@@ -2,7 +2,6 @@
namespace Plugins\ReceiptFE;
-use Carbon\Carbon;
use Modules;
use Modules\Fatture\Fattura;
use Plugins;
diff --git a/templates/ordini/body.php b/templates/ordini/body.php
index ca7922111..6de609db8 100755
--- a/templates/ordini/body.php
+++ b/templates/ordini/body.php
@@ -27,7 +27,7 @@ echo "
- ".tr('#', [], ['upper' => true])." | ";
+ ".tr('#', [], ['upper' => true]).' | ';
if ($has_image) {
echo "
".tr('Immagine', [], ['upper' => true]).' | ';