Novo git da alteração
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>compras_digital</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>com.totvs.tds.ecm.designer.nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="src" path=""/>
|
||||
<classpathentry kind="con" path="com.totvs.tds.ecm.designer.libjs.ByYouECMBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,13 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/application.info=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/edit.ftl=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/view.ftl=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/widget_solicitacoes.properties=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/widget_solicitacoes_en_US.properties=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/widget_solicitacoes_es.properties=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/resources/widget_solicitacoes_pt_BR.properties=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/webapp/WEB-INF/jboss-web.xml=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/webapp/WEB-INF/web.xml=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/webapp/resources/css/widget_solicitacoes.css=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/webapp/resources/images/icon.png=utf8
|
||||
encoding//wcm/widget/widget_solicitacoes/src/main/webapp/resources/js/widget_solicitacoes.js=utf8
|
||||
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="compras_digital">
|
||||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
||||
<property name="context-root" value="compras_digital"/>
|
||||
<property name="java-output-path" value="/compras_digital/build/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
||||
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
function defineStructure() {
|
||||
|
||||
}
|
||||
function onSync(lastSyncDate) {
|
||||
|
||||
}
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
dataset.addColumn("nomeOcorrencia");
|
||||
|
||||
// Adicione dados para o dataset, exemplo:
|
||||
dataset.addRow(["Rádio Parada"]);
|
||||
dataset.addRow(["Câmera Parada"]);
|
||||
dataset.addRow(["Organização do Rack"]);
|
||||
dataset.addRow(["PDV Não Liga"]);
|
||||
dataset.addRow(["PDV Vencido"]);
|
||||
dataset.addRow(["PDV Lento"]);
|
||||
dataset.addRow(["Adquirir PDV"]);
|
||||
dataset.addRow(["Ativar PDV"]);
|
||||
dataset.addRow(["Computador de ER parado"]);
|
||||
dataset.addRow(["Nobreak Apitando"]);
|
||||
dataset.addRow(["Nobreak Não liga"]);
|
||||
dataset.addRow(["Manutenção Periódica do Nobreak"]);
|
||||
dataset.addRow(["Impressora 4200"]);
|
||||
dataset.addRow(["Impressora 5100"]);
|
||||
dataset.addRow(["Impressora Brother HL-L5102DW"]);
|
||||
dataset.addRow(["Impressora sem imprimir"]);
|
||||
dataset.addRow(["Mobshop Parado"]);
|
||||
dataset.addRow(["Mobpin Parado"]);
|
||||
dataset.addRow(["Ativar Mobshop"]);
|
||||
dataset.addRow(["Trocar Mobshop"]);
|
||||
dataset.addRow(["Solicitar Equipamentos"]);
|
||||
dataset.addRow(["Entregar Equipamentos"]);
|
||||
dataset.addRow(["Solicitar chip"]);
|
||||
dataset.addRow(["Email sem acesso"]);
|
||||
dataset.addRow(["Internet sem funcionar"]);
|
||||
dataset.addRow(["Resgatar Imagens"]);
|
||||
dataset.addRow(["Internet"]);
|
||||
dataset.addRow(["Outros"]);
|
||||
dataset.addRow(["Criar Email de colaborador"]);
|
||||
dataset.addRow(["Acesso a VPN"]);
|
||||
dataset.addRow(["Acesso as Pastas da Rede"]);
|
||||
dataset.addRow(["Protheus"]);
|
||||
dataset.addRow(["Instalação de Desktop"]);
|
||||
dataset.addRow(["Instalação de Equipamentos"]);
|
||||
dataset.addRow(["Instalação Câmera"]);
|
||||
dataset.addRow(["Instalação de Impressora"]);
|
||||
dataset.addRow(["Configuração de RB"]);
|
||||
dataset.addRow(["Redes"]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
function onMobileSync(user) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
function defineStructure() {
|
||||
addColumn("codigo");
|
||||
addColumn("descricao");
|
||||
}
|
||||
|
||||
function onSync(lastSyncDate) {}
|
||||
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
var dataSource = "/jdbc/Protheus12"; // Nome da conexão cadastrada no Fluig
|
||||
var ic = new javax.naming.InitialContext();
|
||||
var ds = ic.lookup(dataSource);
|
||||
var conn = ds.getConnection();
|
||||
var stmt = null;
|
||||
var rs = null;
|
||||
|
||||
try {
|
||||
log.info("Iniciando execução do dataset...");
|
||||
|
||||
var sql = "SELECT b1_cod, b1_desc FROM sb1010 WHERE LEFT(b1_cod, 4) IN ('0001','0008', '0002', '0003', '0007', '0006', '0009', '0010', '0011', '0014','0016')";
|
||||
log.info("Query SQL: " + sql);
|
||||
|
||||
stmt = conn.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
dataset.addColumn("codigo");
|
||||
dataset.addColumn("descricao");
|
||||
|
||||
var encontrados = {}; // Usando um objeto para evitar duplicação
|
||||
|
||||
while (rs.next()) {
|
||||
var codigo = rs.getString("b1_cod");
|
||||
var descricao = rs.getString("b1_desc");
|
||||
|
||||
if (!encontrados[codigo]) { // Verifica se já foi adicionado
|
||||
encontrados[codigo] = true; // Marca como processado
|
||||
log.info("Registro encontrado: " + codigo + " - " + descricao);
|
||||
dataset.addRow([codigo, descricao]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(encontrados).length === 0) {
|
||||
log.info("Nenhum registro encontrado para a consulta.");
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
log.error("Erro ao executar dataset: " + e.message);
|
||||
} finally {
|
||||
try {
|
||||
if (rs) rs.close();
|
||||
if (stmt) stmt.close();
|
||||
if (conn) conn.close();
|
||||
} catch (e) {
|
||||
log.error("Erro ao fechar recursos: " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
function onMobileSync(user) {}
|
||||
@@ -0,0 +1,74 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
dataset.addColumn("C8_FILIAL");
|
||||
dataset.addColumn("C8_NUM");
|
||||
dataset.addColumn("C8_ITEM");
|
||||
dataset.addColumn("C8_PRODUTO");
|
||||
dataset.addColumn("C8_QUANT");
|
||||
dataset.addColumn("C8_PRECO");
|
||||
dataset.addColumn("C8_TOTAL");
|
||||
dataset.addColumn("C8_DATPRF");
|
||||
dataset.addColumn("C8_EMISSAO");
|
||||
dataset.addColumn("C8_NUMSC");
|
||||
dataset.addColumn("B1_DESC");
|
||||
dataset.addColumn("B1_UM");
|
||||
dataset.addColumn("B1_TIPO");
|
||||
|
||||
try {
|
||||
var numeroCot = null;
|
||||
if (constraints) {
|
||||
for (var i = 0; i < constraints.length; i++) {
|
||||
if (constraints[i].fieldName == "numCotacao") {
|
||||
numeroCot = constraints[i].initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: "Postprod",
|
||||
endpoint: "/rest/uf_mata131", // sem número -> ele retorna todos
|
||||
method: "get",
|
||||
timeoutService: "60000"
|
||||
};
|
||||
|
||||
var vo = clientService.invoke(JSON.stringify(data));
|
||||
if (vo && vo.getResult()) {
|
||||
var objData = JSON.parse(vo.getResult());
|
||||
var itens = objData["solicitacoes"];
|
||||
|
||||
if (itens && itens.length > 0) {
|
||||
for (var i = 0; i < itens.length; i++) {
|
||||
var item = itens[i];
|
||||
|
||||
// 🔎 se veio constraint, filtra pelo C8_NUM
|
||||
if (numeroCot && item["C8_NUM"] != numeroCot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
dataset.addRow([
|
||||
item["C8_FILIAL"] || "",
|
||||
item["C8_NUM"] || "",
|
||||
item["C8_ITEM"] || "",
|
||||
item["C8_PRODUTO"] || "",
|
||||
item["C8_QUANT"] || "",
|
||||
item["C8_PRECO"] || "",
|
||||
item["C8_TOTAL"] || "",
|
||||
item["C8_DATPRF"] || "",
|
||||
item["C8_EMISSAO"] || "",
|
||||
item["C8_NUMSC"] || "",
|
||||
item["B1_DESC"] || "",
|
||||
item["B1_UM"] || "",
|
||||
item["B1_TIPO"] || ""
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
dataset.addRow(["Erro: " + e.message]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
dataset.addColumn("C7_FILIAL");
|
||||
dataset.addColumn("C7_NUM");
|
||||
dataset.addColumn("C7_ITEM");
|
||||
dataset.addColumn("C7_PRODUTO");
|
||||
dataset.addColumn("C7_QUANT");
|
||||
dataset.addColumn("C7_PRECO");
|
||||
dataset.addColumn("C7_TOTAL");
|
||||
dataset.addColumn("C7_DATPRF");
|
||||
dataset.addColumn("C7_EMISSAO");
|
||||
dataset.addColumn("C7_NUMSC");
|
||||
dataset.addColumn("B1_DESC");
|
||||
dataset.addColumn("B1_UM");
|
||||
dataset.addColumn("B1_TIPO");
|
||||
|
||||
try {
|
||||
var numeroPed = null;
|
||||
if (constraints) {
|
||||
for (var i = 0; i < constraints.length; i++) {
|
||||
if (constraints[i].fieldName == "numeroPed") {
|
||||
numeroPed = constraints[i].initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: "Postprod",
|
||||
endpoint: "/rest/uf_mata121", // sem número -> ele retorna todos
|
||||
method: "get",
|
||||
timeoutService: "60000"
|
||||
};
|
||||
|
||||
var vo = clientService.invoke(JSON.stringify(data));
|
||||
if (vo && vo.getResult()) {
|
||||
var objData = JSON.parse(vo.getResult());
|
||||
var itens = objData["solicitacoes"];
|
||||
|
||||
if (itens && itens.length > 0) {
|
||||
for (var i = 0; i < itens.length; i++) {
|
||||
var item = itens[i];
|
||||
|
||||
// 🔎 se veio constraint, filtra pelo C7_NUM
|
||||
if (numeroPed && item["C7_NUM"] != numeroPed) {
|
||||
continue;
|
||||
}
|
||||
|
||||
dataset.addRow([
|
||||
item["C7_FILIAL"] || "",
|
||||
item["C7_NUM"] || "",
|
||||
item["C7_ITEM"] || "",
|
||||
item["C7_PRODUTO"] || "",
|
||||
item["C7_QUANT"] || "",
|
||||
item["C7_PRECO"] || "",
|
||||
item["C7_TOTAL"] || "",
|
||||
item["C7_DATPRF"] || "",
|
||||
item["C7_EMISSAO"] || "",
|
||||
item["C7_NUMSC"] || "",
|
||||
item["B1_DESC"] || "",
|
||||
item["B1_UM"] || "",
|
||||
item["B1_TIPO"] || ""
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
dataset.addRow(["Erro: " + e.message]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
dataset.addColumn("json");
|
||||
|
||||
try {
|
||||
// Número do pedido recebido como constraint
|
||||
var numPed = "";
|
||||
if (constraints && constraints.length > 0) {
|
||||
for (var i = 0; i < constraints.length; i++) {
|
||||
if (constraints[i].fieldName == "numeroPed") {
|
||||
numPed = constraints[i].initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!numPed) {
|
||||
dataset.addRow([JSON.stringify({
|
||||
sucesso: false,
|
||||
mensagem: "Número do pedido não informado"
|
||||
})]);
|
||||
return dataset;
|
||||
}
|
||||
|
||||
// Monta chamada para o Protheus
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: "Postprod", // nome do serviço cadastrado no Fluig
|
||||
endpoint: "/rest/uf_mata121/" + numPed,
|
||||
method: "get",
|
||||
timeoutService: "100",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
|
||||
var response = clientService.invoke(JSON.stringify(data));
|
||||
if (!response || !response.getResult()) {
|
||||
throw "Sem resposta da API Protheus";
|
||||
}
|
||||
|
||||
var result = JSON.parse(response.getResult());
|
||||
dataset.addRow([JSON.stringify(result)]);
|
||||
|
||||
} catch (e) {
|
||||
log.error("❌ Erro dsConsultaPedido: " + e);
|
||||
dataset.addRow([JSON.stringify({
|
||||
sucesso: false,
|
||||
mensagem: "Erro ao consultar pedido: " + e
|
||||
})]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
function defineStructure() {
|
||||
|
||||
}
|
||||
function onSync(lastSyncDate) {
|
||||
|
||||
}
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
|
||||
var ds = DatasetBuilder.newDataset();
|
||||
|
||||
ds.addColumn("codigo");
|
||||
ds.addColumn("filial");
|
||||
ds.addColumn("estabelecimento");
|
||||
ds.addColumn("cep");
|
||||
ds.addColumn("logradouro");
|
||||
ds.addColumn("numero");
|
||||
ds.addColumn("bairro");
|
||||
ds.addColumn("cidade");
|
||||
ds.addColumn("estado");
|
||||
ds.addColumn("cnpj");
|
||||
|
||||
|
||||
|
||||
ds.addRow(new Array("010101","4494", "ESCRITÓRIO MATRIZ","57035-030","RUA DESPORTISTA HUMBERTO GUIMARAES","343","PONTA VERDE","MACEIÓ","AL","08.489.643/0001-52"));
|
||||
ds.addRow(new Array("010102","3546", "LJ BIG BOMPREÇO GRUTA","57052-000","AVENIDA FERNANDES LIMA","3700","GRUTA DE LOURDES","MACEIÓ","AL","08.489.643/0003-14"));
|
||||
ds.addRow(new Array("010103","4560", "LJ MACEIÓ SHOPPING TERREO","57031-532","AVENIDA GUSTAVO PAIVA","2900","MANGABEIRAS","MACEIÓ","AL","08.489.643/0004-03"));
|
||||
ds.addRow(new Array("010104","5699", "LJ MOREIRA LIMA","57020-000","RUA MOREIRA LIMA","93","CENTRO","MACEIÓ","AL","08.489.643/0005-86"));
|
||||
ds.addRow(new Array("010106","12522", "LJ MACEIÓ SHOPPING EXPANSÃO","57031-530","AVENIDA GUSTAVO PAIVA","2990","MANGABEIRAS","MACEIÓ","AL","08.489.643/0016-39"));
|
||||
ds.addRow(new Array("010107","12828", "LJ GBARBOSA S.MARIS","57036-550","AV ENG. PAULO BRANDÃO NOGUEIRA","S/N","JATIÚCA","MACEIÓ","AL","08.489.643/0017-10"));
|
||||
ds.addRow(new Array("010108","12838", "LJ RIO LARGO","57100-000","AV PRES GETULIO VARGAS","148","CENTRO","RIO LARGO","AL","08.489.643/0018-09"));
|
||||
ds.addRow(new Array("010109","21647", "QUIOSQUE CARAJÁS MANGABEIRAS","57037-901","AV COMENDADOR GUSTAVO PAIVA","S/N","MANGABEIRAS","MACEIÓ","AL","08.489.643/0019-81"));
|
||||
ds.addRow(new Array("010110","12817", "LJ SHOPPING PÁTIO","57073-470","AV MENINO MARCELO","3800","CIDADE UNIVERSITÁRIA","MACEIÓ","AL","08.489.643/0020-15"));
|
||||
ds.addRow(new Array("010111","12824", "QUIOSQUE GBARBOSA TABULEIRO","57061-110","AVENIDA MACEIÓ","S/N","TABULEIRO","MACEIÓ","AL","08.489.643/0021-04"));
|
||||
ds.addRow(new Array("010112","12823", "LJ PONTA VERDE","57035-330","RUA DEPUTADO JOSÉ LAGES","431","PONTA VERDE","MACEIÓ","AL","08.489.643/0022-87"));
|
||||
ds.addRow(new Array("010113","20858", "QUIOSQUE SUPER GIRO","57010-003","AVENIDA SIQUEIRA CAMPOS","1368","PRADO","MACEIÓ","AL","08.489.643/0023-68"));
|
||||
ds.addRow(new Array("010114","12820", "LJ ATACADÃO TABULEIRO","57082-160","AV DOUTOR DURVAL DE GOIS MONTEIRO","12650","TABULEIRO","MACEIÓ","AL","08.489.643/0024-49"));
|
||||
ds.addRow(new Array("010115","12830", "LJ LIVRAMENTO","57020-030","RUA DO LIVRAMENTO","24","CENTRO","MACEIÓ","AL","08.489.643/0025-20"));
|
||||
ds.addRow(new Array("010117","19103", "LJ UNICOMPRA PONTA VERDE","57035-060","RUA DURVAL GUIMARÃES","S/N","PONTA VERDE","MACEIÓ","AL","08.489.643/0027-91"));
|
||||
ds.addRow(new Array("010118","12826", "LJ ASSAÍ MANGABEIRAS","57037-532","AV COMENDADOR GUSTAVO PAIVA","3261","MANGABEIRAS","MACEIÓ","AL","08.489.643/0028-72"));
|
||||
ds.addRow(new Array("010119","12829", "LJ JACINTINHO","57041-000","RUA CLETO CAMPELO","2394","JACINTINHO","MACEIÓ","AL","08.489.643/0029-53"));
|
||||
ds.addRow(new Array("010120","12818", "LJ GBARBOSA SERRARIA","57046-000","AVENIDA MENINO MARCELO","9730","SERRARIA","MACEIÓ","AL","08.489.643/0030-97"));
|
||||
ds.addRow(new Array("010121","13427", "LJ SHOPPING CIDADE","57055-000","AVENIDA FERNANDES LIMA","679","FAROL","MACEIÓ","AL","08.489.643/0031-78"));
|
||||
ds.addRow(new Array("010124","14617", "LJ PARQUE SHOPPING","57038-000","AVENIDA GUSTAVO PAIVA","5945","CRUZ DAS ALMAS",",MACEIÓ","AL","08.489.643/0034-10"));
|
||||
ds.addRow(new Array("010126","14668", "LJ MIX MATHEUS ANTARES","57038-410","AVENIDA MENINO MARCELO","5300","ANTARES","MACEIÓ","AL","08.489.643/0036-82"));
|
||||
ds.addRow(new Array("010128","20006", "LJ SÃO SEBASTIÃO","43850-000","PRAÇA DOZE DE OUTUBRO","65","CENTRO","SÃO SEBASTIÃO DO PASSÉ","BA","08.489.643/0038-44"));
|
||||
ds.addRow(new Array("010130","20009", "LJ CANDEIAS BAIXO","43815-050","AVENIDA ANTONIO PATTERSON","196","TRIÂNGULO","CANDEIAS","BA","08.489.643/0040-69"));
|
||||
ds.addRow(new Array("010131","20005", "LJ CANDEIAS CIMA","43805-000","RUA 13 DE MAIO","147","CENTRO","CANDEIAS","BA","08.489.643/0041-40"));
|
||||
ds.addRow(new Array("010132","20056", "LJ SIMÕES FILHO","43700-000","AV LUÍS EDUARDO MAGALHÃES","109","CENTRO","SIMÕES FILHO","BA","08.489.643/0042-20"));
|
||||
ds.addRow(new Array("010133","20057", "LJ CONCEIÇÃO COITÉ","48730-000","RUA DR AMÂNCIO MOTA","30","CENTRO","CONCEIÃO DO COITÉ","BA","08.489.643/0043-01"));
|
||||
ds.addRow(new Array("010134","20441", "LJ LAGARTO","49400-000","AVENIDA LEANDRO MACIEL","36","CENTRO","LAGARTO","SE","08.489.643/0044-92"));
|
||||
ds.addRow(new Array("010135","20968", "HIB ITABAIANINHA","49290-000","PRAÇA OLÍMPIO CAMPOS","154","CENTRO","ITABAIANINHA","SE","08.489.643/0059-79"));
|
||||
ds.addRow(new Array("010136","20969", "HIB MARECHAL DEODORO","57160-000","RUA DR TAVARES BASTOS","03","CENTRO","MARECHAL DEODORO","AL","08.489.643/0054-64"));
|
||||
ds.addRow(new Array("010137","20970", "VD SÃO SEBASTIÃO","43850-000","PRAÇA DOZE DE OUTUBRO","116","CENTRO","SÃO SEBASTIÃO DO PASSÉ","BA","08.489.643/0050-30"));
|
||||
ds.addRow(new Array("010138","20986", "HIB OLINDINA","48470-000","AVENIDA ANTONIO MANGABEIRA","84","CENTRO","OLINDINA","BA","08.489.643/0055-45"));
|
||||
ds.addRow(new Array("010139","20988", "HIB QUEIMADAS","48860-000","PRAÇA CORONEL FRANCISCO LANTYER","21","CENTRO","QUEIMADAS","BA","08.489.643/0051-11"));
|
||||
ds.addRow(new Array("010140","20989", "HIB ENTRE RIOS","48180-000","AVENIDA JURACY MAGALHÃES","320","CENTRO","ENTRE RIOS","BA","08.489.643/0056-26"));
|
||||
ds.addRow(new Array("010141","20991", "HIB CAMPO ALEGRE","57250-000","RUA DO COMÉRCIO","49","CENTRO","CAMPO ALEGRE","AL","08.489.643/0061-93"));
|
||||
ds.addRow(new Array("010142","20992", "ER CONCEIÇÃO COITÉ","48730-000","RUA DR AMANCIO MOTA","35","CENTRO","CONCEIÇÃO DO COITÉ","BA","08.489.643/0045-73"));
|
||||
ds.addRow(new Array("010143","20993", "ER CANDEIAS","43815-010","AV ANTONIO PATTERSON","213","TRIANGULO","CANDEIAS","BA","08.489.643/0046-54"));
|
||||
ds.addRow(new Array("010144","20994", "ER SIMÕES FILHO","43700-000","AV LUÍS EDUARDO MAGALHÃES","109","CENTRO","SIMÕES FILHO","BA","08.489.643/0047-35"));
|
||||
ds.addRow(new Array("010145","20995", "ER LAGARTO","49400-000","AVENIDA LEANDRO MACIEL","36","CENTRO","LAGARTO","SE","08.489.643/0060-02"));
|
||||
ds.addRow(new Array("010146","20996", "ER ANTARES","57083-048","AV ANTONIO LISBOA DE AMORIM","220","ANTARES","MACEIÓ","AL","08.489.643/0057-07"));
|
||||
ds.addRow(new Array("010147","20997", "ER PITANGUINHA","57052-050","AVENIDA FERNANDES LIMA","840","PITANGUINHA","MACEIÓ","AL","08.489.643/0058-98"));
|
||||
ds.addRow(new Array("010148","20998", "CD TABULEIRO","57073-482","ESTRADA DA CODEAL","770","TABULEIRO","MACEIÓ","AL","08.489.643/0062-74"));
|
||||
ds.addRow(new Array("010149","20999", "HIB ESPLANADA","48370-000","PRAÇA LADISLAU CAVALCANTE","31","CENTRO","ESPLANADA","BA","08.489.643/0053-83"));
|
||||
ds.addRow(new Array("010150","21000", "HIB SANTALUZ","48880-000","RUA RIO BRANCO","96","CENTRO","SANTALUZ","BA","08.489.643/0052-00"));
|
||||
ds.addRow(new Array("010151","21001", "HIB RIO REAL","48330-000","PC SEN ANTONIO CARLOS MAGALHÃES","146","CENTRO","RIO REAL","BA","08.489.643/0049-05"));
|
||||
ds.addRow(new Array("010152","21007", "TÔ QUE TÔ MACEIÓ CENTRO","57020-220","AVENIDA MOREIRA LIMA","293","CENTRO","MACEIÓ","AL","08.489.643/0048-16"));
|
||||
ds.addRow(new Array("010153","21068", "LJ ATAKAREJO SIMÕES FILHO","43700-000","AV ENG ELMO SEREJO DE FARIAS","2073","CONJ HAB VIDA NOVA","SIMÕES FILHO","BA","08.489.643/0063-55"));
|
||||
ds.addRow(new Array("010154","21277", "LJ GBARBOSA SOCORRO","49160-000","AVENIDA 1","13","CONJ JOAO ALVES FILHO","NOSSA SENHORA DO SOCORRO","SE","08.489.643/0065-17"));
|
||||
ds.addRow(new Array("010155","21278", "ER SOCORRO","49140-000","AVENIDA COLETORA A","597","CONJ MARCOS FREIRE I","NOSSA SENHORA DO SOCORRO","SE","08.489.643/0066-06"));
|
||||
ds.addRow(new Array("010156","21495", "HIB BARRA DOS COQUEIROS","49140-000","AVENIDA OCEANICA","506","ANTONIO PEDRO","BARRA DOS COQUEIROS","SE","08.489.643/0067-89"));
|
||||
ds.addRow(new Array("010157","21296", "LJ SHOPPING PRÊMIO SOCORRO","49160-000","AVENIDA COLETORA A","S/N","CONJ MARCOS FREIRE I","NOSSA SENHORA DO SOCRRO","SE","08.489.643/0064-36"));
|
||||
ds.addRow(new Array("010159","21381", "LJ CAPIM GROSSO","44695-000","AV ACM","121","CENTRO","CAPIM-GROSSO","BA","08.489.643/0069-40"));
|
||||
ds.addRow(new Array("010160","21383", "ER CAPIM GROSSO","44695-000","AV ACM","121","CENTRO","CAPIM-GROSSO","BA","08.489.643/0070-84"));
|
||||
ds.addRow(new Array("010161","21375", "HIB IPIRÁ","44600-000","AVENIDA CESÁR CABRAL","15","CENTRO","IPIRÁ","BA","08.489.643/0071-65"));
|
||||
ds.addRow(new Array("010162","21624", "MIX MATEUS TRAPICHE","57010-000","AVENIDA SIQUEIRA CAMPOS","1295","PRADO","MACEIÓ","AL","08.489.643/0072-46"));
|
||||
ds.addRow(new Array("010163","22448", "ER CAMPO ALEGRE","57250-000","RUA DO COMÉRCIO","49","CENTRO","CAMPO ALEGRE","AL","08.489.643/0073-27"));
|
||||
ds.addRow(new Array("010164","23475", "MIX MATEUS TABULEIRO","57082-160","AV DOUTOR DURVAL DE GOIS MONTEIRO","9207","TABULEIRO","MACEIÓ","AL","08.489.643/0074-08"));
|
||||
ds.addRow(new Array("010165","22541", "ER RIO LARGO","57100-000","RUA JUDITH PAIVA","445","CENTRO","RIO LARGO","AL","08.489.643/0075-99"));
|
||||
ds.addRow(new Array("010166","AMG", "AMG SERRARIA","57046-000","AVENIDA MENINO MARCELO","S/N","SERRARIA","MACEIÓ","AL","08.489.643/0076-70"));
|
||||
ds.addRow(new Array("010167","23156", "SHOPPING CENTRO SUL","49400-000","AV CONTORNO BR","3795","SÃO JOSE","LAGARTO","SE","08.489.643/0077-50"));
|
||||
ds.addRow(new Array("030101","910173", "QDB PARQUE SHOPPING","57038-000","AVENIDA COMENDADOR GUSTAVO PAIVA","5945","CRUZ DAS ALMAS","MACEIÓ","AL","20.318.877/0001-32"));
|
||||
ds.addRow(new Array("030102","910291", "QDB MACEIO SHOPPING","57037-532","AVENIDA COMENDADOR GUSTAVO PAIVA","2900","MANGABEIRAS","MACEIÓ","AL","20.318.877/0002-13"));
|
||||
ds.addRow(new Array("070101","23713", "MATRIZ - ZEFERINO CORREIA","45000-520","RUA ZEFERINO CORREIA","17","CENTRO","VITORIA DA CONQUISTA","BA","14.378.160/0001-83"));
|
||||
ds.addRow(new Array("070102","23711", "HIB LIMA GUERRA","45000-390","AL. LIMA GUERRA","04","CENTRO","VITORIA DA CONQUISTA","BA","14.378.160/0005-07"));
|
||||
ds.addRow(new Array("070103","23712", "HIB CANDIDO SALES","24157-000","AL. RIO BRANCO","373","CENTRO","CÂNDIDO SALES","BA","14.378.160/0006-98"));
|
||||
ds.addRow(new Array("070104","23705", "LOJA SHOPPING CONQUISTA SUL","45055-900","AVENIDA JURACY MAGALHAES","3340","FELICIA","VITORIA DA CONQUISTA","BA","14.378.160/0013-17"));
|
||||
ds.addRow(new Array("070105","23703", " VD BARRA CHOCA","45120-000","AV GETULIO VARGAS","98","CENTRO","CHOCA","BA","14.378.160/0016-60"));
|
||||
ds.addRow(new Array("070106","23707", "LOJA BRASIL","45051-070","AV ITABUNA","2724","BRASIL","VITORIA DA CONQUISTA","BA","14.378.160/0011-55"));
|
||||
ds.addRow(new Array("070107","23706", "LOJA ASSAI FELICIA","45055-686","AV ANEL DE CONTORNO","S/N","FELICIA","VITORIA DA CONQUISTA","BA","14.378.160/0012-36"));
|
||||
ds.addRow(new Array("070108","23709", "LOJA SHOPPING CONQUISTA","45055-900","AV JURACY MAGALHAES","3340","FELICIA","VITORIA DA CONQUISTA","BA","14.378.160/0009-30"));
|
||||
ds.addRow(new Array("070109","23704", "VD CONDEUBA","46200-000","PC NOSSA SENHORA APARECIDA","08","CENTRO","CONDEÚBA","BA","14.378.160/0015-89"));
|
||||
ds.addRow(new Array("070110","23703", "LOJA BARRA CHOCA","45120-000","AV GETULIO VARGAS","98","CENTRO","CHOCA","BA","14.378.160/0016-60"));
|
||||
ds.addRow(new Array("070111","23702", "LOJA PANVICON CENTER","45000-230","AVENIDA LAURO DE FREITAS","142","CENTRO","VITORIA DA CONQUISTA","BA","14.378.160/0017-40"));
|
||||
ds.addRow(new Array("070112","23701", "LOJA NOVE DE NOVEMBRO","45000-370","PC NOVE DE NOVEMBRO","10","CENTRO","VITORIA DA CONQUISTA","BA","14.378.160/0018-21"));
|
||||
ds.addRow(new Array("070113","23665", "LOJA UNIVERSIDADE","45031-000","AV OLIVIA FLORES","2500","UNIVERSIDADE","VITORIA DA CONQUISTA","BA","14.378.160/0021-27"));
|
||||
ds.addRow(new Array("010172","24253", "LOJA IRECÊ CENTRO","44860-051","RUA AUGUSTO NUNES PEREIRA","162","CENTRO","IRECÊ","BA","08.489.643/0095-32"));
|
||||
ds.addRow(new Array("010171","24254", "LOJA JOÃO DOURADO","44920-000","AVENIDA JOAQUIM AUGUSTO","212D","CENTRO","JOÃO DOURADO","BA","08.489.643/0089-94"));
|
||||
ds.addRow(new Array("010173","24254", "ER IRECE","44860-169","AVENIDA EDVALDO SANTOS LOPES","438","CENTRO","IRECE","BA","08.489.643/0094-51"));
|
||||
ds.addRow(new Array("010169","24257", "HIB MIGUEL CALMON","44720-000","PRAÇA LAURO DE FREITAS","180","CENTRO","MIGUEL CALMON","BA","08.489.643/0088-03"));
|
||||
ds.addRow(new Array("010170","24258", "LOJA ATACADAO IRECE","44868-520","AVENIDA ATACADAO NOVO IRECE","01","NOVO IRECÊ","IRECÊ","BA","08.489.643/0093-70"));
|
||||
ds.addRow(new Array("010175","24268", "LOJA JACOBINA","44702-342","RUA CORONEL TEIXEIRA","44","CENTRO","JACOBINA","BA","08.489.643/0097-02"));
|
||||
ds.addRow(new Array("010176","24269", "ER JACOBINA","44702-358","AVENIDA MANOEL NOVAES","178","CENTRO","JACOBINA","BA","08.489.643/0096-13"));
|
||||
ds.addRow(new Array("010174","24293", "HIB MORRO DO CHAPEU","44850-970","RUA PROJETADA 01","203","CENTRO","MORRO DO CHAPEU","BA","08.489.643/0099-66"));
|
||||
ds.addRow(new Array("010168","23813", "HIB VALENTE","48890-000","RUA CASTRO ALVES","174","CENTRO","VALENTE","BA","08.489.643/0078-31"));
|
||||
ds.addRow(new Array("010177","23711", "ER CONQUISTA","45000-390","ALAMEDA LIMA GUERRA","174","CENTRO","VITORIA DA CONQUISTA","BA","08.489.643/0100-34"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ds;
|
||||
|
||||
}
|
||||
function onMobileSync(user) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
criarEstrutura(dataset);
|
||||
|
||||
try {
|
||||
log.info("🚀 Iniciando dsPostPedidoCompra");
|
||||
|
||||
// Captura os parâmetros via constraints
|
||||
var estabelecimento = trim(getParametro(constraints, "estabelecimento"));
|
||||
var numeroPedido = trim(getParametro(constraints, "numeroPedido"));
|
||||
var dataAbertura = trim(getParametro(constraints, "dataAbertura"));
|
||||
var fornecedor = trim(getParametro(constraints, "fornecedor"));
|
||||
var condPagamento = trim(getParametro(constraints, "condPagamentoIndica"));
|
||||
var userCompras = trim(getParametro(constraints, "userValidacaoCompras"));
|
||||
|
||||
// Monta o payload
|
||||
var payload = {
|
||||
"C7_FILIAL": estabelecimento,
|
||||
"C7_NUM": numeroPedido,
|
||||
"C7_EMISSAO": dataAbertura,
|
||||
"C7_FORNECE": fornecedor,
|
||||
"C7_LOJA": "01",
|
||||
"C7_COND": condPagamento,
|
||||
"C7_CONTATO": userCompras,
|
||||
"C7_FILENT": estabelecimento,
|
||||
"C7_TPFRETE": "C",
|
||||
"C7_FRETE": "0",
|
||||
"C7_ITENS": [fornecedor] // você pode ajustar isso para ser um array com objetos, se necessário
|
||||
};
|
||||
|
||||
log.info("📤 Payload: " + JSON.stringify(payload));
|
||||
|
||||
// Monta a chamada para o serviço
|
||||
var data = {
|
||||
companyId: "01",
|
||||
serviceCode: "Integrador Pedido de compra",
|
||||
endpoint: "/REST/PEDIDO/",
|
||||
method: "post",
|
||||
timeoutService: "100",
|
||||
params: payload,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var response = clientService.invoke(JSON.stringify(data));
|
||||
var result = response.getResult();
|
||||
|
||||
log.info("✅ Retorno da API: " + result);
|
||||
|
||||
if (!result || result.indexOf("ERRO") !== -1) {
|
||||
throw result || "Erro desconhecido na integração.";
|
||||
}
|
||||
|
||||
dataset.addRow(["SUCESSO", result]);
|
||||
|
||||
} catch (e) {
|
||||
var erro = "❌ Erro: " + e.message;
|
||||
log.error("[dsPostPedidoCompra] " + erro);
|
||||
dataset.addRow(["FALHA", erro]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
// Criação das colunas
|
||||
function criarEstrutura(dataset) {
|
||||
dataset.addColumn("STATUS", DatasetFieldType.STRING);
|
||||
dataset.addColumn("RETORNO", DatasetFieldType.STRING);
|
||||
}
|
||||
|
||||
// Função para buscar parâmetro nas constraints
|
||||
function getParametro(constraints, campo) {
|
||||
var valor = "";
|
||||
if (constraints && constraints.length > 0) {
|
||||
for each (var c in constraints) {
|
||||
if (c.getFieldName().trim().toUpperCase() === campo.trim().toUpperCase()) {
|
||||
valor = c.getInitialValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return valor;
|
||||
}
|
||||
|
||||
// Trim com segurança
|
||||
function trim(valor) {
|
||||
if (!valor) return "";
|
||||
return valor.trim();
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
dataset.addColumn("codigo");
|
||||
dataset.addColumn("descricao");
|
||||
dataset.addColumn("tipo");
|
||||
dataset.addColumn("medida");
|
||||
dataset.addColumn("armazem");
|
||||
dataset.addColumn("icms");
|
||||
dataset.addColumn("ipi");
|
||||
dataset.addColumn("contrato");
|
||||
dataset.addColumn("localizacao");
|
||||
dataset.addColumn("rastro");
|
||||
dataset.addColumn("bloqueado");
|
||||
dataset.addColumn("ultimo_preco");
|
||||
|
||||
|
||||
try {
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: "Postprod",
|
||||
endpoint: "/rest/uf_mata010/",
|
||||
method: "get",
|
||||
timeoutService: "60000",
|
||||
params: {}
|
||||
};
|
||||
|
||||
var vo = clientService.invoke(JSON.stringify(data));
|
||||
var retorno = vo.getResult();
|
||||
|
||||
if (retorno) {
|
||||
var objData = JSON.parse(retorno);
|
||||
var itens = objData["produtos"];
|
||||
|
||||
if (itens && itens.length > 0) {
|
||||
for (var i = 0; i < itens.length; i++) {
|
||||
var item = itens[i];
|
||||
|
||||
// aplica filtro:
|
||||
var codigo = (item["B1_COD"] || "").trim();
|
||||
var bloqueado = (item["B1_MSBLQL"] || "").trim();
|
||||
|
||||
// só adiciona se o código NÃO tiver 5 dígitos OU se bloqueado != "1"
|
||||
if (codigo.length !== 5 && bloqueado !== "1") {
|
||||
dataset.addRow([
|
||||
codigo,
|
||||
item["B1_DESC"],
|
||||
item["B1_TIPO"],
|
||||
item["B1_UM"],
|
||||
item["B1_LOCPAD"],
|
||||
item["B1_PICM"],
|
||||
item["B1_IPI"],
|
||||
item["B1_CONTRAT"],
|
||||
item["B1_LOCALIZ"],
|
||||
item["B1_RASTRO"],
|
||||
bloqueado,
|
||||
item["B1_UPRC"]
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dataset.addRow(["Sem produtos retornados"]);
|
||||
}
|
||||
} else {
|
||||
dataset.addRow(["Sem resposta da API"]);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
dataset = DatasetBuilder.newDataset();
|
||||
dataset.addColumn("ERRO");
|
||||
dataset.addRow([e.message]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
dataset.addColumn("status");
|
||||
dataset.addColumn("mensagem");
|
||||
dataset.addColumn("erro");
|
||||
|
||||
log.info("### Enviando dados para Protheus com autenticação ###");
|
||||
|
||||
try {
|
||||
var jsonData = "{}";
|
||||
if (constraints) {
|
||||
for (var i = 0; i < constraints.length; i++) {
|
||||
if (constraints[i].fieldName == "params" && constraints[i].initialValue) {
|
||||
jsonData = constraints[i].initialValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("Dados recebidos: " + jsonData);
|
||||
|
||||
var url = "https://rest.grupoginseng.com.br/rest_teste/uf_mata010";
|
||||
var urlObj = new java.net.URL(url);
|
||||
var httpConn = urlObj.openConnection();
|
||||
|
||||
var usuario = "fluig";
|
||||
var senha = "Ginseng@";
|
||||
var authString = usuario + ":" + senha;
|
||||
var authBytes = new java.lang.String(authString).getBytes("UTF-8");
|
||||
var encodedAuth = java.util.Base64.getEncoder().encodeToString(authBytes);
|
||||
|
||||
httpConn.setDoOutput(true);
|
||||
httpConn.setRequestMethod("POST");
|
||||
httpConn.setRequestProperty("Content-Type", "application/json");
|
||||
httpConn.setRequestProperty("Accept", "application/json");
|
||||
httpConn.setRequestProperty("Authorization", "Basic " + encodedAuth);
|
||||
httpConn.setConnectTimeout(30000);
|
||||
httpConn.setReadTimeout(30000);
|
||||
|
||||
var outputStream = httpConn.getOutputStream();
|
||||
var writer = new java.io.OutputStreamWriter(outputStream, "UTF-8");
|
||||
writer.write(jsonData);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
outputStream.close();
|
||||
|
||||
// Ler resposta ou erro
|
||||
var response = "";
|
||||
try {
|
||||
var inputStream = httpConn.getInputStream();
|
||||
var scanner = new java.util.Scanner(inputStream, "UTF-8");
|
||||
response = scanner.useDelimiter("\\A").hasNext() ? scanner.next() : "";
|
||||
scanner.close();
|
||||
} catch (e) {
|
||||
var errorStream = httpConn.getErrorStream();
|
||||
if (errorStream != null) {
|
||||
var scanner = new java.util.Scanner(errorStream, "UTF-8");
|
||||
response = scanner.useDelimiter("\\A").hasNext() ? scanner.next() : "";
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
|
||||
log.info("Response bruto: " + response);
|
||||
|
||||
// Adiciona no dataset sempre, sem depender do status HTTP
|
||||
dataset.addRow(["OK", response, ""]);
|
||||
|
||||
} catch (error) {
|
||||
log.error("Erro completo: " + error.toString());
|
||||
dataset.addRow(["Erro", "", error.toString()]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
function onSync(lastSyncDate) {}
|
||||
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
// Define as colunas do dataset
|
||||
dataset.addColumn("CODIGO");
|
||||
dataset.addColumn("DESCRICAO");
|
||||
dataset.addColumn("CNPJ");
|
||||
dataset.addColumn("ENDERECO");
|
||||
dataset.addColumn("COMPLEMENTO");
|
||||
dataset.addColumn("BAIRRO");
|
||||
dataset.addColumn("CIDADE");
|
||||
dataset.addColumn("ESTADO");
|
||||
dataset.addColumn("CEP");
|
||||
dataset.addColumn("CODIGO_MUNICIPIO");
|
||||
dataset.addColumn("BPCS");
|
||||
dataset.addColumn("LOJA");
|
||||
|
||||
var dataSource = "/jdbc/Tabeladeloja"; // ajuste se necessário
|
||||
var ic = new javax.naming.InitialContext();
|
||||
var ds = ic.lookup(dataSource);
|
||||
var conn = ds.getConnection();
|
||||
var stmt = null;
|
||||
var rs = null;
|
||||
|
||||
try {
|
||||
log.info("Iniciando execução do dataset...");
|
||||
|
||||
var sql = ""
|
||||
+ " SELECT "
|
||||
+ " M0_CODFIL, M0_FILIAL, M0_CGC, M0_ENDENT, M0_COMPENT, "
|
||||
+ " M0_BAIRENT, M0_CIDENT, M0_ESTENT, M0_CEPENT, M0_CODMUN, M0_TEL_PO "
|
||||
+ " FROM SYS_COMPANY "
|
||||
+ " WHERE (M0_CODFIL LIKE '0101%' OR M0_CODFIL LIKE '03%') "
|
||||
+ " AND D_E_L_E_T_ = ' '";
|
||||
|
||||
log.info("Query SQL: " + sql);
|
||||
|
||||
stmt = conn.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
var vistos = {};
|
||||
|
||||
while (rs.next()) {
|
||||
var codigo = rs.getString("M0_CODFIL");
|
||||
var descricao = rs.getString("M0_FILIAL");
|
||||
var cnpj = rs.getString("M0_CGC");
|
||||
var endereco = rs.getString("M0_ENDENT");
|
||||
var complemento = rs.getString("M0_COMPENT");
|
||||
var bairro = rs.getString("M0_BAIRENT");
|
||||
var cidade = rs.getString("M0_CIDENT");
|
||||
var estado = rs.getString("M0_ESTENT");
|
||||
var cep = rs.getString("M0_CEPENT");
|
||||
var ibge = rs.getString("M0_CODMUN");
|
||||
var bpcs = rs.getString("M0_TEL_PO");
|
||||
|
||||
var loja = (bpcs ? bpcs.trim() : "") + "-" + (descricao ? descricao.trim() : "");
|
||||
|
||||
if (!vistos[codigo]) {
|
||||
vistos[codigo] = true;
|
||||
dataset.addRow([
|
||||
codigo, descricao, cnpj, endereco, complemento, bairro,
|
||||
cidade, estado, cep, ibge, bpcs, loja
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(vistos).length === 0) {
|
||||
log.info("Nenhum registro encontrado para a consulta.");
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
log.error("Erro ao executar dataset: " + e.message);
|
||||
} finally {
|
||||
try { if (rs) rs.close(); } catch (e) { log.error(e.message); }
|
||||
try { if (stmt) stmt.close(); } catch (e) { log.error(e.message); }
|
||||
try { if (conn) conn.close(); } catch (e) { log.error(e.message); }
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
function onMobileSync(user) {}
|
||||
@@ -0,0 +1,98 @@
|
||||
function defineStructure() {
|
||||
dataset.addColumn("CODIGO");
|
||||
dataset.addColumn("DESCRICAO");
|
||||
dataset.addColumn("CNPJ");
|
||||
dataset.addColumn("ENDERECO");
|
||||
dataset.addColumn("COMPLEMENTO");
|
||||
dataset.addColumn("BAIRRO");
|
||||
dataset.addColumn("CIDADE");
|
||||
dataset.addColumn("ESTADO");
|
||||
dataset.addColumn("CEP");
|
||||
dataset.addColumn("CODIGO_MUNICIPIO");
|
||||
dataset.addColumn("BPCS");
|
||||
dataset.addColumn("LOJA");
|
||||
}
|
||||
|
||||
function onSync(lastSyncDate) {}
|
||||
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
var dataSource = "/jdbc/Tabeladeloja";
|
||||
var ic = new javax.naming.InitialContext();
|
||||
var ds = ic.lookup(dataSource);
|
||||
var conn = ds.getConnection();
|
||||
var stmt = null;
|
||||
var rs = null;
|
||||
|
||||
try {
|
||||
log.info("Iniciando execução do dataset...");
|
||||
|
||||
var sql = ""
|
||||
+ " SELECT "
|
||||
+ " M0_CODFIL, M0_FILIAL, M0_CGC, M0_ENDENT, M0_COMPENT, "
|
||||
+ " M0_BAIRENT, M0_CIDENT, M0_ESTENT, M0_CEPENT, M0_CODMUN, M0_TEL_PO "
|
||||
+ " FROM SYS_COMPANY "
|
||||
+ " WHERE (M0_CODFIL LIKE '0101%' OR M0_CODFIL LIKE '03%') "
|
||||
+ " AND D_E_L_E_T_ = ' '";
|
||||
|
||||
log.info("Query SQL: " + sql);
|
||||
|
||||
stmt = conn.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
// As colunas aqui devem ter exatamente os MESMOS nomes do defineStructure:
|
||||
dataset.addColumn("CODIGO");
|
||||
dataset.addColumn("DESCRICAO");
|
||||
dataset.addColumn("CNPJ");
|
||||
dataset.addColumn("ENDERECO");
|
||||
dataset.addColumn("COMPLEMENTO");
|
||||
dataset.addColumn("BAIRRO");
|
||||
dataset.addColumn("CIDADE");
|
||||
dataset.addColumn("ESTADO");
|
||||
dataset.addColumn("CEP");
|
||||
dataset.addColumn("CODIGO_MUNICIPIO");
|
||||
dataset.addColumn("BPCS");
|
||||
dataset.addColumn("LOJA");
|
||||
|
||||
var vistos = {};
|
||||
|
||||
while (rs.next()) {
|
||||
var codigo = rs.getString("M0_CODFIL");
|
||||
var descricao = rs.getString("M0_FILIAL");
|
||||
var cnpj = rs.getString("M0_CGC");
|
||||
var endereco = rs.getString("M0_ENDENT");
|
||||
var complemento = rs.getString("M0_COMPENT");
|
||||
var bairro = rs.getString("M0_BAIRENT");
|
||||
var cidade = rs.getString("M0_CIDENT");
|
||||
var estado = rs.getString("M0_ESTENT");
|
||||
var cep = rs.getString("M0_CEPENT");
|
||||
var ibge = rs.getString("M0_CODMUN");
|
||||
var bpcs = rs.getString("M0_TEL_PO");
|
||||
|
||||
var loja = (bpcs ? bpcs.trim() : "") + "-" + (descricao ? descricao.trim() : "");
|
||||
|
||||
if (!vistos[codigo]) {
|
||||
vistos[codigo] = true;
|
||||
dataset.addRow([
|
||||
codigo, descricao, cnpj, endereco, complemento, bairro,
|
||||
cidade, estado, cep, ibge, bpcs, loja
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(vistos).length === 0) {
|
||||
log.info("Nenhum registro encontrado para a consulta.");
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
log.error("Erro ao executar dataset: " + e.message);
|
||||
} finally {
|
||||
try { if (rs) rs.close(); } catch (e) { log.error(e.message); }
|
||||
try { if (stmt) stmt.close(); } catch (e) { log.error(e.message); }
|
||||
try { if (conn) conn.close(); } catch (e) { log.error(e.message); }
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
function onMobileSync(user) {}
|
||||
@@ -0,0 +1,68 @@
|
||||
function defineStructure() {}
|
||||
|
||||
function onSync(lastSyncDate) {}
|
||||
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
// Definir as colunas
|
||||
dataset.addColumn("codigoCentroCusto");
|
||||
dataset.addColumn("centroCusto");
|
||||
dataset.addColumn("gestorCentroCusto");
|
||||
dataset.addColumn("idGestor");
|
||||
dataset.addColumn("diretorCentroCusto");
|
||||
dataset.addColumn("idDiretor");
|
||||
dataset.addColumn("diretorGeral");
|
||||
dataset.addColumn("idDiretorGeral");
|
||||
|
||||
// Lista dos centros de custo
|
||||
var dados = [
|
||||
// Comercial dividido por estado
|
||||
["41101", "Comercial Alagoas", "Raquel Tenorio ", "Analanny Magalhães", "João Marcelo"],
|
||||
["41101", "Comercial Bahia", "Arianne Sodre", "Analanny Magalhães", "João Marcelo"],
|
||||
["41101", "Comercial Sergipe", "Iolanda Bezerra", "Analanny Magalhães", "João Marcelo"],
|
||||
["41101", "Marketing e Treinamento", "Andreia Leite", "João Marcelo", "João Marcelo"],
|
||||
|
||||
|
||||
// Outros centros de custo (exemplo que você já tinha)
|
||||
["51101", "Diretoria e Gestão", "João Marcelo", "Diogo Demetrio", "João Marcelo"],
|
||||
["51102", "Operações", "Diogo Demetrio", "Ariklenyo Nascimento", "João Marcelo"],
|
||||
["51103", "Controladoria", "Ariklenyo Nascimento", "Marla Palma", "João Marcelo"],
|
||||
["51104", "Compliance", "Marla Palma", "Lucila Brandão", "João Marcelo"],
|
||||
["51107", "Administrativo", "Lucila Brandão", "Francine Peiter", "João Marcelo"],
|
||||
["51110", "Gente e Cultura", "Francine Peiter", "Igor Oliveira", "João Marcelo"],
|
||||
["51113", "TI", "Igor Oliveira", "Lucas Rocha", "João Marcelo"],
|
||||
["51114", "Projetos e Performance", "Lucas Rocha", "Andrey Cunha", "João Marcelo"],
|
||||
["teste", "teste", "Andrey Cunha", "Andrey Cunha", "João Marcelo"]
|
||||
];
|
||||
|
||||
// Função para buscar matrícula pelo nome
|
||||
function getMatricula(nome) {
|
||||
if (!nome) return "";
|
||||
var c1 = DatasetFactory.createConstraint("colleagueName", nome, nome, ConstraintType.MUST);
|
||||
var dsUser = DatasetFactory.getDataset("colleague", ["colleagueId"], [c1], null);
|
||||
return dsUser.rowsCount > 0 ? dsUser.getValue(0, "colleagueId") : "";
|
||||
}
|
||||
|
||||
// Preenche dataset
|
||||
for (var i = 0; i < dados.length; i++) {
|
||||
var idGestor = getMatricula(dados[i][2]);
|
||||
var idDiretor = getMatricula(dados[i][3]);
|
||||
var idDiretorGeral = getMatricula(dados[i][4]);
|
||||
|
||||
dataset.addRow([
|
||||
dados[i][0], // codigoCentroCusto
|
||||
dados[i][1], // centroCusto
|
||||
dados[i][2], // gestor
|
||||
idGestor,
|
||||
dados[i][3], // diretor
|
||||
idDiretor,
|
||||
dados[i][4], // diretor geral
|
||||
idDiretorGeral
|
||||
]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
function onMobileSync(user) {}
|
||||
@@ -0,0 +1,73 @@
|
||||
function defineStructure() {
|
||||
|
||||
}
|
||||
function onSync(lastSyncDate) {
|
||||
|
||||
}
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
dataset.addColumn("codigo");
|
||||
dataset.addColumn("descricao");
|
||||
|
||||
log.info("### Iniciando criação do dataset de Condições de Pagamento ###");
|
||||
|
||||
var servicecode = 'API_CONDICAO_PAGAMENTO'; // Nome do serviço cadastrado no Fluig
|
||||
var usuario = "fluig";
|
||||
var senha = "Ginseng@";
|
||||
|
||||
try {
|
||||
log.info("Iniciando chamada para o clientService...");
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: servicecode,
|
||||
endpoint: "https://rest.grupoginseng.com.br/rest/api/fat/v1/paymentcondition?Fields=Code,Plots.Description&Page=1&PageSize=100",
|
||||
method: 'get',
|
||||
timeoutService: '60000',
|
||||
params: {},
|
||||
options: {
|
||||
encoding: 'UTF-8',
|
||||
useBasicAuth: true,
|
||||
username: usuario,
|
||||
password: senha
|
||||
}
|
||||
};
|
||||
|
||||
log.info("Parâmetros da chamada: " + JSON.stringify(data));
|
||||
|
||||
var vo = clientService.invoke(JSON.stringify(data));
|
||||
var retorno = vo.getResult();
|
||||
log.info("Retorno da chamada: " + retorno);
|
||||
|
||||
if (retorno) {
|
||||
var objData = JSON.parse(retorno);
|
||||
var itens = objData["items"];
|
||||
|
||||
log.info("Número de itens retornados: " + itens.length);
|
||||
|
||||
for (var i = 0; i < itens.length; i++) {
|
||||
dataset.addRow([
|
||||
itens[i]["Code"],
|
||||
itens[i]["Description"]
|
||||
]);
|
||||
}
|
||||
log.info("Dataset preenchido com sucesso");
|
||||
} else {
|
||||
log.warn("A API retornou uma resposta vazia.");
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
log.error("Erro na chamada do clientService: " + error.message);
|
||||
dataset = DatasetBuilder.newDataset();
|
||||
dataset.addColumn('ERRO');
|
||||
dataset.addRow([error.toString()]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function onMobileSync(user) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
// Definir colunas que queremos no retorno
|
||||
dataset.addColumn("C1_FILIAL");
|
||||
dataset.addColumn("C1_NUM");
|
||||
dataset.addColumn("C1_ITEM");
|
||||
dataset.addColumn("C1_PRODUTO");
|
||||
dataset.addColumn("C1_DESCRI");
|
||||
dataset.addColumn("C1_QUANT");
|
||||
dataset.addColumn("C1_VUNIT");
|
||||
dataset.addColumn("C1_TOTAL");
|
||||
dataset.addColumn("C1_DATPRF");
|
||||
dataset.addColumn("C1_CC");
|
||||
dataset.addColumn("C1_CONTA");
|
||||
dataset.addColumn("C1_SOLICIT");
|
||||
dataset.addColumn("C1_EMISSAO");
|
||||
dataset.addColumn("C1_COTACAO");
|
||||
dataset.addColumn("C1_PEDIDO");
|
||||
dataset.addColumn("C1_ITEMPED");
|
||||
dataset.addColumn("STATUS");
|
||||
dataset.addColumn("data_consulta");
|
||||
dataset.addColumn("hora_consulta");
|
||||
dataset.addColumn("sucesso");
|
||||
|
||||
try {
|
||||
// 🔎 Captura o número da SC passado como constraint
|
||||
var numeroSC = null;
|
||||
if (constraints != null) {
|
||||
for (var i = 0; i < constraints.length; i++) {
|
||||
if (constraints[i].fieldName == "numeroSCProtheus") {
|
||||
numeroSC = constraints[i].initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!numeroSC) {
|
||||
dataset.addRow(["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Erro: número SC não informado"]);
|
||||
return dataset;
|
||||
}
|
||||
|
||||
// ⚙️ Monta requisição para o Protheus
|
||||
var data = {
|
||||
companyId: "1",
|
||||
serviceCode: "Postprod", // ajuste conforme seu serviço cadastrado
|
||||
endpoint: "/rest/uf_mata110/" + numeroSC,
|
||||
method: "get",
|
||||
timeoutService: "10000",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var response = clientService.invoke(JSON.stringify(data));
|
||||
|
||||
if (response && response.getResult()) {
|
||||
var result = JSON.parse(response.getResult());
|
||||
|
||||
if (result.sucesso && result.solicitacoes && result.solicitacoes.length > 0) {
|
||||
var sc = result.solicitacoes[0]; // pega a primeira solicitação retornada
|
||||
|
||||
// ⚠️ Trata a cotação: ignora valores default
|
||||
var cotacao = sc.C1_COTACAO || "";
|
||||
if (cotacao == "000000" || cotacao == "000001") {
|
||||
cotacao = "";
|
||||
}
|
||||
|
||||
dataset.addRow([
|
||||
sc.C1_FILIAL || "",
|
||||
sc.C1_NUM || "",
|
||||
sc.C1_ITEM || "",
|
||||
sc.C1_PRODUTO || "",
|
||||
sc.C1_DESCRI || "",
|
||||
sc.C1_QUANT || "",
|
||||
sc.C1_VUNIT || "",
|
||||
sc.C1_TOTAL || "",
|
||||
sc.C1_DATPRF || "",
|
||||
sc.C1_CC || "",
|
||||
sc.C1_CONTA || "",
|
||||
sc.C1_SOLICIT || "",
|
||||
sc.C1_EMISSAO || "",
|
||||
cotacao,
|
||||
sc.C1_PEDIDO || "",
|
||||
sc.C1_ITEMPED || "",
|
||||
sc.STATUS || "",
|
||||
result.data_consulta || "",
|
||||
result.hora_consulta || "",
|
||||
"true"
|
||||
]);
|
||||
} else {
|
||||
dataset.addRow(["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "false"]);
|
||||
}
|
||||
} else {
|
||||
dataset.addRow(["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "false"]);
|
||||
}
|
||||
} catch (e) {
|
||||
dataset.addRow(["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Erro: " + e.message]);
|
||||
}
|
||||
|
||||
return dataset;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
function defineStructure() {
|
||||
addColumn("codigo");
|
||||
addColumn("nome");
|
||||
|
||||
}
|
||||
function onSync(lastSyncDate) {
|
||||
|
||||
}
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
var dataSource = "/jdbc/ProtheusDSs"; // Nome da conexão cadastrada no Fluig
|
||||
var ic = new javax.naming.InitialContext();
|
||||
var ds = ic.lookup(dataSource);
|
||||
var conn = ds.getConnection();
|
||||
var stmt = null;
|
||||
var rs = null;
|
||||
|
||||
try {
|
||||
log.info("Iniciando execução do dataset...");
|
||||
|
||||
var sql = "SELECT a2_cod, a2_nome FROM SA2010 where D_E_L_E_T_ = '';"
|
||||
log.info("Query SQL: " + sql);
|
||||
|
||||
stmt = conn.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
dataset.addColumn("codigo");
|
||||
dataset.addColumn("nome");
|
||||
|
||||
var encontrouResultados = false;
|
||||
while (rs.next()) {
|
||||
encontrouResultados = true;
|
||||
log.info("Registro encontrado: " + rs.getString("a2_cod") + " - " + rs.getString("a2_nome"));
|
||||
dataset.addRow([rs.getString("a2_cod"), rs.getString("a2_nome")]);
|
||||
}
|
||||
|
||||
if (!encontrouResultados) {
|
||||
log.info("Nenhum registro encontrado para a consulta.");
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
log.error("Erro ao executar dataset: " + e.message);
|
||||
} finally {
|
||||
try {
|
||||
if (rs) rs.close();
|
||||
if (stmt) stmt.close();
|
||||
if (conn) conn.close();
|
||||
} catch (e) {
|
||||
log.error("Erro ao fechar recursos: " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
return dataset;
|
||||
|
||||
}
|
||||
|
||||
function onMobileSync(user) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
function defineStructure() {
|
||||
|
||||
}
|
||||
function onSync(lastSyncDate) {
|
||||
|
||||
}
|
||||
function createDataset(fields, constraints, sortFields) {
|
||||
|
||||
var dataset = DatasetBuilder.newDataset();
|
||||
|
||||
dataset.addColumn("nomeOcorrenciaManutencao");
|
||||
|
||||
// Adicione dados para o dataset, exemplo:
|
||||
dataset.addRow(["Substituição de lâmpada AR 111"]);
|
||||
dataset.addRow(["Reparo em fita de led ( Serviço de solda )"]);
|
||||
dataset.addRow(["Fonte de 5ap para fita de led dos móveis"]);
|
||||
dataset.addRow(["Letreiro sem funcionar"]);
|
||||
dataset.addRow(["Disjuntor desarmando"]);
|
||||
dataset.addRow(["Tomadas do caixa sem funcionar"]);
|
||||
dataset.addRow(["Troca de lâmpadas tubular branco frio - 6500k 9w ER salão de vendas"]);
|
||||
dataset.addRow(["Substituição lâmpada bulbo 15w estoque"]);
|
||||
dataset.addRow(["Substituição de Painel de led 62,5x62,5 40w 6500k branco frio (ER,CD )"]);
|
||||
dataset.addRow(["Interruptor sem funcionar"]);
|
||||
dataset.addRow(["Painel de led 30x30 24W 6500k ( wc, copa )"]);
|
||||
dataset.addRow(["Ponto elétrico ( Copa, estoque, pdv , vendas)"]);
|
||||
dataset.addRow(["Visita emergencial ( Disjuntor geral desarmando )"]);
|
||||
dataset.addRow(["Fonte de 10ap para letreiro"]);
|
||||
dataset.addRow(["Central Nobreak 2 Contr. Motor Dc Porta Aço Enrolar Aut. 24v"]);
|
||||
dataset.addRow(["Central 2 Contr. Motor AC Porta Aço Enrolar Aut. 24v"]);
|
||||
dataset.addRow(["Motor De Porta De Enrolar De Aço Ac de 100 á 500 Kg 220v"]);
|
||||
dataset.addRow(["Motor P/porta De Aço De Enrolar Dc 100 á 800 kg 220v C/ com central Nobreak"]);
|
||||
dataset.addRow(["Manutenção preventiva em porta de enrolar automática"]);
|
||||
dataset.addRow(["Serviço emergencial porta de enrolar não quer abrir ou descer"]);
|
||||
dataset.addRow(["Controle para porta de enrolar automática + configuração"]);
|
||||
dataset.addRow(["Ar-condicionado"]);
|
||||
dataset.addRow(["Vazamento no estoque"]);
|
||||
dataset.addRow(["Torneira gotejando ( copa,wc )"]);
|
||||
dataset.addRow(["Vaso sanitário entupido"]);
|
||||
dataset.addRow(["Pintura da fachada"]);
|
||||
dataset.addRow(["Pintura do estoque"]);
|
||||
dataset.addRow(["Pintura geral da loja"]);
|
||||
dataset.addRow(["Caixa de gordura entupida"]);
|
||||
dataset.addRow(["Telhado com vazamento"]);
|
||||
dataset.addRow(["Instalação de porta copo, papel toalha etc..."]);
|
||||
dataset.addRow(["Reparo de gesso"]);
|
||||
dataset.addRow(["Fechadura para porta de vidro"]);
|
||||
dataset.addRow(["Puxador da porta caindo ( vidro, retaguarda, copa etc..."]);
|
||||
dataset.addRow(["Porta de vidro arrastando"]);
|
||||
dataset.addRow(["Cadeira de make com defeito"]);
|
||||
dataset.addRow(["Porta dos móveis caindo"]);
|
||||
dataset.addRow(["Confecção de móvel ( Copa, retaguarda etc...)"]);
|
||||
dataset.addRow(["Outros"]);
|
||||
dataset.addRow(["Demarcações"]);
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function onMobileSync(user) {
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,729 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Solicitação de compra</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="/style-guide/css/fluig-style-guide.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="comprasV2.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
|
||||
<!-- JS -->
|
||||
<script src="/resources/js/jquery/jquery.js"></script>
|
||||
<script src="/resources/js/jquery/jquery-ui.min.js"></script>
|
||||
<script src="/resources/js/mustache/mustache-min.js"></script>
|
||||
<script src="/style-guide/js/fluig-style-guide.min.js"></script>
|
||||
<script type="text/javascript" src="/webdesk/vcXMLRPC.js"></script>
|
||||
<script type="text/javascript" src="compras_digital.js"></script>
|
||||
<script type="text/javascript" src="anexos.js"></script>
|
||||
|
||||
<style>
|
||||
/* Ajuste de altura e alinhamento dos botões com inputs */
|
||||
.input-group .form-control,
|
||||
.input-group .btn {
|
||||
height: 34px;
|
||||
line-height: 1.42857143;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.input-group .btn {
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
h6 { color: #AFB0B3 !important; font-weight: normal !important; }
|
||||
h2 {
|
||||
color: #04506b !important;
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
}
|
||||
h2:after {
|
||||
content: "" !important;
|
||||
flex: 1 1 auto !important;
|
||||
border-bottom: 2px solid #04506b !important;
|
||||
margin-left: .5rem !important;
|
||||
}
|
||||
.flaticon { color: #04506b !important; }
|
||||
|
||||
#rcorners {
|
||||
height: 110px;
|
||||
line-height: 110px;
|
||||
color: #fff;
|
||||
border-radius: 0 0 50px 50px;
|
||||
background: linear-gradient(90deg, rgba(4,80,107,1) 0%, rgba(4,80,107,1) 50%, rgba(4,80,107,1) 100%);
|
||||
text-align: center !important;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.change-weight { font-weight: 400 !important; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="fluig-style-guide" style="background-color:white;">
|
||||
<h1 id="rcorners" style="margin:0;">Solicitação de compra</h1>
|
||||
<ul id="wizard-steps" class="steps m-t-20">
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Solicitação</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Validando necessidade</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Solicitando...</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Dados Adicionais</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Indicar Cotação</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Confirmação Cotação</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Aprovação Ccusto</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Aprovação GERF</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Aprovação CEO</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Receber Produto</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Problema</span></li>
|
||||
<li class="step-item"><span class="step-bullet"></span><span class="step-label">Fim</span></li>
|
||||
</ul>
|
||||
|
||||
<form name="form" role="form">
|
||||
<!-- Campos ocultos -->
|
||||
<input type="hidden" id="WKNumProces" name="WKNumProces">
|
||||
<input type="hidden" id="activity" name="activity">
|
||||
<input type="hidden" id="formMode" name="formMode">
|
||||
<input type="hidden" id="empresa" name="empresa">
|
||||
<input type="hidden" id="requesterMail" name="requesterMail">
|
||||
<input type="hidden" id="requesterId" name="requesterId">
|
||||
<input type="hidden" id="currentUserName" name="currentUserName">
|
||||
<input type="hidden" id="currentUsermail" name="currentUsermail">
|
||||
<input type="hidden" id="currentUserId" name="currentUserId">
|
||||
<input type="hidden" id="moreInfo" name="moreInfo">
|
||||
<input type="hidden" id="gestor_cc" name="gestor_cc">
|
||||
<input type="hidden" id="filialest" name="filialest">
|
||||
<input type="hidden" id="filialdest" name="filialdest">
|
||||
<input type="hidden" id="filialprotheus" name="filialprotheus">
|
||||
<input type="hidden" id="codigocentroCusto" name="codigocentroCusto">
|
||||
<input type="hidden" name="numeroSCProtheus" id="numeroSCProtheus">
|
||||
<input type="hidden" name="statusSCProtheus" id="statusSCProtheus">
|
||||
<input type="hidden" name="solicitanteSCProtheus" id="solicitanteSCProtheus">
|
||||
<input type="hidden" name="emissaoSCProtheus" id="emissaoSCProtheus">
|
||||
<input type="hidden" name="qtdItensSCProtheus" id="qtdItensSCProtheus">
|
||||
<input type="hidden" name="dataCadastroSCProtheus" id="dataCadastroSCProtheus">
|
||||
<input type="hidden" name="horaCadastroSCProtheus" id="horaCadastroSCProtheus">
|
||||
<input type="hidden" name="cotacaoSCProtheus" id="cotacaoSCProtheus">
|
||||
<input type="hidden" name="pedidoSCProtheus" id="pedidoSCProtheus">
|
||||
<input type="hidden" name="statusAtendimento" id="statusAtendimento">
|
||||
|
||||
|
||||
|
||||
<div class="container activity-all">
|
||||
<!-- ACTIVITY 0 / 1 - Dados da solicitação -->
|
||||
<div class="activity activity-0 activity-1">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-tests-central icon-md" aria-hidden="true"></i>Dados da solicitação</h2>
|
||||
<button type="button" class="btn btn-info btn-sm" id="btnHistorico"
|
||||
style="background-color:#04506b; border-color:#04506b;">
|
||||
<i class="fluigicon fluigicon-eye-open"></i> Ver Histórico
|
||||
</button>
|
||||
<h6>Dados referentes aos responsáveis pela abertura e pela solicitação do atual processo.</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Linha 1 -->
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-2 col-xs-12">
|
||||
<label>Tipo de Solicitação</label>
|
||||
<select name="tipoSolicitacao" id="tipoSolicitacao" class="form-control" required>
|
||||
<option value="">Selecione</option>
|
||||
<option>Material</option>
|
||||
<option>Serviço</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Usuário solicitante</label>
|
||||
<input type="text" name="usuarioSolicitante" id="usuarioSolicitante" class="form-control"
|
||||
placeholder="Inserir nome completo do solicitante. Ex: João da Silva"
|
||||
data-protection="Usuário solicitante" data-protection-anonymizable data-protection-sensitive
|
||||
data-protection-name data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>E-mail do solicitante</label>
|
||||
<input type="email" name="emailSolicitante" id="emailSolicitante" class="form-control"
|
||||
placeholder="Inserir e-mail do solicitante. Ex: joaodasilva@mail.com"
|
||||
data-protection="E-mail do solicitante" data-protection-anonymizable data-protection-sensitive
|
||||
data-protection-mail data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-12 divEstabelecimentoFilial alertaCampo">
|
||||
<label for="zoom">Estabelecimento/Filial <span class="required text-danger"><strong>*</strong></span></label>
|
||||
<input type="zoom" class="form-control" name="estabelecimento" id="estabelecimento" data-zoom="{
|
||||
'displayKey':'LOJA',
|
||||
'placeholder': 'Buscar nome do estabelecimento ou filial',
|
||||
'datasetId':'dsSysCompan',
|
||||
'fields':[
|
||||
{'field':'LOJA','label':'Filial','standard':'true','search':'true'},
|
||||
{'field':'CNPJ','label':'CNPJ','standard':'true'},
|
||||
{'field':'ESTADO','label':'ESTADO','standard':'true'}
|
||||
]
|
||||
}">
|
||||
<p class="help-block" id="estabelecimentoFilial" style="display:none;position:absolute;font-size:12px;">
|
||||
Preenchimento obrigatório
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12 divCentroCusto alertaCampo">
|
||||
<label for="zoom">Centro de custo <span class="required text-danger"><strong>*</strong></span></label>
|
||||
<input type="zoom" class="form-control" name="centro_custo" id="centro_custo" data-zoom="{
|
||||
'displayKey':'centroCusto',
|
||||
'placeholder': 'Buscar número ou nome do centro de custo',
|
||||
'datasetId':'ds_centroCusto',
|
||||
'fields':[
|
||||
{'field':'codigoCentroCusto','label':'Código','standard':'true','search':'true'},
|
||||
{'field':'centroCusto','label':'Nome','search':'true'},
|
||||
{'field':'gestorCentroCusto','label':'gestorCentroCusto','visible':'false'},
|
||||
{'field':'idGestor','label':'idGestor','visible':'false'},
|
||||
{'field':'emailGestor','label':'emailGestor','visible':'false'}
|
||||
]
|
||||
}">
|
||||
<p class="help-block" id="centroCusto" style="display:none;position:absolute;font-size:12px;">
|
||||
Preenchimento obrigatório
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group col-md-2 col-xs-12">
|
||||
<label>Urgência</label>
|
||||
<select name="urgencia" id="urgencia" class="form-control">
|
||||
<option value="">Selecione</option>
|
||||
<option>Normal</option>
|
||||
<option>Urgente</option>
|
||||
<option>Emergencial</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Linha 3 -->
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-4 col-xs-12">
|
||||
<label for="descProduto">Produto/serviço</label>
|
||||
<div class="input-group">
|
||||
<input type="hidden" name="produtoCod" id="produtoCod">
|
||||
<input type="text" name="descProduto" id="descProduto" class="form-control" placeholder="Buscar..." readonly>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-info" type="button" id="btnBuscaProd">
|
||||
<span class="fluigicon fluigicon-search"></span>
|
||||
</button>
|
||||
<button class="btn btn-danger" type="button" id="btnLimpaProd">
|
||||
<span class="fluigicon fluigicon-trash"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2 col-xs-12">
|
||||
<label>Quantidade </label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn"><button type="button" class="btn btn-danger" id="qtdMenos">−</button></span>
|
||||
<input type="number" min="0" step="1" name="quantidade" id="quantidade" class="form-control text-center" value="0" required>
|
||||
<span class="input-group-btn"><button type="button" class="btn btn-success" id="qtdMais">+</button></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Botão adicionar item (oculto) -->
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-8 col-xs-12 text-center">
|
||||
<button type="button" id="btnAddItem" class="btn btn-primary" style="display:none;">
|
||||
<span class="fluigicon fluigicon-add"></span> Adicionar Item
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Painel Itens -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Itens</strong></div>
|
||||
<div class="panel-body">
|
||||
<table id="tbItens" tablename="tbItens" class="table table-bordered" noaddbutton="true" nodeletebutton="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Código</th>
|
||||
<th>Descrição</th>
|
||||
<th>Qtd</th>
|
||||
<th>Data Limite</th>
|
||||
<th>*</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Linha modelo -->
|
||||
<tr class="tableRow" detail="true">
|
||||
<td><span class="tableIndex"></span></td>
|
||||
<td><input type="text" name="Codproduto" class="form-control" readonly></td>
|
||||
<td><input type="text" name="produtoDesc" class="form-control" readonly></td>
|
||||
<td><input type="number" name="qtd" class="form-control text-right" min="0" step="1"></td>
|
||||
<td><input type="date" name="dataNec" class="form-control" placeholder="dd/mm/aa"></td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-link" onclick="fnWdkRemoveChild(this)">
|
||||
<span class="fluigicon fluigicon-trash"></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-link" onclick="handleProductLink(this)" data-link="">
|
||||
<span class="fluigicon fluigicon-link"></span>
|
||||
</button>
|
||||
</div>
|
||||
<!-- campo hidden que o Fluig vai gravar -->
|
||||
<input type="hidden" name="produtoLink" class="produto-link">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Linha 5 - Anexo + Observações -->
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Adicionar Anexo?</label>
|
||||
<div class="componentAnexo">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="hidden" class="descAnexo" name="fdComprovante" value="Anexo" />
|
||||
<input type="text" id="fnComprovante" name="fnComprovante" class="form-control inputAnexo input-sm" placeholder="Selecione um arquivo" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btnUpFile btn btn-success btn-sm" data-acao="upload" onclick="anexo(event)" title="Selecionar">
|
||||
<i class="fluigicon fluigicon-file-upload icon-sm"></i>
|
||||
</button>
|
||||
<button style="display:none;" type="button" class="btnViewerFile btn btn-info btn-sm" data-acao="viewer" onclick="anexo(event)" title="Visualizar" disabled>
|
||||
<i class="fluigicon fluigicon-eye-open icon-sm"></i>
|
||||
</button>
|
||||
<button style="display:none;" type="button" class="btnDownloadFile btn btn-info btn-sm" data-acao="download" onclick="anexo(event)" title="Download" disabled>
|
||||
<i class="fluigicon fluigicon-download icon-sm"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-8 col-xs-12">
|
||||
<label>Motivo da compra<span class="required text-danger"><strong>*</strong></span></label>
|
||||
<textarea class="form-control" rows="3" id="observacoes" name="observacoes"
|
||||
placeholder="Descreva aqui alguma informação adicional que julgar importante."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-0/1 -->
|
||||
|
||||
<!-- ACTIVITY 4 - Análise da necessidade -->
|
||||
<div class="activity activity-121">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-check-circle" aria-hidden="true"></i>Análise da Necessidade</h2>
|
||||
<h6>Informações complementares sobre a análise da solicitação pelo gestor responsável</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-6 col-xs-12">
|
||||
<label>Responsável por aprovar a solicitação</label>
|
||||
<input type="text" name="user_validacao_gestor" id="user_validacao_gestor" class="form-control" readonly
|
||||
data-protection="Responsável por lançamento de documentos" data-protection-anonymizable
|
||||
data-protection-sensitive data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Data</label>
|
||||
<input type="text" name="data_validacao_gestor" id="data_validacao_gestor" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_gestor">Justificativa</label>
|
||||
<textarea class="form-control" name="justi_decisao_gestor" id="justi_decisao_gestor"></textarea>
|
||||
<p class="help-block" id="justiDecisaoGestor" style="display:none;">Preenchimento obrigatório</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-4 -->
|
||||
|
||||
<!-- DADOS DO DOCUMENTO -->
|
||||
<div class="activity activity-114">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-totvs-forms icon-md" aria-hidden="true"></i>Dados da Solicitação</h2>
|
||||
<h6>Dados referentes a solicitação.</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-top:15px; border-radius:8px; box-shadow:0 2px 5px rgba(0,0,0,0.1);">
|
||||
<div class="card-body" style="padding:15px; background-color:#f9f9f9;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<p><strong>Número:</strong> <span id="numeroSCProtheus_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Status:</strong> <span id="statusSCProtheus_label" class="badge bg-secondary">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Solicitante:</strong> <span id="solicitanteSCProtheus_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Emissão:</strong> <span id="emissaoSCProtheus_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Qtd. Itens:</strong> <span id="qtdItensSCProtheus_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Data da aprovação:</strong> <span id="dataCadastroSCProtheus_label">-</span> às <span id="horaCadastroSCProtheus_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Status:</strong> <span id="statusSC_label" class="badge bg-secondary">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Cotação:</strong> <span id="cotacaoSC_label">-</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Pedido:</strong> <span id="pedidoSC_label">-</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- CONSULTA COTAÇÃO -->
|
||||
<div class="activity activity-105">
|
||||
<div class="row">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Consulta Cotação</strong></div>
|
||||
|
||||
<!-- Campo hidden para guardar o total -->
|
||||
<input type="hidden" name="valorTotalCotacao" id="valorTotalCotacao" value="0"/>
|
||||
|
||||
<!-- Tabela Pai-Filho -->
|
||||
<table tablename="tbCotacao" id="tbCotacao" class="table table-bordered" noaddbutton="true" nodeletebutton="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item</th>
|
||||
<th>Produto</th>
|
||||
<th>Qtd</th>
|
||||
<th>Preço</th>
|
||||
<th>Total</th>
|
||||
<th>Selecionar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- O Fluig precisa de uma linha “modelo” -->
|
||||
<tr>
|
||||
<td><input type="text" name="item" id="item" readonly></td>
|
||||
<td><input type="text" name="produto" id="produto" readonly></td>
|
||||
<td><input type="text" name="qtdc" id="qtdc" readonly></td>
|
||||
<td><input type="text" name="preco" id="preco" readonly></td>
|
||||
<td><input type="text" name="total" id="total" readonly></td>
|
||||
<td><input type="checkbox" name="selecionado" id="selecionado" value="S"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ACTIVITY 137- Aprovar cotação Compras -->
|
||||
<div class="activity activity-137">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-check-circle" aria-hidden="true"></i>Aprovar cotação</h2>
|
||||
<h6>Análise da cotação</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-6 col-xs-12">
|
||||
<label>Usuário responsável da Cotação</label>
|
||||
<input type="text" name="user_validacao_aprova" id="user_validacao_aprova" class="form-control" readonly
|
||||
data-protection="Responsável por aprovar de documentos" data-protection-anonymizable
|
||||
data-protection-sensitive data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Data</label>
|
||||
<input type="text" name="data_validacao_aprova" id="data_validacao_aprova" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_aprova">Justificativa</label>
|
||||
<textarea class="form-control" name="justi_decisao_aprova" id="justi_decisao_aprova"></textarea>
|
||||
<p class="help-block" id="justiDecisaoGestor" style="display:none;">Preenchimento obrigatório</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ACTIVITY 133- Aprovar cotação Compras -->
|
||||
<div class="activity activity-133">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-check-circle" aria-hidden="true"></i>Aprovação do Gestor do C.Custo</h2>
|
||||
<h6>Aprovação da cotação</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-6 col-xs-12">
|
||||
<label>Gestor responsável da Cotação</label>
|
||||
<input type="text" name="gestor_validacao_aprova" id="gestor_validacao_aprova" class="form-control" readonly
|
||||
data-protection="Responsável por aprovar de documentos" data-protection-anonymizable
|
||||
data-protection-sensitive data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Data</label>
|
||||
<input type="text" name="data_validacao_aprova_gestor" id="data_validacao_aprova_gestor" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_aprova_gestor">Justificativa</label>
|
||||
<textarea class="form-control" name="justi_decisao_aprova_gestor" id="justi_decisao_aprova_gestor"></textarea>
|
||||
<p class="help-block" id="justi_decisao_aprova_gestor" style="display:none;">Preenchimento obrigatório</p>
|
||||
</div>
|
||||
<div class="form-group col-md-8 col-xs-12">
|
||||
<label>Jusiticativa do solicitante <span class="required text-danger"><strong>*</strong></span></label>
|
||||
<textarea class="form-control" rows="3" id="observacoesdosolicitante" name="observacoesdosolicitante" readonly
|
||||
placeholder="Descreva aqui alguma informação adicional que julgar importante."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-131 -->
|
||||
<!-- ACTIVITY 147- Aprovar cotação Compras -->
|
||||
<div class="activity activity-147">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-check-circle" aria-hidden="true"></i>Aprovação do Gerente Financeiro</h2>
|
||||
<h6>Aprovação do Gerente Financeiro</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-6 col-xs-12">
|
||||
<label>Ger. Financeiro responsável pela Aprovação</label>
|
||||
<input type="text" name="gerf_validacao_aprova" id="gerf_validacao_aprova" class="form-control" readonly
|
||||
data-protection="Responsável por aprovar de documentos" data-protection-anonymizable
|
||||
data-protection-sensitive data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Data</label>
|
||||
<input type="text" name="data_validacao_aprova_gerf" id="data_validacao_aprova_gerf" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_aprova_gerente">Justificativa</label>
|
||||
<textarea class="form-control" name="justi_decisao_aprova_gerente" id="justi_decisao_aprova_gerente" readonly></textarea>
|
||||
<p class="help-block" id="justi_decisao_aprova_gerente" style="display:none;">Preenchimento obrigatório</p>
|
||||
</div>
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_gc">Justificativa do Gestor do Centro de Custo</label>
|
||||
<textarea class="form-control" name="justi_decisao_gc" id="justi_decisao_gc"readonly></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao__soli">Justificativa do Solicitante</label>
|
||||
<textarea class="form-control" name="justi_decisao__soli" id="justi_decisao__soli" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-131 -->
|
||||
<!-- ACTIVITY 137- Aprovar cotação Compras -->
|
||||
<div class="activity activity-158">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2><i class="flaticon flaticon-check-circle" aria-hidden="true"></i>Aprovação CEO</h2>
|
||||
<h6> Aprovação do CEO</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-6 col-xs-12">
|
||||
<label>Usuário responsável</label>
|
||||
<input type="text" name="ceo_validacao_aprova" id="ceo_validacao_aprova" class="form-control" readonly
|
||||
data-protection="Responsável por aprovar de documentos" data-protection-anonymizable
|
||||
data-protection-sensitive data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo" />
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-12">
|
||||
<label>Data</label>
|
||||
<input type="text" name="data_validacao_aprova_ceo" id="data_validacao_aprova_ceo" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_aprova_ceo">Justificativa</label>
|
||||
<textarea class="form-control" name="justi_decisao_aprova_ceo" id="justi_decisao_aprova_ceo" readonly></textarea>
|
||||
<p class="help-block" id="justi_decisao_aprova_ceo" style="display:none;">Preenchimento obrigatório</p>
|
||||
</div>
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_aprova_ceo">Justificativa do Gerente Financeiro</label>
|
||||
<textarea class="form-control" name="justi_decisao_gerf" id="justi_decisao_gerf" readonly></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisaogc">Justificativa do Gestor do Centro de custo</label>
|
||||
<textarea class="form-control" name="justi_decisaogc" id="justi_decisaogc" readonly></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-12 divJustiDecisaoGestor alertaCampo">
|
||||
<label for="justi_decisao_solic">Justificativa do Solicitante</label>
|
||||
<textarea class="form-control" name="justi_decisao_solic" id="justi_decisao_solic" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-131 -->
|
||||
<div class="activity activity-18">
|
||||
<div>
|
||||
<br />
|
||||
<h2>
|
||||
<i class="flaticon flaticon-check-circle" aria-hidden="true"></i>
|
||||
Validação do pedido e entrega dos itens
|
||||
</h2>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Botão para consultar agora -->
|
||||
<div id="espelhoPedido" style="margin-top:15px;">
|
||||
⏳ Aguardando geração do pedido...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-10 col-xs-6">
|
||||
<label for="userValidacaoItens"> Solicitante </label>
|
||||
<input type="text" name="userValidacaoItens" id="userValidacaoItens" class="form-control"
|
||||
data-protection="Solicitante" data-protection-anonymizable data-protection-sensitive
|
||||
data-protection-name
|
||||
data-protection-class-legitimate-interests="Dado coletado para o funcionamento do processo"
|
||||
readonly />
|
||||
</div>
|
||||
<div class="form-group col-md-2 col-xs-6">
|
||||
<label for="dataValidacaoItens"> Data </label>
|
||||
<input type="text" name="dataValidacaoItens" id="dataValidacaoItens" class="form-control" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Houve algum problema com a compra?</label>
|
||||
<span class="text-danger"><strong>*</strong></span><br />
|
||||
<div>
|
||||
<label>
|
||||
<input name="validacaoItens" id="validacaoItensEntregue" value="entregue" type="radio" />
|
||||
<span class="change-weight">Não houve problema</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="validacaoItens" id="validacaoItensNaoEntregue" value="naoEntregue" type="radio" />
|
||||
<span class="change-weight">Pedido não entregue</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input name="validacaoItens" id="validacaoItensIncorreto" value="incorreto" type="radio" />
|
||||
<span class="change-weight">Entregue com inconsistência (qualidade, quantidade,
|
||||
embalagem)</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justificativaDecisaoItens">
|
||||
<div class="form-field">
|
||||
<div class="form-input">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="justificativaDecisaoItens">Justificativa</label>
|
||||
<span class="text-danger"><strong>*</strong></span>
|
||||
<textarea class="form-control requiredInput"
|
||||
placeholder="Insira a justificativa sobre a validação dos itens" name="justificativaDecisaoItens"
|
||||
id="justificativaDecisaoItens"></textarea>
|
||||
<p class="text-danger text-error">
|
||||
Preenchimento obrigatório.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="activity activity-24">
|
||||
<div>
|
||||
<br />
|
||||
<h2>
|
||||
<i class="flaticon flaticon-document-check" aria-hidden="true"></i>
|
||||
Validar problema: considerações de compras
|
||||
</h2>
|
||||
<h6>Dados referentes às possíveis implicações desta compra.</h6>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="justificativaValidaProblema">Quais as suas considerações?</label>
|
||||
<span class="text-danger"><strong>*</strong></span>
|
||||
<textarea placeholder="Insira as considerções desta compra." class="form-control"
|
||||
name="justificativaValidaProblema" id="justificativaValidaProblema"></textarea>
|
||||
<p class="text-danger text-error">
|
||||
Preenchimento obrigatório.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /activity-18 -->
|
||||
<br><br>
|
||||
<h6>Todos os campos com * são de preenchimento obrigatório.</h6>
|
||||
</div><!-- /container -->
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,437 @@
|
||||
/**
|
||||
* Toda a lógica para o correto funcionamento desse componente foi feito em cima das classes abaixo:
|
||||
* .componentAnexo, .descAnexo, .inputAnexo, .btnUpFile, .btnViewerFile, .btnDownloadFile e o atributo data-acao
|
||||
* Sem elas o código não irá funcionar, então se por acaso você quiser alterar os nomes dessas classes
|
||||
* lembre-se de alterar nas funções desse arquivo e também no css
|
||||
*/
|
||||
|
||||
/**
|
||||
* Direciona para cada função correspondente ao valor que esta no atributo data-acao do botão
|
||||
* @param {object} event Parâmetro obrigatório, o própio elemento que sofreu o evento click
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function anexo(event){
|
||||
console.log("event")
|
||||
console.log(event)
|
||||
try{
|
||||
const acao = event.currentTarget.getAttribute("data-acao");
|
||||
const inputFile = $(event.currentTarget).parent().parent().find(".inputAnexo")[0]
|
||||
const fileDescription = $(event.currentTarget).parent().parent().find(".descAnexo").val()
|
||||
if(acao == "upload"){
|
||||
uploadFile(fileDescription, inputFile.id)
|
||||
}
|
||||
if(acao == "viewer"){
|
||||
viewerFile(fileDescription)
|
||||
}
|
||||
if(acao == "download"){
|
||||
downloadFile(fileDescription, inputFile.id)
|
||||
}
|
||||
if(acao == "delete"){
|
||||
removeFileConfirm(fileDescription, inputFile.id)
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função anexo")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Envia arquivos para a aba Anexos do Fluig
|
||||
* Função adaptada por Sérgio Machado
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do arquivo que ficará na aba anexos do Fluig
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @return {void}
|
||||
*/
|
||||
function uploadFile(fileDescription, idInput) {
|
||||
try{
|
||||
var tabAttachments = parent.document.getElementById("tab-attachments");
|
||||
if (tabAttachments) {
|
||||
//Verifica se o navegador é o Ie9 para realizar o devido tratamento
|
||||
if (parent.WCMAPI.isIe9()) {
|
||||
$(".ecm-navigation-silverlight", parent.document).show("fade").css("top", 0);
|
||||
$("#ecm-navigation-silverlight", parent.document).attr({
|
||||
"data-on-camera": "true", "data-file-name-camera": fileDescription, "data-inputNameFile": idInput
|
||||
});
|
||||
$(parent.document).on("keyup", this.actionKeyup)
|
||||
} else {
|
||||
var element = parent.document.getElementById("ecm-navigation-inputFile-clone");
|
||||
if (element && document.createEvent) {
|
||||
element.setAttribute("data-on-camera", "true");
|
||||
if (fileDescription && idInput) {
|
||||
element.setAttribute("data-file-name-camera", fileDescription)
|
||||
element.setAttribute("data-inputNameFile", idInput)
|
||||
}
|
||||
//Realiza o click no botão "Carregar arquivos" que tem na aba de anexos
|
||||
element.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função uploadFile")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Função executada após a escolha do arquivo a ser enviado para o Fluig.
|
||||
* Verifica se o anexo já existe, seta o valor do arquivo fisico no campo e altera o estado dos botões
|
||||
* @return {void}
|
||||
*/
|
||||
$(function(){
|
||||
try{
|
||||
window.parent.$("#ecm-navigation-inputFile-clone").on('change', function(e) {
|
||||
const inputNameFile = this.getAttribute("data-inputNameFile");
|
||||
const fileDescription = this.getAttribute("data-file-name-camera");
|
||||
const filePhisical = this.files[0].name;
|
||||
if(fileDescription && fileDescription){
|
||||
/**
|
||||
* O trecho de código abaixo percorre os anexos do Fluig e caso já exista um anexo com a mesma descrição, ele será removido.
|
||||
* Em seguida limpa o campo onde é armazenado o nome fisico do arquivo
|
||||
*/
|
||||
$.each(parent.ECM.attachmentTable.getData(), function(i, attachment) {
|
||||
var descricao = attachment.description;
|
||||
if (fileDescription == descricao) {
|
||||
parent.WKFViewAttachment.removeAttach([i]);
|
||||
setFilePhisicalName(inputNameFile, "");
|
||||
}
|
||||
});
|
||||
setFilePhisicalName(inputNameFile, filePhisical)
|
||||
if(getFormMode() == "ADD"){
|
||||
btnState(inputNameFile, 'delete', 'download');
|
||||
}
|
||||
if(getFormMode() == "MOD"){
|
||||
btnState(inputNameFile, 'delete', 'viewer');
|
||||
}
|
||||
if(getFormMode() == "VIEW"){
|
||||
btnState(inputNameFile, 'download', 'viewer');
|
||||
}
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado ao selecionar o arquivo")
|
||||
console.error(e)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Visualizar arquivos que esta na aba Anexos do Fluig
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do anexo
|
||||
* @return {void}
|
||||
*/
|
||||
function viewerFile(fileDescription) {
|
||||
try{
|
||||
if(hasFileFluig(fileDescription)){
|
||||
const anexos = parent.ECM.attachmentTable.getData();
|
||||
for(let i = 0; i < anexos.length; i++){
|
||||
var descricao = anexos[i].description;
|
||||
if (fileDescription == descricao) {
|
||||
parent.WKFViewAttachment.openAttachmentView('adm', anexos[i].documentId);
|
||||
return
|
||||
}
|
||||
}
|
||||
}else{
|
||||
FLUIGC.toast({
|
||||
title: "Atenção",
|
||||
message: "Anexo não encontrado",
|
||||
type: "warning"
|
||||
});
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função viewerFile")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Realiza o download do arquivo que esta na aba Anexos do Fluig
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do arquivo que esta na aba anexos do Fluig
|
||||
* @return {void}
|
||||
*/
|
||||
function downloadFile(fileDescription, idInput) {
|
||||
try{
|
||||
const filename = getFormMode() == "VIEW" ? $(`#${idInput}`).text() : $(`#${idInput}`).val()
|
||||
FLUIGC.message.confirm({
|
||||
message: `Deseja baixar o anexo <b>${filename}</b>?`,
|
||||
title: 'Confirmação',
|
||||
labelYes: 'Sim, quero baixar',
|
||||
labelNo: 'Não, quero cancelar',
|
||||
}, function(result) {
|
||||
if (result) {
|
||||
$.each(parent.ECM.attachmentTable.getData(), function(i, attachment) {
|
||||
var descricao = attachment.description;
|
||||
if (fileDescription == descricao) {
|
||||
parent.WKFViewAttachment.downloadAttach([i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função downloadFile")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirmação para Remove arquivo que esta na aba Anexos do Fluig
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do arquivo que esta na aba anexos do Fluig
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function removeFileConfirm(fileDescription, idInput) {
|
||||
try{
|
||||
const filename = $(`#${idInput}`).val()
|
||||
FLUIGC.message.confirm({
|
||||
message: `Deseja remover o anexo <b>${filename}</b>?`,
|
||||
title: 'Confirmação',
|
||||
labelYes: 'Sim, quero remover',
|
||||
labelNo: 'Não, quero cancelar',
|
||||
}, function(result) {
|
||||
if (result) {
|
||||
removeFile(fileDescription)
|
||||
setFilePhisicalName(idInput, "")
|
||||
btnState(idInput, "upload", "download")
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função removeFileConfirm")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove arquivo que esta na aba Anexos do Fluig
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do arquivo que esta na aba anexos do Fluig
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function removeFile(fileDescription) {
|
||||
try{
|
||||
$.each(parent.ECM.attachmentTable.getData(), function(i, attachment) {
|
||||
if (attachment.description == fileDescription) {
|
||||
parent.WKFViewAttachment.removeAttach([i]);
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função removeFile")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Seta o nome do arquivo fisico no campo e realiza tratativa caso o campo esteja bloqueado pelo enableFields
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @param {String} filePhisical Parâmetro obrigatório, nome do arquivo fisico
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function setFilePhisicalName(idInput, filePhisical){
|
||||
try{
|
||||
if(idInput.indexOf("_") == 0){
|
||||
$("#" + idInput.substring(1)).val(filePhisical);
|
||||
}
|
||||
$("#" + idInput).val(filePhisical);
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função setFilePhisicalName")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Altera o estado e visibilidade dos botões de anexos
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @param {String} acao Parâmetro obrigatório, ação para ser executada no momento do click, se é delete ou upload
|
||||
* @param {String} btn Parâmetro obrigatório, botão secundário que deve sofrer ação de ficar visível ou não. Botão de Download ou Viewer
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function btnState(idInput, acao, btn){
|
||||
try{
|
||||
let btnUpFile = $(`#${idInput}`).parent().parent().find(".btnUpFile");
|
||||
let btnDownloadFile = $(`#${idInput}`).parent().parent().find(".btnDownloadFile");
|
||||
let btnViewerFile = $(`#${idInput}`).parent().parent().find(".btnViewerFile");
|
||||
if(acao == "delete"){
|
||||
btnUpFile.removeClass("btn-success").addClass("btn-danger");
|
||||
btnUpFile.attr({'data-acao': acao, 'title': 'Excluir'});
|
||||
btnUpFile.find("i").removeClass("fluigicon-file-upload").addClass("fluigicon-trash");
|
||||
if(btn == "download"){
|
||||
btnDownloadFile.prop("disabled", false);
|
||||
btnDownloadFile.show()
|
||||
}
|
||||
if(btn == "viewer"){
|
||||
btnViewerFile.prop("disabled", false);
|
||||
btnViewerFile.show()
|
||||
}
|
||||
}
|
||||
if(acao == "upload"){
|
||||
btnUpFile.removeClass("btn-danger").addClass("btn-success");
|
||||
btnUpFile.attr({'data-acao': acao, 'title': 'Selecionar'});
|
||||
btnUpFile.find("i").removeClass("fluigicon-trash").addClass("fluigicon-file-upload");
|
||||
btnDownloadFile.prop("disabled", true);
|
||||
btnDownloadFile.hide()
|
||||
btnViewerFile.prop("disabled", true);
|
||||
btnViewerFile.hide()
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função btnState")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Faz tratativa nos botões do anexos percorrente cada class .componentAnexo
|
||||
* Em modo de visualização o botão de upload é removido, e caso tenha anexo, habilita o botão de visualização do anexo
|
||||
* Se em modo de edição e conter anexo o botão de upload é alterado para o botão de deletar anexos e habilita o botão de visualização
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function displayBtnFiles(){
|
||||
try{
|
||||
$('.componentAnexo').each(function(i, element) {
|
||||
let inputFile = $(element).find(".inputAnexo")
|
||||
let inputFileVew = $(element).find(".componentAnexo")
|
||||
let btnUpFile = $(element).find(".btnUpFile");
|
||||
let btnViewerFile = $(element).find(".btnViewerFile");
|
||||
let btnDownloadFile = $(element).find(".btnDownloadFile");
|
||||
|
||||
if(getFormMode() == "VIEW"){
|
||||
btnUpFile.remove();
|
||||
if(inputFileVew.val() != ""){
|
||||
btnViewerFile.prop("disabled", false);
|
||||
btnViewerFile.show()
|
||||
}
|
||||
}
|
||||
if(getFormMode() == "MOD" && inputFile.val() != ""){
|
||||
btnUpFile.remove();
|
||||
// btnState(inputFile[0].id, "delete", "viewer")
|
||||
btnViewerFile.prop("disabled", false);
|
||||
btnViewerFile.show()
|
||||
btnDownloadFile.prop("disabled", false);
|
||||
btnDownloadFile.show()
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função displayBtnFiles")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove o botão de upload/delete
|
||||
* @param {String} inputFile Parâmetro obrigatório, Id do campo
|
||||
* @return {void}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function invisibleBtnUpload(inputFile){
|
||||
try{
|
||||
if(getFormMode() == "MOD" || getFormMode() == "VIEW"){
|
||||
if($(`#_${inputFile}`).length){
|
||||
let btnUpFile = $(`#_${inputFile}`).parent().parent().find(".btnUpFile");
|
||||
btnUpFile.remove();
|
||||
} else{
|
||||
let btnUpFile = $(`#${inputFile}`).parent().parent().find(".btnUpFile");
|
||||
btnUpFile.remove();
|
||||
}
|
||||
}
|
||||
if($(`#_${inputFile}`).length){
|
||||
if($(`#_${inputFile}`).val() == ""){
|
||||
$(`#_${inputFile}`).attr({placeholder:"Nenhum anexo selecionado"});
|
||||
}
|
||||
} else{
|
||||
if($(`#${inputFile}`).val() == ""){
|
||||
$(`#${inputFile}`).attr({placeholder:"Nenhum anexo selecionado"});
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
console.error("Houve um erro inesperado na função invisibleBtnUpload")
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifica se os campos do anexo de uma tabela pai e filho esta preenchido,
|
||||
* caso esteja, ele verifica se o anexo esta presente na aba de anexos do Fluig
|
||||
* @param {String} tablename Parâmetro obrigatório, tablename da tabela pai e filho.
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo de anexo que deseja verificar
|
||||
* @return {String} - Retorna string de erros caso apresente erros
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function invalidFilesTable(tablename, idInput){
|
||||
try {
|
||||
let errors = "";
|
||||
const countRows = $(`[tablename='${tablename}']`).find('tbody tr').not(':first');
|
||||
for(let i = 0; i < countRows.length; i++){
|
||||
let indice = getIndice(countRows.eq(i).find("input")[0].id);
|
||||
let inputNameFile = $(`#_${idInput}___${indice}`).length ? $(`#_${idInput}___${indice}`) : $(`#${idInput}___${indice}`)
|
||||
let fileDescription = inputNameFile.parent().find(".descAnexo").val()
|
||||
if(inputNameFile.val() && !hasFileFluig(fileDescription)){
|
||||
errors += `<li style='margin-bottom: 5px;'>O anexo <b>${inputNameFile.val()}</b> da linha <b>${i+1}</b> não foi encontrado</li>`
|
||||
}
|
||||
}
|
||||
return errors
|
||||
} catch (e) {
|
||||
console.error('Houve um erro inesperado na função invalidFileTable')
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifica se o campo do anexo esta preenchido, caso esteja, ele verifica se o anexo esta válido
|
||||
* @param {String} idInput Parâmetro obrigatório, Id do campo em que o nome do arquivo fisico é gravado
|
||||
* @return {Boolean}
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function invalidFile(idInput){
|
||||
try {
|
||||
const inputNameFile = $(`#${idInput}`).val()
|
||||
if(inputNameFile){
|
||||
if($(`#_${idInput}`).length){
|
||||
let fileDescription = $(`#_${idInput}`).parent().find(".descAnexo").val()
|
||||
return !hasFileFluig(fileDescription)
|
||||
} else{
|
||||
let fileDescription = $(`#${idInput}`).parent().find(".descAnexo").val()
|
||||
return !hasFileFluig(fileDescription)
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Houve um erro inesperado na função invalidFile')
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifica se o anexo existe na aba de anexos do Fluig
|
||||
* @param {String} fileDescription Parâmetro obrigatório, Descrição do arquivo
|
||||
* @return {Boolean} - Retorna verdadeiro caso o arquivo exista
|
||||
* @author Sérgio Machado
|
||||
*/
|
||||
function hasFileFluig(fileDescription){
|
||||
try {
|
||||
const anexos = parent.ECM.attachmentTable.getData();
|
||||
for(let i = 0; i < anexos.length; i++){
|
||||
var descricao = anexos[i].description;
|
||||
if (fileDescription == descricao) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
} catch (e) {
|
||||
console.error('Houve um erro inesperado na função hasFileFluig')
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
$(document).ready(function () {
|
||||
if ($("#formMode").val() == "VIEW") {
|
||||
showAndBlock(["all"]);
|
||||
} else {
|
||||
var activity = $("#activity").val();
|
||||
var requestDate = getCurrentDate();
|
||||
|
||||
$(".activity").hide();
|
||||
$(".activity-" + activity).show();
|
||||
|
||||
// Atividade 4: Abertura
|
||||
if (activity == 4) {
|
||||
$("#dataNec").val(requestDate[0]); // já coloca a data de hoje
|
||||
toggleBotaoAddItem();
|
||||
|
||||
// Atividade 6: Validação do Centro de Custo
|
||||
} else if (activity == 5) {
|
||||
showAndBlock([4]); // bloqueia os campos da abertura
|
||||
$("#userValidacaoGestor").val($("#currentUserName").val());
|
||||
$("#dataValidacaoGestor").val(requestDate[0] + " - " + requestDate[1]);
|
||||
|
||||
if ($("#justificativaDecisaoGestor").val() == "") {
|
||||
$(".justificativa-activity-4").hide();
|
||||
}
|
||||
}
|
||||
}});
|
||||
|
||||
$(document).ready(function () {
|
||||
try {
|
||||
FLUIGC.calendar('#dataNec');
|
||||
} catch (e) {
|
||||
console.warn("Erro ao iniciar calendário:", e);
|
||||
}
|
||||
|
||||
toggleBotaoAddItem(); // inicia escondido
|
||||
|
||||
/* ========= Eventos ========= */
|
||||
$('#precoRef, #quantidade').on('input', recalcTotal);
|
||||
|
||||
$('#qtdMais').on('click', function () {
|
||||
let v = parseInt($('#quantidade').val() || '0', 10);
|
||||
$('#quantidade').val(v + 1);
|
||||
recalcTotal();
|
||||
});
|
||||
|
||||
$('#qtdMenos').on('click', function () {
|
||||
let v = parseInt($('#quantidade').val() || '0', 10);
|
||||
v = Math.max(0, v - 1);
|
||||
$('#quantidade').val(v);
|
||||
recalcTotal();
|
||||
});
|
||||
|
||||
$('#btnBuscaProd').on('click', consultarProdutos);
|
||||
$('#btnLimpaProd').on('click', limparCamposPrincipais);
|
||||
$('#btnAddItem').on('click', adicionarItem);
|
||||
});
|
||||
|
||||
function showAndBlock(activity) {
|
||||
for (var i = 0; i < activity.length; i++) {
|
||||
$(".activity-" + activity[i]).show();
|
||||
$(".hideButton").hide();
|
||||
$(".activity-" + activity[i] + " :input").each(function () {
|
||||
$(this).attr("readonly", "readonly")
|
||||
.css("background-color", "#eee")
|
||||
.children("option:not(:selected)").prop("disabled", true);
|
||||
|
||||
if ($(this).is(":checkbox") || $(this).is(":radio")) {
|
||||
$(this).attr("disabled", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getCurrentDate() {
|
||||
var newDate = new Date();
|
||||
var h = newDate.getHours();
|
||||
if (h < 10) {
|
||||
h = "0" + h;
|
||||
}
|
||||
var m = newDate.getMinutes();
|
||||
if (m < 10) {
|
||||
m = "0" + m;
|
||||
}
|
||||
var hour = h + ":" + m; // + ":" + s;
|
||||
var day = newDate.getDate();
|
||||
if (day < 10) {
|
||||
day = "0" + day;
|
||||
}
|
||||
var month = newDate.getMonth() + 1;
|
||||
if (month < 10) {
|
||||
month = "0" + month;
|
||||
}
|
||||
newDate = day + "/" + month + "/" + newDate.getFullYear();
|
||||
var currentDate = [newDate, hour];
|
||||
return currentDate;
|
||||
}
|
||||
|
||||
|
||||
function toggleBotaoAddItem() {
|
||||
const temProduto = $('#produtoCod').val() || $('#DescoProduto').val();
|
||||
if (temProduto && temProduto.trim() !== "") {
|
||||
$('#btnAddItem').show();
|
||||
} else {
|
||||
$('#btnAddItem').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function setSelectedZoomItem(selectedItem) {
|
||||
if (selectedItem.inputId === "estabelecimento") {
|
||||
// joga o código da filial (cnpj, etc.)
|
||||
$("#filialDesc").val(selectedItem.CNPJ); // supondo que o dataset dsSysCompany devolva o campo CNPJ
|
||||
$("#filialest").val(selectedItem.ESTADO); // supondo que o dataset dsSysCompany devolva o campo ESTADO
|
||||
}
|
||||
if (selectedItem.inputId === "centroCusto") {
|
||||
// joga o nome do gestor
|
||||
$("#gestorCentroCusto").val(selectedItem.gestorCentroCusto); // supondo que o dataset dsCentroCusto devolva o campo GestorCentroCusto
|
||||
}
|
||||
}
|
||||
|
||||
function removedZoomItem(removedItem) {
|
||||
if (removedItem.inputId === "estabelecimento") {
|
||||
// Quando remover a empresa, limpa os campos relacionados
|
||||
$("#filialDesc").val('');
|
||||
$("#filialest").val('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ========= Config ========= */
|
||||
const DATASET_PRODUTOS = "dsProd"; // dataset de produtos
|
||||
let todosProdutos = [];
|
||||
let paginaAtual = 1;
|
||||
const itensPorPagina = 10;
|
||||
|
||||
/* ========= Utils ========= */
|
||||
function escapeHTML(txt) {
|
||||
return $('<div>').text(txt == null ? '' : String(txt)).html();
|
||||
}
|
||||
|
||||
function brMoneyToFloat(v) {
|
||||
if (!v) return 0;
|
||||
return parseFloat(String(v).replace(/\./g, '').replace(',', '.')) || 0;
|
||||
}
|
||||
|
||||
function floatToBRL(n) {
|
||||
try {
|
||||
return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(n || 0);
|
||||
} catch (_) {
|
||||
return 'R$ ' + (n || 0).toFixed(2).replace('.', ',');
|
||||
}
|
||||
}
|
||||
|
||||
/* ========= Modal Consulta Produtos ========= */
|
||||
function consultarProdutos() {
|
||||
FLUIGC.modal({
|
||||
title: 'Consulta de Produtos',
|
||||
content:
|
||||
'<div id="buscaProduto" style="margin-bottom:10px;">' +
|
||||
'<input type="text" id="filtroDescricao" class="form-control" placeholder="Buscar por descrição..." onkeyup="filtrarProdutos()">' +
|
||||
'</div>' +
|
||||
'<div id="listaProdutos"></div>' +
|
||||
'<div id="paginacaoProdutos" style="margin-top:10px; text-align:center;"></div>',
|
||||
id: 'modalConsultaProdutos',
|
||||
size: 'large',
|
||||
actions: [{ 'label': 'Fechar', 'autoClose': true }]
|
||||
}, function (err) {
|
||||
if (!err) carregaListaProdutos();
|
||||
});
|
||||
}
|
||||
|
||||
function carregaListaProdutos(filtro) {
|
||||
// Só chama o dataset se ainda não carregou nada
|
||||
if (todosProdutos.length === 0) {
|
||||
let dataset = DatasetFactory.getDataset(DATASET_PRODUTOS, null, null, null);
|
||||
todosProdutos = dataset && dataset.values ? dataset.values : [];
|
||||
console.log("Produtos carregados do dataset:", todosProdutos.length);
|
||||
}
|
||||
|
||||
paginaAtual = 1;
|
||||
renderizaProdutos(filtro);
|
||||
}
|
||||
|
||||
|
||||
function filtrarProdutos() {
|
||||
paginaAtual = 1;
|
||||
renderizaProdutos();
|
||||
}
|
||||
|
||||
function renderizaProdutos(filtro) {
|
||||
filtro = (filtro || $('#filtroDescricao').val() || '').toLowerCase();
|
||||
|
||||
// Agora filtra no cache (sem chamar dataset de novo)
|
||||
const produtosFiltrados = todosProdutos.filter(p =>
|
||||
(p.descricao || '').toLowerCase().includes(filtro) ||
|
||||
(p.codigo || '').toLowerCase().includes(filtro) ||
|
||||
(p.medida || '').toLowerCase().includes(filtro)
|
||||
);
|
||||
|
||||
const inicio = (paginaAtual - 1) * itensPorPagina;
|
||||
const fim = inicio + itensPorPagina;
|
||||
const produtosPagina = produtosFiltrados.slice(inicio, fim);
|
||||
|
||||
let html = `
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Codigo</th>
|
||||
<th>Descricao</th>
|
||||
<th>UM</th>
|
||||
<th>Ultimo Preco</th>
|
||||
<th>Acao</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
if (produtosPagina.length === 0) {
|
||||
html += `
|
||||
<tr>
|
||||
<td colspan="5" class="text-center text-muted">
|
||||
Nenhum produto encontrado
|
||||
</td>
|
||||
</tr>`;
|
||||
} else {
|
||||
produtosPagina.forEach(produto => {
|
||||
const codigo = escapeHTML(produto['codigo']);
|
||||
const descricao = escapeHTML(produto['descricao']);
|
||||
const um = escapeHTML(produto['medida'] || '');
|
||||
const preco = produto['ultimoPreco'] || '0,00';
|
||||
|
||||
html += `
|
||||
<tr>
|
||||
<td>${codigo}</td>
|
||||
<td>${descricao}</td>
|
||||
<td>${um}</td>
|
||||
<td>${preco}</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-success selecionar-produto"
|
||||
data-codigo="${codigo}"
|
||||
data-descricao="${descricao}"
|
||||
data-preco="${preco}">
|
||||
Selecionar
|
||||
</button>
|
||||
</td>
|
||||
</tr>`;
|
||||
});
|
||||
}
|
||||
|
||||
html += `</tbody></table>`;
|
||||
$('#listaProdutos').html(html);
|
||||
|
||||
renderizaPaginacao(produtosFiltrados.length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function renderizaPaginacao(totalItens) {
|
||||
const totalPaginas = Math.ceil(totalItens / itensPorPagina);
|
||||
let html = '';
|
||||
if (totalPaginas > 1) {
|
||||
if (paginaAtual > 1) {
|
||||
html += '<button class="btn btn-sm btn-default" onclick="mudarPagina(' + (paginaAtual - 1) + ')">Anterior</button> ';
|
||||
}
|
||||
html += ' Pagina ' + paginaAtual + ' de ' + totalPaginas + ' ';
|
||||
if (paginaAtual < totalPaginas) {
|
||||
html += '<button class="btn btn-sm btn-default" onclick="mudarPagina(' + (paginaAtual + 1) + ')">Proxima</button>';
|
||||
}
|
||||
}
|
||||
$('#paginacaoProdutos').html(html);
|
||||
}
|
||||
|
||||
function mudarPagina(n) {
|
||||
paginaAtual = n;
|
||||
renderizaProdutos();
|
||||
}
|
||||
|
||||
/* ========= Seleção ========= */
|
||||
function selecionarProduto(codigo, descricao, preco) {
|
||||
$('#produtoCod').val(codigo);
|
||||
$('#DescoProduto').val(codigo + ' - ' + descricao);
|
||||
$('#ultimoPreco').val(preco);
|
||||
|
||||
FLUIGC.toast({ title: 'Produto', message: 'Selecionado: ' + descricao, type: 'success' });
|
||||
$('#modalConsultaProdutos').modal('hide');
|
||||
|
||||
toggleBotaoAddItem(); // 👈 mostra botão
|
||||
}
|
||||
|
||||
/* ========= Eventos delegados ========= */
|
||||
$(document).on('click', '.selecionar-produto', function () {
|
||||
const codigo = $(this).data('codigo');
|
||||
const descricao = $(this).data('descricao');
|
||||
const preco = $(this).data('preco');
|
||||
selecionarProduto(codigo, descricao, preco);
|
||||
});
|
||||
|
||||
// Digitação em Qtd ou Preço Ref → recalcula automaticamente
|
||||
$(document).on('input', 'input[name^="qtd___"], input[name^="Refpreco___"]', function () {
|
||||
recalcLinha(this);
|
||||
});
|
||||
|
||||
/* ========= Total / Quantidade ========= */
|
||||
function recalcTotal() {
|
||||
const q = parseFloat($('#quantidade').val() || '0');
|
||||
const p = brMoneyToFloat($('#precoRef').val());
|
||||
const t = (q * p) || 0;
|
||||
$('#total').val(floatToBRL(t));
|
||||
}
|
||||
|
||||
/* ========= Index das linhas ========= */
|
||||
function atualizarIndex() {
|
||||
$('#tbItens tbody tr.tableRow').each(function (i) {
|
||||
if (!$(this).is('[detail=true]')) {
|
||||
$(this).find('.tableIndex').text(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* ========= Totais da tabela ========= */
|
||||
function atualizarTotais() {
|
||||
let totalItens = 0;
|
||||
let totalGeral = 0;
|
||||
|
||||
// Pega todos os valores da tabela
|
||||
const dadosTabela = $('#tbItens').find('input').serializeArray();
|
||||
|
||||
// Transforma em objeto chave:valor para fácil acesso
|
||||
const mapValores = {};
|
||||
dadosTabela.forEach(item => {
|
||||
mapValores[item.name] = item.value;
|
||||
});
|
||||
|
||||
// Percorre por linha (cada linha tem um sufixo ___1, ___2...)
|
||||
let idx = 1;
|
||||
while (mapValores['qtd___' + idx] !== undefined) {
|
||||
const qtd = parseFloat(mapValores['qtd___' + idx] || 0);
|
||||
const preco = brMoneyToFloat(mapValores['Refpreco___' + idx] || "0");
|
||||
const total = qtd * preco;
|
||||
|
||||
totalItens += qtd;
|
||||
totalGeral += total;
|
||||
|
||||
// Atualiza campo total da linha
|
||||
if ($(`#totalValor___${idx}`).length) {
|
||||
$(`#totalValor___${idx}`).val(floatToBRL(total));
|
||||
}
|
||||
|
||||
idx++;
|
||||
}
|
||||
|
||||
// Atualiza rodapé
|
||||
$('#totalItens').val(totalItens);
|
||||
$('#totalGeral').val(floatToBRL(totalGeral));
|
||||
}
|
||||
|
||||
/* ========= Recalcula uma linha ========= */
|
||||
function recalcLinha(el) {
|
||||
const $linha = $(el).closest('tr');
|
||||
const qtd = parseFloat($linha.find('input[name^="qtd___"]').val() || '0');
|
||||
const preco = brMoneyToFloat($linha.find('input[name^="Refpreco___"]').val() || '0');
|
||||
const total = qtd * preco;
|
||||
|
||||
$linha.find('input[name^="totalValor___"]').val(floatToBRL(total));
|
||||
atualizarTotais();
|
||||
}
|
||||
|
||||
/* ========= Remover linha ========= */
|
||||
function fnWdkRemoveChild(el) {
|
||||
$(el).closest('tr').remove();
|
||||
atualizarIndex();
|
||||
atualizarTotais();
|
||||
}
|
||||
|
||||
/* ========= Adicionar Item ========= */
|
||||
function adicionarItem() {
|
||||
const cod = $('#produtoCod').val();
|
||||
const desc = $('#DescoProduto').val();
|
||||
const ult = $('#ultimoPreco').val() || '0,00';
|
||||
const qtd = $('#quantidade').val();
|
||||
const prec = $('#precoRef').val();
|
||||
const tot = $('#total').val();
|
||||
const dataN = $('#dataNec').val();
|
||||
|
||||
if (!cod) {
|
||||
FLUIGC.toast({ title: 'Atenção', message: 'Selecione um produto/serviço', type: 'warning' });
|
||||
return;
|
||||
}
|
||||
|
||||
const idx = wdkAddChild('tbItens');
|
||||
|
||||
setTimeout(() => {
|
||||
$('input[name="Codproduto___' + idx + '"]').val(cod);
|
||||
|
||||
const somenteDesc = desc.includes('-') ? desc.split('-').slice(1).join('-').trim() : desc;
|
||||
$('input[name="produtoDesc___' + idx + '"]').val(somenteDesc);
|
||||
|
||||
$('input[name="ultimoPrecoItem___' + idx + '"]').val(ult);
|
||||
$('input[name="qtd___' + idx + '"]').val(qtd).on('input', function () { recalcLinha(this); });
|
||||
$('input[name="Refpreco___' + idx + '"]').val(prec).on('input', function () { recalcLinha(this); });
|
||||
$('input[name="totalValor___' + idx + '"]').val(tot);
|
||||
$('input[name="dataNecItem___' + idx + '"]').val(dataN);
|
||||
|
||||
atualizarIndex();
|
||||
atualizarTotais();
|
||||
}, 0);
|
||||
|
||||
FLUIGC.toast({ title: 'Item', message: 'Adicionado à lista', type: 'success' });
|
||||
|
||||
limparCamposPrincipais();
|
||||
}
|
||||
|
||||
/* ========= Limpar campos principais ========= */
|
||||
function limparCamposPrincipais() {
|
||||
$('#produtoCod, #DescoProduto').val('');
|
||||
$('#ultimoPreco').val('0,00');
|
||||
$('#quantidade').val('0');
|
||||
$('#precoRef').val('0,00');
|
||||
$('#total').val('R$ 0,00');
|
||||
$('#fnComprovante').val('');
|
||||
|
||||
|
||||
toggleBotaoAddItem(); // 👈 mostra botão
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
.painel-ginseng > .panel-heading {
|
||||
background-color: #7a113a !important; /* azul do logo */
|
||||
color: #fff !important; /* texto branco */
|
||||
border-color: #0b556b !important;
|
||||
}
|
||||
|
||||
.painel-ginseng {
|
||||
border-color: #0b556b !important;
|
||||
}
|
||||
|
||||
/* tabela ocupa 100% */
|
||||
#tbItens {
|
||||
table-layout: fixed; /* força obedecer larguras definidas */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* todas as células centralizam por padrão */
|
||||
#tbItens td, #tbItens th {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* coluna # */
|
||||
#tbItens th:nth-child(1),
|
||||
#tbItens td:nth-child(1) {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
/* coluna Código (maior espaço) */
|
||||
#tbItens th:nth-child(2),
|
||||
#tbItens td:nth-child(2) {
|
||||
width: 18%;
|
||||
white-space: normal; /* deixa quebrar */
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Descrição */
|
||||
#tbItens th:nth-child(3),
|
||||
#tbItens td:nth-child(3) {
|
||||
width: 27%;
|
||||
}
|
||||
|
||||
/* Preço Ref. */
|
||||
#tbItens th:nth-child(4),
|
||||
#tbItens td:nth-child(4) {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
|
||||
/* qtd */
|
||||
#tbItens th:nth-child(5),
|
||||
#tbItens td:nth-child(5) {
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
/* Data limite */
|
||||
#tbItens th:nth-child(6),
|
||||
#tbItens td:nth-child(6) {
|
||||
width: 8%;
|
||||
}
|
||||
|
||||
/* Excluir */
|
||||
#tbItens th:nth-child(7),
|
||||
#tbItens td:nth-child(7) {
|
||||
width: 6%;
|
||||
}
|
||||
|
||||
td.text-center .btn-link {
|
||||
margin: 0 2px; /* espaçamento horizontal */
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,432 @@
|
||||
$(document).ready(function () {
|
||||
try {
|
||||
FLUIGC.calendar('#dataNec');
|
||||
} catch (e) {
|
||||
console.warn("Erro ao iniciar calendário:", e);
|
||||
}
|
||||
|
||||
toggleBotaoAddItem(); // inicia escondido
|
||||
|
||||
/* ========= Eventos ========= */
|
||||
$('#precoRef, #quantidade').on('input', recalcTotal);
|
||||
|
||||
// formata o teto de preço só quando o usuário sair do campo
|
||||
$('#precoRef').on('blur', function() {
|
||||
const p = brMoneyToFloat($(this).val());
|
||||
$(this).val(floatToBRL(p));
|
||||
recalcTotal();
|
||||
});
|
||||
|
||||
$('#qtdMais').on('click', function () {
|
||||
let v = parseInt($('#quantidade').val() || '0', 10);
|
||||
$('#quantidade').val(v + 1);
|
||||
recalcTotal();
|
||||
});
|
||||
|
||||
$('#qtdMenos').on('click', function () {
|
||||
let v = parseInt($('#quantidade').val() || '0', 10);
|
||||
v = Math.max(0, v - 1);
|
||||
$('#quantidade').val(v);
|
||||
recalcTotal();
|
||||
});
|
||||
|
||||
$('#btnBuscaProd').on('click', consultarProdutos);
|
||||
$('#btnLimpaProd').on('click', limparCamposPrincipais);
|
||||
$('#btnAddItem').on('click', adicionarItem);
|
||||
});
|
||||
|
||||
/* ========= Total / Quantidade ========= */
|
||||
function recalcTotal() {
|
||||
const q = parseFloat($('#quantidade').val() || '0');
|
||||
const p = brMoneyToFloat($('#precoRef').val());
|
||||
const t = (q * p) || 0;
|
||||
$('#total').val(floatToBRL(t));
|
||||
|
||||
}
|
||||
|
||||
function setSelectedZoomItem(selectedItem) {
|
||||
if (selectedItem.inputId === "estabelecimento") {
|
||||
// joga o código da filial (cnpj, etc.)
|
||||
$("#filialdest").val(selectedItem.CNPJ); // supondo que o dataset dsSysCompany devolva o campo CNPJ
|
||||
$("#filialest").val(selectedItem.ESTADO); // supondo que o dataset dsSysCompany devolva o campo ESTADO
|
||||
$("#filialprotheus").val(selectedItem.CODIGO); // supondo que o dataset dsSysCompany devolva o campo CODIGO
|
||||
}
|
||||
if (selectedItem.inputId === "centro_custo") {
|
||||
// joga o código da filial (cnpj, etc.)
|
||||
$("#gestor_cc").val(selectedItem.idGestor); // supondo que o dataset Centro_custo devolva o campo GestorCentroCusto
|
||||
$("#codigocentroCusto").val(selectedItem.codigoCentroCusto); // supondo que o dataset Centro_custo devolva o campo GestorCentroCusto
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function removedZoomItem(removedItem) {
|
||||
if (removedItem.inputId === "estabelecimento") {
|
||||
// Quando remover a empresa, limpa os campos relacionados
|
||||
$("#filialDesc").val('');
|
||||
$("#filialest").val('');
|
||||
}
|
||||
}
|
||||
|
||||
/* ========= Config ========= */
|
||||
const DATASET_PRODUTOS = "dsProd"; // dataset de produtos
|
||||
let todosProdutos = [];
|
||||
let paginaAtual = 1;
|
||||
const itensPorPagina = 10;
|
||||
|
||||
/* ========= Utils ========= */
|
||||
function escapeHTML(txt) {
|
||||
return $('<div>').text(txt == null ? '' : String(txt)).html();
|
||||
}
|
||||
|
||||
function brMoneyToFloat(v) {
|
||||
if (!v) return 0;
|
||||
return parseFloat(
|
||||
String(v)
|
||||
.replace(/R\$/g, '') // remove "R$"
|
||||
.replace(/\s/g, '') // remove espaços
|
||||
.replace(/\./g, '') // remove pontos de milhar
|
||||
.replace(',', '.') // troca vírgula por ponto
|
||||
) || 0;
|
||||
}
|
||||
|
||||
function floatToBRL(n) {
|
||||
try {
|
||||
return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(n || 0);
|
||||
} catch (_) {
|
||||
return 'R$ ' + (n || 0).toFixed(2).replace('.', ',');
|
||||
}
|
||||
}
|
||||
|
||||
/* ========= Modal Consulta Produtos ========= */
|
||||
function consultarProdutos() {
|
||||
FLUIGC.modal({
|
||||
title: 'Consulta de Produtos',
|
||||
content:
|
||||
'<div id="buscaProduto" style="margin-bottom:10px;">' +
|
||||
'<input type="text" id="filtroDescricao" class="form-control" placeholder="Buscar por nome..." onkeyup="filtrarProdutos()">' +
|
||||
'</div>' +
|
||||
'<div id="listaProdutos"></div>' +
|
||||
'<div id="paginacaoProdutos" style="margin-top:10px; text-align:center;"></div>',
|
||||
id: 'modalConsultaProdutos',
|
||||
size: 'large',
|
||||
actions: [{ 'label': 'Fechar', 'autoClose': true }]
|
||||
}, function (err) {
|
||||
if (!err) carregaListaProdutos();
|
||||
});
|
||||
}
|
||||
|
||||
function carregaListaProdutos(filtro) {
|
||||
// Só chama o dataset se ainda não carregou nada
|
||||
if (todosProdutos.length === 0) {
|
||||
let dataset = DatasetFactory.getDataset(DATASET_PRODUTOS, null, null, null);
|
||||
todosProdutos = dataset && dataset.values ? dataset.values : [];
|
||||
console.log("Produtos carregados do dataset:", todosProdutos.length);
|
||||
}
|
||||
|
||||
paginaAtual = 1;
|
||||
renderizaProdutos(filtro);
|
||||
}
|
||||
|
||||
|
||||
function filtrarProdutos() {
|
||||
paginaAtual = 1;
|
||||
renderizaProdutos();
|
||||
}
|
||||
|
||||
function renderizaProdutos(filtro) {
|
||||
filtro = (filtro || $('#filtroDescricao').val() || '').toLowerCase();
|
||||
|
||||
// Agora filtra no cache (sem chamar dataset de novo)
|
||||
const produtosFiltrados = todosProdutos.filter(p =>
|
||||
(p.descricao || '').toLowerCase().includes(filtro) ||
|
||||
(p.codigo || '').toLowerCase().includes(filtro) ||
|
||||
(p.medida || '').toLowerCase().includes(filtro)
|
||||
);
|
||||
|
||||
const inicio = (paginaAtual - 1) * itensPorPagina;
|
||||
const fim = inicio + itensPorPagina;
|
||||
const produtosPagina = produtosFiltrados.slice(inicio, fim);
|
||||
|
||||
let html = `
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Codigo</th>
|
||||
<th>Descricao</th>
|
||||
<th>UM</th>
|
||||
<th>Ultimo Preco</th>
|
||||
<th>Acao</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
if (produtosPagina.length === 0) {
|
||||
html += `
|
||||
<tr>
|
||||
<td colspan="5" class="text-center text-muted">
|
||||
Nenhum produto encontrado
|
||||
</td>
|
||||
</tr>`;
|
||||
} else {
|
||||
produtosPagina.forEach(produto => {
|
||||
const codigo = escapeHTML(produto['codigo']);
|
||||
const descricao = escapeHTML(produto['descricao']);
|
||||
const um = escapeHTML(produto['medida'] || '');
|
||||
const preco = produto['ultimo_preco'] || '0,00';
|
||||
|
||||
html += `
|
||||
<tr>
|
||||
<td>${codigo}</td>
|
||||
<td>${descricao}</td>
|
||||
<td>${um}</td>
|
||||
<td>${preco}</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-success selecionar-produto"
|
||||
data-codigo="${codigo}"
|
||||
data-descricao="${descricao}"
|
||||
data-preco="${preco}">
|
||||
Selecionar
|
||||
</button>
|
||||
</td>
|
||||
</tr>`;
|
||||
});
|
||||
}
|
||||
|
||||
html += `</tbody></table>`;
|
||||
$('#listaProdutos').html(html);
|
||||
|
||||
renderizaPaginacao(produtosFiltrados.length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function renderizaPaginacao(totalItens) {
|
||||
const totalPaginas = Math.ceil(totalItens / itensPorPagina);
|
||||
let html = '';
|
||||
if (totalPaginas > 1) {
|
||||
if (paginaAtual > 1) {
|
||||
html += '<button class="btn btn-sm btn-default" onclick="mudarPagina(' + (paginaAtual - 1) + ')">Anterior</button> ';
|
||||
}
|
||||
html += ' Pagina ' + paginaAtual + ' de ' + totalPaginas + ' ';
|
||||
if (paginaAtual < totalPaginas) {
|
||||
html += '<button class="btn btn-sm btn-default" onclick="mudarPagina(' + (paginaAtual + 1) + ')">Proxima</button>';
|
||||
}
|
||||
}
|
||||
$('#paginacaoProdutos').html(html);
|
||||
}
|
||||
|
||||
function mudarPagina(n) {
|
||||
paginaAtual = n;
|
||||
renderizaProdutos();
|
||||
}
|
||||
|
||||
/* ========= Seleção ========= */
|
||||
function selecionarProduto(codigo, descricao, preco) {
|
||||
$('#produtoCod').val(codigo);
|
||||
$('#descProduto').val(codigo + ' - ' + descricao);
|
||||
$('#ultimoPreco').val(preco);
|
||||
|
||||
FLUIGC.toast({ title: 'Produto', message: 'Selecionado: ' + descricao, type: 'success' });
|
||||
$('#modalConsultaProdutos').modal('hide');
|
||||
|
||||
toggleBotaoAddItem(); // 👈 mostra botão
|
||||
}
|
||||
|
||||
function toggleBotaoAddItem() {
|
||||
const temProduto = $('#produtoCod').val() || $('#descProduto').val();
|
||||
if (temProduto && temProduto.trim() !== "") {
|
||||
$('#btnAddItem').show();
|
||||
} else {
|
||||
$('#btnAddItem').hide();
|
||||
}
|
||||
}
|
||||
/* ========= Adicionar Item ========= */
|
||||
function adicionarItem() {
|
||||
const cod = $('#produtoCod').val();
|
||||
const desc = $('#descProduto').val();
|
||||
const qtd = $('#quantidade').val();
|
||||
|
||||
if (!cod) {
|
||||
FLUIGC.toast({ title: 'Atenção', message: 'Selecione um produto/serviço', type: 'warning' });
|
||||
return;
|
||||
}
|
||||
|
||||
const idx = wdkAddChild('tbItens');
|
||||
|
||||
setTimeout(() => {
|
||||
$('input[name="Codproduto___' + idx + '"]').val(cod);
|
||||
|
||||
const somenteDesc = desc.includes('-') ? desc.split('-').slice(1).join('-').trim() : desc;
|
||||
$('input[name="produtoDesc___' + idx + '"]').val(somenteDesc);
|
||||
$('input[name="qtd___' + idx + '"]').val(qtd).on('input', function () { recalcLinha(this); });
|
||||
$('input[name="ultimoPreco___' + idx + '"]').val(prec).on('input', function () { recalcLinha(this); });
|
||||
|
||||
atualizarIndex();
|
||||
atualizarTotais();
|
||||
}, 0);
|
||||
|
||||
FLUIGC.toast({ title: 'Item', message: 'Adicionado à lista', type: 'success' });
|
||||
|
||||
limparCamposPrincipais();
|
||||
}
|
||||
|
||||
/* ========= Limpar campos principais ========= */
|
||||
function limparCamposPrincipais() {
|
||||
$('#produtoCod, #descProduto').val('');
|
||||
$('#quantidade').val('0');
|
||||
$('#precoRef').val('0,00');
|
||||
$('#fnComprovante').val('');
|
||||
|
||||
|
||||
toggleBotaoAddItem(); // 👈 mostra botão
|
||||
}
|
||||
|
||||
/* ========= Eventos delegados ========= */
|
||||
$(document).on('click', '.selecionar-produto', function () {
|
||||
const codigo = $(this).data('codigo');
|
||||
const descricao = $(this).data('descricao');
|
||||
const preco = $(this).data('preco');
|
||||
selecionarProduto(codigo, descricao, preco);
|
||||
});
|
||||
|
||||
|
||||
/* ========= Index das linhas ========= */
|
||||
function atualizarIndex() {
|
||||
$('#tbItens tbody tr.tableRow').each(function (i) {
|
||||
if (!$(this).is('[detail=true]')) {
|
||||
$(this).find('.tableIndex').text(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ========= Remover linha ========= */
|
||||
function fnWdkRemoveChild(el) {
|
||||
$(el).closest('tr').remove();
|
||||
atualizarIndex();
|
||||
atualizarTotais();
|
||||
}
|
||||
|
||||
/* ========= Link do produto ========= */
|
||||
function handleProductLink(el) {
|
||||
const $row = $(el).closest("tr");
|
||||
const $hidden = $row.find("input.produto-link");
|
||||
let linkAtual = $hidden.val();
|
||||
|
||||
if (!linkAtual) {
|
||||
// ainda não tem link → pedir ao usuário
|
||||
let novoLink = prompt("Insira o link do produto:");
|
||||
if (novoLink && novoLink.trim() !== "") {
|
||||
$hidden.val(novoLink.trim()); // grava no hidden (vai persistir no Fluig)
|
||||
}
|
||||
} else {
|
||||
// já existe link → abrir
|
||||
window.open(linkAtual, "_blank");
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var steps = [
|
||||
{ state: 1, label: "Solicitação" },
|
||||
{ state: 121, label: "Validando Necessidade" },
|
||||
{ state: 82, label: "Enviando pedido" },
|
||||
{ state: 114, label: "Cotação Iniciada" },
|
||||
{ state: 105, label: "Indicar Cotação" },
|
||||
{ state: 137, label: "Confirmação da cotação" },
|
||||
{ state: 133, label: "Aprovação Gestor" },
|
||||
{ state: 147, label: "Aprovação Ger. Financeiro" },
|
||||
{ state: 158, label: "Aprovação CEO" },
|
||||
{ state: 18, label: "Recebimento do Produto" },
|
||||
{ state: 24, label: "Problema" },
|
||||
{ state: 52, label: "Fim" }
|
||||
];
|
||||
|
||||
var current = parseInt($("#activity").val() || "0", 10);
|
||||
var idxAtual = steps.findIndex(function (s) { return s.state === current; });
|
||||
if (idxAtual < 0) idxAtual = 0;
|
||||
|
||||
$("#wizard-steps .step-item").each(function (i) {
|
||||
if (i < idxAtual) $(this).addClass("done");
|
||||
if (i === idxAtual) $(this).addClass("active");
|
||||
});
|
||||
|
||||
// clique nos steps
|
||||
$("#wizard-steps .step-item").on("click", function () {
|
||||
var index = $(this).index();
|
||||
var step = steps[index];
|
||||
if (!step) return;
|
||||
|
||||
// 👉 se já estava ativo, mostra tudo de novo
|
||||
if ($(this).hasClass("active") && $(".activity:visible").length === 1) {
|
||||
$(".activity").show();
|
||||
$("#wizard-steps .step-item").removeClass("active");
|
||||
return;
|
||||
}
|
||||
|
||||
// senão, mostra só a activity clicada
|
||||
$(".activity").hide();
|
||||
$(".activity-" + step.state).show();
|
||||
|
||||
$("#wizard-steps .step-item").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
// Quando carregar a página, já pinta o status se tiver valor nos inputs
|
||||
let status = $("#statusSCProtheus").val() || "";
|
||||
let badgeClass = "badge bg-secondary";
|
||||
|
||||
if (status.toLowerCase().includes("sucesso")) badgeClass = "badge bg-success";
|
||||
if (status.toLowerCase().includes("erro")) badgeClass = "badge bg-danger";
|
||||
|
||||
$("#statusSCProtheus_label")
|
||||
.text(status || "-")
|
||||
.removeClass()
|
||||
.addClass(badgeClass);
|
||||
});
|
||||
|
||||
function recalcularTotalCotacao() {
|
||||
var soma = 0;
|
||||
|
||||
$("input[name^='selecionado___']").each(function() {
|
||||
var idx = $(this).attr("id").split("___")[1];
|
||||
|
||||
// pega qtd e preço da linha
|
||||
var qtd = parseFloat($("#qtdc___" + idx).val() || "0");
|
||||
var preco = parseFloat($("#preco___" + idx).val() || "0");
|
||||
|
||||
// calcula total da linha
|
||||
var total = qtd * preco;
|
||||
|
||||
// atualiza campo total da linha
|
||||
$("#total___" + idx).val(total.toFixed(2));
|
||||
|
||||
// se marcado, acumula na soma
|
||||
if ($(this).is(":checked")) {
|
||||
soma += total;
|
||||
}
|
||||
});
|
||||
|
||||
// Atualiza o hidden e dispara change pro Fluig gravar
|
||||
$("#valorTotalCotacao").val(soma.toFixed(2)).trigger("change");
|
||||
}
|
||||
// dispara sempre que marcar/desmarcar
|
||||
$(document).on("change", "input[name^='selecionado___']", function() {
|
||||
recalcularTotalCotacao();
|
||||
});
|
||||
|
||||
// recalcula ao abrir a atividade
|
||||
$(document).ready(function() {
|
||||
recalcularTotalCotacao();
|
||||
});
|
||||
|
||||
// garante que o total seja salvo antes de enviar a atividade
|
||||
function beforeSendValidate(numState, nextState) {
|
||||
console.log("Executando beforeSendValidate, recalculando total...");
|
||||
recalcularTotalCotacao();
|
||||
return true; // precisa retornar true senão bloqueia o envio
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
function displayFields(form, customHTML) {
|
||||
|
||||
var activity = getValue('WKNumState');
|
||||
var userId = getValue('WKUser');
|
||||
|
||||
form.setShowDisabledFields(true);
|
||||
form.setHidePrintLink(true);
|
||||
|
||||
form.setValue("WKNumProces", getValue('WKNumProces'));
|
||||
form.setValue("activity", activity);
|
||||
form.setValue("formMode", form.getFormMode());
|
||||
form.setValue("empresa", getValue("WKCompany"));
|
||||
|
||||
var c1 = DatasetFactory.createConstraint("colleagueId", userId, userId, ConstraintType.MUST);
|
||||
var filter = new Array(c1);
|
||||
var fields = new Array("colleagueName");
|
||||
var retorno = DatasetFactory.getDataset("colleague", fields, filter, null);
|
||||
|
||||
//requester
|
||||
if (activity == 0) {
|
||||
form.setValue("usuario_abertura", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("requesterMail", retorno.getValue(0, "mail"));
|
||||
form.setValue("requesterId", userId);
|
||||
} else {
|
||||
form.setValue("currentUserName", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("currentUsermail", retorno.getValue(0, "mail"));
|
||||
form.setValue("currentUserId", userId);
|
||||
}
|
||||
|
||||
// ✅ Quando for atividade de aprovação do gestor
|
||||
if (activity == 121) {
|
||||
var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());
|
||||
form.setValue("user_validacao_gestor", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("data_validacao_gestor", hoje);
|
||||
}
|
||||
|
||||
if (activity == 133) {
|
||||
var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());
|
||||
form.setValue("gestor_validacao_aprova", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("data_validacao_aprova_gestor", hoje);
|
||||
}
|
||||
|
||||
if (activity == 137) {
|
||||
var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());
|
||||
form.setValue("user_validacao_aprova", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("data_validacao_aprova", hoje);
|
||||
}
|
||||
|
||||
if (activity == 147) {
|
||||
var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());
|
||||
form.setValue("gerf_validacao_aprova", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("data_validacao_aprova_gerf", hoje);
|
||||
}
|
||||
|
||||
if (activity == 18) {
|
||||
var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());
|
||||
form.setValue("userValidacaoItens", retorno.getValue(0, "colleagueName"));
|
||||
form.setValue("dataValidacaoItens", hoje);
|
||||
}
|
||||
|
||||
// ✅ Injetar dados da SC do Protheus (se já tiverem sido preenchidos no servicetask)
|
||||
var camposSC = [
|
||||
"numeroSCProtheus",
|
||||
"statusSCProtheus",
|
||||
"solicitanteSCProtheus",
|
||||
"emissaoSCProtheus",
|
||||
"qtdItensSCProtheus",
|
||||
"dataCadastroSCProtheus",
|
||||
"horaCadastroSCProtheus"
|
||||
];
|
||||
|
||||
camposSC.forEach(function(campo) {
|
||||
var valor = form.getValue(campo);
|
||||
if (valor) {
|
||||
customHTML.append("<script>$('#" + campo + "_label').text('" + valor + "');</script>");
|
||||
}
|
||||
});
|
||||
|
||||
// cor no status
|
||||
var status = form.getValue("statusSCProtheus");
|
||||
if (status) {
|
||||
var badgeClass = "badge bg-secondary";
|
||||
if (status.toLowerCase().indexOf("sucesso") >= 0) badgeClass = "badge bg-success";
|
||||
if (status.toLowerCase().indexOf("erro") >= 0) badgeClass = "badge bg-danger";
|
||||
|
||||
customHTML.append("<script>$('#statusSCProtheus_label').removeClass().addClass('" + badgeClass + "').text('" + status + "');</script>");
|
||||
}
|
||||
|
||||
// Consultar informações adicionais da SC no Protheus
|
||||
var numSC = form.getValue("numeroSCProtheus");
|
||||
if (numSC) {
|
||||
try {
|
||||
var c1 = DatasetFactory.createConstraint("numeroSCProtheus", numSC, numSC, ConstraintType.MUST);
|
||||
var ds = DatasetFactory.getDataset("ds_consultaSC", null, [c1], null);
|
||||
|
||||
if (ds && ds.rowsCount > 0) {
|
||||
var status = ds.getValue(0, "STATUS") || "";
|
||||
var cotacao = ds.getValue(0, "C1_COTACAO") || "";
|
||||
var pedido = ds.getValue(0, "C1_PEDIDO") || "";
|
||||
|
||||
// grava nos hidden inputs
|
||||
form.setValue("statusAtendimento", status);
|
||||
form.setValue("cotacaoSCProtheus", cotacao);
|
||||
form.setValue("pedidoSCProtheus", pedido);
|
||||
|
||||
// mostra nos cards (HTML)
|
||||
customHTML.append("<script>$('#statusSC_label').text('" + status + "');</script>");
|
||||
customHTML.append("<script>$('#cotacaoSC_label').text('" + cotacao + "');</script>");
|
||||
customHTML.append("<script>$('#pedidoSC_label').text('" + pedido + "');</script>");
|
||||
}
|
||||
} catch (e) {
|
||||
log.error("❌ Erro ao consultar dataset ds_consultaSC: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var msgs = [];
|
||||
|
||||
var numeroSC = form.getValue("numeroSCProtheus");
|
||||
var cotacaoSC = form.getValue("cotacaoSCProtheus");
|
||||
var pedidoSC = form.getValue("pedidoSCProtheus");
|
||||
|
||||
if (numeroSC) msgs.push("📌 Gerou SC Protheus nº " + numeroSC);
|
||||
if (cotacaoSC) msgs.push("📌 SC originou Cotação nº " + cotacaoSC);
|
||||
if (pedidoSC) msgs.push("📌 Cotação finalizou → Pedido nº " + pedidoSC);
|
||||
|
||||
if (msgs.length === 0) {
|
||||
msgs.push("ℹ️ Nenhum dado de integração Protheus encontrado no formulário");
|
||||
}
|
||||
|
||||
// Monta conteúdo HTML do histórico
|
||||
var htmlHistorico = "<ul class='hist-list'>";
|
||||
for (var i = 0; i < msgs.length; i++) {
|
||||
htmlHistorico += "<li class='hist-item'>" + msgs[i] + "</li>";
|
||||
}
|
||||
htmlHistorico += "</ul>";
|
||||
|
||||
// Script para abrir modal ao clicar no botão
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("$('#btnHistorico').off('click').on('click', function(){");
|
||||
customHTML.append(" var myModal = FLUIGC.modal({");
|
||||
customHTML.append(" title: 'Histórico do Processo',");
|
||||
customHTML.append(" content: `" + htmlHistorico + "`,");
|
||||
customHTML.append(" id: 'modalHistorico',");
|
||||
customHTML.append(" size: 'large'");
|
||||
customHTML.append(" });");
|
||||
customHTML.append("});");
|
||||
customHTML.append("</script>");
|
||||
|
||||
} catch (e) {
|
||||
log.error("[displayFields] Erro ao montar histórico: " + e);
|
||||
}
|
||||
|
||||
var numCot = form.getValue("cotacaoSCProtheus");
|
||||
var numSC = form.getValue("numeroSCProtheus"); // pega a SC atual
|
||||
|
||||
function formatCurrency(v) {
|
||||
if (!v || isNaN(v)) return "R$ 0,00";
|
||||
var num = parseFloat(v).toFixed(2);
|
||||
return "R$ " + num.replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
||||
}
|
||||
|
||||
function formatDate(v) {
|
||||
if (!v || v.length !== 8) return v || "";
|
||||
var y = v.substring(0,4);
|
||||
var m = v.substring(4,6);
|
||||
var d = v.substring(6,8);
|
||||
return d + "/" + m + "/" + y;
|
||||
}
|
||||
|
||||
function formatPrazo(v) {
|
||||
if (!v) return "";
|
||||
return v + " dias úteis";
|
||||
}
|
||||
|
||||
if (!numCot) {
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("$('#cotacaoContainer').html('<p>⚠️ Cotação não informada no formulário.</p>');");
|
||||
customHTML.append("</script>");
|
||||
return;
|
||||
}
|
||||
|
||||
var c = DatasetFactory.createConstraint("numCotacao", numCot, numCot, ConstraintType.MUST);
|
||||
var ds = DatasetFactory.getDataset("dsComprasCotacao", null, [c], null);
|
||||
var precoFormatado = formatCurrency(preco);
|
||||
var totalFormatado = formatCurrency(total);
|
||||
|
||||
if (ds && ds.rowsCount > 0) {
|
||||
for (var i = 0; i < ds.rowsCount; i++) {
|
||||
var item = ds.getValue(i, "C8_ITEM");
|
||||
var desc = ds.getValue(i, "B1_DESC");
|
||||
var qtd = ds.getValue(i, "C8_QUANT");
|
||||
var preco = ds.getValue(i, "C8_PRECO");
|
||||
var total = ds.getValue(i, "C8_TOTAL");
|
||||
|
||||
// adiciona linha na tabela pai-filho
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("var idx = wdkAddChild('tbCotacao');");
|
||||
customHTML.append("$('#item___'+idx).val('" + item + "');");
|
||||
customHTML.append("$('#produto___'+idx).val('" + desc + "');");
|
||||
customHTML.append("$('#qtdc___'+idx).val('" + qtd + "');");
|
||||
customHTML.append("$('#preco___' + idx).val('" + precoFormatado + "');");
|
||||
customHTML.append("$('#total___' + idx).val('" + totalFormatado + "');");
|
||||
customHTML.append("</script>");
|
||||
}
|
||||
} else {
|
||||
customHTML.append("<script>$('#tbCotacao tbody').html('<tr><td colspan=6>⏳ Nenhum item encontrado.</td></tr>');</script>");
|
||||
}
|
||||
|
||||
try {
|
||||
var numPedido = form.getValue("pedidoSCProtheus"); // hidden no formulário
|
||||
if (!numPedido) {
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("$('#espelhoPedido').html('<span class=\"badge bg-warning\">⏳ O pedido ainda não foi criado</span>');");
|
||||
customHTML.append("</script>");
|
||||
return;
|
||||
}
|
||||
|
||||
var c = DatasetFactory.createConstraint("numeroPed", numPedido, numPedido, ConstraintType.MUST);
|
||||
var ds = DatasetFactory.getDataset("dsComprasGateway", null, [c], null);
|
||||
|
||||
if (!ds || ds.rowsCount === 0) {
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("$('#espelhoPedido').html('<span class=\"badge bg-warning\">⏳ O pedido ainda não foi criado</span>');");
|
||||
customHTML.append("</script>");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var html = "";
|
||||
for (var i = 0; i < ds.rowsCount; i++) {
|
||||
var rowNum = ds.getValue(i, "C7_NUM");
|
||||
var desc = ds.getValue(i, "B1_DESC");
|
||||
var qtd = ds.getValue(i, "C7_QUANT");
|
||||
var valor = ds.getValue(i, "C7_TOTAL");
|
||||
var un = ds.getValue(i, "B1_UM");
|
||||
var pr = ds.getValue(i, "C7_DATPRF");
|
||||
|
||||
html += "<div class='pedido-card'>"
|
||||
+ " <div class='pedido-header'>Pedido nº " + (rowNum || "-") + "</div>"
|
||||
+ " <div class='pedido-grid'>"
|
||||
+ " <div class='pedido-box'><b>Descrição</b><br>" + (desc || "-") + "</div>"
|
||||
+ " <div class='pedido-box'><b>Quantidade</b><br>" + parseInt(qtd || 0) + " " + (un || "") + "</div>"
|
||||
+ " <div class='pedido-box'><b>Valor</b><br>" + formatCurrency(valor) + "</div>"
|
||||
+ " <div class='pedido-box'><b>Data de Entrega</b><br>" + formatDate(pr) + "</div>"
|
||||
+ " </div>"
|
||||
+ "</div>";
|
||||
|
||||
}
|
||||
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("$('#espelhoPedido').html(" + JSON.stringify(html) + ");");
|
||||
customHTML.append("</script>");
|
||||
|
||||
} catch (e) {
|
||||
var msg = "❌ Erro displayFields Pedido: " + (e && e.message ? e.message : e);
|
||||
log.error(msg);
|
||||
|
||||
customHTML.append("<script>");
|
||||
customHTML.append("console.error(" + JSON.stringify(msg) + ");"); // aparece no console do navegador
|
||||
customHTML.append("$('#espelhoPedido').html('<span class=\"badge bg-danger\">" + msg + "</span>');");
|
||||
customHTML.append("</script>");
|
||||
}
|
||||
|
||||
// Se estou na atividade do Gestor do CC (ex: 133)
|
||||
if (activity == 133) {
|
||||
// Copia a justificativa do solicitante para o campo de exibição
|
||||
form.setValue("observacoesdosolicitante", form.getValue("observacoes"));
|
||||
}
|
||||
|
||||
// Se estou na atividade do GERF (ex: 147)
|
||||
if (activity == 147) {
|
||||
form.setValue("justi_decisao__soli", form.getValue("observacoes")); // solicitante
|
||||
form.setValue("justi_decisao_gc", form.getValue("justi_decisao_aprova_gestor")); // gestor
|
||||
}
|
||||
|
||||
// Se estou na atividade do CEO (ex: 158)
|
||||
if (activity == 158) {
|
||||
form.setValue("justi_decisao_solic", form.getValue("observacoes")); // solicitante
|
||||
form.setValue("justi_decisaogc", form.getValue("justi_decisao_aprova_gestor")); // gestor
|
||||
form.setValue("justi_decisao_gerf", form.getValue("justi_decisao_aprova_gerente")); // gerente financeiro
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
function enableFields(form) {
|
||||
var atividade = getValue("WKNumState");
|
||||
|
||||
if (atividade != 0 && atividade != 4 && atividade != 9) {
|
||||
|
||||
form.setEnabled("emitido_por", false);
|
||||
form.setEnabled("tipo_cadastro", false);
|
||||
form.setEnabled("radio_ged", false);
|
||||
form.setEnabled("radio_data_validade", false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
function validateForm(form){
|
||||
var msg = "";
|
||||
var activity = getValue("WKNumState");
|
||||
|
||||
// Só valida "Justificativa do Gestor" quando estiver na atividade do gestor (ex.: 5)
|
||||
if (activity == 121) {
|
||||
if (form.getValue("justi_decisao_gestor") == "") {
|
||||
msg += "Campo Justificativa do Gestor não foi preenchido\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (msg != "") {
|
||||
throw msg;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,161 @@
|
||||
.componentAnexo{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.componentAnexo .input-group{
|
||||
flex-grow: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.componentAnexo .inputAnexo{
|
||||
color: blue!important;
|
||||
border-radius: 0!important;
|
||||
}
|
||||
|
||||
.componentAnexo .icones{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn{
|
||||
outline: none!important;
|
||||
outline-offset: unset!important;
|
||||
border-radius: 0;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn-default,
|
||||
.componentAnexo .icones .btn-default:focus,
|
||||
.componentAnexo .icones .btn-default:active,
|
||||
.componentAnexo .icones .btn-default:hover{
|
||||
border: solid 1px #58595b!important;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn-primary,
|
||||
.componentAnexo .icones .btn-primary:focus,
|
||||
.componentAnexo .icones .btn-primary:active,
|
||||
.componentAnexo .icones .btn-primary:hover{
|
||||
border: solid 1px #58595b!important;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn-success,
|
||||
.componentAnexo .icones .btn-success:focus,
|
||||
.componentAnexo .icones .btn-success:active,
|
||||
.componentAnexo .icones .btn-success:hover{
|
||||
border: solid 1px #1ab83f!important;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn-info,
|
||||
.componentAnexo .icones .btn-info:focus,
|
||||
.componentAnexo .icones .btn-info:active,
|
||||
.componentAnexo .icones .btn-info:hover{
|
||||
border: solid 1px #1eaad9!important;
|
||||
}
|
||||
.componentAnexo .icones .btn-warning,
|
||||
.componentAnexo .icones .btn-warning:focus,
|
||||
.componentAnexo .icones .btn-warning:active,
|
||||
.componentAnexo .icones .btn-warning:hover{
|
||||
border: solid 1px #e3b420!important;
|
||||
}
|
||||
|
||||
.componentAnexo .icones .btn-danger,
|
||||
.componentAnexo .icones .btn-danger:focus,
|
||||
.componentAnexo .icones .btn-danger:active,
|
||||
.componentAnexo .icones .btn-danger:hover{
|
||||
border: solid 1px #cc3d3d!important;
|
||||
}
|
||||
|
||||
/* Etapas concluídas */
|
||||
#wizard-steps .step-item.done .step-bullet {
|
||||
background-color: #28a745; /* verde */
|
||||
border-color: #28a745;
|
||||
color: white;
|
||||
}
|
||||
#wizard-steps .step-item.done .step-label {
|
||||
color: #28a745;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Etapa atual */
|
||||
#wizard-steps .step-item.active .step-bullet {
|
||||
background-color: #007bff; /* azul */
|
||||
border-color: #007bff;
|
||||
color: white;
|
||||
}
|
||||
#wizard-steps .step-item.active .step-label {
|
||||
color: #007bff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Etapas futuras */
|
||||
#wizard-steps .step-item .step-bullet {
|
||||
background-color: #e9ecef; /* cinza claro */
|
||||
border: 2px solid #ccc;
|
||||
color: #6c757d;
|
||||
}
|
||||
#wizard-steps .step-item .step-label {
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
/* Deixar as bolinhas maiores e destacadas */
|
||||
#wizard-steps .step-bullet {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.hist-list {
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
list-style: none;
|
||||
}
|
||||
.hist-list .hist-item {
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px dashed #ddd;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.hist-list .hist-item:last-child { border-bottom: 0; }
|
||||
|
||||
|
||||
.pedido-card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.pedido-header {
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
background: #f5f5f5;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.pedido-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.pedido-box {
|
||||
flex: 1 1 120px; /* mínimo 120px, ajusta conforme espaço */
|
||||
background: #fafafa;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
application.type=widget
|
||||
application.code=widget_solicitacoes
|
||||
application.title=widget-solicitacoes
|
||||
application.description=widget-solicitacoes
|
||||
application.fluig.version=null
|
||||
application.category=Suprimentos
|
||||
application.renderer=freemarker
|
||||
developer.code=G-ALES1NT-TEC06
|
||||
developer.name=andrey.cunha
|
||||
developer.url=http://www.fluig.com
|
||||
application.uiwidget=true
|
||||
application.mobileapp=false
|
||||
application.version=${build.version}-${build.revision}
|
||||
view.file=view.ftl
|
||||
edit.file=edit.ftl
|
||||
locale.file.base.name=widget_solicitacoes
|
||||
application.resource.js.1=/resources/js/widget_solicitacoes.js
|
||||
application.resource.css.2=/resources/css/widget_solicitacoes.css
|
||||
hash=4a16315e9e66fa7d797b3f6b1fb365b69f9a4ce2
|
||||
@@ -0,0 +1,4 @@
|
||||
<div id="MyWidget_${instanceId}" class="super-widget wcm-widget-class fluig-style-guide" data-params="MyWidget.instance()">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<div id="MyWidget_${instanceId}"
|
||||
class="super-widget wcm-widget-class fluig-style-guide"
|
||||
data-params="MyWidget.instance()">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Consultar Solicitações</strong></div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Número SC</label>
|
||||
<input type="text" id="filtroNumero_${instanceId}" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Solicitante</label>
|
||||
<input type="text" id="filtroSolicitante_${instanceId}" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Status</label>
|
||||
<select id="filtroStatus_${instanceId}" class="form-control">
|
||||
<option value="">Todos</option>
|
||||
<option value="Aguardando Aprovação">Aguardando Aprovação</option>
|
||||
<option value="Em Cotação">Em Cotação</option>
|
||||
<option value="Convertida em Pedido">Convertida em Pedido</option>
|
||||
<option value="Encerrada">Encerrada</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label> </label><br>
|
||||
<button class="btn btn-primary" data-pesquisar>Pesquisar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id="listaSolicitacoes_${instanceId}"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jboss-web>
|
||||
<context-root>/widget_solicitacoes</context-root>
|
||||
<disable-cross-context>false</disable-cross-context>
|
||||
</jboss-web>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
</session-config>
|
||||
</web-app>
|
||||
+1
@@ -0,0 +1 @@
|
||||
/* Coloque aqui seu codigo CSS */
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
+55
@@ -0,0 +1,55 @@
|
||||
var MyWidget = SuperWidget.extend({
|
||||
|
||||
// Variáveis do widget (se precisar salvar estado entre chamadas)
|
||||
instanceId: null,
|
||||
|
||||
// Método iniciado quando o widget é carregado
|
||||
init: function() {
|
||||
this.instanceId = this.instanceId || new Date().getTime();
|
||||
console.log("Widget Solicitações carregado, instância:", this.instanceId);
|
||||
},
|
||||
|
||||
// BIND de eventos
|
||||
bindings: {
|
||||
local: {
|
||||
'pesquisar': ['click_consultarSolicitacoes']
|
||||
},
|
||||
global: {}
|
||||
},
|
||||
|
||||
// Função chamada ao clicar em "Pesquisar"
|
||||
consultarSolicitacoes: function(htmlElement, event) {
|
||||
var numero = $("#filtroNumero_" + this.instanceId).val();
|
||||
var solicitante = $("#filtroSolicitante_" + this.instanceId).val();
|
||||
var status = $("#filtroStatus_" + this.instanceId).val();
|
||||
|
||||
var constraints = [];
|
||||
if (numero) constraints.push(DatasetFactory.createConstraint("C1_NUM", numero, numero, ConstraintType.MUST));
|
||||
if (solicitante) constraints.push(DatasetFactory.createConstraint("C1_SOLICIT", solicitante, solicitante, ConstraintType.MUST));
|
||||
if (status) constraints.push(DatasetFactory.createConstraint("STATUS", status, status, ConstraintType.MUST));
|
||||
|
||||
var ds = DatasetFactory.getDataset("dsSolicitacoesCompra", null, constraints, null);
|
||||
|
||||
let html = `<table class="table table-striped">
|
||||
<thead><tr>
|
||||
<th>Número</th><th>Solicitante</th><th>Data</th><th>Status</th><th>Pedido</th>
|
||||
</tr></thead><tbody>`;
|
||||
|
||||
if (ds && ds.values.length) {
|
||||
ds.values.forEach(sc => {
|
||||
html += `<tr>
|
||||
<td>${sc.C1_NUM}</td>
|
||||
<td>${sc.C1_SOLICIT}</td>
|
||||
<td>${sc.C1_EMISSAO}</td>
|
||||
<td>${sc.STATUS}</td>
|
||||
<td>${sc.C1_PEDIDO || '-'}</td>
|
||||
</tr>`;
|
||||
});
|
||||
} else {
|
||||
html += `<tr><td colspan="5" class="text-center">Nenhuma solicitação encontrada</td></tr>`;
|
||||
}
|
||||
|
||||
html += `</tbody></table>`;
|
||||
$("#listaSolicitacoes_" + this.instanceId).html(html);
|
||||
}
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,822 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<java version="1.8.0_461" class="java.beans.XMLDecoder">
|
||||
<object class="java.util.HashMap">
|
||||
<void method="put">
|
||||
<string>volume</string>
|
||||
<array class="java.lang.String" length="1">
|
||||
<void index="0">
|
||||
<string>Default</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>mecanismoGrupo</string>
|
||||
<object class="java.util.ArrayList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Aprovadores Compras Nvl 3</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AprovadoresComprasNvl3</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Compras Indiretos</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ComprasIndiretos</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Obras e manutenção</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Manutencao</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Requisitantes de Vaga</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Requisitantesdevaga</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Tecnologia e Comunicação</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>TIC</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>expediente</string>
|
||||
<array class="java.lang.String" length="4">
|
||||
<void index="0">
|
||||
<string>Default</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Expediente BackOffice, Logística e Motorista</string>
|
||||
</void>
|
||||
<void index="2">
|
||||
<string>Expediente Escritório Matriz</string>
|
||||
</void>
|
||||
<void index="3">
|
||||
<string>Expediente Lojas</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>processosServidor</string>
|
||||
<object class="java.util.ArrayList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Abertura de Chamado</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Abertura de chamado Manutenção</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Abertura de Chamado</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>FlowEssentials_AberturaDeChamado</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Solicitação de compra - Totvs</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>FlowEssentials_SolicitacaoDeCompras</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Flowservico_terceirizado</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Flowservico_terceirizado</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Listar Tarefas</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>FLUIGADHOC</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Recrutamento e seleção</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Recrutamento e Seleção</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Solicitação de compra - Ginseng</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Solicitação de compras </string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Solicitação de compra - Ginseng</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Solicitação de compras - Integração teste</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Solicitação de compra - Ginseng</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Solicitação de compras v2</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.ProcessDefinitionDto">
|
||||
<void property="companyId">
|
||||
<int>1</int>
|
||||
</void>
|
||||
<void property="processDescription">
|
||||
<string>Transferência Ginseng</string>
|
||||
</void>
|
||||
<void property="processId">
|
||||
<string>Transferência Ginseng</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>mecanismo</string>
|
||||
<array class="[Ljava.lang.Object;" length="10">
|
||||
<void index="0">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Associação</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Associado</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="1">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Campo de Formulário</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Campo Formulário</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="2">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Executor de Atividade</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Executor Atividade</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="3">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Grupo</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Grupo</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="4">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Grupos do Colaborador</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Grupos Colaborador</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="5">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>mecCustomAprov</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>mecCustomAprov</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="6">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Papel</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Papel</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="7">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição para um Grupo</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Pool Grupo</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="8">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição para um Papel</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Pool Papel</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="9">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Usuário</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Usuário</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>camposFormulario, documentoId = 9305</string>
|
||||
<array class="java.lang.String" length="69">
|
||||
<void index="0">
|
||||
<string>activity</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>centro_custo</string>
|
||||
</void>
|
||||
<void index="2">
|
||||
<string>ceo_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="3">
|
||||
<string>codigocentroCusto</string>
|
||||
</void>
|
||||
<void index="4">
|
||||
<string>Codproduto</string>
|
||||
</void>
|
||||
<void index="5">
|
||||
<string>cotacaoSCProtheus</string>
|
||||
</void>
|
||||
<void index="6">
|
||||
<string>currentUserId</string>
|
||||
</void>
|
||||
<void index="7">
|
||||
<string>currentUsermail</string>
|
||||
</void>
|
||||
<void index="8">
|
||||
<string>currentUserName</string>
|
||||
</void>
|
||||
<void index="9">
|
||||
<string>dataCadastroSCProtheus</string>
|
||||
</void>
|
||||
<void index="10">
|
||||
<string>dataNec</string>
|
||||
</void>
|
||||
<void index="11">
|
||||
<string>dataValidacaoItens</string>
|
||||
</void>
|
||||
<void index="12">
|
||||
<string>data_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="13">
|
||||
<string>data_validacao_aprova_ceo</string>
|
||||
</void>
|
||||
<void index="14">
|
||||
<string>data_validacao_aprova_gerf</string>
|
||||
</void>
|
||||
<void index="15">
|
||||
<string>data_validacao_aprova_gestor</string>
|
||||
</void>
|
||||
<void index="16">
|
||||
<string>data_validacao_gestor</string>
|
||||
</void>
|
||||
<void index="17">
|
||||
<string>descProduto</string>
|
||||
</void>
|
||||
<void index="18">
|
||||
<string>emailSolicitante</string>
|
||||
</void>
|
||||
<void index="19">
|
||||
<string>emissaoSCProtheus</string>
|
||||
</void>
|
||||
<void index="20">
|
||||
<string>empresa</string>
|
||||
</void>
|
||||
<void index="21">
|
||||
<string>estabelecimento</string>
|
||||
</void>
|
||||
<void index="22">
|
||||
<string>fdComprovante</string>
|
||||
</void>
|
||||
<void index="23">
|
||||
<string>filialdest</string>
|
||||
</void>
|
||||
<void index="24">
|
||||
<string>filialest</string>
|
||||
</void>
|
||||
<void index="25">
|
||||
<string>filialprotheus</string>
|
||||
</void>
|
||||
<void index="26">
|
||||
<string>fnComprovante</string>
|
||||
</void>
|
||||
<void index="27">
|
||||
<string>formMode</string>
|
||||
</void>
|
||||
<void index="28">
|
||||
<string>gerf_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="29">
|
||||
<string>gestor_cc</string>
|
||||
</void>
|
||||
<void index="30">
|
||||
<string>gestor_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="31">
|
||||
<string>horaCadastroSCProtheus</string>
|
||||
</void>
|
||||
<void index="32">
|
||||
<string>item</string>
|
||||
</void>
|
||||
<void index="33">
|
||||
<string>justificativaDecisaoItens</string>
|
||||
</void>
|
||||
<void index="34">
|
||||
<string>justificativaValidaProblema</string>
|
||||
</void>
|
||||
<void index="35">
|
||||
<string>justi_decisao_aprova</string>
|
||||
</void>
|
||||
<void index="36">
|
||||
<string>justi_decisao_aprova_ceo</string>
|
||||
</void>
|
||||
<void index="37">
|
||||
<string>justi_decisao_aprova_gerente</string>
|
||||
</void>
|
||||
<void index="38">
|
||||
<string>justi_decisao_aprova_gestor</string>
|
||||
</void>
|
||||
<void index="39">
|
||||
<string>justi_decisao_gestor</string>
|
||||
</void>
|
||||
<void index="40">
|
||||
<string>moreInfo</string>
|
||||
</void>
|
||||
<void index="41">
|
||||
<string>numeroSCProtheus</string>
|
||||
</void>
|
||||
<void index="42">
|
||||
<string>observacoes</string>
|
||||
</void>
|
||||
<void index="43">
|
||||
<string>pedidoSCProtheus</string>
|
||||
</void>
|
||||
<void index="44">
|
||||
<string>preco</string>
|
||||
</void>
|
||||
<void index="45">
|
||||
<string>produto</string>
|
||||
</void>
|
||||
<void index="46">
|
||||
<string>produtoCod</string>
|
||||
</void>
|
||||
<void index="47">
|
||||
<string>produtoDesc</string>
|
||||
</void>
|
||||
<void index="48">
|
||||
<string>produtoLink</string>
|
||||
</void>
|
||||
<void index="49">
|
||||
<string>qtd</string>
|
||||
</void>
|
||||
<void index="50">
|
||||
<string>qtdc</string>
|
||||
</void>
|
||||
<void index="51">
|
||||
<string>qtdItensSCProtheus</string>
|
||||
</void>
|
||||
<void index="52">
|
||||
<string>quantidade</string>
|
||||
</void>
|
||||
<void index="53">
|
||||
<string>requesterId</string>
|
||||
</void>
|
||||
<void index="54">
|
||||
<string>requesterMail</string>
|
||||
</void>
|
||||
<void index="55">
|
||||
<string>selecionado</string>
|
||||
</void>
|
||||
<void index="56">
|
||||
<string>solicitanteSCProtheus</string>
|
||||
</void>
|
||||
<void index="57">
|
||||
<string>statusAtendimento</string>
|
||||
</void>
|
||||
<void index="58">
|
||||
<string>statusSCProtheus</string>
|
||||
</void>
|
||||
<void index="59">
|
||||
<string>tipoSolicitacao</string>
|
||||
</void>
|
||||
<void index="60">
|
||||
<string>total</string>
|
||||
</void>
|
||||
<void index="61">
|
||||
<string>urgencia</string>
|
||||
</void>
|
||||
<void index="62">
|
||||
<string>userValidacaoItens</string>
|
||||
</void>
|
||||
<void index="63">
|
||||
<string>user_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="64">
|
||||
<string>user_validacao_gestor</string>
|
||||
</void>
|
||||
<void index="65">
|
||||
<string>usuarioSolicitante</string>
|
||||
</void>
|
||||
<void index="66">
|
||||
<string>validacaoItens</string>
|
||||
</void>
|
||||
<void index="67">
|
||||
<string>valorTotalCotacao</string>
|
||||
</void>
|
||||
<void index="68">
|
||||
<string>WKNumProces</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>forms</string>
|
||||
<object class="java.util.LinkedList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>FLUIGADHOC</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>FLUIGADHOC</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>3</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>FLUIGADHOCPROCESS</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>FLUIGADHOCPROCESS</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>4</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_tipo_ocorrencia</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_tipo_ocorrencia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>14</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_abertura_chamado</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_abertura_chamado</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>15</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSFormulariodeAberturadechamado</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Formulário de Abertura de chamado</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>20</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>Abertura_de_chamados</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Solicitação de abertura de chamados</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>21</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSvistoriadeServico</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>vistoriadeServico</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>24</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSFormulariodeReservadesala</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Formulário de Reserva de sala</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>34</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_centrocusto</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_centrocusto</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>103</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_cadastro_item</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_cadastro_item</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>104</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_estabelecimento</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_estabelecimento</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>105</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_solicitacao_compras</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_solicitacao_compras</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>165</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>aberturadechamado_manutencao</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>aberturadechamado_manutencao</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>400</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>Solicitacao_transferencia</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Solicitacao_transferencia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>590</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>recrutamento</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>recrutamento</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>823</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_aniversariantes</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Aniversariantes</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7690</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_cardapio</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Cardápio do Dia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7695</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_convenios</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Convênios</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7703</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_news</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Notícias</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7709</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>compras_digital</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>compras_digital</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>9305</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</java>
|
||||
@@ -0,0 +1,691 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<java version="1.8.0_461" class="java.beans.XMLDecoder">
|
||||
<object class="java.util.HashMap">
|
||||
<void method="put">
|
||||
<string>camposFormulario, documentoId = 2297</string>
|
||||
<array class="java.lang.String" length="0"/>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>volume</string>
|
||||
<array class="java.lang.String" length="1">
|
||||
<void index="0">
|
||||
<string>Default</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>mecanismoGrupo</string>
|
||||
<object class="java.util.ArrayList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Aprovadores Compras Nvl 3</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AprovadoresComprasNvl3</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Compras Indiretos</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ComprasIndiretos</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Obras e manutenção</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Manutencao</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Requisitantes de Vaga</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Requisitantesdevaga</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Tecnologia e Comunicação</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>TIC</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>expediente</string>
|
||||
<array class="java.lang.String" length="4">
|
||||
<void index="0">
|
||||
<string>Default</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Expediente BackOffice, Logística e Motorista</string>
|
||||
</void>
|
||||
<void index="2">
|
||||
<string>Expediente Escritório Matriz</string>
|
||||
</void>
|
||||
<void index="3">
|
||||
<string>Expediente Lojas</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>mecanismo</string>
|
||||
<array class="[Ljava.lang.Object;" length="10">
|
||||
<void index="0">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Associação</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Associado</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="1">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Campo de Formulário</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Campo Formulário</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="2">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Executor de Atividade</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Executor Atividade</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="3">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Grupo</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Grupo</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="4">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Grupos do Colaborador</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Grupos Colaborador</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="5">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>mecCustomAprov</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>mecCustomAprov</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="6">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Papel</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Papel</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="7">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição para um Grupo</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Pool Grupo</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="8">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição para um Papel</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Pool Papel</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void index="9">
|
||||
<array class="java.lang.Object" length="2">
|
||||
<void index="0">
|
||||
<string>Atribuição por Usuário</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>Usuário</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>forms</string>
|
||||
<object class="java.util.LinkedList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>FLUIGADHOC</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>FLUIGADHOC</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>3</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>FLUIGADHOCPROCESS</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>FLUIGADHOCPROCESS</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>4</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_tipo_ocorrencia</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_tipo_ocorrencia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>14</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_abertura_chamado</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_abertura_chamado</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>15</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSFormulariodeAberturadechamado</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Formulário de Abertura de chamado</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>20</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>Abertura_de_chamados</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Solicitação de abertura de chamados</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>21</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSvistoriadeServico</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>vistoriadeServico</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>24</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>DSFormulariodeReservadesala</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Formulário de Reserva de sala</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>34</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_centrocusto</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_centrocusto</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>103</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_cadastro_item</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_cadastro_item</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>104</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_dataset_estabelecimento</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_dataset_estabelecimento</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>105</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>totvsflow_solicitacao_compras</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>totvsflow_solicitacao_compras</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>165</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>aberturadechamado_manutencao</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>aberturadechamado_manutencao</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>400</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>Solicitacao_transferencia</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Solicitacao_transferencia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>590</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>recrutamento</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>recrutamento</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>823</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_aniversariantes</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Aniversariantes</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7690</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_cardapio</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Cardápio do Dia</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7695</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_convenios</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Convênios</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7703</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>kit_news</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>Notícias</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>7709</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.technology.ecmrestclient.cardindexpublisher.FormVO">
|
||||
<void property="datasetName">
|
||||
<string>compras_digital</string>
|
||||
</void>
|
||||
<void property="documentDescription">
|
||||
<string>compras_digital</string>
|
||||
</void>
|
||||
<void property="documentId">
|
||||
<int>9305</int>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>camposFormulario, documentoId = 9305</string>
|
||||
<array class="java.lang.String" length="69">
|
||||
<void index="0">
|
||||
<string>activity</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<string>centro_custo</string>
|
||||
</void>
|
||||
<void index="2">
|
||||
<string>ceo_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="3">
|
||||
<string>codigocentroCusto</string>
|
||||
</void>
|
||||
<void index="4">
|
||||
<string>Codproduto</string>
|
||||
</void>
|
||||
<void index="5">
|
||||
<string>cotacaoSCProtheus</string>
|
||||
</void>
|
||||
<void index="6">
|
||||
<string>currentUserId</string>
|
||||
</void>
|
||||
<void index="7">
|
||||
<string>currentUsermail</string>
|
||||
</void>
|
||||
<void index="8">
|
||||
<string>currentUserName</string>
|
||||
</void>
|
||||
<void index="9">
|
||||
<string>dataCadastroSCProtheus</string>
|
||||
</void>
|
||||
<void index="10">
|
||||
<string>dataNec</string>
|
||||
</void>
|
||||
<void index="11">
|
||||
<string>dataValidacaoItens</string>
|
||||
</void>
|
||||
<void index="12">
|
||||
<string>data_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="13">
|
||||
<string>data_validacao_aprova_ceo</string>
|
||||
</void>
|
||||
<void index="14">
|
||||
<string>data_validacao_aprova_gerf</string>
|
||||
</void>
|
||||
<void index="15">
|
||||
<string>data_validacao_aprova_gestor</string>
|
||||
</void>
|
||||
<void index="16">
|
||||
<string>data_validacao_gestor</string>
|
||||
</void>
|
||||
<void index="17">
|
||||
<string>descProduto</string>
|
||||
</void>
|
||||
<void index="18">
|
||||
<string>emailSolicitante</string>
|
||||
</void>
|
||||
<void index="19">
|
||||
<string>emissaoSCProtheus</string>
|
||||
</void>
|
||||
<void index="20">
|
||||
<string>empresa</string>
|
||||
</void>
|
||||
<void index="21">
|
||||
<string>estabelecimento</string>
|
||||
</void>
|
||||
<void index="22">
|
||||
<string>fdComprovante</string>
|
||||
</void>
|
||||
<void index="23">
|
||||
<string>filialdest</string>
|
||||
</void>
|
||||
<void index="24">
|
||||
<string>filialest</string>
|
||||
</void>
|
||||
<void index="25">
|
||||
<string>filialprotheus</string>
|
||||
</void>
|
||||
<void index="26">
|
||||
<string>fnComprovante</string>
|
||||
</void>
|
||||
<void index="27">
|
||||
<string>formMode</string>
|
||||
</void>
|
||||
<void index="28">
|
||||
<string>gerf_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="29">
|
||||
<string>gestor_cc</string>
|
||||
</void>
|
||||
<void index="30">
|
||||
<string>gestor_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="31">
|
||||
<string>horaCadastroSCProtheus</string>
|
||||
</void>
|
||||
<void index="32">
|
||||
<string>item</string>
|
||||
</void>
|
||||
<void index="33">
|
||||
<string>justificativaDecisaoItens</string>
|
||||
</void>
|
||||
<void index="34">
|
||||
<string>justificativaValidaProblema</string>
|
||||
</void>
|
||||
<void index="35">
|
||||
<string>justi_decisao_aprova</string>
|
||||
</void>
|
||||
<void index="36">
|
||||
<string>justi_decisao_aprova_ceo</string>
|
||||
</void>
|
||||
<void index="37">
|
||||
<string>justi_decisao_aprova_gerente</string>
|
||||
</void>
|
||||
<void index="38">
|
||||
<string>justi_decisao_aprova_gestor</string>
|
||||
</void>
|
||||
<void index="39">
|
||||
<string>justi_decisao_gestor</string>
|
||||
</void>
|
||||
<void index="40">
|
||||
<string>moreInfo</string>
|
||||
</void>
|
||||
<void index="41">
|
||||
<string>numeroSCProtheus</string>
|
||||
</void>
|
||||
<void index="42">
|
||||
<string>observacoes</string>
|
||||
</void>
|
||||
<void index="43">
|
||||
<string>pedidoSCProtheus</string>
|
||||
</void>
|
||||
<void index="44">
|
||||
<string>preco</string>
|
||||
</void>
|
||||
<void index="45">
|
||||
<string>produto</string>
|
||||
</void>
|
||||
<void index="46">
|
||||
<string>produtoCod</string>
|
||||
</void>
|
||||
<void index="47">
|
||||
<string>produtoDesc</string>
|
||||
</void>
|
||||
<void index="48">
|
||||
<string>produtoLink</string>
|
||||
</void>
|
||||
<void index="49">
|
||||
<string>qtd</string>
|
||||
</void>
|
||||
<void index="50">
|
||||
<string>qtdc</string>
|
||||
</void>
|
||||
<void index="51">
|
||||
<string>qtdItensSCProtheus</string>
|
||||
</void>
|
||||
<void index="52">
|
||||
<string>quantidade</string>
|
||||
</void>
|
||||
<void index="53">
|
||||
<string>requesterId</string>
|
||||
</void>
|
||||
<void index="54">
|
||||
<string>requesterMail</string>
|
||||
</void>
|
||||
<void index="55">
|
||||
<string>selecionado</string>
|
||||
</void>
|
||||
<void index="56">
|
||||
<string>solicitanteSCProtheus</string>
|
||||
</void>
|
||||
<void index="57">
|
||||
<string>statusAtendimento</string>
|
||||
</void>
|
||||
<void index="58">
|
||||
<string>statusSCProtheus</string>
|
||||
</void>
|
||||
<void index="59">
|
||||
<string>tipoSolicitacao</string>
|
||||
</void>
|
||||
<void index="60">
|
||||
<string>total</string>
|
||||
</void>
|
||||
<void index="61">
|
||||
<string>urgencia</string>
|
||||
</void>
|
||||
<void index="62">
|
||||
<string>userValidacaoItens</string>
|
||||
</void>
|
||||
<void index="63">
|
||||
<string>user_validacao_aprova</string>
|
||||
</void>
|
||||
<void index="64">
|
||||
<string>user_validacao_gestor</string>
|
||||
</void>
|
||||
<void index="65">
|
||||
<string>usuarioSolicitante</string>
|
||||
</void>
|
||||
<void index="66">
|
||||
<string>validacaoItens</string>
|
||||
</void>
|
||||
<void index="67">
|
||||
<string>valorTotalCotacao</string>
|
||||
</void>
|
||||
<void index="68">
|
||||
<string>WKNumProces</string>
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
</object>
|
||||
</java>
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 28 KiB |
@@ -0,0 +1,869 @@
|
||||
<list>
|
||||
<ProcessDefinition>
|
||||
<processDefinitionPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
</processDefinitionPK>
|
||||
<processDescription>novo_diagrama</processDescription>
|
||||
<instruction></instruction>
|
||||
<active>true</active>
|
||||
<publicProcess>false</publicProcess>
|
||||
<volumeId>Default</volumeId>
|
||||
<categoryId></categoryId>
|
||||
<managerEngineAllocationId></managerEngineAllocationId>
|
||||
<snapshotFrequency>0</snapshotFrequency>
|
||||
<baseDay>0</baseDay>
|
||||
<baseMonth>0</baseMonth>
|
||||
<periodId>Default</periodId>
|
||||
<uniqueCardVersion>false</uniqueCardVersion>
|
||||
<keyWord></keyWord>
|
||||
<complementsLevel>1</complementsLevel>
|
||||
<notifyRequisitionerComplements>true</notifyRequisitionerComplements>
|
||||
<notifyManagerComplements>false</notifyManagerComplements>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<warningDeadlineTime>0</warningDeadlineTime>
|
||||
<notifyAuthorityComplements>true</notifyAuthorityComplements>
|
||||
</ProcessDefinition>
|
||||
<ProcessDefinitionVersion>
|
||||
<processDefinitionVersionPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
</processDefinitionVersionPK>
|
||||
<versionDescription></versionDescription>
|
||||
<formId>2297</formId>
|
||||
<editionMode>true</editionMode>
|
||||
<updateAttachmentsVersion>false</updateAttachmentsVersion>
|
||||
<controlsAttachmentsSecurity>false</controlsAttachmentsSecurity>
|
||||
<active>true</active>
|
||||
<blockedVersion>false</blockedVersion>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<bpmnVersion>2</bpmnVersion>
|
||||
<processStates/>
|
||||
<favorito>false</favorito>
|
||||
<inheritFormSecurity>false</inheritFormSecurity>
|
||||
<mobileReady>false</mobileReady>
|
||||
</ProcessDefinitionVersion>
|
||||
<list>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>4</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Início</stateName>
|
||||
<stateDescription>Início</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<engineAllocationId></engineAllocationId>
|
||||
<engineAllocationConfiguration></engineAllocationConfiguration>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>true</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>false</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>150</positionX>
|
||||
<positionY>82</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>10</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>5</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Analisar necessidade de compra</stateName>
|
||||
<stateDescription>Analisar necessidade de compra</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>260</positionX>
|
||||
<positionY>160</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>11</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Em Cotação</stateName>
|
||||
<stateDescription>Em Cotação</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>560</positionX>
|
||||
<positionY>470</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>15</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Alçadas de aprovação</stateName>
|
||||
<stateDescription>Alçadas de aprovação</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>940</positionX>
|
||||
<positionY>570</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>19</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Solicitação criada</stateName>
|
||||
<stateDescription>Solicitação criada</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>380</positionX>
|
||||
<positionY>300</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>23</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Pedido criado</stateName>
|
||||
<stateDescription>Pedido criado</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>1240</positionX>
|
||||
<positionY>314</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>25</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Receber validar o produto/serviço</stateName>
|
||||
<stateDescription>Receber validar o produto/serviço</stateDescription>
|
||||
<instruction></instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<deadlineFieldName></deadlineFieldName>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<selectColleague>1</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>3600</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>3600</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>true</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>1240</positionX>
|
||||
<positionY>26</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>0</stateType>
|
||||
<bpmnType>80</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<noticeExpirationAuthorityTime>0</noticeExpirationAuthorityTime>
|
||||
<noticeExpirationRequisitionerTime>0</noticeExpirationRequisitionerTime>
|
||||
<noticeExpirationManagerTime>0</noticeExpirationManagerTime>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
<executionType>0</executionType>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>13</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Aprovação</stateName>
|
||||
<stateDescription>Aprovação</stateDescription>
|
||||
<joint>false</joint>
|
||||
<initialState>false</initialState>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<automatic>true</automatic>
|
||||
<positionX>830</positionX>
|
||||
<positionY>440</positionY>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<stateType>1</stateType>
|
||||
<bpmnType>120</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<openInstances>0</openInstances>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
</ProcessState>
|
||||
<ProcessState>
|
||||
<processStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>27</sequence>
|
||||
</processStatePK>
|
||||
<stateName>Fim</stateName>
|
||||
<stateDescription>Fim</stateDescription>
|
||||
<instruction>Atividade final do processo</instruction>
|
||||
<deadlineTime>0</deadlineTime>
|
||||
<joint>false</joint>
|
||||
<agreementPercentage>0</agreementPercentage>
|
||||
<engineAllocationId></engineAllocationId>
|
||||
<engineAllocationConfiguration></engineAllocationConfiguration>
|
||||
<selectColleague>0</selectColleague>
|
||||
<initialState>false</initialState>
|
||||
<notifyAuthorityDelay>true</notifyAuthorityDelay>
|
||||
<notifyRequisitionerDelay>false</notifyRequisitionerDelay>
|
||||
<allowanceAuthorityTime>0</allowanceAuthorityTime>
|
||||
<frequenceAuthorityTime>1</frequenceAuthorityTime>
|
||||
<allowanceRequisitionerTime>0</allowanceRequisitionerTime>
|
||||
<frequenceRequisitionerTime>0</frequenceRequisitionerTime>
|
||||
<transferAttachments>false</transferAttachments>
|
||||
<subProcessId></subProcessId>
|
||||
<formFolder>0</formFolder>
|
||||
<notifyAuthorityFollowUp>false</notifyAuthorityFollowUp>
|
||||
<notifyRequisitionerFollowUp>false</notifyRequisitionerFollowUp>
|
||||
<automatic>false</automatic>
|
||||
<positionX>1530</positionX>
|
||||
<positionY>60</positionY>
|
||||
<forecastedEffortType>0</forecastedEffortType>
|
||||
<forecastedEffort>0</forecastedEffort>
|
||||
<notifyManagerFollowUp>false</notifyManagerFollowUp>
|
||||
<notifyManagerDelay>false</notifyManagerDelay>
|
||||
<allowanceManagerTime>0</allowanceManagerTime>
|
||||
<frequenceManagerTime>0</frequenceManagerTime>
|
||||
<inhibitTransfer>false</inhibitTransfer>
|
||||
<periodId></periodId>
|
||||
<stateType>6</stateType>
|
||||
<bpmnType>60</bpmnType>
|
||||
<signalId>0</signalId>
|
||||
<counterSign>false</counterSign>
|
||||
<openInstances>0</openInstances>
|
||||
<destinationStates/>
|
||||
<digitalSignature>false</digitalSignature>
|
||||
</ProcessState>
|
||||
</list>
|
||||
<list>
|
||||
<ConditionProcessState>
|
||||
<conditionProcessStatePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<expressionOrder>1</expressionOrder>
|
||||
<version>1</version>
|
||||
<sequence>13</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>true</condition>
|
||||
<destinationSequenceId>15</destinationSequenceId>
|
||||
<engineAllocationConfiguration><AssignmentController><User>andrey.cunha</User></AssignmentController></engineAllocationConfiguration>
|
||||
<engineAllocationId>Usuário</engineAllocationId>
|
||||
<conditionType>0</conditionType>
|
||||
</ConditionProcessState>
|
||||
</list>
|
||||
<list>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>6</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>4</initialStateSequence>
|
||||
<finalStateSequence>5</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>16</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>13</initialStateSequence>
|
||||
<finalStateSequence>15</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>20</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>5</initialStateSequence>
|
||||
<finalStateSequence>19</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>21</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>19</initialStateSequence>
|
||||
<finalStateSequence>11</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>22</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>11</initialStateSequence>
|
||||
<finalStateSequence>13</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>24</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>15</initialStateSequence>
|
||||
<finalStateSequence>23</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>26</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>23</initialStateSequence>
|
||||
<finalStateSequence>25</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
<ProcessLink>
|
||||
<processLinkPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>28</linkSequence>
|
||||
</processLinkPK>
|
||||
<actionLabel></actionLabel>
|
||||
<returnPermited>false</returnPermited>
|
||||
<initialStateSequence>25</initialStateSequence>
|
||||
<finalStateSequence>27</finalStateSequence>
|
||||
<returnLabel></returnLabel>
|
||||
<name></name>
|
||||
<automaticLink>false</automaticLink>
|
||||
<defaultLink>false</defaultLink>
|
||||
<type>0</type>
|
||||
</ProcessLink>
|
||||
</list>
|
||||
<list/>
|
||||
<list>
|
||||
<WorkflowProcessEvent>
|
||||
<workflowProcessEventPK>
|
||||
<companyId>1</companyId>
|
||||
<eventId>ENG_LITERALS</eventId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
</workflowProcessEventPK>
|
||||
<eventDescription>#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
</eventDescription>
|
||||
</WorkflowProcessEvent>
|
||||
<WorkflowProcessEvent>
|
||||
<workflowProcessEventPK>
|
||||
<companyId>1</companyId>
|
||||
<eventId>ESP_LITERALS</eventId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
</workflowProcessEventPK>
|
||||
<eventDescription>#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
</eventDescription>
|
||||
</WorkflowProcessEvent>
|
||||
<WorkflowProcessEvent>
|
||||
<workflowProcessEventPK>
|
||||
<companyId>1</companyId>
|
||||
<eventId>POR_LITERALS</eventId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
</workflowProcessEventPK>
|
||||
<eventDescription>#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
</eventDescription>
|
||||
</WorkflowProcessEvent>
|
||||
</list>
|
||||
<list/>
|
||||
<list>
|
||||
<SwimLane>
|
||||
<color>FFFFFF</color>
|
||||
<height>681</height>
|
||||
<width>1631</width>
|
||||
<positionX>10</positionX>
|
||||
<positionY>10</positionY>
|
||||
<stateName>Pool</stateName>
|
||||
<type>1</type>
|
||||
<parentSequence>0</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>1</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
<SwimLane>
|
||||
<color>408080</color>
|
||||
<height>136</height>
|
||||
<width>1601</width>
|
||||
<positionX>40</positionX>
|
||||
<positionY>10</positionY>
|
||||
<stateName>Solicitante</stateName>
|
||||
<type>2</type>
|
||||
<parentSequence>1</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>2</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
<SwimLane>
|
||||
<color>C0C0C0</color>
|
||||
<height>136</height>
|
||||
<width>1601</width>
|
||||
<positionX>40</positionX>
|
||||
<positionY>146</positionY>
|
||||
<stateName>Gestor CC</stateName>
|
||||
<type>2</type>
|
||||
<parentSequence>1</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>3</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
<SwimLane>
|
||||
<color>adc9ac</color>
|
||||
<height>136</height>
|
||||
<width>1601</width>
|
||||
<positionX>40</positionX>
|
||||
<positionY>418</positionY>
|
||||
<stateName>Compras</stateName>
|
||||
<type>2</type>
|
||||
<parentSequence>1</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>4</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
<SwimLane>
|
||||
<color>d0daae</color>
|
||||
<height>137</height>
|
||||
<width>1601</width>
|
||||
<positionX>40</positionX>
|
||||
<positionY>554</positionY>
|
||||
<stateName>Alçadas</stateName>
|
||||
<type>2</type>
|
||||
<parentSequence>1</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>5</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
<SwimLane>
|
||||
<color>d6e0d0</color>
|
||||
<height>136</height>
|
||||
<width>1601</width>
|
||||
<positionX>40</positionX>
|
||||
<positionY>282</positionY>
|
||||
<stateName>Protheus</stateName>
|
||||
<type>2</type>
|
||||
<parentSequence>1</parentSequence>
|
||||
<swimLanePK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<sequence>6</sequence>
|
||||
</swimLanePK>
|
||||
</SwimLane>
|
||||
</list>
|
||||
<list>
|
||||
<ProcessComponGraf>
|
||||
<componType>1</componType>
|
||||
<positionX>210</positionX>
|
||||
<positionY>20</positionY>
|
||||
<processComponGrafPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<componGrafSequence>7</componGrafSequence>
|
||||
</processComponGrafPK>
|
||||
<stateName>Start</stateName>
|
||||
</ProcessComponGraf>
|
||||
</list>
|
||||
<list>
|
||||
<ProcessLinkAssoc>
|
||||
<processLinkAssocPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>8</linkSequence>
|
||||
</processLinkAssocPK>
|
||||
<initialStateSequence>7</initialStateSequence>
|
||||
<finalStateSequence>4</finalStateSequence>
|
||||
</ProcessLinkAssoc>
|
||||
</list>
|
||||
<list>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>6</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>167</positionX>
|
||||
<positionY>205</positionY>
|
||||
</ProcessLinkBend>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>8</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>167</positionX>
|
||||
<positionY>48</positionY>
|
||||
</ProcessLinkBend>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>16</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>992</positionX>
|
||||
<positionY>494</positionY>
|
||||
</ProcessLinkBend>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>20</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>313</positionX>
|
||||
<positionY>337</positionY>
|
||||
</ProcessLinkBend>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>21</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>432</positionX>
|
||||
<positionY>504</positionY>
|
||||
</ProcessLinkBend>
|
||||
<ProcessLinkBend>
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>novo_diagrama</processId>
|
||||
<version>1</version>
|
||||
<linkSequence>24</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
<positionX>1294</positionX>
|
||||
<positionY>608</positionY>
|
||||
</ProcessLinkBend>
|
||||
</list>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
<list/>
|
||||
</list>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 13 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
@@ -0,0 +1,4 @@
|
||||
#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
@@ -0,0 +1,4 @@
|
||||
#Mon Sep 01 13:10:08 BRT 2025
|
||||
process.category=
|
||||
process.description=novo_diagrama
|
||||
process.instructions=
|
||||
@@ -0,0 +1,20 @@
|
||||
function servicetask114(attempt, message) {
|
||||
log.info("🚀 ST92 — Verifica se já existe código de cotação no formulário");
|
||||
|
||||
var numSC = hAPI.getCardValue("numeroSCProtheus");
|
||||
var numCot = hAPI.getCardValue("cotacaoSCProtheus");
|
||||
|
||||
log.info("📌 SC: " + numSC + " | Cotação: " + numCot);
|
||||
|
||||
if (!numSC) {
|
||||
throw "❌ Número da SC não informado no formulário.";
|
||||
}
|
||||
|
||||
// se não tiver cotação ainda, força o loop da atividade
|
||||
if (!numCot || numCot === "000000" || numCot === "000001") {
|
||||
throw "⏳ Cotação ainda não disponível para a SC " + numSC;
|
||||
}
|
||||
|
||||
// se já tiver código, só registra log e deixa o processo seguir
|
||||
log.info("✅ Cotação " + numCot + " encontrada no formulário. Processo segue.");
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
function toProtheusDate(d) {
|
||||
if (!d) return "";
|
||||
if (d.indexOf("/") > -1) {
|
||||
var parts = d.split("/");
|
||||
return parts[2] + parts[1] + parts[0]; // dd/MM/yyyy -> yyyyMMdd
|
||||
}
|
||||
if (d.indexOf("-") > -1) {
|
||||
return d.replace(/-/g, ""); // yyyy-MM-dd -> yyyyMMdd
|
||||
}
|
||||
return d; // já está no formato certo
|
||||
}
|
||||
|
||||
function hojeProtheus() {
|
||||
var d = new Date();
|
||||
var yyyy = d.getFullYear();
|
||||
var mm = d.getMonth() + 1;
|
||||
var dd = d.getDate();
|
||||
if (mm < 10) mm = "0" + mm;
|
||||
if (dd < 10) dd = "0" + dd;
|
||||
return "" + yyyy + mm + dd; // yyyyMMdd
|
||||
}
|
||||
|
||||
function servicetask82(attempt, message) {
|
||||
log.info("🚀 Iniciando servicetask82");
|
||||
|
||||
var qtdItens = hAPI.getChildrenIndexes("tbItens");
|
||||
log.info("📦 Total de itens na tabela: " + qtdItens.length);
|
||||
|
||||
var itens = [];
|
||||
for (var i = 0; i < qtdItens.length; i++) {
|
||||
var index = qtdItens[i];
|
||||
var item = {
|
||||
"C1_PRODUTO": String(hAPI.getCardValue("Codproduto___" + index)),
|
||||
"C1_QUANT": Number(hAPI.getCardValue("qtd___" + index)),
|
||||
"C1_DATPRF": toProtheusDate(String(hAPI.getCardValue("dataNec___" + index)))
|
||||
};
|
||||
itens.push(item);
|
||||
log.info("📌 Item adicionado: " + JSON.stringify(item));
|
||||
}
|
||||
|
||||
var payload = {
|
||||
"C1_SOLICIT": String(hAPI.getCardValue("usuarioSolicitante")),
|
||||
"C1_EMISSAO": hojeProtheus(),
|
||||
"C1_FILENT": String(hAPI.getCardValue("filialProtheus")).trim(),
|
||||
"C1_OBS": String(hAPI.getCardValue("observacoes")),
|
||||
"itens": itens
|
||||
};
|
||||
|
||||
log.info("📦 Payload montado:");
|
||||
log.info(JSON.stringify(payload));
|
||||
|
||||
var data1 = {
|
||||
companyId: '1',
|
||||
serviceCode: 'Postprod',
|
||||
endpoint: '/rest/UF_MATA110',
|
||||
method: 'post',
|
||||
timeoutService: '100',
|
||||
params: payload, // objeto puro
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
var clientService = fluigAPI.getAuthorizeClientService();
|
||||
var response = clientService.invoke(JSON.stringify(data1)); // SEMPRE stringify aqui
|
||||
|
||||
log.info("📬 Resposta da API Protheus:");
|
||||
log.dir(response);
|
||||
|
||||
if (response && response.getResult()) {
|
||||
var result = JSON.parse(response.getResult());
|
||||
if (result.sucesso) {
|
||||
hAPI.setCardValue("numeroSCProtheus", result.C1_NUM || "");
|
||||
hAPI.setCardValue("statusSCProtheus", "SC cadastrada com sucesso");
|
||||
hAPI.setCardValue("solicitanteSCProtheus", result.C1_SOLICIT || "");
|
||||
hAPI.setCardValue("emissaoSCProtheus", result.C1_EMISSAO || "");
|
||||
hAPI.setCardValue("qtdItensSCProtheus", String(result.quantidade_itens || ""));
|
||||
hAPI.setCardValue("dataCadastroSCProtheus", result.data_cadastro || "");
|
||||
hAPI.setCardValue("horaCadastroSCProtheus", result.hora_cadastro || "");
|
||||
} else {
|
||||
hAPI.setCardValue("statusSCProtheus", "Erro: " + result.erro);
|
||||
throw "Erro Protheus: " + result.message;
|
||||
}
|
||||
} else {
|
||||
throw "Sem resposta da API Protheus";
|
||||
}
|
||||
} catch (e) {
|
||||
log.error("❌ Erro ao enviar SC para o Protheus: " + e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
log.info("🏁 Finalização da servicetask82");
|
||||
}
|
||||
Reference in New Issue
Block a user