www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,73 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.contab.CausaleContabile;
|
||||
import it.acxent.contab.CausaleContabileCR;
|
||||
import it.acxent.contab.RigaCausaleContabile;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/CausaleContabile.abl"})
|
||||
public class CausaleContabileSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -442960013744440571L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
|
||||
CausaleContabile bbean = (CausaleContabile)bean;
|
||||
req.setAttribute("list", new RigaCausaleContabile(getApFull(req)).findByCausaleContabile(bbean.getId_causaleContabile()));
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new CausaleContabile(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new CausaleContabileCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
super.prepareNewRecord(req, res);
|
||||
}
|
||||
|
||||
public void _addConto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_causaleContabile = getRequestLongParameter(req, "id_causaleContabile");
|
||||
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||||
ResParm rp = new ResParm(true);
|
||||
CausaleContabile bean = new CausaleContabile(getApFull(req));
|
||||
bean.findByPrimaryKey(id_causaleContabile);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
if (rp.getStatus()) {
|
||||
RigaCausaleContabile rBean = new RigaCausaleContabile(getApFull(req));
|
||||
rBean.findByPrimaryKey(id_rigaCausaleContabile);
|
||||
fillObject(req, rBean);
|
||||
rBean.setId_causaleContabile(bean.getId_causaleContabile());
|
||||
rBean.save();
|
||||
}
|
||||
req.setAttribute("id_causaleContabile", Long.valueOf(bean.getId_causaleContabile()));
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _modConto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||||
RigaCausaleContabile riga = new RigaCausaleContabile(getApFull(req));
|
||||
riga.findByPrimaryKey(id_rigaCausaleContabile);
|
||||
req.setAttribute("bean2", riga);
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _delConto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_rigaCausaleContabile = getRequestLongParameter(req, "id_rigaCausaleContabile");
|
||||
RigaCausaleContabile riga = new RigaCausaleContabile(getApFull(req));
|
||||
riga.findByPrimaryKey(id_rigaCausaleContabile);
|
||||
ResParm rp = riga.delete();
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.MagFisico;
|
||||
import it.acxent.contab.CausaleMagazzino;
|
||||
import it.acxent.contab.CausaleMagazzinoCR;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/CausaleMagazzino.abl"})
|
||||
public class CausaleMagazzinoSvlt extends AblServletSvlt {
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaMagFisico", new MagFisico(getApFull(req)).findAll());
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaMagFisico", new MagFisico(getApFull(req)).findAll());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new CausaleMagazzino(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new CausaleMagazzinoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaMagFisico", new MagFisico(getApFull(req)).findAll());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Banca;
|
||||
import it.acxent.anag.BancaCR;
|
||||
import it.acxent.contab.DistintaRiba;
|
||||
import it.acxent.contab.DistintaRibaCR;
|
||||
import it.acxent.contab.DocumentoScadenza;
|
||||
import it.acxent.contab.DocumentoScadenzaCR;
|
||||
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/DistintaRiba.abl"})
|
||||
public class DistintaRibaSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -5831361296695092818L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
DistintaRiba bean = (DistintaRiba)beanA;
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR();
|
||||
fillObject(req, CR);
|
||||
req.setAttribute("listaBanche", new Banca(getApFull(req)).findByCR(new BancaCR(), 0, 0));
|
||||
CR.setId_distintaRiba(bean.getId_distintaRiba());
|
||||
Vectumerator<DocumentoScadenza> vec = new DocumentoScadenza(getApFull(req)).findByCR(CR, 0, 0);
|
||||
if (CR.getFlgAccorpaScadenze() == 1L || bean.getFlgAccorpaScadenze() == 1L)
|
||||
vec = bean.accorpaScadenze(vec);
|
||||
req.setAttribute("listaScadenze", vec);
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new DistintaRiba(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new DistintaRibaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void refresh(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_distintaRiba = getRequestLongParameter(req, "id_distintaRiba");
|
||||
DistintaRiba bean = new DistintaRiba(getApFull(req));
|
||||
bean.findByPrimaryKey(id_distintaRiba);
|
||||
fillComboAfterDetail(bean, req, res);
|
||||
super.refresh(req, res);
|
||||
}
|
||||
|
||||
public void _creaFile(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_distintaRiba = getRequestLongParameter(req, "id_distintaRiba");
|
||||
DistintaRiba bean = new DistintaRiba(getApFull(req));
|
||||
bean.findByPrimaryKey(id_distintaRiba);
|
||||
ResParm rp = bean.creaFile();
|
||||
if (rp.getStatus()) {
|
||||
req.setAttribute("retPath", rp.getMsg());
|
||||
sendMessage(req, "File creato correttamente");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
try {
|
||||
long l_id = getRequestLongParameter(req, "id_distintaRiba");
|
||||
DistintaRiba bean = new DistintaRiba(apFull);
|
||||
bean.findByPrimaryKey(l_id);
|
||||
DistintaRibaCR CR = new DistintaRibaCR();
|
||||
fillObject(req, CR);
|
||||
CR.setId_distintaRiba(l_id);
|
||||
sendPdf(res, bean.creaReportPdf(CR), "Riba_" + DBAdapter.getDayTimeTimestamp() + ".pdf");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Iva;
|
||||
import it.acxent.anag.TipoPagamento;
|
||||
import it.acxent.anag.TipoPagamentoCR;
|
||||
import it.acxent.anag.Users;
|
||||
import it.acxent.anag.Vettore;
|
||||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoOrd.abl"})
|
||||
public class DocumentoOrdSvlt extends DocumentoSvlt {
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return "documento";
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
Documento bean = (Documento)beanA;
|
||||
super.fillComboAfterDetail(beanA, req, res);
|
||||
}
|
||||
|
||||
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ResParm rp = new ResParm(true);
|
||||
return rp;
|
||||
}
|
||||
|
||||
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("id_tipoDocumento", String.valueOf(getId_docOrdine()));
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("nf4", getNf4());
|
||||
req.setAttribute("listaOperatori", new Users(apFull)
|
||||
.findUsersByProfileMax(9L));
|
||||
Documento bean = new Documento(apFull);
|
||||
bean.setId_tipoDocumento(getId_docOrdine());
|
||||
bean.setFlgStato(1L);
|
||||
bean.setId_tipoPagamento(1L);
|
||||
req.setAttribute("bean", bean);
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull)
|
||||
.findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("listaVettore", new Vettore(apFull).findAll());
|
||||
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull)
|
||||
.findAll());
|
||||
req.setAttribute("listaIva", new Iva(apFull).findAll());
|
||||
RigaDocumento bean2 = new RigaDocumento(apFull);
|
||||
bean2.setId_iva(getParm("CODICE_IVA_STD_VEND").getNumeroLong());
|
||||
req.setAttribute("bean2", bean2);
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
search(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.TipoPagamento;
|
||||
import it.acxent.anag.TipoPagamentoCR;
|
||||
import it.acxent.contab.DocumentoPagamento;
|
||||
import it.acxent.contab.DocumentoPagamentoCR;
|
||||
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.StringTokenizer;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoPagamento.abl"})
|
||||
public class DocumentoPagamentoSvlt extends AblServletSvlt {
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaTipiPagamento", new TipoPagamento(getApFull(req)).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipiPagamento", new TipoPagamento(apFull).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
TipoDocumentoCR TDCR = new TipoDocumentoCR();
|
||||
TDCR.setFlgTipologia(20L);
|
||||
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull).findByCR(TDCR, 0, 0));
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new DocumentoPagamento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new DocumentoPagamentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaTipiPagamento", new TipoPagamento(getApFull(req)).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
DocumentoPagamento bean = new DocumentoPagamento(getApFull(req));
|
||||
bean.setId_documento(getRequestLongParameter(req, "id_documento"));
|
||||
req.setAttribute("bean", bean);
|
||||
}
|
||||
|
||||
public void _loadLista(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_clifor = getRequestLongParameter(req, "id_clifor");
|
||||
req.setAttribute("listaPagamenti", new DocumentoPagamento(
|
||||
getApFull(req)).findByClifor(id_clifor, 1L));
|
||||
setJspPageRelative("/documentoPagamentoList.jsp", req);
|
||||
callJsp(req, res);
|
||||
}
|
||||
|
||||
public void _savePagamenti(HttpServletRequest req, HttpServletResponse res) {
|
||||
String listaDocumenti = getRequestParameter(req, "listaDocumenti");
|
||||
StringTokenizer st = new StringTokenizer(listaDocumenti, "|");
|
||||
DocumentoPagamento dp = null;
|
||||
while (st.hasMoreTokens()) {
|
||||
String documento = st.nextToken();
|
||||
StringTokenizer stDocumento = new StringTokenizer(documento, ",");
|
||||
long id_documento = Long.valueOf(stDocumento.getToken(0));
|
||||
double importo = Double.valueOf(stDocumento.getToken(1));
|
||||
long flgStatoTipoIncasso = Long.valueOf(stDocumento.getToken(2));
|
||||
dp = new DocumentoPagamento(getApFull(req));
|
||||
fillObject(req, dp);
|
||||
dp.setId_documento(id_documento);
|
||||
dp.setFlgTipoMovimento(2L);
|
||||
dp.setImporto(importo);
|
||||
dp.setFlgTipoIncasso(flgStatoTipoIncasso);
|
||||
dp.save();
|
||||
}
|
||||
req.setAttribute("id_tipoPagamento", "0");
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
if (getAct(req).toLowerCase().equals("ins"))
|
||||
return super.getBeanPageName(req) + super.getBeanPageName(req);
|
||||
return super.getBeanPageName(req);
|
||||
}
|
||||
|
||||
public void _printReport(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoPagamento bean = new DocumentoPagamento(getApFull(req));
|
||||
DocumentoPagamentoCR CR = new DocumentoPagamentoCR(getApFull(req));
|
||||
CR = (DocumentoPagamentoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
|
||||
sendPdf(res, bean.creaReportPdf(CR), "Report_Documenti_Pagamento " + DBAdapter.getDayTimeTimestamp());
|
||||
}
|
||||
|
||||
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoPagamentoCR CR = new DocumentoPagamentoCR(getApFull(req));
|
||||
fillObject(req, CR);
|
||||
if (CR.getId_clifor() > 0L)
|
||||
if (CR.getClifor().getFlgTipo().equals("C")) {
|
||||
req.setAttribute("flgClienteFornitore", "C");
|
||||
} else {
|
||||
req.setAttribute("flgClienteFornitore", "F");
|
||||
}
|
||||
return super.beforeSearch(req, res);
|
||||
}
|
||||
|
||||
public void _creaFileCvs(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoPagamentoCR CR = (DocumentoPagamentoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
|
||||
DocumentoPagamento bean = new DocumentoPagamento(getApFull(req));
|
||||
bean.creaFileCvs(CR);
|
||||
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File export in formato cvs (Excel)</a>");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Iva;
|
||||
import it.acxent.anag.TipoPagamento;
|
||||
import it.acxent.anag.TipoPagamentoCR;
|
||||
import it.acxent.anag.Users;
|
||||
import it.acxent.anag.Vettore;
|
||||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.DocumentoCR;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Date;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoPre.abl"})
|
||||
public class DocumentoPreSvlt extends DocumentoSvlt {
|
||||
private static final long serialVersionUID = -3181095019824437439L;
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
if (getCmd(req).equals("search"))
|
||||
return "documentoPre";
|
||||
return "documento";
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
super.fillComboAfterDetail(beanA, req, res);
|
||||
}
|
||||
|
||||
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ResParm rp = new ResParm(true);
|
||||
return rp;
|
||||
}
|
||||
|
||||
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getRequestLongParameter(req, "flgTipologia") == 0L)
|
||||
req.setAttribute("flgStatoPrenotazione", Integer.valueOf(200));
|
||||
req.setAttribute("flgTipologia", Integer.valueOf(4));
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("nf4", getNf4());
|
||||
req.setAttribute("listaOperatori", new Users(apFull).findUsersByProfileMax(9L));
|
||||
Documento bean = new Documento(apFull);
|
||||
bean.setId_tipoDocumento(getId_docPrenotazione());
|
||||
bean.setFlgStato(1L);
|
||||
bean.setId_tipoPagamento(1L);
|
||||
req.setAttribute("bean", bean);
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("listaVettore", new Vettore(apFull).findAll());
|
||||
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull).findAll());
|
||||
req.setAttribute("listaIva", new Iva(apFull).findAll());
|
||||
RigaDocumento bean2 = new RigaDocumento(apFull);
|
||||
bean2.setId_iva(getParm("CODICE_IVA_STD_VEND").getNumeroLong());
|
||||
req.setAttribute("bean2", bean2);
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
|
||||
public void _annAssPren(HttpServletRequest req, HttpServletResponse res) {
|
||||
RigaDocumento row = new RigaDocumento(getApFull(req));
|
||||
long l_id = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
row.findByPrimaryKey(l_id);
|
||||
row.setFlgPrenotazioneArrivata(0L);
|
||||
ResParm rp = row.save();
|
||||
rp.append(row.getDocumento().aggiornaStatoPrenotazione(row.getDocumento().getFlgStatoPrenotazione(), 0L));
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Prenotazione riga aggiornata con successo!");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _annullaSlip(HttpServletRequest req, HttpServletResponse res) {
|
||||
RigaDocumento row = new RigaDocumento(getApFull(req));
|
||||
long l_id = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
row.findByPrimaryKey(l_id);
|
||||
row.setQtaSlipStampate(0L);
|
||||
ResParm rp = row.save();
|
||||
rp.append(row.getDocumento().aggiornaStatoPrenotazione(row.getDocumento().getFlgStatoPrenotazione(), 0L));
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Stampa slip azzerata. Prenotazione riga aggiornata con successo!");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
protected void XXXXotherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getCmd(req).equals("aggionraSRCR")) {
|
||||
Documento bean = null;
|
||||
long l_id = getRequestLongParameter(req, "id_documento");
|
||||
bean = new Documento(getApFull(req));
|
||||
bean.findByPrimaryKey(l_id);
|
||||
long l_flgStatoRiparazione = getRequestLongParameter(req, "flgStatoRiparazioneS");
|
||||
ResParm rp = new ResParm();
|
||||
if (bean.getDBState() == 0) {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg("Errore! Codice documento non valido");
|
||||
} else {
|
||||
rp = bean.aggiornaStatoRiparazione(l_flgStatoRiparazione);
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Stato Riparazione aggiornato.");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
search(req, res);
|
||||
} else if (getCmd(req).equals("inviaAvviso")) {
|
||||
Documento bean = null;
|
||||
long l_id = getRequestLongParameter(req, "id_documento");
|
||||
bean = new Documento(getApFull(req));
|
||||
bean.findByPrimaryKey(l_id);
|
||||
ResParm rp = new ResParm();
|
||||
if (bean.getDBState() == 0) {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg("Errore! Codice documento non valido");
|
||||
} else {
|
||||
rp = bean.sendAvvisoRiparazione();
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Avviso inviato correttamente.");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
search(req, res);
|
||||
} else if (getCmd(req).equals("annAssPren")) {
|
||||
RigaDocumento row = new RigaDocumento(getApFull(req));
|
||||
long l_id = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
row.findByPrimaryKey(l_id);
|
||||
row.setFlgPrenotazioneArrivata(0L);
|
||||
ResParm rp = row.save();
|
||||
rp.append(row.getDocumento().aggiornaStatoPrenotazione(row.getDocumento().getFlgStatoPrenotazione(), 0L));
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Prenotazione riga aggiornata con successo!");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getCmd(req).equals("annullaSlip")) {
|
||||
RigaDocumento row = new RigaDocumento(getApFull(req));
|
||||
long l_id = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
row.findByPrimaryKey(l_id);
|
||||
row.setQtaSlipStampate(0L);
|
||||
ResParm rp = row.save();
|
||||
rp.append(row.getDocumento().aggiornaStatoPrenotazione(row.getDocumento().getFlgStatoPrenotazione(), 0L));
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Stampa slip azzerata. Prenotazione riga aggiornata con successo!");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
} else {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
public void _addRestituzioneAcconto(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
ResParm rp = new ResParm(true);
|
||||
long id_documento = getRequestLongParameter(req, "id_documento");
|
||||
Date dataRestituzione = getRequestDateParameter(req, "dataRestituzioneAcconto");
|
||||
DocumentoCR CR = new DocumentoCR(apFull);
|
||||
fillObject(req, CR);
|
||||
req.setAttribute("CR", CR);
|
||||
req.setAttribute("cmd", "search");
|
||||
if (id_documento > 0L) {
|
||||
Documento bean = new Documento(apFull);
|
||||
bean.findByPrimaryKey(id_documento);
|
||||
bean.setDataRestituzioneAcconto(dataRestituzione);
|
||||
rp = bean.aggiornaStatoPrenotazione(bean.getFlgStatoPrenotazione(), 100L);
|
||||
} else {
|
||||
rp = new ResParm(false, "ERRORE! Id documento non valido!");
|
||||
}
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _creaReportCsvPrenotazioni(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoCR CR = (DocumentoCR)req.getSession().getAttribute("CRdocumentoPre");
|
||||
Documento bean = new Documento(getApFull(req));
|
||||
bean.creaFileCvsPrenotazioni(CR);
|
||||
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File export in formato cvs (Excel)</a>");
|
||||
}
|
||||
|
||||
protected void search(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoCR CR = new DocumentoCR(getApFull(req));
|
||||
fillObject(req, CR);
|
||||
if (CR.getFlgReport().equals("S")) {
|
||||
req.getSession().setAttribute("CRdocumentoPre", CR);
|
||||
if (CR.getFlgStatoPrenotazioneArt() > -1L) {
|
||||
Documento bean = new Documento(getApFull(req));
|
||||
Vectumerator<Documento> vec = bean.findPrenotazioniByCR(CR);
|
||||
req.setAttribute("list", vec);
|
||||
req.setAttribute("CR", CR);
|
||||
callJsp(req, res);
|
||||
} else {
|
||||
super.search(req, res);
|
||||
}
|
||||
} else {
|
||||
super.search(req, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Iva;
|
||||
import it.acxent.anag.TipoPagamento;
|
||||
import it.acxent.anag.TipoPagamentoCR;
|
||||
import it.acxent.anag.Users;
|
||||
import it.acxent.anag.Vettore;
|
||||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.DocumentoCR;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.TipoAllegatoDocumento;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.AbMessages;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoRip.abl"})
|
||||
public class DocumentoRipSvlt extends DocumentoSvlt {
|
||||
private static final long serialVersionUID = 6122990489236236941L;
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return "documentoRip";
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Documento bean = (Documento)beanA;
|
||||
int ordineInverso = (bean.getTipoDocumento().getFlgOrdinamentoRigheEdit() == 1L) ? 1 : 0;
|
||||
Vectumerator<RigaDocumento> vec = bean.findRigheDocumento(1, 1, ordineInverso);
|
||||
if (vec.hasMoreElements()) {
|
||||
RigaDocumento bean2 = (RigaDocumento)vec.nextElement();
|
||||
req.setAttribute("bean2", bean2);
|
||||
}
|
||||
req.setAttribute("listaDocGen", bean.getTipoDocumento().findDocGen(1L, 0L, 0, 0));
|
||||
req.setAttribute("listaOperatori", new Users(apFull).findUsersByFlgOperatore());
|
||||
req.setAttribute("listaDocFigli", bean.findDocumentiFiglio());
|
||||
req.setAttribute("listaDocPadri", bean.findDocumentiPadre());
|
||||
if (bean.getTipoDocumento().getFlgAllegato() == 1L) {
|
||||
req.setAttribute("listaTipiAllegatoDocumento", new TipoAllegatoDocumento(apFull).findAll());
|
||||
req.setAttribute("listaAllegati", bean.getAllegati(0L));
|
||||
}
|
||||
req.setAttribute("listaIva", new Iva(apFull).findAll());
|
||||
}
|
||||
|
||||
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
Documento bean = (Documento)beanA;
|
||||
RigaDocumento row = new RigaDocumento(getApFull(req));
|
||||
ResParm rp = new ResParm(true);
|
||||
if (bean.getId_documento() != 0L) {
|
||||
fillObject(req, row);
|
||||
System.out.println(getRequestParameter(req, "flgReso"));
|
||||
rp = Documento.addRigaDocumento(bean, row);
|
||||
return bean.save();
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("id_tipoDocumento", String.valueOf(getId_docRiparazione()));
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("nf4", getNf4());
|
||||
req.setAttribute("listaOperatori", new Users(apFull).findUsersByProfileMax(9L));
|
||||
Documento bean = new Documento(apFull);
|
||||
bean.setId_tipoDocumento(getId_docRiparazione());
|
||||
bean.setFlgStato(1L);
|
||||
bean.setId_tipoPagamento(1L);
|
||||
req.setAttribute("bean", bean);
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("listaVettore", new Vettore(apFull).findAll());
|
||||
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull).findAll());
|
||||
req.setAttribute("listaIva", new Iva(apFull).findAll());
|
||||
RigaDocumento bean2 = new RigaDocumento(apFull);
|
||||
bean2.setId_iva(getParm("CODICE_IVA_STD_VEND").getNumeroLong());
|
||||
req.setAttribute("bean2", bean2);
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
|
||||
protected void afterCreaDocFigli(HttpServletRequest req, HttpServletResponse res, Documento bean, long l_id_tipoDocumentoFiglio) {
|
||||
TipoDocumento td = new TipoDocumento(getApFull(req));
|
||||
td.findByPrimaryKey(l_id_tipoDocumentoFiglio);
|
||||
if (td.getFlgClienteFornitore().equals("F")) {
|
||||
bean.setFlgStatoRiparazione(1L);
|
||||
} else {
|
||||
bean.setFlgStatoRiparazione(99L);
|
||||
bean.setDataChiusura(DBAdapter.getToday());
|
||||
}
|
||||
bean.save();
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_OK"));
|
||||
}
|
||||
|
||||
public void _aggionraSRCR(HttpServletRequest req, HttpServletResponse res) {
|
||||
Documento bean = null;
|
||||
long l_id = getRequestLongParameter(req, "id_documento");
|
||||
bean = new Documento(getApFull(req));
|
||||
bean.findByPrimaryKey(l_id);
|
||||
long l_flgStatoRiparazione = getRequestLongParameter(req, "flgStatoRiparazioneS");
|
||||
ResParm rp = new ResParm();
|
||||
if (bean.getDBState() == 0) {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg("Errore! Codice documento non valido");
|
||||
} else {
|
||||
rp = bean.aggiornaStatoRiparazione(l_flgStatoRiparazione);
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Stato Riparazione aggiornato.");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _vediRientri(HttpServletRequest req, HttpServletResponse res) {
|
||||
long l_id = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
RigaDocumento bean2 = new RigaDocumento(getApFull(req));
|
||||
bean2.findByPrimaryKey(l_id);
|
||||
req.setAttribute("list", new Documento(getApFull(req)).findRientri(bean2.getSeriale()));
|
||||
req.setAttribute("bean2", bean2);
|
||||
setJspPageRelative("rientriView.jsp", req);
|
||||
callJsp(req, res);
|
||||
}
|
||||
|
||||
public void _creaReportCsvRiparazioni(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoCR CR = (DocumentoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
|
||||
Documento bean = new Documento(getApFull(req));
|
||||
bean.creaFileCvsRiparazioni(CR);
|
||||
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File export in formato cvs (Excel)</a>");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Banca;
|
||||
import it.acxent.contab.DistintaRiba;
|
||||
import it.acxent.contab.DocumentoScadenza;
|
||||
import it.acxent.contab.DocumentoScadenzaCR;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class DocumentoScadenzaAutoComboSvlt extends DocumentoScadenzaAutoOrdSvlt {
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return "documentoScadenzaAutoCombo";
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {
|
||||
Vectumerator<Banca> vecBanca;
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
long timestampElaborazione = getRequestLongParameter(req, "timestampElaborazione");
|
||||
Vectumerator<DistintaRiba> vec = new Vectumerator();
|
||||
if (timestampElaborazione > 0L) {
|
||||
Banca banca = new Banca(apFull);
|
||||
banca.resetPresentazioneRibaAuto();
|
||||
vecBanca = new Banca(apFull).findByOrdine();
|
||||
} else {
|
||||
vecBanca = new Banca(apFull).findByOrdineVisibili();
|
||||
}
|
||||
vecBanca.moveFirst();
|
||||
while (vecBanca.hasMoreElements()) {
|
||||
Banca banca = (Banca)vecBanca.nextElement();
|
||||
DistintaRiba dr = new DistintaRiba(apFull);
|
||||
if (timestampElaborazione > 0L)
|
||||
dr.findDistintaByTimestampBanca(timestampElaborazione, banca.getId_banca());
|
||||
dr.setId_banca(banca.getId_banca());
|
||||
dr.setTimestampElaborazione(timestampElaborazione);
|
||||
double importo = getRequestDoubleParameter(req, "distinta_" + banca.getId_banca());
|
||||
dr.setImportoManuale(importo);
|
||||
if (timestampElaborazione == 0L || dr.getId_distintaRiba() > 0L) {
|
||||
banca.addBancaAPresentazioneRibaAuto();
|
||||
vec.add(dr);
|
||||
}
|
||||
}
|
||||
req.setAttribute("listaBanche", vec);
|
||||
req.setAttribute("listaBancheNonVis", new Banca(apFull).findNonVisibili());
|
||||
req.setAttribute("listaEstrazioni", new DistintaRiba(apFull).findDistinte());
|
||||
}
|
||||
|
||||
public void _init(HttpServletRequest req, HttpServletResponse res) {
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.resetPresentazioneRibaAuto();
|
||||
fillComboAfterSearch(getBeanCR(req), req, res);
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _rimuoviBancaDaDistinta(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_banca = getRequestLongParameter(req, "id_banca");
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findByPrimaryKey(id_banca);
|
||||
ResParm rp = banca.rimuoviBancaAPresentazioneRibaAuto();
|
||||
DocumentoScadenza bean = new DocumentoScadenza(getApFull(req));
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR(getApFull());
|
||||
fillObject(req, CR);
|
||||
CR.setFlgDaEstrarre(1L);
|
||||
CR.setFlgSoloRiba(1L);
|
||||
double tot = bean.getTotaleScadenzeByCR(CR);
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _addBancaADistinta(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_banca = getRequestLongParameter(req, "id_bancaDaAggungere");
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findByPrimaryKey(id_banca);
|
||||
ResParm rp = banca.addBancaAPresentazioneRibaAuto();
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Banca;
|
||||
import it.acxent.anag.BancaCR;
|
||||
import it.acxent.contab.DistintaRiba;
|
||||
import it.acxent.contab.DistintaRibaCR;
|
||||
import it.acxent.contab.DocumentoScadenza;
|
||||
import it.acxent.contab.DocumentoScadenzaCR;
|
||||
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.HashMapUtil;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.util.HashMap;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoScadenzaAuto.abl"})
|
||||
public class DocumentoScadenzaAutoOrdSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -7830020471332013441L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
long timestampElaborazione = getRequestLongParameter(req, "timestampElaborazione");
|
||||
Vectumerator<DistintaRiba> vec = new Vectumerator();
|
||||
Vectumerator<Banca> vecBanca = new Banca(apFull).findByOrdine();
|
||||
vecBanca.moveFirst();
|
||||
while (vecBanca.hasMoreElements()) {
|
||||
Banca banca = (Banca)vecBanca.nextElement();
|
||||
DistintaRiba dr = new DistintaRiba(apFull);
|
||||
if (timestampElaborazione > 0L)
|
||||
dr.findDistintaByTimestampBanca(timestampElaborazione, banca.getId_banca());
|
||||
dr.setId_banca(banca.getId_banca());
|
||||
dr.setTimestampElaborazione(timestampElaborazione);
|
||||
double importo = getRequestDoubleParameter(req, "distinta_" + banca.getId_banca());
|
||||
dr.setImportoManuale(importo);
|
||||
vec.add(dr);
|
||||
}
|
||||
req.setAttribute("listaBanche", vec);
|
||||
req.setAttribute("listaEstrazioni", new DistintaRiba(apFull).findDistinte());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new DocumentoScadenza(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new DocumentoScadenzaCR(getApFull(req));
|
||||
}
|
||||
|
||||
public void _creaDistinta(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoScadenza bean = new DocumentoScadenza(getApFull(req));
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR(getApFull());
|
||||
fillObject(req, CR);
|
||||
CR.setFlgDaEstrarre(1L);
|
||||
CR.setFlgSoloRiba(1L);
|
||||
CR.setFlgOrderImporto(1L);
|
||||
System.out.println("_creaDistinta");
|
||||
Vectumerator<Banca> vecRiba = new Vectumerator();
|
||||
Vectumerator<Banca> vec = new Banca(getApFull(req)).findByOrdine();
|
||||
while (vec.hasMoreElements()) {
|
||||
Banca row = (Banca)vec.nextElement();
|
||||
double importo = getRequestDoubleParameter(req, "distinta_" + row.getId_banca());
|
||||
if (importo > 0.0D) {
|
||||
System.out.println("" + row.getId_banca() + " - " + row.getId_banca() + " " + row.getDescrizione());
|
||||
row.setImportoRiba(importo);
|
||||
vecRiba.add(row);
|
||||
}
|
||||
}
|
||||
CR.setVecRiba(vecRiba);
|
||||
bean.creaDistinte(CR);
|
||||
req.setAttribute("timestampElaborazione", Long.valueOf(CR.getTimestampElaborazione()));
|
||||
req.setAttribute("CR", CR);
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _eliminaDistinta(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
long id_distintaRiba = getRequestLongParameter(req, "id_distintaRiba");
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR(apFull);
|
||||
fillObject(req, CR);
|
||||
DistintaRiba distinta = new DistintaRiba(apFull);
|
||||
distinta.findByPrimaryKey(id_distintaRiba);
|
||||
req.setAttribute("timestampElaborazione", Long.valueOf(distinta.getTimestampElaborazione()));
|
||||
ResParm rp = distinta.delete();
|
||||
req.setAttribute("CR", CR);
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _selezionaScadenza(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_documentoScadenza = getRequestLongParameter(req, "id_documentoScadenza");
|
||||
DocumentoScadenza documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
documentoScadenza.findByPrimaryKey(id_documentoScadenza);
|
||||
documentoScadenza.setFlgScadenzaSelezionata(1L);
|
||||
documentoScadenza.save();
|
||||
}
|
||||
|
||||
public void _deselezionaScadenza(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_documentoScadenza = getRequestLongParameter(req, "id_documentoScadenza");
|
||||
DocumentoScadenza documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
documentoScadenza.findByPrimaryKey(id_documentoScadenza);
|
||||
documentoScadenza.setFlgScadenzaSelezionata(0L);
|
||||
documentoScadenza.save();
|
||||
}
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return "documentoScadenzaAutoOrd";
|
||||
}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void _recuperaTotale(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoScadenza bean = new DocumentoScadenza(getApFull(req));
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR(getApFull());
|
||||
fillObject(req, CR);
|
||||
CR.setFlgDaEstrarre(1L);
|
||||
CR.setFlgSoloRiba(1L);
|
||||
double tot = bean.getTotaleScadenzeByCR(CR);
|
||||
sendHtmlMsgResponse(req, res, getNf().format(tot));
|
||||
}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
try {
|
||||
long l_id = getRequestLongParameter(req, "id_distintaRiba");
|
||||
DistintaRiba bean = new DistintaRiba(apFull);
|
||||
bean.findByPrimaryKey(l_id);
|
||||
DistintaRibaCR CR = new DistintaRibaCR();
|
||||
fillObject(req, CR);
|
||||
CR.setId_distintaRiba(l_id);
|
||||
sendPdf(res, bean.creaReportPdf(CR), "Report_Documenti_Scadenza " + DBAdapter.getDayTimeTimestamp());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void _creaDistintaxx(HttpServletRequest req, HttpServletResponse res) {
|
||||
DocumentoScadenza bean = new DocumentoScadenza(getApFull(req));
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR(getApFull());
|
||||
fillObject(req, CR);
|
||||
CR.setFlgDaEstrarre(1L);
|
||||
CR.setFlgSoloRiba(1L);
|
||||
CR.setFlgOrderImporto(1L);
|
||||
HashMap<Long, Double> hm = new HashMap<>();
|
||||
Vectumerator<Banca> vec = new Banca(getApFull(req)).findByCR(new BancaCR(), 0, 0);
|
||||
while (vec.hasMoreElements()) {
|
||||
Banca banca = (Banca)vec.nextElement();
|
||||
double importo = getRequestDoubleParameter(req, "distinta_" + banca.getId_banca());
|
||||
if (importo > 0.0D)
|
||||
hm.put(Long.valueOf(banca.getId_banca()), Double.valueOf(importo));
|
||||
}
|
||||
hm = (HashMap<Long, Double>)HashMapUtil.sortReverseByValue(hm);
|
||||
bean.creaDistinte(CR);
|
||||
req.setAttribute("timestampElaborazione", Long.valueOf(CR.getTimestampElaborazione()));
|
||||
req.setAttribute("CR", CR);
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _bancaMeno(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_banca = getRequestLongParameter(req, "id_banca");
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findByPrimaryKey(id_banca);
|
||||
ResParm rp = banca.settaOrdineMeno();
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _bancaPiu(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_banca = getRequestLongParameter(req, "id_banca");
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findByPrimaryKey(id_banca);
|
||||
ResParm rp = banca.settaOrdinePiu();
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Banca;
|
||||
import it.acxent.anag.BancaCR;
|
||||
import it.acxent.contab.DistintaRiba;
|
||||
import it.acxent.contab.DistintaRibaCR;
|
||||
import it.acxent.contab.DocumentoScadenza;
|
||||
import it.acxent.contab.DocumentoScadenzaCR;
|
||||
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.StringTokenizer;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/DocumentoScadenza.abl"})
|
||||
public class DocumentoScadenzaSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -7830020471332013441L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaBanche", new Banca(getApFull(req)).findByCR(new BancaCR(), 0, 0));
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new DocumentoScadenza(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new DocumentoScadenzaCR(getApFull(req));
|
||||
}
|
||||
|
||||
public void _creaDistinta(HttpServletRequest req, HttpServletResponse res) {
|
||||
String scadenzeSelezionate = req.getParameter("scadenzeSelezionate");
|
||||
StringTokenizer st = new StringTokenizer(scadenzeSelezionate, ";");
|
||||
DocumentoScadenza documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
DistintaRibaCR CR = new DistintaRibaCR();
|
||||
fillObject(req, CR);
|
||||
DistintaRiba distinta = new DistintaRiba(getApFull(req));
|
||||
fillObject(req, distinta);
|
||||
distinta.setFlgStatoDistinta(0L);
|
||||
ResParm rp = distinta.save();
|
||||
if (rp.getStatus())
|
||||
while (st.hasMoreTokens()) {
|
||||
String s = st.nextToken();
|
||||
if (!s.isEmpty()) {
|
||||
documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
documentoScadenza.findByPrimaryKey(Long.valueOf(s));
|
||||
documentoScadenza.setFlgScadenzaSelezionata(0L);
|
||||
documentoScadenza.setId_distintaRiba(distinta.getId_distintaRiba());
|
||||
documentoScadenza.save();
|
||||
}
|
||||
}
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _selezionaScadenza(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_documentoScadenza = getRequestLongParameter(req, "id_documentoScadenza");
|
||||
DocumentoScadenza documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
documentoScadenza.findByPrimaryKey(id_documentoScadenza);
|
||||
documentoScadenza.setFlgScadenzaSelezionata(1L);
|
||||
documentoScadenza.save();
|
||||
}
|
||||
|
||||
public void _deselezionaScadenza(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_documentoScadenza = getRequestLongParameter(req, "id_documentoScadenza");
|
||||
DocumentoScadenza documentoScadenza = new DocumentoScadenza(getApFull(req));
|
||||
documentoScadenza.findByPrimaryKey(id_documentoScadenza);
|
||||
documentoScadenza.setFlgScadenzaSelezionata(0L);
|
||||
documentoScadenza.save();
|
||||
}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
DocumentoScadenza bean = new DocumentoScadenza(apFull);
|
||||
try {
|
||||
DocumentoScadenzaCR CR = new DocumentoScadenzaCR();
|
||||
fillObject(req, CR);
|
||||
sendPdf(res, bean.creaListaScadenzePdf(CR), "Report_Documenti_Scadenza " + DBAdapter.getDayTimeTimestamp());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,18 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.art.AllegatoArticolo;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/_attach/_doc/*"})
|
||||
public class GetDocumentoAttachSvlt extends it.acxent.servlet.GetFileSvlt {
|
||||
private static final long serialVersionUID = -4630036169261100261L;
|
||||
|
||||
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
|
||||
AllegatoArticolo bean = new AllegatoArticolo(getApFull(req));
|
||||
bean.findByPrimaryKey(getRequestLongParameter(req, "id"));
|
||||
String fileName = bean.getNomeFileCompleto();
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag._AnagAdapter;
|
||||
import it.acxent.contab.Documento;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.reg.EcDc;
|
||||
import it.acxent.servlet.AcServlet;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.sql.Time;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class GetFileSvlt extends AcServlet {
|
||||
protected void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||
File theFile = null;
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
if (checkProfile(req, res)) {
|
||||
Documento doc = new Documento(getApFull(req));
|
||||
String id = getIdDocumento(req, res);
|
||||
doc.findByPrimaryKey(Long.valueOf(id));
|
||||
String fileName = getDocBase() + getDocBase() + doc.getPathTmp();
|
||||
String ext = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length());
|
||||
if (ext.toLowerCase().equals("html") || ext.toLowerCase().equals("jsp") || ext.toLowerCase().equals("php")) {
|
||||
String thePage = req.getContextPath() + req.getContextPath();
|
||||
setJspPage(thePage, req);
|
||||
res.sendRedirect(getJspPage(req));
|
||||
} else {
|
||||
fileName = doc.getPathStampaDocumentoFull();
|
||||
ext = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length());
|
||||
theFile = new File(fileName);
|
||||
res.setContentType("application/" + ext);
|
||||
if (theFile.exists()) {
|
||||
if (doc.getDBState() == 1) {
|
||||
doc.setDataDownload(DBAdapter.getToday());
|
||||
doc.setOraDownload(new Time(DBAdapter.getTimestamp().getTime()));
|
||||
doc.setIpDownload(req.getRemoteAddr());
|
||||
doc.setFlgDownload(1L);
|
||||
doc.save();
|
||||
}
|
||||
fis = new FileInputStream(theFile);
|
||||
byte[] temp = new byte[1024];
|
||||
int nByte = 0;
|
||||
ServletOutputStream sos = res.getOutputStream();
|
||||
while ((nByte = fis.read(temp)) != -1)
|
||||
sos.write(temp, 0, nByte);
|
||||
sos.flush();
|
||||
fis.close();
|
||||
sos.close();
|
||||
} else if (useAlwaysSendRedirect()) {
|
||||
String absPage = getFileNotFoundJsp(req, res).startsWith("/") ? (
|
||||
req.getContextPath() + req.getContextPath()) : (
|
||||
req.getContextPath() + "/" + req.getContextPath());
|
||||
res.sendRedirect(absPage);
|
||||
} else {
|
||||
setJspPage(getFileNotFoundJsp(req, res), req);
|
||||
res.sendRedirect(getJspPage(req));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setJspPage(getFileNotFoundJsp(req, res), req);
|
||||
res.sendRedirect(getJspPage(req));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
theFile = null;
|
||||
if (fis != null)
|
||||
fis = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
|
||||
String fileName = getRequestParameter(req, "id");
|
||||
fileName = EcDc.decodeDizionario(fileName, _AnagAdapter.KEY_ENCODE_DIZ);
|
||||
return fileName;
|
||||
}
|
||||
|
||||
protected String getIdDocumento(HttpServletRequest req, HttpServletResponse res) {
|
||||
String id = getRequestParameter(req, "id2");
|
||||
id = EcDc.decodeDizionario(id, _AnagAdapter.KEY_ENCODE_DIZ);
|
||||
return id;
|
||||
}
|
||||
|
||||
protected String getFileNotFoundJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||
return "/fileNotFound.jsp";
|
||||
}
|
||||
|
||||
protected boolean checkProfile(HttpServletRequest req, HttpServletResponse res) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void processRequest(HttpServletRequest request, HttpServletResponse response) {
|
||||
callJsp(request, response);
|
||||
}
|
||||
|
||||
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/GetIva.pdf"})
|
||||
public class GetIvaSvlt extends it.acxent.servlet.GetFileSvlt {
|
||||
protected String getUploadPath() {
|
||||
return getParm("PATH_TMP").getTesto();
|
||||
}
|
||||
|
||||
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
|
||||
return getDocBase() + getDocBase() + getUploadPath();
|
||||
}
|
||||
|
||||
protected boolean checkProfile(HttpServletRequest req, HttpServletResponse res) {
|
||||
return super.checkProfile(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.contab.IncassoPagamento;
|
||||
import it.acxent.contab.IncassoPagamentoCR;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/IncassoPagamento.abl"})
|
||||
public class IncassoPagamentoSvlt 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) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new IncassoPagamento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new IncassoPagamentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {}
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
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>");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.contab.PianoConti;
|
||||
import it.acxent.contab.PianoContiCR;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/PianoConti.abl"})
|
||||
public class PianoContiSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -6143176459987431155L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new PianoConti(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new PianoContiCR(getApFull(req));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.contab.RegistroIva;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.util.AbMessages;
|
||||
import java.io.File;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/RegistroIva.abl"})
|
||||
public class RegistroIvaSvlt extends _ContabSvlt {
|
||||
protected void xchiamaJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||
setJspPageRelative("registroIva.jsp", req);
|
||||
try {
|
||||
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
||||
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
if (getLoginUserGrant(req, getBean(req).getTableBeanName()) > 0L) {
|
||||
if (getAct(req).equals("riva")) {
|
||||
RegistroIva bean = RegistroIva.getInstance(getApFull(req), getTipoRegistro(req));
|
||||
fillObject(req, bean);
|
||||
String nomeRegistro = "riva_" + String.valueOf(bean.getDataDa()) + "_" + String.valueOf(bean.getDataA()) + ".pdf";
|
||||
String fileName = getPathTmpFull() + getPathTmpFull();
|
||||
if (isFileExist(fileName))
|
||||
new File(fileName).delete();
|
||||
bean.setFileName(fileName);
|
||||
bean.creaRegistroIvaPdf();
|
||||
bean.aggiustaRPAIniziale();
|
||||
req.setAttribute("bean", bean);
|
||||
} else if (getAct(req).equals("riep")) {
|
||||
RegistroIva bean = RegistroIva.getInstance(getApFull(req), getTipoRegistro(req));
|
||||
fillObject(req, bean);
|
||||
String nomeRegistro = "riep_" + String.valueOf(bean.getDataDa()) + "_" + String.valueOf(bean.getDataA()) + ".pdf";
|
||||
String fileName = getPathTmpFull() + getPathTmpFull();
|
||||
if (isFileExist(fileName))
|
||||
new File(fileName).delete();
|
||||
bean.setFileName(fileName);
|
||||
bean.creaRiepilogoIvaPdf();
|
||||
bean.aggiustaRPAIniziale();
|
||||
req.setAttribute("bean", bean);
|
||||
} else {
|
||||
sendMessage(req, "?? comando non valido!");
|
||||
}
|
||||
} else {
|
||||
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_R"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
forceJspPageRelative("registroIva.jsp", req);
|
||||
callJsp(req, res);
|
||||
}
|
||||
|
||||
protected void search(HttpServletRequest req, HttpServletResponse res) {
|
||||
RegistroIva bean = RegistroIva.getInstance(getApFull(req), getTipoRegistro(req));
|
||||
if (getLoginUserGrant(req, bean.getTableBeanName()) > 0L) {
|
||||
fillObject(req, bean);
|
||||
bean.aggiustaRPAIniziale();
|
||||
req.setAttribute("bean", bean);
|
||||
} else {
|
||||
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_R"));
|
||||
}
|
||||
forceJspPageRelative("registroIva.jsp", req);
|
||||
callJsp(req, res);
|
||||
}
|
||||
|
||||
protected long getTipoRegistro(HttpServletRequest req) {
|
||||
long tr = getRequestLongParameter(req, "id_registroIva");
|
||||
if (tr == 0L)
|
||||
return 1L;
|
||||
return tr;
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return RegistroIva.getInstance(getApFull(req), getTipoRegistro(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void _stampaRegistroIva(HttpServletRequest req, HttpServletResponse res) {
|
||||
RegistroIva bean = RegistroIva.getInstance(getApFull(req), getTipoRegistro(req));
|
||||
fillObject(req, bean);
|
||||
String nomeRegistro = "riva_" + String.valueOf(bean.getDataDa()) + "_" + String.valueOf(bean.getDataA()) + ".pdf";
|
||||
String fileName = nomeRegistro;
|
||||
bean.setFileName(fileName);
|
||||
bean.creaRegistroIvaPdf();
|
||||
bean.aggiustaRPAIniziale();
|
||||
req.setAttribute("bean", bean);
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Esercizio;
|
||||
import it.acxent.anag.Iva;
|
||||
import it.acxent.anag.MagFisico;
|
||||
import it.acxent.anag.TipoPagamento;
|
||||
import it.acxent.anag.Vettore;
|
||||
import it.acxent.art.Marca;
|
||||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.Movimento;
|
||||
import it.acxent.contab.MovimentoCR;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.RigaDocumentoCR;
|
||||
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.newsletter.CodaMessaggi;
|
||||
import it.acxent.newsletter.TemplateMsg;
|
||||
import it.acxent.util.AbMessages;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contab/RigaDocumento.abl"})
|
||||
public class RigaDocumentoSvlt extends _ContabSvlt {
|
||||
private static final long serialVersionUID = -4988119342406716471L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Documento bean = null;
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_documento");
|
||||
bean = new Documento(apFull);
|
||||
try {
|
||||
bean.findByPrimaryKey(l_id);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
req.setAttribute("id_documento", String.valueOf(bean.getId_documento()));
|
||||
if (rp.getStatus() == true) {
|
||||
if (getAct(req).equals("addRigaArticolo")) {
|
||||
RigaDocumento row = new RigaDocumento(apFull);
|
||||
if (l_id != 0L) {
|
||||
fillObject(req, row);
|
||||
rp = Documento.addRigaDocumento(bean, row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delRigaArticolo")) {
|
||||
RigaDocumento row = new RigaDocumento(apFull);
|
||||
long l_id_rigaDocumento = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
if (l_id_rigaDocumento != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delRigaDocumento(row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modRigaArticolo")) {
|
||||
RigaDocumento row = new RigaDocumento(apFull);
|
||||
if (getRequestLongParameter(req, "id_rigaDocumento") != 0L) {
|
||||
fillObject(req, row);
|
||||
long l_id_rigaDocumento = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
row.findByPrimaryKey(l_id_rigaDocumento);
|
||||
req.setAttribute("bean2", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
} else {
|
||||
req.setAttribute("bean", bean);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected void mail(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||
super.processRequest(req, res);
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
RigaDocumento bean = (RigaDocumento)beanA;
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull).findAll());
|
||||
req.setAttribute("listaVettore", new Vettore(apFull).findAll());
|
||||
req.setAttribute("listaTipoDocumento", new TipoDocumento(apFull).findAll());
|
||||
req.setAttribute("listaIva", new Iva(apFull).findAll());
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CRA, 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 RigaDocumento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new RigaDocumentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getCmd(req).equals("ov")) {
|
||||
RigaDocumentoCR CR = new RigaDocumentoCR(getApFull(req));
|
||||
fillObject(req, CR);
|
||||
CR.setId_tipoDocumento(getId_docOrdine());
|
||||
CR.setFlgTipoRicerca(0L);
|
||||
req.setAttribute("CR", CR);
|
||||
RigaDocumento bean = new RigaDocumento(getApFull(req));
|
||||
req.setAttribute("list", bean.findByCR(CR, 0, 0));
|
||||
setJspPageRelative("ordiniView.jsp", req);
|
||||
callJsp(req, res);
|
||||
} else if (getCmd(req).equals("creaCodaMsgTimCard")) {
|
||||
creaCodaMessaggiTimCard(req, res);
|
||||
}
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
protected ResParm beforeSearch(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (!getAct(req).contains("back")) {
|
||||
long l_id_esercizio = getRequestLongParameter(req, "id_esercizio");
|
||||
if (l_id_esercizio == 0L)
|
||||
req.setAttribute("id_esercizio", String.valueOf(DBAdapter.getCurrentYear()));
|
||||
}
|
||||
req.setAttribute("flgRicercaMag", Long.valueOf(RigaDocumentoCR.RICERCA_SOLO_MAGAZZINO));
|
||||
return super.beforeSearch(req, res);
|
||||
}
|
||||
|
||||
protected void creaCodaMessaggiTimCard(HttpServletRequest req, HttpServletResponse res) {
|
||||
RigaDocumento bean = new RigaDocumento(getApFull(req));
|
||||
RigaDocumentoCR CR = new RigaDocumentoCR(getApFull(req));
|
||||
fillObject(req, CR);
|
||||
CR.setFlgTipoRicerca(1L);
|
||||
Vectumerator vec = bean.findByCR(CR, 0, 0);
|
||||
long l_id_templateMsg = getRequestLongParameter(req, "id_templateMsg");
|
||||
TemplateMsg ts = new TemplateMsg(getApFull(req));
|
||||
ts.findByPrimaryKey(l_id_templateMsg);
|
||||
String campagna = ts.getDescrizione() + " " + ts.getDescrizione();
|
||||
while (vec.hasMoreElements()) {
|
||||
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||
if (ts.getFlgTipo() == 1L)
|
||||
continue;
|
||||
if (row.getArticolo().getId_tipo() == 271L) {
|
||||
CodaMessaggi cm = new CodaMessaggi(getApFull(req));
|
||||
cm.setFlgTipo(ts.getFlgTipo());
|
||||
cm.setCampagna(campagna);
|
||||
cm.setCellulare(row.getSeriale().trim());
|
||||
cm.setTestoMessaggio(ts.getTestoMessaggio());
|
||||
cm.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void _statoRigaPre(HttpServletRequest req, HttpServletResponse res) {
|
||||
long l_id_rigaDocumento = getRequestLongParameter(req, "id_rigaDocumento");
|
||||
RigaDocumento bean = new RigaDocumento(getApFull(req));
|
||||
bean.findByPrimaryKey(l_id_rigaDocumento);
|
||||
if (getAct(req).equals("reset")) {
|
||||
bean.setStatoPrenotazione(-1L);
|
||||
bean.superSave();
|
||||
}
|
||||
long stato = bean.getStatoPrenotazione();
|
||||
req.setAttribute("stato", String.valueOf(stato));
|
||||
req.setAttribute("statoMsg", bean.getStatoRiga(stato));
|
||||
req.setAttribute("id", String.valueOf(l_id_rigaDocumento));
|
||||
sendCmdJspFetchPageResponse(req, res);
|
||||
}
|
||||
|
||||
protected int getPageRow(HttpServletRequest req) {
|
||||
return 55;
|
||||
}
|
||||
|
||||
public void _creaReportCsv(HttpServletRequest req, HttpServletResponse res) {
|
||||
RigaDocumentoCR CR = (RigaDocumentoCR)req.getSession().getAttribute(
|
||||
getATTR_CRBEAN(req));
|
||||
CR.setFlgTipoReport(getRequestLongParameter(req, "flgTipoReport"));
|
||||
CR.setId_users(getLoginUserId(req).longValue());
|
||||
RigaDocumento bean = new RigaDocumento(getApFull(req));
|
||||
bean.creaFileCvsMov(CR);
|
||||
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File report in formato cvs (Excel)</a>");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.contab.TipoAllegatoDocumento;
|
||||
import it.acxent.contab.TipoAllegatoDocumentoCR;
|
||||
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.AbMessages;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/TipoAllegatoDocumento.abl"})
|
||||
public class TipoAllegatoDocumentoSvlt extends AblServletSvlt {
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipoAllegatoDocumento bean = null;
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_tipoDocumento");
|
||||
bean = new TipoAllegatoDocumento(apFull);
|
||||
try {
|
||||
bean.findByPrimaryKey(l_id);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
l_id = bean.getId_tipoAllegatoDocumento();
|
||||
req.setAttribute("id_tipoAllegatoDocumento", String.valueOf(l_id));
|
||||
req.setAttribute("bean", bean);
|
||||
if (rp.getStatus() != true) {
|
||||
req.setAttribute("bean", bean);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
forceMessage(req,
|
||||
AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new TipoAllegatoDocumento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipoAllegatoDocumentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Contatore;
|
||||
import it.acxent.common.TtFont;
|
||||
import it.acxent.contab.CausaleMagazzino;
|
||||
import it.acxent.contab.DocPrel;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.contab.TipoDocumentoCR;
|
||||
import it.acxent.contab.TipoStampaDocumento;
|
||||
import it.acxent.contab.TipologiaDocumento;
|
||||
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.tex.anag.Lavorazione;
|
||||
import it.acxent.tex.anag.TipoDocumentoLavorazione;
|
||||
import it.acxent.util.AbMessages;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/TipoDocumento.abl"})
|
||||
public class TipoDocumentoSvlt extends AblServletSvlt {
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipoDocumento bean = (TipoDocumento)beanA;
|
||||
req.setAttribute("listaTipologiaDocumento", new TipologiaDocumento(apFull).findAll());
|
||||
req.setAttribute("listaTipoStampaDocumento", new TipoStampaDocumento(apFull)
|
||||
.findByTipologiaDocumento(bean.getId_tipologiaDocumento()));
|
||||
req.setAttribute("listaCausaliMagazzino", new CausaleMagazzino(apFull).findAll());
|
||||
req.setAttribute("listaContatori", new Contatore(apFull).findAll());
|
||||
if (bean.getFlgTipologia() != 3L)
|
||||
req.setAttribute("listaDocumentiPadre", new TipoDocumento(apFull).findAll());
|
||||
if (bean.getFlgTipologia() == 4L) {
|
||||
TipoDocumentoCR CR = new TipoDocumentoCR();
|
||||
CR.setFlgTipologie("0,1,2,4,5,100,");
|
||||
req.setAttribute("listaDocumentiFiglio", new TipoDocumento(apFull).findByCR(CR, 0, 0));
|
||||
} else {
|
||||
req.setAttribute("listaDocumentiFiglio", new TipoDocumento(apFull).findAll());
|
||||
}
|
||||
req.setAttribute("listaDocPrel", bean.findDocPrel(0L, 0, 0));
|
||||
req.setAttribute("listaDocGen", bean.findDocGen(0L, 0L, 0, 0));
|
||||
req.setAttribute("listaTtf", TtFont.getInstance(apFull).findAll());
|
||||
req.setAttribute("listaLavorazione", new Lavorazione(apFull).findAll());
|
||||
req.setAttribute("listaDocumentoLavorazione", new TipoDocumentoLavorazione(apFull).findByTipoDocumento(bean.getId_tipoDocumento()));
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipologiaDocumento", new TipologiaDocumento(apFull).findAll());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new TipoDocumento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipoDocumentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipologiaDocumento", new TipologiaDocumento(apFull).findAll());
|
||||
req.setAttribute("listaCausaliMagazzino", new CausaleMagazzino(apFull).findAll());
|
||||
req.setAttribute("listaContatori", new Contatore(apFull).findAll());
|
||||
req.setAttribute("listaTtf", TtFont.getInstance(apFull).findAll());
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getCmd(req).equals("list")) {
|
||||
TipoDocumento bean = new TipoDocumento(getApFull(req));
|
||||
TipoDocumentoCR CR = new TipoDocumentoCR(getApFull(req));
|
||||
CR.setFlgNascondiNuovo(0L);
|
||||
req.setAttribute("list", bean.findByCR(CR, 0, 0));
|
||||
setJspPageRelative("tipoDocumentoL.jsp", req);
|
||||
callJsp(req, res);
|
||||
} else {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipoDocumento bean = null;
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_tipoDocumento");
|
||||
bean = new TipoDocumento(apFull);
|
||||
try {
|
||||
bean.findByPrimaryKey(l_id);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
l_id = bean.getId_tipoDocumento();
|
||||
req.setAttribute("id_tipoDocumento", String.valueOf(l_id));
|
||||
req.setAttribute("bean", bean);
|
||||
if (rp.getStatus() == true) {
|
||||
if (getAct(req).equals("addDocPrel")) {
|
||||
DocPrel row = new DocPrel(apFull);
|
||||
if (l_id != 0L) {
|
||||
fillObject(req, row);
|
||||
row.setFlgTipoGenerazione(getRequestLongParameter(req, "flgTipoGenerazionePadre"));
|
||||
rp = bean.addDocPrel(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delDocPrel")) {
|
||||
DocPrel row = new DocPrel(apFull);
|
||||
long l_id_docPrel = getRequestLongParameter(req, "id_docPrel");
|
||||
if (l_id_docPrel != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delDocPrel(row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addDocFiglio")) {
|
||||
DocPrel row = new DocPrel(apFull);
|
||||
if (l_id != 0L) {
|
||||
fillObject(req, row);
|
||||
row.setId_tipoDocumentoPrel(row.getId_tipoDocumento());
|
||||
row.setId_tipoDocumento(getRequestLongParameter(req, "id_tipoDocumentoFiglio"));
|
||||
rp = bean.addDocPrel(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delDocPrel")) {
|
||||
DocPrel row = new DocPrel(apFull);
|
||||
long l_id_docPrel = getRequestLongParameter(req, "id_docPrel");
|
||||
if (l_id_docPrel != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delDocPrel(row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
} else {
|
||||
req.setAttribute("bean", bean);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
public void _addDocLavorazione(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
ResParm rp = new ResParm(true, "");
|
||||
if (getLoginUserGrant(req, getBean(req).getTableBeanName()) < 2L) {
|
||||
sendGrantMessage(req, "Permessi di scrittura mancanti");
|
||||
showBean(req, res);
|
||||
} else {
|
||||
try {
|
||||
TipoDocumentoLavorazione row = new TipoDocumentoLavorazione(apFull);
|
||||
fillObject(req, row);
|
||||
rp = row.save();
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void _delDocLavorazione(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipoDocumentoLavorazione bean = new TipoDocumentoLavorazione(apFull);
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_tipoDocumentoLavorazione");
|
||||
bean.findByPrimaryKey(l_id);
|
||||
if (getLoginUserGrant(req, getBean(req).getTableBeanName()) < 2L) {
|
||||
sendGrantMessage(req, "Permessi di scrittura mancanti");
|
||||
showBean(req, res);
|
||||
} else {
|
||||
try {
|
||||
rp = bean.delete();
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Lavorazione Cancellata");
|
||||
} else {
|
||||
sendMessage(req, "Errore! " + rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Contatore;
|
||||
import it.acxent.common.TtFont;
|
||||
import it.acxent.contab.CausaleMagazzino;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.contab.TipoDocumentoCR;
|
||||
import it.acxent.contab.TipoStampaDocumento;
|
||||
import it.acxent.contab.TipoStampaDocumentoCR;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/TipoStampaDocumento.abl"})
|
||||
public class TipoStampaDocumentoSvlt extends AblServletSvlt {
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new TipoStampaDocumento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipoStampaDocumentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaCausaliMagazzino", new CausaleMagazzino(apFull)
|
||||
.findAll());
|
||||
req.setAttribute("listaContatori", new Contatore(apFull).findAll());
|
||||
req.setAttribute("listaTtf", TtFont.getInstance(apFull).findAll());
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getCmd(req).equals("list")) {
|
||||
TipoDocumento bean = new TipoDocumento(getApFull(req));
|
||||
TipoDocumentoCR CR = new TipoDocumentoCR(getApFull(req));
|
||||
CR.setFlgMenu(0L);
|
||||
req.setAttribute("list", bean.findByCR(CR, 0, 0));
|
||||
setJspPageRelative("tipoDocumentoL.jsp", req);
|
||||
callJsp(req, res);
|
||||
} else {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.anag.Contatore;
|
||||
import it.acxent.common.TtFont;
|
||||
import it.acxent.contab.CausaleMagazzino;
|
||||
import it.acxent.contab.TipoDocumento;
|
||||
import it.acxent.contab.TipoDocumentoCR;
|
||||
import it.acxent.contab.TipoStampaDocumento;
|
||||
import it.acxent.contab.TipologiaDocumento;
|
||||
import it.acxent.contab.TipologiaDocumentoCR;
|
||||
import it.acxent.contab.TipologiaDocumentoTipoStampa;
|
||||
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 javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/contabConfig/TipologiaDocumento.abl"})
|
||||
public class TipologiaDocumentoSvlt extends AblServletSvlt {
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipologiaDocumento bean = (TipologiaDocumento)beanA;
|
||||
req.setAttribute("listaTipoStampaDocumento", new TipoStampaDocumento(apFull).findAll());
|
||||
req.setAttribute("listaStampeByTipologiaDocumento", bean.findByTipologiaDocumento());
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new TipologiaDocumento(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipologiaDocumentoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaCausaliMagazzino", new CausaleMagazzino(apFull).findAll());
|
||||
req.setAttribute("listaContatori", new Contatore(apFull).findAll());
|
||||
req.setAttribute("listaTtf", TtFont.getInstance(apFull).findAll());
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
if (getCmd(req).equals("list")) {
|
||||
TipoDocumento bean = new TipoDocumento(getApFull(req));
|
||||
TipoDocumentoCR CR = new TipoDocumentoCR(getApFull(req));
|
||||
CR.setFlgMenu(0L);
|
||||
req.setAttribute("list", bean.findByCR(CR, 0, 0));
|
||||
setJspPageRelative("tipoDocumentoL.jsp", req);
|
||||
callJsp(req, res);
|
||||
} else {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void _initTipologie(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipologiaDocumento bean = new TipologiaDocumento(apFull);
|
||||
ResParm rp = bean.initTipologie();
|
||||
sendMessage(req, rp.getMsg());
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
public void _delTipoStampa(HttpServletRequest req, HttpServletResponse res) {
|
||||
ResParm rp;
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipologiaDocumentoTipoStampa bean2 = new TipologiaDocumentoTipoStampa(apFull);
|
||||
fillObject(req, bean2);
|
||||
if (bean2.getId_tipologiaDocumentoTipoStampa() > 0L) {
|
||||
bean2.findByPrimaryKey(bean2.getId_tipologiaDocumentoTipoStampa());
|
||||
rp = bean2.delete();
|
||||
} else {
|
||||
rp = new ResParm(false, "Errore! Impossibile cancellare tipo stampa ");
|
||||
}
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _addTipoStampa(HttpServletRequest req, HttpServletResponse res) {
|
||||
ResParm rp;
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
TipologiaDocumentoTipoStampa bean2 = new TipologiaDocumentoTipoStampa(apFull);
|
||||
fillObject(req, bean2);
|
||||
if (bean2.getId_tipologiaDocumentoTipoStampa() > 0L)
|
||||
bean2.findByPrimaryKey(bean2.getId_tipologiaDocumentoTipoStampa());
|
||||
if (bean2.getId_tipoStampaDocumento() > 0L) {
|
||||
rp = bean2.save();
|
||||
} else {
|
||||
rp = new ResParm(false, "Errore! Tipo Stampa non selezionata correttamente");
|
||||
}
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package it.acxent.contab.servlet;
|
||||
|
||||
import it.acxent.common.Users;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.servlet.AblServletSvlt;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public abstract class _ContabSvlt extends AblServletSvlt {
|
||||
protected static ApplParmFull ap2;
|
||||
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
if (getLoginUser(req) == null) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
if (getLoginUser(req).getFlgValido().equals("N")) {
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
if (getLoginUser(req).getId_userProfile() > 0L)
|
||||
return true;
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected long getLoginUserGrant(HttpServletRequest req, String l_permesso) {
|
||||
if (isSecureServlet(req))
|
||||
try {
|
||||
return getLoginUser(req).getGrantType(l_permesso);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return 0L;
|
||||
}
|
||||
return 4L;
|
||||
}
|
||||
|
||||
protected String getAct3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "act3");
|
||||
}
|
||||
|
||||
protected String getCmd3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "cmd3");
|
||||
}
|
||||
|
||||
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
return super.getLoginPage(req, res);
|
||||
}
|
||||
|
||||
protected Users getUser(HttpServletRequest req) {
|
||||
return new it.acxent.anag.Users(getApFull(req));
|
||||
}
|
||||
|
||||
protected boolean useAlwaysSendRedirect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ApplParmFull getAp2() {
|
||||
if (ap2 == null) {
|
||||
ApplParmFull apFull = getApFull();
|
||||
ApplParm apx = new ApplParm(apFull.getParm("DBDRIVER2").getNumeroInt(), apFull.getParm("DBNAME2").getTesto(),
|
||||
apFull.getParm("USER2").getTesto(), apFull.getParm("PASSWORD2").getTesto());
|
||||
ap2 = new ApplParmFull(apx);
|
||||
}
|
||||
return ap2;
|
||||
}
|
||||
|
||||
protected long getId_docCassa() {
|
||||
return getParm("ID_DOC_CASSA").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docOrdine() {
|
||||
return getParm("ID_DOC_ORDINE").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docPrenotazione() {
|
||||
return getParm("ID_DOC_PRENOTAZIONE").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docRiparazione() {
|
||||
return getParm("ID_DOC_RIPARAZIONE").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docOrdineWww() {
|
||||
return getParm("ID_DOC_ORDINE_WWW").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docRicevuta() {
|
||||
return getParm("ID_DOC_RICEVUTA").getNumeroLong();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue