Regalamiunsorriso/decompiled-libs/www/acxent-common-1.0.1/it/acxent/contab/servlet/MovimentoSvlt.java

193 lines
8.6 KiB
Java
Raw Normal View History

2026-04-22 18:41:37 +02:00
package it.acxent.contab.servlet;
import it.acxent.anag.Esercizio;
import it.acxent.anag.MagFisico;
import it.acxent.art.Articolo;
import it.acxent.art.Marca;
import it.acxent.contab.Movimento;
import it.acxent.contab.MovimentoCR;
import it.acxent.contab.RigaDocumento;
import it.acxent.contab.TipoDocumento;
import it.acxent.contab.TipoDocumentoCR;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.util.Vectumerator;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/contab/Movimento.abl"})
public class MovimentoSvlt extends AblServletSvlt {
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull).findByCR(new TipoDocumentoCR(), 0, 0));
req.setAttribute("listaMagFisico", new MagFisico(apFull).findAll());
req.setAttribute("listaEsercizi", new Esercizio(apFull).findAll());
req.setAttribute("listaMarche", new Marca(apFull).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Movimento(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new MovimentoCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
if (getCmd(req).equals("viewM")) {
setJspPageRelative("../../admin/art/articoloViewMovimento.jsp", req);
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_magFisico = getRequestLongParameter(req, "id_magFisico");
long l_id_clifor = getRequestLongParameter(req, "id_clifor");
long l_flgInMagazzino = getRequestLongParameter(req, "flgInMagazzino");
Articolo bean = new Articolo(getApFull(req));
bean.findByPrimaryKey(l_id_articolo);
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
CR.setId_magFisico(l_id_magFisico);
CR.setId_clifor(l_id_clifor);
CR.setFlgInMagazzino(l_flgInMagazzino);
Movimento mov = new Movimento(getApFull(req));
Vectumerator vec = mov.findSaldiArticoloVarianteTagliaByCR(CR, 0, 0);
req.setAttribute("listaArticoliVarianteMovimento", vec);
req.setAttribute("bean", bean);
callJsp(req, res);
} else {
super.otherCommands(req, res);
}
}
protected int getPageRow(HttpServletRequest req) {
return 55;
}
public void _interrogazione2(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("list1", bean.findOrdiniByArticolo(l_id_articolo));
req.setAttribute("CR", CR);
showBean(req, res);
}
public void _loadDettaglio1(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_documento = getRequestLongParameter(req, "id_documento");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("list1", bean.findOrdiniByArticolo(l_id_articolo));
req.setAttribute("list2", bean.findMovimentiDiCaricoByArticoloDocumento(l_id_articolo, l_id_documento));
req.setAttribute("CR", CR);
showBean(req, res);
}
public void _loadDettaglio2(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_documento = getRequestLongParameter(req, "id_documento");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
CR.setId_documento(l_id_documento);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("list1", bean.findOrdiniByArticolo(l_id_articolo));
req.setAttribute("list2", bean.findMovimentiDiCaricoByArticoloDocumento(l_id_articolo, l_id_documento));
req.setAttribute("CR", CR);
showBean(req, res);
}
public void _loadDettaglio3(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_documento = getRequestLongParameter(req, "id_documento");
long l_id_documento2 = getRequestLongParameter(req, "id_documento2");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
CR.setId_documento(l_id_documento);
CR.setId_documento2(l_id_documento2);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("list1", bean.findOrdiniByArticolo(l_id_articolo));
req.setAttribute("list2", bean.findMovimentiDiCaricoByArticoloDocumento(l_id_articolo, l_id_documento));
req.setAttribute("list3", bean.findDettaglioBollaByArticoloDocumento(l_id_articolo, l_id_documento2));
req.setAttribute("CR", CR);
showBean(req, res);
}
public void _loadDettaglio4(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_documento = getRequestLongParameter(req, "id_documento");
long l_id_documento2 = getRequestLongParameter(req, "id_documento2");
long l_id_rigaDocumento = getRequestLongParameter(req, "id_rigaDocumento");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
CR.setId_documento(l_id_documento);
CR.setId_documento2(l_id_documento2);
CR.setId_documento(l_id_rigaDocumento);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("list1", bean.findOrdiniByArticolo(l_id_articolo));
req.setAttribute("list2", bean.findMovimentiDiCaricoByArticoloDocumento(l_id_articolo, l_id_documento));
req.setAttribute("list3", bean.findDettaglioBollaByArticoloDocumento(l_id_articolo, l_id_documento2));
req.setAttribute("list4", new Movimento(getApFull(req)).findByRigaDocumento(l_id_rigaDocumento));
req.setAttribute("CR", CR);
showBean(req, res);
}
public void _aggiustaOrdini(HttpServletRequest req, HttpServletResponse res) {
RigaDocumento bean = new RigaDocumento(getApFull(req));
bean.importMovimentoOrdiniAFornitore();
showBean(req, res);
}
public void _interrogazione3(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
MovimentoCR CR = new MovimentoCR();
CR.setId_articolo(l_id_articolo);
RigaDocumento bean = new RigaDocumento(getApFull(req));
req.setAttribute("CR", CR);
showBean(req, res);
}
protected String getBeanPageName(HttpServletRequest req) {
if (getCmd(req).equals("interrogazione3"))
return "checkOrdinato";
return super.getBeanPageName(req);
}
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
if (getBackRequest(req).equals(getACT_BACK())) {
MovimentoCR movimentoCR = (MovimentoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
l_id_articolo = movimentoCR.getId_articolo();
}
MovimentoCR CR = new MovimentoCR(getApFull(req));
fillObject(req, CR);
if (l_id_articolo > 0L) {
Articolo articolo = new Articolo(getApFull(req));
articolo.findByPrimaryKey(l_id_articolo);
if (articolo.getTipo().getFlgUsaVarianti() == 1L)
if (articolo.getDBState() == 1)
req.setAttribute("listaVarianti", articolo.findArticoliVarianti(-1L, -1L));
}
if (CR.getId_esercizio() == -1L)
req.setAttribute("id_esercizio", Integer.valueOf(DBAdapter.getCurrentYear()));
return super.beforeSearch(req, res);
}
public void _creaReportCsv(HttpServletRequest req, HttpServletResponse res) {
MovimentoCR CR = (MovimentoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
CR.setFlgTipoReport(getRequestLongParameter(req, "flgTipoReport"));
CR.setId_users(getLoginUserId(req).longValue());
Movimento bean = new Movimento(getApFull(req));
bean.creaFileCvs(CR);
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File report in formato cvs (Excel)</a>");
}
}