aggiunta stampa degli articoli inclusi nel filtro del report
This commit is contained in:
@@ -127,6 +127,28 @@ class Inventario {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function getPdfInv($data) {
|
||||
|
||||
$GestSetup = new GestSetup;
|
||||
$GestSetup->keySection("REPORT_NAME_FILTRO");
|
||||
$JP = new JasperProcessor;
|
||||
$Ret = $JP->load($GestSetup);
|
||||
if ($Ret->is_OK()) {
|
||||
$JP = $Ret->get("JP");
|
||||
|
||||
$idInventario = $data["id_inventario"];
|
||||
$codMdep = User::get_current_userCodMdep();
|
||||
$fileName = "filtro_inventario_" . $idInventario . "_" . $codMdep;
|
||||
|
||||
$JP->param("id_inventario", $idInventario)
|
||||
->param("cod_mdep", $codMdep);
|
||||
|
||||
$Ret = $JP->cacheAs($fileName)->run();
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
public static function save($data) {
|
||||
$Ret = new Ret;
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ if (isset($_POST["upload_inventario"])) {
|
||||
} else if (isset($_GET["get_pdf"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["get_pdf"]);
|
||||
Inventario::getPdf($data)->display();
|
||||
} else if (isset($_GET["get_pdf_inv"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["get_pdf_inv"]);
|
||||
Inventario::getPdfInv($data)->display();
|
||||
} else if (isset($_GET["popup-invenr"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["popup-invenr"]);
|
||||
include "popup-invenr.php";
|
||||
|
||||
@@ -44,7 +44,10 @@
|
||||
<td class="text-center vertical-middle"><?
|
||||
if (!is_null($row["filtro"])) {
|
||||
?>
|
||||
<i class="fa fa-filter text-muted" title="Esiste un Filtro sull'inventario"></i><?
|
||||
<button class="btn stampaInv">
|
||||
<i class="fa fa-filter text-muted" title="Esiste un Filtro sull'inventario"></i>
|
||||
</button>
|
||||
<?
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-center vertical-middle">
|
||||
|
||||
@@ -38,6 +38,16 @@ $(function () {
|
||||
_inventario.view(idInventario);
|
||||
});
|
||||
|
||||
$(".stampaInv").on("click", function () {
|
||||
const $this = $(this);
|
||||
const $tr = $this.closest("tr[data-id_inventario]");
|
||||
const idInventario = $tr.getDataAttr("id_inventario");
|
||||
$this.disableAll();
|
||||
_inventario.get_pdf_inv(idInventario).then(function () {
|
||||
$this.disableAll(false);
|
||||
});
|
||||
});
|
||||
|
||||
$(".bt_pdf").on("click", function () {
|
||||
var $this = $(this);
|
||||
var $tr = $this.closest("tr[data-id_inventario]");
|
||||
@@ -155,6 +165,18 @@ var _inventario = {
|
||||
return d;
|
||||
},
|
||||
|
||||
get_pdf_inv: function (idInventario) {
|
||||
const d = $.Deferred();
|
||||
const ajax = new Ajax();
|
||||
ajax.get("get_pdf_inv")
|
||||
.data({id_inventario: idInventario})
|
||||
.noticeAsModal()
|
||||
.deferred(d)
|
||||
.onSuccess({downloadFile: true})
|
||||
.execute();
|
||||
return d;
|
||||
},
|
||||
|
||||
save: function (idInventario) {
|
||||
const self = this;
|
||||
const d = $.Deferred();
|
||||
|
||||
Reference in New Issue
Block a user