Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
e51ab219c8
10
editor.php
10
editor.php
|
@ -472,19 +472,19 @@ if ($read_only || !empty($block_edit)) {
|
||||||
|
|
||||||
var content_was_modified = false;
|
var content_was_modified = false;
|
||||||
|
|
||||||
//controllo se digito qualche valore o cambio qualche select
|
// Controllo se digito qualche valore o cambio qualche select
|
||||||
$("input, textarea, select").bind("change paste keyup", function(event) {
|
$(".content input, .content textarea, .content select").bind("change paste keyup", function(event) {
|
||||||
if (event.keyCode >= 32) {
|
if (event.keyCode >= 32) {
|
||||||
content_was_modified = true;
|
content_was_modified = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".superselect, .superselectajax").on("change", function (e) {
|
$(".content .superselect, .content .superselectajax").on("change", function (e) {
|
||||||
content_was_modified = true;
|
content_was_modified = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
//tolgo il controllo se sto salvando
|
// Tolgo il controllo se sto salvando
|
||||||
$(".btn-success, button[type=submit]").bind("click", function() {
|
$(".content .btn-success, .content button[type=submit]").bind("click", function() {
|
||||||
content_was_modified = false;
|
content_was_modified = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ function verifica_numero_intervento(Intervento $intervento)
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $intervento->data_richiesta;
|
$data = $intervento->data_richiesta;
|
||||||
$documenti = Intervento::where('data_richiesta', '=', $data)
|
$documenti = Intervento::whereDate('data_richiesta', '=', $data->format('Y-m-d'))
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
// Recupero maschera per questo segmento
|
// Recupero maschera per questo segmento
|
||||||
|
@ -310,12 +310,12 @@ function verifica_numero_intervento(Intervento $intervento)
|
||||||
|
|
||||||
if ((strpos($maschera, 'YYYY') !== false) or (strpos($maschera, 'yy') !== false)) {
|
if ((strpos($maschera, 'YYYY') !== false) or (strpos($maschera, 'yy') !== false)) {
|
||||||
$ultimo = Generator::getPreviousFrom($maschera, 'in_interventi', 'codice', [
|
$ultimo = Generator::getPreviousFrom($maschera, 'in_interventi', 'codice', [
|
||||||
'DATE(data_richiesta) < '.prepare(date('Y-m-d', strtotime($data))),
|
'DATE(data_richiesta) < '.prepare($data->format('Y-m-d')),
|
||||||
'YEAR(data_richiesta) = '.prepare(date('Y', strtotime($data))),
|
'YEAR(data_richiesta) = '.prepare($data->format('Y')),
|
||||||
], $data);
|
], $data);
|
||||||
} else {
|
} else {
|
||||||
$ultimo = Generator::getPreviousFrom($maschera, 'in_interventi', 'codice', [
|
$ultimo = Generator::getPreviousFrom($maschera, 'in_interventi', 'codice', [
|
||||||
'DATE(data_richiesta) < '.prepare(date('Y-m-d', strtotime($data))),
|
'DATE(data_richiesta) < '.prepare($data->format('Y-m-d')),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,4 +266,5 @@ input("prezzo_qta").change(function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).ready(cambioImpostazioni);
|
$(document).ready(cambioImpostazioni);
|
||||||
|
content_was_modified = false;
|
||||||
</script>';
|
</script>';
|
||||||
|
|
|
@ -36,7 +36,7 @@ echo '
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<button type="button" class="btn btn-info btn-block" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
<button type="button" class="btn btn-info btn-block" style="margin-top:25px;" onclick="aggiungiPrezzi(this, false)">
|
||||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -141,11 +141,10 @@ function gestionePrezzi(id_anagrafica, direzione) {
|
||||||
openModal("'.tr('Gestisci prezzi specifici').'", "'.$structure->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
openModal("'.tr('Gestisci prezzi specifici').'", "'.$structure->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
||||||
}
|
}
|
||||||
|
|
||||||
function aggiungiPrezzi(button) {
|
function aggiungiPrezzi(button, is_uscita) {
|
||||||
let panel = $(button).closest(".box");
|
let panel = $(button).closest(".box");
|
||||||
let tab = panel.closest(".tab-pane");
|
|
||||||
|
|
||||||
let direzione = tab.attr("id") === "fornitori" ? "uscita" : "entrata";
|
let direzione = is_uscita ? "uscita" : "entrata";
|
||||||
let id_anagrafica = panel.find("select").val();
|
let id_anagrafica = panel.find("select").val();
|
||||||
|
|
||||||
if (id_anagrafica) {
|
if (id_anagrafica) {
|
||||||
|
|
|
@ -84,4 +84,7 @@ echo '
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>$(document).ready(init);</script>';
|
<script>
|
||||||
|
$(document).ready(init);
|
||||||
|
content_was_modified = false;
|
||||||
|
</script>';
|
||||||
|
|
|
@ -39,7 +39,7 @@ echo '
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="btn-group btn-group-flex">
|
<div class="btn-group btn-group-flex">
|
||||||
<button type="button" class="btn btn-info" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
<button type="button" class="btn btn-info" style="margin-top:25px;" onclick="aggiungiPrezzi(this, true)">
|
||||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ if (!$fornitori_disponibili->isEmpty()) {
|
||||||
|
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.$dettaglio->updated_at->diffForHumans().'</small></p>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
|
@ -210,32 +210,6 @@ if (!$fornitori_disponibili->isEmpty()) {
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<script>
|
<script>
|
||||||
function modificaPrezzi(button) {
|
|
||||||
let tr = $(button).closest("tr");
|
|
||||||
let id_anagrafica = tr.data("id_anagrafica");
|
|
||||||
let direzione = tr.data("direzione");
|
|
||||||
|
|
||||||
gestionePrezzi(id_anagrafica, direzione);
|
|
||||||
}
|
|
||||||
|
|
||||||
function gestionePrezzi(id_anagrafica, direzione) {
|
|
||||||
openModal("'.tr('Gestisci prezzi specifici').'", "'.Plugin::pool('Listino Clienti')->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
|
||||||
}
|
|
||||||
|
|
||||||
function aggiungiPrezzi(button) {
|
|
||||||
let panel = $(button).closest(".box");
|
|
||||||
let tab = panel.closest(".tab-pane");
|
|
||||||
|
|
||||||
let direzione = tab.attr("id") === "fornitori" ? "uscita" : "entrata";
|
|
||||||
let id_anagrafica = panel.find("select").val();
|
|
||||||
|
|
||||||
if (id_anagrafica) {
|
|
||||||
gestionePrezzi(id_anagrafica, direzione);
|
|
||||||
} else {
|
|
||||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function modificaFornitore(id_riga, id_anagrafica) {
|
function modificaFornitore(id_riga, id_anagrafica) {
|
||||||
openModal("Modifica dati fornitore", "'.$structure->fileurl('dettaglio_fornitore.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_riga=" + id_riga + "&id_anagrafica=" + id_anagrafica);
|
openModal("Modifica dati fornitore", "'.$structure->fileurl('dettaglio_fornitore.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_riga=" + id_riga + "&id_anagrafica=" + id_anagrafica);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue