This commit is contained in:
@@ -74,7 +74,7 @@ export default moduleFactory
|
|||||||
label: "Quantidade Embalagem",
|
label: "Quantidade Embalagem",
|
||||||
column: "quantidadeembalagem",
|
column: "quantidadeembalagem",
|
||||||
format: "number",
|
format: "number",
|
||||||
entrypoint: "detalhe_preco_embalagem"
|
entrypoint: "detalhe_preco_embalagem",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Estoque Disponível",
|
label: "Estoque Disponível",
|
||||||
@@ -232,7 +232,7 @@ export default moduleFactory
|
|||||||
},
|
},
|
||||||
params: ["codproduto"],
|
params: ["codproduto"],
|
||||||
},
|
},
|
||||||
detalhe_preco_embalagem: {
|
detalhe_preco: {
|
||||||
name: "Detalhe Preço Embalagem",
|
name: "Detalhe Preço Embalagem",
|
||||||
display: {
|
display: {
|
||||||
type: "table",
|
type: "table",
|
||||||
@@ -273,6 +273,204 @@ export default moduleFactory
|
|||||||
},
|
},
|
||||||
params: ["nrempresa", "codproduto"],
|
params: ["nrempresa", "codproduto"],
|
||||||
},
|
},
|
||||||
|
detalhe_mdv: {
|
||||||
|
name: "Detalhe Vendas Dia",
|
||||||
|
display: {
|
||||||
|
type: "table",
|
||||||
|
table: {
|
||||||
|
header: [
|
||||||
|
{
|
||||||
|
label: "Data",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Qtd.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Qtd. ini.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
cell: [
|
||||||
|
{
|
||||||
|
field: "data",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "qtd",
|
||||||
|
format: "currency",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "qtd_inicial",
|
||||||
|
format: "currency",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
params: ["nrempresa", "codproduto"],
|
||||||
|
},
|
||||||
|
detalhe_situacao_vigente: {
|
||||||
|
name: "Detalhe Histórico Venda",
|
||||||
|
display: {
|
||||||
|
type: "table",
|
||||||
|
table: {
|
||||||
|
header: [
|
||||||
|
{
|
||||||
|
label: "Data Início",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Data Fim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Embalagem",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Preço",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
cell: [
|
||||||
|
{
|
||||||
|
field: "data_inicio",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "data_fim",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "embalagem",
|
||||||
|
format: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "preco",
|
||||||
|
format: "currency",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
params: ["nrempresa", "codproduto"],
|
||||||
|
},
|
||||||
|
detalhe_custo_liquido: {
|
||||||
|
name: "Detalhe Custo Médio",
|
||||||
|
display: {
|
||||||
|
type: "table",
|
||||||
|
table: {
|
||||||
|
header: [
|
||||||
|
{
|
||||||
|
label: "Data",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Est. ini.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Est. fin.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Custo",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
cell: [
|
||||||
|
{
|
||||||
|
field: "data",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "estoqinicial",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "estoqfinal",
|
||||||
|
format: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "custo",
|
||||||
|
format: "currency",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
params: ["nrempresa", "codproduto"],
|
||||||
|
},
|
||||||
|
detalhe_estoque_disponivel: {
|
||||||
|
name: "Detalhe Estoque Disponível",
|
||||||
|
display: {
|
||||||
|
type: "table",
|
||||||
|
table: {
|
||||||
|
header: [
|
||||||
|
{
|
||||||
|
label: "Data",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Qtd. ent.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Qtd. sai.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Saldo",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
cell: [
|
||||||
|
{
|
||||||
|
field: "data",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "qtdentrada",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "qtdsaida",
|
||||||
|
format: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "qtdsaldo",
|
||||||
|
format: "currency",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
params: ["nrempresa", "codproduto"],
|
||||||
|
},
|
||||||
|
detalhe_estoque_transito: {
|
||||||
|
name: "Detalhe Estoque Trânsito",
|
||||||
|
display: {
|
||||||
|
type: "table",
|
||||||
|
table: {
|
||||||
|
header: [
|
||||||
|
{
|
||||||
|
label: "NF",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Serie",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Data",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Qtd.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
cell: [
|
||||||
|
{
|
||||||
|
field: "NUMERONF",
|
||||||
|
format: "number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "SERIENF",
|
||||||
|
format: "number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "DTAEMISSAO",
|
||||||
|
format: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "QUANTIDADE",
|
||||||
|
format: "number",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
params: ["nrempresa", "codproduto"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
entrypoint: "consulta",
|
entrypoint: "consulta",
|
||||||
})
|
})
|
||||||
@@ -550,7 +748,7 @@ and pes2.qtdembalagem = (select nvl(max(pes3.qtdembalagem), 1)
|
|||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
detalhe_preco_embalagem: (args) => {
|
detalhe_preco: (args) => {
|
||||||
return {
|
return {
|
||||||
sql: /*sql*/ `
|
sql: /*sql*/ `
|
||||||
select ora_hash(mgmp.SEQPRODUTO||mgmp.NROEMPRESA||mgmp.QTDEMBALAGEM||mgmp.NROSEGMENTO) chave,
|
select ora_hash(mgmp.SEQPRODUTO||mgmp.NROEMPRESA||mgmp.QTDEMBALAGEM||mgmp.NROSEGMENTO) chave,
|
||||||
@@ -574,8 +772,174 @@ and pes2.qtdembalagem = (select nvl(max(pes3.qtdembalagem), 1)
|
|||||||
and mgmp.nroempresa = ${args.nrempresa}
|
and mgmp.nroempresa = ${args.nrempresa}
|
||||||
AND mgmp.NROSEGMENTO NOT IN (22,23,26)
|
AND mgmp.NROSEGMENTO NOT IN (22,23,26)
|
||||||
and mgmp.STATUSVENDA = 'A'
|
and mgmp.STATUSVENDA = 'A'
|
||||||
`
|
`,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
|
detalhe_mdv: (args) => {
|
||||||
|
return {
|
||||||
|
sql: /*sql*/ `
|
||||||
|
select mcdia.dtaentradasaida data,
|
||||||
|
mcdia.nroempresa,
|
||||||
|
mcdia.seqproduto,
|
||||||
|
Decode(to_char(mcdia.dtaentradasaida,'d'),1,'Domingo',2,'Segunda',3,'Ter�a',4,'Quarta',5,'Quinta',6,'Sexta',7,'S�bado') diasemana,
|
||||||
|
mcdia.qtdvda qtd,
|
||||||
|
mcdia.qtdestqinicial qtd_inicial
|
||||||
|
from mrl_custodia mcdia
|
||||||
|
inner join max_empresa me
|
||||||
|
on mcdia.nroempresa = me.nroempresa
|
||||||
|
where 1=1
|
||||||
|
and mcdia.qtdvda > 0
|
||||||
|
and mcdia.dtaentradasaida >= trunc(sysdate)-365
|
||||||
|
AND mcdia.nroempresa = ${args.nrempresa}
|
||||||
|
AND mcdia.seqproduto = ${args.codproduto}
|
||||||
|
order by dtaentradasaida desc;
|
||||||
|
`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
detalhe_situacao_vigente: (args) => {
|
||||||
|
return {
|
||||||
|
sql: /*sql*/ `
|
||||||
|
select mrl_prodempseg.nroempresa,
|
||||||
|
mrl_prodempseg.seqproduto,
|
||||||
|
mrl_promocao.dtainicio,
|
||||||
|
mrl_promocao.dtafim,
|
||||||
|
mfe.qtdembalagem || ' ' || mfe.embalagem embalagem,
|
||||||
|
mrl_promocaoitem.precopromocional preco
|
||||||
|
from mrl_promocaoitem, mrl_promocao, mrl_prodempseg,
|
||||||
|
map_produto mp, map_famembalagem mfe, max_empresa me
|
||||||
|
where 1=1
|
||||||
|
and me.nroempresa = mrl_promocao.nroempresa
|
||||||
|
and me.status = 'A'
|
||||||
|
and me.nrodivisao = 2
|
||||||
|
and me.dtainiciomovestoque <= trunc(sysdate)-1
|
||||||
|
and mrl_promocao.nroempresa = mrl_promocaoitem.nroempresa
|
||||||
|
and mrl_promocao.seqpromocao = mrl_promocaoitem.seqpromocao
|
||||||
|
and mrl_promocao.centralloja = mrl_promocaoitem.centralloja
|
||||||
|
and mrl_promocao.nrosegmento = mrl_promocaoitem.nrosegmento
|
||||||
|
and mrl_promocaoitem.seqproduto = mrl_prodempseg.seqproduto
|
||||||
|
and mrl_promocao.nrosegmento = mrl_prodempseg.nrosegmento
|
||||||
|
and mrl_promocao.nroempresa = mrl_prodempseg.nroempresa
|
||||||
|
and mrl_promocaoitem.qtdembalagem = mrl_prodempseg.qtdembalagem
|
||||||
|
and mp.seqproduto = mrl_prodempseg.seqproduto
|
||||||
|
and mfe.seqfamilia = mp.seqfamilia
|
||||||
|
and mfe.qtdembalagem = mrl_prodempseg.qtdembalagem
|
||||||
|
and nvl(mrl_promocao.tipopromoc, 'N') in ('N', 'F', 'A', 'S')
|
||||||
|
and mrl_promocao.dtainicio >= trunc(sysdate)-90--365
|
||||||
|
AND mrl_prodempseg.nroempresa = ${args.nrempresa}
|
||||||
|
AND mrl_prodempseg.seqproduto = ${args.codproduto}
|
||||||
|
order by mrl_promocao.dtainicio desc
|
||||||
|
`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
detalhe_custo_liquido: (args) => {
|
||||||
|
return {
|
||||||
|
sql: /*sql*/ `
|
||||||
|
select mcdiafam.dtaentradasaida,
|
||||||
|
mcdiafam.nroempresa,
|
||||||
|
PROD.SEQPRODUTO,
|
||||||
|
mcdiafam.seqfamilia,
|
||||||
|
mcdiafam.qtdestqinicial estqinicial,
|
||||||
|
qtdestqinicial + qtdentrada - qtdsaida estqfinal,
|
||||||
|
--trunc(cmdiavlrnf,2) custo
|
||||||
|
cmdiavlrnf custo
|
||||||
|
from mrl_custodiafam mcdiafam
|
||||||
|
INNER JOIN MAP_PRODUTO PROD
|
||||||
|
ON PROD.SEQFAMILIA = MCDIAFAM.SEQFAMILIA
|
||||||
|
inner join max_empresa me
|
||||||
|
on me.nroempresa = mcdiafam.nroempresa
|
||||||
|
and me.status = 'A'
|
||||||
|
and me.dtainiciomovestoque <= trunc(sysdate)-1
|
||||||
|
and me.nrodivisao in (2,4)
|
||||||
|
where 1=1
|
||||||
|
and mcdiafam.dtaentradasaida >= trunc(sysdate)-365
|
||||||
|
AND mcdiafam.nroempresa = ${args.nrempresa}
|
||||||
|
AND PROD.SEQPRODUTO = ${args.codproduto}
|
||||||
|
order by mcdiafam.dtaentradasaida desc
|
||||||
|
`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
detalhe_estoque_disponivel: (args) => {
|
||||||
|
return {
|
||||||
|
sql: /*sql*/ `
|
||||||
|
select
|
||||||
|
cdia.dtaentradasaida,
|
||||||
|
cdia.nroempresa,
|
||||||
|
cdia.seqproduto,
|
||||||
|
cdia.qtdentrada,
|
||||||
|
cdia.qtdsaida,
|
||||||
|
cdia.qtdestqinicial + cdia.qtdentrada - cdia.qtdsaida qtdsaldo
|
||||||
|
from mrl_custodia cdia
|
||||||
|
join max_empresa me
|
||||||
|
on me.nroempresa = cdia.nroempresa
|
||||||
|
and me.status = 'A'
|
||||||
|
and me.dtainiciomovestoque < trunc(sysdate)
|
||||||
|
and me.nrodivisao = 2
|
||||||
|
where cdia.dtaentradasaida >= sysdate - 365
|
||||||
|
and cdia.seqproduto = ${args.codproduto}
|
||||||
|
and cdia.nroempresa = ${args.nrempresa}
|
||||||
|
union all
|
||||||
|
select
|
||||||
|
mle.dtaentradasaida,
|
||||||
|
mle.nroempresa,
|
||||||
|
mle.seqproduto,
|
||||||
|
sum(case when mle.tiplancto = 'E' then mle.qtdlancto else 0 end) qtdentrada,
|
||||||
|
sum(case when mle.tiplancto = 'S' then mle.qtdlancto else 0 end) qtdsaida,
|
||||||
|
cdia.qtdestqinicial
|
||||||
|
+ sum(case when mle.tiplancto = 'E' then mle.qtdlancto else 0 end)
|
||||||
|
- sum(case when mle.tiplancto = 'S' then mle.qtdlancto else 0 end) qtdsaldo
|
||||||
|
from mrl_lanctoestoque mle
|
||||||
|
join max_empresa me
|
||||||
|
on me.nroempresa = mle.nroempresa
|
||||||
|
and me.status = 'A'
|
||||||
|
and me.dtainiciomovestoque < trunc(sysdate)
|
||||||
|
and me.nrodivisao = 4
|
||||||
|
join mrl_custodia cdia
|
||||||
|
on cdia.dtaentradasaida = mle.dtaentradasaida
|
||||||
|
and cdia.nroempresa = mle.nroempresa
|
||||||
|
and cdia.seqproduto = mle.seqproduto
|
||||||
|
where mle.dtaentradasaida >= sysdate - 365
|
||||||
|
and mle.codgeraloper not in (301,302)
|
||||||
|
and mle.seqproduto = ${args.codproduto}
|
||||||
|
and mle.nroempresa = ${args.nrempresa}
|
||||||
|
group by
|
||||||
|
mle.dtaentradasaida,
|
||||||
|
mle.nroempresa,
|
||||||
|
mle.seqproduto,
|
||||||
|
cdia.qtdestqinicial
|
||||||
|
order by dtaentradasaida desc;
|
||||||
|
`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
detalhe_estoque_transito: (args) => {
|
||||||
|
return {
|
||||||
|
sql: /*sql*/ `
|
||||||
|
select
|
||||||
|
cdia.dtaentradasaida,
|
||||||
|
cdia.nroempresa,
|
||||||
|
cdia.seqproduto,
|
||||||
|
cdia.qtdentrada,
|
||||||
|
cdia.qtdsaida,
|
||||||
|
cdia.qtdestqinicial + cdia.qtdentrada - cdia.qtdsaida qtdsaldo
|
||||||
|
SELECT a.nroempresa,
|
||||||
|
b.seqproduto,
|
||||||
|
INITCAP(C.NOMERAZAO) FORNECEDOR,
|
||||||
|
A.NUMERONF,
|
||||||
|
A.SERIENF,
|
||||||
|
A.DTAEMISSAO,
|
||||||
|
A.DTAENTRADA,
|
||||||
|
B.QUANTIDADE,
|
||||||
|
B.VLRITEM VALOR
|
||||||
|
from MLF_AUXNOTAFISCAL A, MLF_AUXNFITEM B, GE_PESSOA C, MAP_PRODUTO D
|
||||||
|
WHERE 1=1
|
||||||
|
and B.SEQAUXNOTAFISCAL = A.SEQAUXNOTAFISCAL
|
||||||
|
AND C.SEQPESSOA = A.SEQPESSOA
|
||||||
|
AND D.SEQPRODUTO = B.SEQPRODUTO
|
||||||
|
AND A.DTAEMISSAO >= SYSDATE-365
|
||||||
|
AND a.nroempresa = ${args.nrempresa}
|
||||||
|
AND b.seqproduto = ${args.codproduto}
|
||||||
|
order by A.DTAEMISSAO, A.NUMERONF, A.SERIENF;
|
||||||
|
`,
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user