diff --git a/Jenkinsfile-Adm b/Jenkinsfile-Adm
new file mode 100644
index 000000000..e1b7bbe4c
--- /dev/null
+++ b/Jenkinsfile-Adm
@@ -0,0 +1,299 @@
+def SETTINGS = "/var/jenkins_home/tools/apache-maven-3.6.0/settings.xml"
+def ENCODE = "ISO-8859-1"
+def MODULO = "adm"
+def TAG_SELECTOR = "UNINTIALIZED"
+
+//======================================================================================================
+def build(SETTINGS, ENCODE, jdk) {
+ if (jdk == 'JDK8.202') {
+ withEnv(["JAVA_HOME=/var/jenkins_home/tools/hudson.model.JDK/JDK8.202"]) {
+ sh "mvn -B -f pom.xml -s ${SETTINGS} clean deploy -DskipTests -Dfile.encoding=${ENCODE} -Dproject.build.sourceEncoding=${ENCODE}"
+ }
+ } else {
+ sh "mvn -B -f pom.xml -s ${SETTINGS} clean deploy -DskipTests -Dfile.encoding=${ENCODE} -Dproject.build.sourceEncoding=${ENCODE}"
+ }
+}
+
+//======================================================================================================
+def deployNexus(projeto, SETTINGS, ENCODE) {
+ echo "Realizando deploy para o nexus: ${projeto}"
+ sh "mvn -B -s ${SETTINGS} deploy -DskipTests --file=pom.xml -Dfile.encoding=${ENCODE}"
+}
+
+//======================================================================================================
+def geraVersao() {
+ TAG_SELECTOR = readMavenPom file: 'pom.xml'
+ VERSAO = TAG_SELECTOR.getVersion()
+ VERSAO_TEXTO = "Versao: ${VERSAO}@${env.BUILD_TIMESTAMP_VERSAO}"
+
+ currentBuild.displayName = "${VERSAO}"
+ currentBuild.description = "
"+
+ ""+
+ "Download Link ventaboletosadm-${VERSAO}.war"
+
+ println(VERSAO_TEXTO)
+ writeFile file: "src/java/versionADM.info", text: VERSAO_TEXTO
+}
+
+//======================================================================================================
+def gitCheckout(branch_name, url_name) {
+ if (branch_name == null || branch_name.isEmpty()) {
+ branch_name = "master"
+ }
+
+ SCM = checkout([
+ $class: 'GitSCM',
+ branches: [[name: "*/${branch_name}"]],
+ doGenerateSubmoduleConfigurations: false,
+ extensions: [[$class: 'AuthorInChangelog']],
+ submoduleCfg: [],
+ userRemoteConfigs: [[credentialsId: 'admin-gitea', url: url_name]]
+ ])
+}
+
+//======================================================================================================
+@NonCPS
+def verificaTicket(mensagem) {
+ def M = mensagem =~ /#\D{2}-\d{4}/
+ if(M){
+ return M[0].substring(1)
+ }
+}
+
+//======================================================================================================
+@NonCPS
+String getChangedFilesList() {
+ changedFiles = ""
+ for (changeLogSet in currentBuild.changeSets) {
+ for (entry in changeLogSet.getItems()) {
+ for (file in entry.getAffectedFiles()) {
+ changedFiles += "${file.editType.name} - ${file.path}\n"
+ }
+ }
+ }
+ return changedFiles
+}
+
+//======================================================================================================
+@NonCPS
+String getChangedLog() {
+ changedLog = ""
+ for (changeLogSet in currentBuild.changeSets) {
+ for (entries in changeLogSet.getItems()) {
+ for (entry in entries) {
+ changedLog += "*Commit: ${entry.commitId}\n"
+ changedLog += "Message: ${entry.msg}\n"
+ for (file in entry.getAffectedFiles()) {
+ changedLog += "${file.editType.name} - ${file.path}\n"
+ }
+ changedLog += "Author: ${entry.author} \n"
+ }
+ }
+ }
+ return changedLog
+}
+
+//======================================================================================================
+def archiveFile(arquivo) {
+ try {
+ archiveArtifacts artifacts: arquivo
+ } catch (err) {
+ echo err.getMessage()
+ }
+}
+
+//======================================================================================================
+pipeline {
+ agent any
+ tools {
+ maven 'mvn_3.6.0'
+ jdk 'JDK8.202'
+ }
+ stages {
+ stage('Info') {
+ steps {
+ sh '''
+ echo "PATH = ${PATH}"
+ echo "M2_HOME = ${M2_HOME}"
+ '''
+ echo "VERSÃO: @${env.BUILD_TIMESTAMP_VERSAO}#${env.BUILD_NUMBER}"
+ echo "parametro ${GIT} "
+ }
+ }
+
+ stage('Checkout Git') {
+ steps {
+ script {
+ try {
+ gitCheckout('master', 'http://18.235.188.113:3000/rjconsultores/ventaBoletosAdm.git')
+ } catch (err) {
+ echo err.getMessage()
+ }
+ }
+ }
+ }
+
+ stage('Deps') {
+ steps {
+ script {
+ if(! getChangedFilesList()) {
+ echo 'Não foram encontradas mudanças desde o ultimo build'
+ currentBuild.result = 'ABORTED'
+ return
+ }
+
+ Auditador = build(job: "Adm/Lib-Auditador-Build", parameters: [
+ [$class: 'StringParameterValue', name: 'GIT', value: "master"]], propagate: false).result
+
+ if(Auditador == 'FAILURE') {
+ currentBuild.result = 'FAILURE'
+ error('Lib-Auditador-Build FAILURE')
+ }
+
+ if(Auditador == 'UNSTABLE') {
+ currentBuild.result = 'UNSTABLE'
+ }
+
+ Integracao = build(job: "Adm/Lib-IntegracaoReceitaDespesa-Build", parameters: [
+ [$class: 'StringParameterValue', name: 'GIT', value: "master"]], propagate: false).result
+
+ if(Integracao == 'FAILURE') {
+ currentBuild.result = 'FAILURE'
+ error('Lib-IntegracaoReceitaDespesa-Build FAILURE')
+ }
+
+ if(Integracao == 'UNSTABLE') {
+ currentBuild.result = 'UNSTABLE'
+ }
+
+ BoletoCnab = build(job: "Adm/Lib-GeneradorBoletosCNAB-Build", parameters: [
+ [$class: 'StringParameterValue', name: 'GIT', value: "master"]], propagate: false).result
+
+ if(BoletoCnab == 'FAILURE') {
+ currentBuild.result = 'FAILURE'
+ error('Lib-GeneradorBoletosCNAB-Build FAILURE')
+ }
+
+ if(BoletoCnab == 'UNSTABLE') {
+ currentBuild.result = 'UNSTABLE'
+ }
+
+ ModelWeb = build(job: "Adm/Lib-ModelWeb-Build", parameters: [
+ [$class: 'StringParameterValue', name: 'GIT', value: "master"]], propagate: false).result
+
+ if(ModelWeb == 'FAILURE') {
+ currentBuild.result = 'FAILURE'
+ error('ModelWeb FAILURE')
+ }
+
+ if(ModelWeb == 'UNSTABLE') {
+ currentBuild.result = 'UNSTABLE'
+ }
+
+ Flyway = build(job: "Adm/Lib-Flyway-Build", parameters: [
+ [$class: 'StringParameterValue', name: 'GIT', value: "master"]], propagate: false).result
+
+ if(Flyway == 'FAILURE') {
+ currentBuild.result = 'FAILURE'
+ error('Flyway FAILURE')
+ }
+
+ if(Flyway == 'UNSTABLE') {
+ currentBuild.result = 'UNSTABLE'
+ }
+ }
+ }
+ }
+
+ stage('Build') {
+ steps {
+ script {
+ geraVersao()
+ build(SETTINGS, ENCODE, 'JDK8.202')
+ }
+ }
+ }
+ stage('Test') {
+ steps {
+ echo "Em construção"
+ }
+ }
+ }
+
+ post {
+ success {
+ script {
+ if( getChangedFilesList()) {
+ //gravando e publicando as mudanças
+ def publisher = LastChanges.getLastChangesPublisher "PREVIOUS_REVISION", "LINE", "LINE", true, true, "", "", "", "", ""
+ publisher.publishLastChanges()
+ def changes = publisher.getLastChanges()
+
+ def textoJira = "Build SUCCESS: Versao ${VERSAO_TEXTO}\n" +
+ "(acesse http://18.235.188.113:1313/job/Adm/job/Adm-Project-Build/${env.BUILD_NUMBER}/)\n\n" +
+ "Download de versão ${VERSAO}\n" +
+ "(http://52.5.53.15:8081/nexus/content/repositories/releases/br/com/rjconsultores/ventaboletosadm/${VERSAO}/ventaboletosadm-${VERSAO}.war)\n\n" +
+ "Alterações do projeto VentaBoletosAdm\n" +
+ "${getChangedFilesList()}\n\n"
+
+ def textoTag = "TAG: **${VERSAO_TEXTO}** \n"
+
+ def changedLog = getChangedLog()
+ def TICKET = verificaTicket(changedLog)
+
+ for (commit in changes.getCommits()) {
+ def commitInfo = commit.getCommitInfo()
+ textoJira += "${commitInfo}\n\n"
+
+ textoTag += "- Commit: ${commitInfo.commitId} \n"+
+ "- Autor: ${commitInfo.committerEmail} \n"+
+ "- Data: ${commitInfo.commitDate} \n"+
+ "- Message: ${commitInfo.commitMessage} \n\n"
+ }
+
+
+ //geração automatica de versão
+ try {
+ def giteaversion = httpRequest contentType: 'APPLICATION_JSON', httpMode: 'POST', requestBody: '''{
+ "body": "'''+textoTag+'''",
+ "draft": false,
+ "name": "'''+VERSAO+'''",
+ "prerelease": false,
+ "tag_name": "'''+VERSAO+'''",
+ "target_commitish": "master"
+ }''', responseHandle: 'NONE', url: 'http://18.235.188.113:3000/api/v1/repos/adm/VentaBoletosAdm/releases?access_token=6231bd083b69e47f5ad34329891ed6b3128a154e', wrapAsMultipart: false
+ } catch (err) {
+ echo err.getMessage()
+ }
+
+
+ if( TICKET ){
+ //integrando ao jira
+ jiraComment body: textoJira, issueKey: TICKET
+
+
+ //resolvendo o card
+ if( textoJira.contains('fixes bug') ){
+ step([$class: 'JiraIssueUpdateBuilder', comment: '', jqlSearch: "issue = ${TICKET}", workflowActionName: 'RESOLVIDO'])
+ }
+ } else {
+ echo 'Ticket não encontrado'
+ }
+
+ archiveFile("target/ventaboletosadm.war")
+ cleanWs(
+ cleanWhenAborted:true,
+ cleanWhenFailure: false,
+ cleanWhenNotBuilt: false,
+ cleanWhenSuccess: true,
+ cleanWhenUnstable: true,
+ deleteDirs: true,
+ notFailBuild: true,
+ disableDeferredWipeout: true,
+ patterns: [[ pattern: '.war' , type: 'EXCLUDE' ]]
+ )
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioLinhasHorarioSimplificado.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioLinhasHorarioSimplificado.java
index b9d7a7d5b..f01805ace 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioLinhasHorarioSimplificado.java
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioLinhasHorarioSimplificado.java
@@ -56,7 +56,7 @@ public class RelatorioLinhasHorarioSimplificado extends Relatorio {
String corridaIds = "", rutaIds = "";
GrupoRuta grupoRuta = (GrupoRuta) parametros.get("GRUPORUTA");
Integer tipoServico = (Integer) parametros.get("TIPOSERVICIO_ID");
- Boolean isPorData = parametros.get("ISPORDATA") == null ? false : true;
+ Boolean isPorData = parametros.get("ISPORDATA") == null ? false : (Boolean) parametros.get("ISPORDATA");
if (lsNumServico != null && !lsNumServico.isEmpty()) {
corridaIds = retornaFiltro(lsNumServico, null);
}
diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
index 153ad3d82..1e03a85bf 100644
--- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
+++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
@@ -580,7 +580,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Datebox dataFimHistorico;
private Boolean utilizaCobrancaAdicional = false;
private boolean isPerfilFuncionBloqueiaDesbloqueiaPontoVenda;
- private boolean isPermissaoMotivoFormaPago;
+ private boolean isPermissaoMotivoFormaPago;
+
+ private Checkbox checkIndBloqueioDescontoAPI;
+ private Checkbox checkIndBloqueioDescontoWEB;
@Autowired
private CobrancaAdcPuntoVentaService cobrancaAdcService;
@@ -1203,7 +1206,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
checkIndVendeFlexBus.setDisabled(true);
checkIndQrcodeTaxaEmbarqueRodTTL.setDisabled(true);
dateAbertura.setDisabled(true);
- txtTaxaConvenienciaPorc.setDisabled(true);
+ txtTaxaConvenienciaPorc.setDisabled(true);
+ checkIndBloqueioDescontoAPI.setDisabled(true);
+ checkIndBloqueioDescontoWEB.setDisabled(true);
}
}
@@ -2412,7 +2417,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
private void validarDiversos() {
- if (!txtResponEnergia.getValue().isEmpty()
+ if (puntoVenta.getDiversosId() != null ||
+ !txtResponEnergia.getValue().isEmpty()
|| cmbPosicao.getSelectedItem() != null
|| checkInformatizada.isChecked()
|| checkBilheteInfo.isChecked()
diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioLinhasHorarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioLinhasHorarioController.java
index 24a9d6388..cb237ff43 100644
--- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioLinhasHorarioController.java
+++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioLinhasHorarioController.java
@@ -122,7 +122,7 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
parametros.put("DATA_FINAL", DateUtil.fimFecha(this.datFinal.getValue()));
parametros.put("ISSIMPLIFICADO", chkSimplificado.isChecked());
- parametros.put("ISSIMPLIFICADO", chkSimplificadoPorData.isChecked());
+ parametros.put("ISPORDATA", chkSimplificadoPorData.isChecked());
parametros.put("USUARIO_ID", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("NOME_USUARIO", UsuarioLogado.getUsuarioLogado().getNombusuario().toString());
@@ -162,7 +162,7 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
parametros.put("lsNumServico", lsNumServico);
Relatorio relatorio = null;
String tituloRelatorio = "";
- if(!chkSimplificado.isChecked()) {
+ if(!chkSimplificado.isChecked() && !chkSimplificadoPorData.isChecked()) {
relatorio = new RelatorioLinhasHorario(parametros, dataSourceRead.getConnection());
tituloRelatorio = "relatorioLinhasHorarioController.window.title";
}else {
@@ -267,10 +267,10 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
public void onEvent(Event event) {
boolean isChecked = chkSimplificado.isChecked();
- if (!isChecked) {
+ if (isChecked) {
chkSimplificadoPorData.setChecked(false);
chkSimplificadoPorData.setDisabled(true);
- } else {
+ } else if (!isChecked) {
chkSimplificadoPorData.setDisabled(false);
}
}
@@ -280,8 +280,11 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
public void onEvent(Event event) {
boolean isChecked = chkSimplificadoPorData.isChecked();
- if (isChecked && !chkSimplificado.isChecked()) {
- chkSimplificado.setChecked(true);
+ if (isChecked ) {
+ chkSimplificado.setChecked(false);
+ chkSimplificado.setDisabled(true);
+ } else if (!isChecked) {
+ chkSimplificado.setDisabled(false);
}
}
});
diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaCredito.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaCredito.java
index adb9d3d6a..9a09dcd30 100644
--- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaCredito.java
+++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaCredito.java
@@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.web.utilerias.render;
import java.math.BigDecimal;
+import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
@@ -45,6 +46,24 @@ public class RenderTarjetaCredito implements ListitemRenderer {
lc = new Listcell("");
}
lc.setParent(lstm);
+
+ BigDecimal tarifaMinima = tarjetaCredito.getTarifaMinima();
+ if (tarifaMinima != null) {
+ lc = new Listcell(tarifaMinima.setScale(2).toString());
+ } else {
+ lc = new Listcell("");
+ }
+ lc.setParent(lstm);
+
+ lc = new Listcell();
+
+ boolean indAplicaVenda = tarjetaCredito.getIndAplicaVenda() != null ? tarjetaCredito.getIndAplicaVenda() : false;
+ Checkbox chkAplicaVenda = new Checkbox();
+ chkAplicaVenda.setDisabled(Boolean.TRUE);
+ chkAplicaVenda.setChecked(indAplicaVenda);
+
+ lc.appendChild(chkAplicaVenda);
+ lc.setParent(lstm);
lstm.setAttribute("data", tarjetaCredito);
}
diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label
index bec334d12..0f4e22eb9 100644
--- a/web/WEB-INF/i3-label_es_MX.label
+++ b/web/WEB-INF/i3-label_es_MX.label
@@ -1937,6 +1937,8 @@ editarPuntoVentaController.lbCheckAdiantamentoAG.value = Adelantes
editarPuntoVentaController.lbUTRRepasse.value = Repassa UTR
editarPuntoVentaController.lbQrcodeTaxaEmbarqueRodTTL.label= Imprimir na venda o QR Code Taxa Embarque Rodoviára TTL
+editarPuntoVentaController.checkIndBloqueioDescontoAPI.label = Bloquear descuento a través de api
+editarPuntoVentaController.checkIndBloqueioDescontoWEB.label = Bloquear descuento en internet
# Fechamento Conta Contábil Agencia
editarPuntoVentaController.puntoventa.label = Agencia
diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label
index 84dc8b2a1..92e718fec 100644
--- a/web/WEB-INF/i3-label_pt_BR.label
+++ b/web/WEB-INF/i3-label_pt_BR.label
@@ -2221,6 +2221,9 @@ editarPuntoVentaController.qrcodeCatracaRodEAN13.label = Imprimir na venda o QR
editarPuntoVentaController.checkBloqDevolveReativaOutroPto.label = Bloqueia Devolver e Reativar em outro Ponto de Venda
editarPuntoVentaController.lbQrcodeTaxaEmbarqueRodTTL.label= Imprimir na venda o QR Code Taxa Embarque Rodoviára TTL
+editarPuntoVentaController.checkIndBloqueioDescontoAPI.label = Bloquear desconto via API
+editarPuntoVentaController.checkIndBloqueioDescontoWEB.label = Bloquear desconto via Internet
+
# Editar comissão ponto de venda
editarPuntoVentaComissaoController.window.title = Comissão Empresa/Ponto de Venda - {0}
editarPuntoVentaComissaoController.MSG.suscribirOK = Comissão da Empresa/Ponto de Venda registrada com sucesso.
diff --git a/web/gui/catalogos/editarPuntoVenta.zul b/web/gui/catalogos/editarPuntoVenta.zul
index 7e9adce76..1335fd640 100644
--- a/web/gui/catalogos/editarPuntoVenta.zul
+++ b/web/gui/catalogos/editarPuntoVenta.zul
@@ -486,6 +486,18 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/web/gui/configuraciones_comerciales/busquedaTarjetaCredito.zul b/web/gui/configuraciones_comerciales/busquedaTarjetaCredito.zul
index 24e250538..adbf43ab3 100644
--- a/web/gui/configuraciones_comerciales/busquedaTarjetaCredito.zul
+++ b/web/gui/configuraciones_comerciales/busquedaTarjetaCredito.zul
@@ -67,6 +67,12 @@
+
+