Compare commits
241
Commits
2c3ff7ec43
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83fffcd31f | ||
|
|
1e64839bf2 | ||
|
|
539af7f912 | ||
|
|
b52ccfae7f | ||
|
|
b09ba2374f | ||
|
|
7f069af336 | ||
|
|
c6bcf1b743 | ||
|
|
1829bd1bc7 | ||
|
|
16bff226c5 | ||
|
|
91a1a4ef96 | ||
|
|
931a814278 | ||
|
|
5b53d994ac | ||
|
|
05d5adf8c9 | ||
|
|
a8c4ab1f78 | ||
|
|
6a72dad748 | ||
|
|
afc4fd5f04 | ||
|
|
4762e8c10d | ||
|
|
c744b6fd61 | ||
|
|
282c4ce7fa | ||
|
|
313482be68 | ||
|
|
ff2a3df470 | ||
|
|
48192eb211 | ||
|
|
f8e97fd09e | ||
|
|
316496520b | ||
|
|
f48618a23c | ||
|
|
1d6a2556e5 | ||
|
|
465205efc6 | ||
|
|
5841de1da3 | ||
|
|
f6f1c9b8c7 | ||
|
|
4a8d31d9d0 | ||
|
|
6dac9550c1 | ||
|
|
75d81bdfc7 | ||
|
|
b5bf9e2b26 | ||
|
|
fa54d93651 | ||
|
|
4bfaea0a47 | ||
|
|
96c461d4b6 | ||
|
|
3422acc241 | ||
|
|
a226f65b00 | ||
|
|
65ad3fd68c | ||
|
|
2d3d2c4fbc | ||
|
|
8ced6a5498 | ||
|
|
bf73616f5c | ||
|
|
dead250cf9 | ||
|
|
c8743d85c8 | ||
|
|
4059dc92e6 | ||
|
|
ef6980358e | ||
|
|
5e5da7a926 | ||
|
|
7dfed7798c | ||
|
|
93a4eb40f5 | ||
|
|
16ef05828e | ||
|
|
9bc9170788 | ||
|
|
9e4b66497c | ||
|
|
7aa4734658 | ||
|
|
3bb4b58216 | ||
|
|
073c284449 | ||
|
|
0c3e16d08c | ||
|
|
9eb74bbea7 | ||
|
|
1be68d9313 | ||
|
|
97b9c16bf1 | ||
|
|
4e3993daf8 | ||
|
|
4c9a841473 | ||
|
|
9c520ec3ad | ||
|
|
548dc62d4a | ||
|
|
0f48fc5afc | ||
|
|
604f9339ed | ||
|
|
7e166ca852 | ||
|
|
fcaa47948b | ||
|
|
31daca8636 | ||
|
|
7831e33c28 | ||
|
|
c7325cc87d | ||
|
|
3a021932f3 | ||
|
|
1d3906bcc3 | ||
|
|
a67f97271a | ||
|
|
e0722b2e2a | ||
|
|
a1c15d43f3 | ||
|
|
f6e41932b1 | ||
|
|
cb8363561a | ||
|
|
adbbaaee8e | ||
|
|
f363390589 | ||
|
|
a52b16b8b2 | ||
|
|
b8f403c2e4 | ||
|
|
8a87ebbc10 | ||
|
|
0991743a80 | ||
|
|
70c3131e9c | ||
|
|
fc5a23132d | ||
|
|
54c77ca23e | ||
|
|
705fadfdb4 | ||
|
|
c190582481 | ||
|
|
aa7fe013c0 | ||
|
|
e051b498f6 | ||
|
|
5dcc4adf2c | ||
|
|
95aa24c029 | ||
|
|
d8764b3bda | ||
|
|
ea88c93da3 | ||
|
|
7d5a853351 | ||
|
|
fc2fa7acac | ||
|
|
47942191ee | ||
|
|
43f9d16e62 | ||
|
|
659e690af3 | ||
|
|
d805fa3164 | ||
|
|
3903f11a92 | ||
|
|
d76e6d7035 | ||
|
|
79a4a4530c | ||
|
|
0ed9fb6d98 | ||
|
|
b6ae121e22 | ||
|
|
ad1a97dd9a | ||
|
|
f8df43d126 | ||
|
|
61818beb31 | ||
|
|
4b2d63007b | ||
|
|
9366fc90e4 | ||
|
|
a5ccd3083f | ||
|
|
f574991f0d | ||
|
|
2498c785d3 | ||
|
|
ccf12198ba | ||
|
|
f414a150d9 | ||
|
|
67a5190309 | ||
|
|
9ba79096c4 | ||
|
|
80bd203be6 | ||
|
|
8ac18135e5 | ||
|
|
65515b14c2 | ||
|
|
4bdcf34a7d | ||
|
|
a7431ef94a | ||
|
|
c795294090 | ||
|
|
5eedb6b174 | ||
|
|
f9a7bb91dc | ||
|
|
60a4119326 | ||
|
|
895499a8a8 | ||
|
|
6c20f62de9 | ||
|
|
3923c9dc01 | ||
|
|
d1b29437c9 | ||
|
|
6ec15cfb3d | ||
|
|
aeab10ce0d | ||
|
|
0641c6b2be | ||
|
|
c7442a777b | ||
|
|
7e2f99b50e | ||
|
|
c1719d4b6e | ||
|
|
c296da0151 | ||
|
|
66a57b4b3c | ||
|
|
c141af53f2 | ||
|
|
750b9a6bcf | ||
|
|
303a722875 | ||
|
|
58909014ab | ||
|
|
3d43efa82f | ||
|
|
ecf819671d | ||
|
|
1ea7f53344 | ||
|
|
899f4ee138 | ||
|
|
37209b5009 | ||
|
|
c00ba4b920 | ||
|
|
31fbc9a3b9 | ||
|
|
7bda7659a6 | ||
|
|
e33dad06b8 | ||
|
|
12bb4e837b | ||
|
|
fc49b30714 | ||
|
|
1647848fec | ||
|
|
5f1c3b6e3b | ||
|
|
5baf191a88 | ||
|
|
64f5e612d9 | ||
|
|
7638c1046b | ||
|
|
c52fce4cb8 | ||
|
|
5667c1e508 | ||
|
|
61195adc75 | ||
|
|
3d293561d2 | ||
|
|
d4eb103454 | ||
|
|
bb9d9a05a1 | ||
|
|
866778edfe | ||
|
|
4ce1e7a03d | ||
|
|
f163516115 | ||
|
|
1ed4e0e691 | ||
|
|
189c582eee | ||
|
|
ecdd770632 | ||
|
|
7915a27efe | ||
|
|
79eff57d70 | ||
|
|
9ac3f70a13 | ||
|
|
972f2f1f47 | ||
|
|
d43f2729bd | ||
|
|
987c2c1122 | ||
|
|
e414e52523 | ||
|
|
a3e88776a9 | ||
|
|
9e70c46451 | ||
|
|
adf5224440 | ||
|
|
888a36553e | ||
|
|
97ef961e13 | ||
|
|
77e844390e | ||
|
|
81182e5ded | ||
|
|
60e392c033 | ||
|
|
367f0c4340 | ||
|
|
43aa1c809d | ||
|
|
b6085d4140 | ||
|
|
affc09c3e8 | ||
|
|
4532d51e4b | ||
|
|
ee27da0669 | ||
|
|
b27b20d42d | ||
|
|
382ec5cd35 | ||
|
|
4cb8d4c71b | ||
|
|
f216a7acfa | ||
|
|
f140ab917e | ||
|
|
cda8053d90 | ||
|
|
7f789181cf | ||
|
|
26961ddd81 | ||
|
|
3284ae0de9 | ||
|
|
ea1493db43 | ||
|
|
7b1b414629 | ||
|
|
0d17478789 | ||
|
|
6f50812bb1 | ||
|
|
052b80de34 | ||
|
|
cc4964af5e | ||
|
|
3df53ba483 | ||
|
|
91eeef199e | ||
|
|
f230a3002d | ||
|
|
817720127e | ||
|
|
a37d0336b5 | ||
|
|
c4169453ce | ||
|
|
7f975157a5 | ||
|
|
69b4500eed | ||
|
|
b7877d7c07 | ||
|
|
b05e858ac6 | ||
|
|
33f477778e | ||
|
|
c0f6b23e19 | ||
|
|
7b6cb1e111 | ||
|
|
efdf8953dd | ||
|
|
9a8c922af3 | ||
|
|
45e559c05c | ||
|
|
43d5a218e7 | ||
|
|
acacf34eea | ||
|
|
5fa61ead23 | ||
|
|
ca75ed204c | ||
|
|
4bb2df1630 | ||
|
|
8e9619ae77 | ||
|
|
18cf673753 | ||
|
|
9ce99926e1 | ||
|
|
347e8139fc | ||
|
|
46d9dd4f5d | ||
|
|
30c19630e9 | ||
|
|
88b994fa17 | ||
|
|
f13b57e592 | ||
|
|
a7a8b9010d | ||
|
|
10e4565b8d | ||
|
|
8c49a9a9de | ||
|
|
fa1b51c33e | ||
|
|
fd01d27119 | ||
|
|
68b73cfd54 |
+20
@@ -33,6 +33,7 @@ mydatabase.db
|
||||
|
||||
# ── Logs de ejecución ──
|
||||
*.log
|
||||
*.err
|
||||
|
||||
# ── Spool de reportes (salida temporal de impresión) ──
|
||||
PROYECTO/spool/
|
||||
@@ -47,3 +48,22 @@ desktop.ini
|
||||
|
||||
# NOTA: se CONSERVAN en el repo -> *.4gl *.per *.4fd *.4pw *.4st *.4ad
|
||||
# *.sch *.4db (esquema), imagenes (*.png *.jpg), README, docs.
|
||||
|
||||
# -- Paquetes GAR: se generan en el build (gsmake -t mbs mbsERP.4pw), no van al repo --
|
||||
*.gar
|
||||
|
||||
# -- PROYECTO/bin: no se versiona (compilados, imagenes, ejecutables, datos de ejecucion) --
|
||||
# salvo los disenos de reporte .4rp, que son fuentes registradas en mbsERP.4pw.
|
||||
PROYECTO/bin/**
|
||||
!PROYECTO/bin/**/
|
||||
!PROYECTO/bin/**/*.4rp
|
||||
|
||||
# -- Llaves y certificados: NUNCA en el repo (se entregan aparte a quien los necesite) --
|
||||
*.jks
|
||||
*.keystore
|
||||
*.p12
|
||||
*.pfx
|
||||
*.pem
|
||||
*.key
|
||||
*.crt
|
||||
*.cer
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,561 @@
|
||||
<title>Radiografía Marmotech</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap">
|
||||
<style>
|
||||
:root{
|
||||
--bg:#f2efe9; --surface:#fbfaf7; --surface-2:#f5f2ea;
|
||||
--ink:#231f18; --muted:#726c60; --faint:#9a9284;
|
||||
--line:#e4dfd4; --line-2:#efe9dd;
|
||||
--accent:#9a6a2b; --accent-soft:#e9dcc4;
|
||||
--pos:#2f7d57; --neg:#b3402a; --warn:#b1832a;
|
||||
--grid:#eae4d8;
|
||||
--shadow:0 1px 2px rgba(40,33,20,.05),0 8px 24px -12px rgba(40,33,20,.14);
|
||||
--radius:14px;
|
||||
}
|
||||
@media (prefers-color-scheme:dark){
|
||||
:root:not([data-theme="light"]){
|
||||
--bg:#17150f; --surface:#211e16; --surface-2:#26221a;
|
||||
--ink:#ece6da; --muted:#a69d8c; --faint:#7c7361;
|
||||
--line:#332e24; --line-2:#2b271e;
|
||||
--accent:#cd9c56; --accent-soft:#3a3020;
|
||||
--pos:#4fb07f; --neg:#e0674e; --warn:#d5a34a;
|
||||
--grid:#2a261d;
|
||||
--shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -14px rgba(0,0,0,.6);
|
||||
}
|
||||
}
|
||||
:root[data-theme="dark"]{
|
||||
--bg:#17150f; --surface:#211e16; --surface-2:#26221a;
|
||||
--ink:#ece6da; --muted:#a69d8c; --faint:#7c7361;
|
||||
--line:#332e24; --line-2:#2b271e;
|
||||
--accent:#cd9c56; --accent-soft:#3a3020;
|
||||
--pos:#4fb07f; --neg:#e0674e; --warn:#d5a34a;
|
||||
--grid:#2a261d;
|
||||
--shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -14px rgba(0,0,0,.6);
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0}
|
||||
body{
|
||||
background:var(--bg); color:var(--ink);
|
||||
font-family:"IBM Plex Sans",system-ui,sans-serif;
|
||||
font-size:15px; line-height:1.5;
|
||||
-webkit-font-smoothing:antialiased;
|
||||
}
|
||||
.wrap{max-width:1220px; margin:0 auto; padding:22px 20px 60px}
|
||||
.num{font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1}
|
||||
|
||||
/* Header */
|
||||
header.top{display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:6px}
|
||||
.brand{display:flex; align-items:center; gap:14px}
|
||||
.mark{width:44px; height:44px; flex:0 0 auto}
|
||||
.brand h1{font-family:"Fraunces",serif; font-weight:600; font-size:26px; letter-spacing:-.01em; margin:0; line-height:1.05}
|
||||
.brand .sub{color:var(--muted); font-size:12.5px; letter-spacing:.14em; text-transform:uppercase; margin-top:3px}
|
||||
.period{text-align:right}
|
||||
.period .lbl{font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--faint)}
|
||||
.period .val{font-family:"Fraunces",serif; font-size:19px; font-weight:500}
|
||||
.period .note{font-size:11.5px; color:var(--muted)}
|
||||
|
||||
.rule{height:1px; background:linear-gradient(90deg,var(--accent),var(--line) 60%,transparent); margin:16px 0 18px; opacity:.7}
|
||||
|
||||
/* Tabs */
|
||||
nav.tabs{display:flex; gap:4px; margin-bottom:20px; border-bottom:1px solid var(--line); flex-wrap:wrap}
|
||||
nav.tabs button{
|
||||
appearance:none; border:0; background:none; cursor:pointer; color:var(--muted);
|
||||
font-family:inherit; font-size:14px; font-weight:500; padding:10px 15px; border-radius:8px 8px 0 0;
|
||||
border-bottom:2px solid transparent; margin-bottom:-1px; display:flex; align-items:center; gap:8px;
|
||||
}
|
||||
nav.tabs button .idx{font-family:"IBM Plex Mono",monospace; font-size:11px; color:var(--faint)}
|
||||
nav.tabs button:hover{color:var(--ink); background:var(--surface-2)}
|
||||
nav.tabs button[aria-selected="true"]{color:var(--ink); border-bottom-color:var(--accent)}
|
||||
nav.tabs button[aria-selected="true"] .idx{color:var(--accent)}
|
||||
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
|
||||
|
||||
.page{display:none; animation:fade .35s ease}
|
||||
.page.active{display:block}
|
||||
@keyframes fade{from{opacity:0; transform:translateY(4px)}to{opacity:1; transform:none}}
|
||||
@media (prefers-reduced-motion:reduce){.page,.page.active{animation:none}}
|
||||
|
||||
/* Cards & grid */
|
||||
.grid{display:grid; gap:14px}
|
||||
.kpis{grid-template-columns:repeat(4,1fr)}
|
||||
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px 17px}
|
||||
.card h3{margin:0 0 2px; font-size:11.5px; letter-spacing:.13em; text-transform:uppercase; color:var(--muted); font-weight:600}
|
||||
.card .cap{font-size:11.5px; color:var(--faint); margin:0 0 12px}
|
||||
.kpi .k-val{font-family:"Fraunces",serif; font-weight:600; font-size:29px; letter-spacing:-.01em; line-height:1.05; margin-top:6px}
|
||||
.kpi .k-val small{font-size:14px; color:var(--muted); font-weight:500; font-family:"IBM Plex Sans"}
|
||||
.kpi .k-sub{display:flex; align-items:center; gap:8px; margin-top:9px; font-size:12.5px; color:var(--muted)}
|
||||
.delta{display:inline-flex; align-items:center; gap:4px; font-weight:600; font-variant-numeric:tabular-nums; padding:2px 7px; border-radius:20px; font-size:12px}
|
||||
.delta.up{color:var(--pos); background:color-mix(in srgb,var(--pos) 12%,transparent)}
|
||||
.delta.down{color:var(--neg); background:color-mix(in srgb,var(--neg) 12%,transparent)}
|
||||
.delta.flat{color:var(--warn); background:color-mix(in srgb,var(--warn) 12%,transparent)}
|
||||
.accent-bar{height:3px; border-radius:3px; background:var(--accent); opacity:.9; margin:-16px -17px 14px; border-radius:var(--radius) var(--radius) 0 0}
|
||||
|
||||
.row{display:grid; gap:14px; margin-top:14px}
|
||||
.r-8-4{grid-template-columns:1.9fr 1.1fr}
|
||||
.r-6-6{grid-template-columns:1fr 1fr}
|
||||
.r-7-5{grid-template-columns:1.4fr 1fr}
|
||||
|
||||
/* Chart bits */
|
||||
svg{display:block; width:100%; height:auto; overflow:visible}
|
||||
.lgd{display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin-top:10px}
|
||||
.lgd span{display:inline-flex; align-items:center; gap:6px}
|
||||
.dot{width:10px; height:10px; border-radius:3px; display:inline-block}
|
||||
|
||||
table.tbl{width:100%; border-collapse:collapse; font-size:13px}
|
||||
table.tbl th{text-align:left; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--faint); font-weight:600; padding:7px 8px; border-bottom:1px solid var(--line)}
|
||||
table.tbl td{padding:8px; border-bottom:1px solid var(--line-2); font-variant-numeric:tabular-nums}
|
||||
table.tbl td.r,table.tbl th.r{text-align:right}
|
||||
table.tbl tr:last-child td{border-bottom:0}
|
||||
.barcell{position:relative}
|
||||
.barcell .fill{position:absolute; left:0; top:50%; transform:translateY(-50%); height:60%; border-radius:3px; background:var(--accent-soft)}
|
||||
.barcell span{position:relative}
|
||||
|
||||
.ratio{display:flex; align-items:baseline; gap:10px}
|
||||
.ratio .big{font-family:"Fraunces",serif; font-weight:600; font-size:34px; letter-spacing:-.02em}
|
||||
.foot{color:var(--muted); font-size:12px; margin-top:26px; border-top:1px solid var(--line); padding-top:14px}
|
||||
.foot code{font-family:"IBM Plex Mono",monospace; font-size:11.5px; background:var(--surface-2); padding:1px 5px; border-radius:4px}
|
||||
.pill{font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--accent); background:var(--accent-soft); padding:3px 8px; border-radius:20px; font-weight:600}
|
||||
|
||||
@media(max-width:880px){
|
||||
.kpis{grid-template-columns:repeat(2,1fr)}
|
||||
.r-8-4,.r-6-6,.r-7-5{grid-template-columns:1fr}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="wrap">
|
||||
<header class="top">
|
||||
<div class="brand">
|
||||
<svg class="mark" viewBox="0 0 44 44" aria-hidden="true">
|
||||
<rect x="1" y="1" width="42" height="42" rx="9" fill="none" stroke="var(--accent)" stroke-width="1.5"/>
|
||||
<path d="M8 30 L17 15 L23 24 L29 12 L36 30 Z" fill="none" stroke="var(--accent)" stroke-width="1.6" stroke-linejoin="round"/>
|
||||
<path d="M8 33 L36 33" stroke="var(--accent)" stroke-width="1.6"/>
|
||||
<circle cx="29" cy="12" r="1.8" fill="var(--accent)"/>
|
||||
</svg>
|
||||
<div>
|
||||
<h1>Radiografía de la Empresa</h1>
|
||||
<div class="sub">Marmotech, S.A. · Cuadro de Mando de Presidencia</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="period">
|
||||
<div class="lbl">Periodo</div>
|
||||
<div class="val num">Enero – Julio 2026</div>
|
||||
<div class="note">acumulado del año · comparado vs. 2025</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="rule"></div>
|
||||
|
||||
<nav class="tabs" role="tablist">
|
||||
<button role="tab" aria-selected="true" data-p="p1"><span class="idx">01</span> Radiografía</button>
|
||||
<button role="tab" aria-selected="false" data-p="p2"><span class="idx">02</span> Análisis de Gastos</button>
|
||||
<button role="tab" aria-selected="false" data-p="p3"><span class="idx">03</span> Estructura Financiera</button>
|
||||
</nav>
|
||||
|
||||
<!-- ============ PÁGINA 1 ============ -->
|
||||
<section class="page active" id="p1" role="tabpanel">
|
||||
<div class="grid kpis">
|
||||
<div class="card kpi"><div class="accent-bar"></div>
|
||||
<h3>Ventas Netas</h3>
|
||||
<div class="k-val num">RD$ 1,375.3<small> M</small></div>
|
||||
<div class="k-sub"><span class="delta down">▼ 1.3%</span> vs. 1,393.1 M (2025)</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Utilidad Bruta</h3>
|
||||
<div class="k-val num">RD$ 706.9<small> M</small></div>
|
||||
<div class="k-sub"><span class="delta down">▼ 1.4 pp</span> margen 51.4% <span style="color:var(--faint)">(52.8%)</span></div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Utilidad Operativa</h3>
|
||||
<div class="k-val num">RD$ 292.1<small> M</small></div>
|
||||
<div class="k-sub"><span class="delta flat">21.2%</span> margen operativo</div>
|
||||
</div>
|
||||
<div class="card kpi"><div class="accent-bar"></div>
|
||||
<h3>Utilidad Neta</h3>
|
||||
<div class="k-val num">RD$ 219.6<small> M</small></div>
|
||||
<div class="k-sub"><span class="delta down">▼ 21.4%</span> margen 16.0% <span style="color:var(--faint)">(20.1%)</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row r-7-5">
|
||||
<div class="card">
|
||||
<h3>Estado de Resultados — Cascada</h3>
|
||||
<p class="cap">De ventas a utilidad neta · acumulado 2026 (RD$ millones)</p>
|
||||
<svg id="waterfall" viewBox="0 0 720 300" role="img" aria-label="Cascada del estado de resultados"></svg>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Composición de cada RD$ vendido</h3>
|
||||
<p class="cap">Estructura del peso de ventas · 2026</p>
|
||||
<svg id="composition" viewBox="0 0 360 300" role="img" aria-label="Composición de ventas"></svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row r-7-5">
|
||||
<div class="card">
|
||||
<h3>Comportamiento del periodo actual</h3>
|
||||
<p class="cap">Ventas netas (barras) y utilidad neta (línea) por mes · 2026</p>
|
||||
<svg id="trend" viewBox="0 0 720 280" role="img" aria-label="Tendencia mensual 2026"></svg>
|
||||
<div class="lgd">
|
||||
<span><i class="dot" style="background:var(--accent-soft)"></i> Ventas netas</span>
|
||||
<span><i class="dot" style="background:var(--accent)"></i> Utilidad neta</span>
|
||||
<span><i class="dot" style="background:var(--pos)"></i> Margen neto %</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Trayectoria anual</h3>
|
||||
<p class="cap">Ventas y utilidad neta por año (RD$ M) · 2026 parcial</p>
|
||||
<svg id="annual" viewBox="0 0 360 280" role="img" aria-label="Comparativo anual"></svg>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ PÁGINA 2 ============ -->
|
||||
<section class="page" id="p2" role="tabpanel">
|
||||
<div class="grid kpis">
|
||||
<div class="card kpi"><div class="accent-bar"></div>
|
||||
<h3>Gastos Operativos</h3>
|
||||
<div class="k-val num">RD$ 414.7<small> M</small></div>
|
||||
<div class="k-sub"><span class="delta down">▲ 7.1%</span> vs. 387.2 M (2025)</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Gasto / Ventas</h3>
|
||||
<div class="k-val num">30.2<small> %</small></div>
|
||||
<div class="k-sub"><span class="delta down">▲ 2.4 pp</span> vs. 27.8% (2025)</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Gerencia mayor peso</h3>
|
||||
<div class="k-val" style="font-size:22px">Ventas y Mercadeo</div>
|
||||
<div class="k-sub num">RD$ 184.5 M · 44% del gasto</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Mayor alza YoY</h3>
|
||||
<div class="k-val" style="font-size:22px">Admin. y Materiales</div>
|
||||
<div class="k-sub num"><span class="delta down">▲ 13.3%</span> +12.3 M</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row r-6-6">
|
||||
<div class="card">
|
||||
<h3>Gasto por gerencia</h3>
|
||||
<p class="cap">2026 vs. 2025 · acumulado ene–jul (RD$ M)</p>
|
||||
<svg id="ger" viewBox="0 0 380 300" role="img" aria-label="Gasto por gerencia"></svg>
|
||||
<div class="lgd">
|
||||
<span><i class="dot" style="background:var(--accent)"></i> 2026</span>
|
||||
<span><i class="dot" style="background:var(--accent-soft)"></i> 2025</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Naturaleza del gasto</h3>
|
||||
<p class="cap">Por subgrupo contable · 2026 (RD$ M)</p>
|
||||
<table class="tbl">
|
||||
<thead><tr><th>Subgrupo</th><th class="r">Monto</th><th class="r">% ventas</th></tr></thead>
|
||||
<tbody id="subg"></tbody>
|
||||
</table>
|
||||
<p class="cap" style="margin-top:12px">El subgrupo <b>76 Cierre de gastos de fabricación</b> (−325.7 M) es una absorción a costo; reduce el gasto neto operativo.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<h3>Gasto mensual — control de eficiencia</h3>
|
||||
<p class="cap">Gasto operativo por mes y su relación con las ventas · 2026</p>
|
||||
<svg id="gtrend" viewBox="0 0 720 250" role="img" aria-label="Gasto mensual"></svg>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ PÁGINA 3 ============ -->
|
||||
<section class="page" id="p3" role="tabpanel">
|
||||
<div class="grid kpis">
|
||||
<div class="card kpi"><div class="accent-bar"></div>
|
||||
<h3>Activos Totales</h3>
|
||||
<div class="k-val num">RD$ 6,435<small> M</small></div>
|
||||
<div class="k-sub">al 31-jul-2026</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Razón Corriente</h3>
|
||||
<div class="k-val num">2.29<small> ×</small></div>
|
||||
<div class="k-sub"><span class="delta up">sólida</span> activo cte. 3,250 / pasivo cte. 1,420</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Capital de Trabajo</h3>
|
||||
<div class="k-val num">RD$ 1,830<small> M</small></div>
|
||||
<div class="k-sub">holgura de liquidez operativa</div>
|
||||
</div>
|
||||
<div class="card kpi">
|
||||
<h3>Endeudamiento</h3>
|
||||
<div class="k-val num">36<small> %</small></div>
|
||||
<div class="k-sub"><span class="delta up">conservador</span> pasivo / activo</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row r-6-6">
|
||||
<div class="card">
|
||||
<h3>De dónde viene y dónde está el capital</h3>
|
||||
<p class="cap">Activos = Pasivos + Patrimonio + resultado del ejercicio (RD$ M)</p>
|
||||
<svg id="bal" viewBox="0 0 380 300" role="img" aria-label="Estructura del balance"></svg>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Composición del activo</h3>
|
||||
<p class="cap">al 31-jul-2026 (RD$ M)</p>
|
||||
<table class="tbl">
|
||||
<thead><tr><th>Rubro</th><th class="r">Saldo</th></tr></thead>
|
||||
<tbody id="act"></tbody>
|
||||
</table>
|
||||
<h3 style="margin-top:18px">Composición del pasivo</h3>
|
||||
<table class="tbl">
|
||||
<thead><tr><th>Rubro</th><th class="r">Saldo</th></tr></thead>
|
||||
<tbody id="pas"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="foot">
|
||||
<span class="pill">Prototipo de diseño</span>
|
||||
Vista previa del tablero de Power BI. Fuente: <code>MarmotechBI.presidencia.vwPLMensual</code>, <code>vwGastosDepto</code>, <code>vwBalanceMensual</code> —
|
||||
reproduce el Mayor General Analítico (cgprrp008) y el Análisis de Gastos (cgprrp009). Cifras validadas contra el sistema al 31-jul-2026.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
var css=getComputedStyle(document.documentElement);
|
||||
var C=function(n){return css.getPropertyValue(n).trim()};
|
||||
function col(n){return C(n)}
|
||||
var money=function(v){return v.toLocaleString('en-US',{minimumFractionDigits:1,maximumFractionDigits:1})};
|
||||
|
||||
/* tabs */
|
||||
var btns=document.querySelectorAll('nav.tabs button');
|
||||
btns.forEach(function(b){
|
||||
b.addEventListener('click',function(){
|
||||
btns.forEach(function(x){x.setAttribute('aria-selected','false')});
|
||||
b.setAttribute('aria-selected','true');
|
||||
document.querySelectorAll('.page').forEach(function(p){p.classList.remove('active')});
|
||||
document.getElementById(b.dataset.p).classList.add('active');
|
||||
});
|
||||
});
|
||||
|
||||
var NS='http://www.w3.org/2000/svg';
|
||||
function el(t,a){var e=document.createElementNS(NS,t);for(var k in a)e.setAttribute(k,a[k]);return e;}
|
||||
function txt(x,y,s,o){o=o||{};var t=el('text',{x:x,y:y});t.textContent=s;
|
||||
t.setAttribute('fill',o.fill||col('--muted'));
|
||||
t.setAttribute('font-size',o.fs||11);
|
||||
t.setAttribute('font-family',o.mono?'"IBM Plex Mono",monospace':'"IBM Plex Sans",sans-serif');
|
||||
t.setAttribute('font-weight',o.fw||400);
|
||||
if(o.anchor)t.setAttribute('text-anchor',o.anchor);
|
||||
t.setAttribute('font-variant-numeric','tabular-nums');
|
||||
return t;}
|
||||
|
||||
/* ---------- WATERFALL ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('waterfall'); if(!svg)return;
|
||||
var W=720,H=300,padL=8,padR=8,base=250,top=20;
|
||||
var steps=[
|
||||
{l:'Ventas',v:1375.3,type:'start'},
|
||||
{l:'Costo',v:-668.4,type:'neg'},
|
||||
{l:'Ut. Bruta',v:706.9,type:'sub'},
|
||||
{l:'Gastos',v:-414.7,type:'neg'},
|
||||
{l:'Ut. Operat.',v:292.1,type:'sub'},
|
||||
{l:'Otros/ISR',v:-72.5,type:'neg'},
|
||||
{l:'Ut. Neta',v:219.6,type:'end'}
|
||||
];
|
||||
var max=1375.3, sc=(base-top)/max;
|
||||
var n=steps.length, gap=14, bw=(W-padL-padR-gap*(n-1))/n;
|
||||
var run=0;
|
||||
steps.forEach(function(s,i){
|
||||
var x=padL+i*(bw+gap), h, y, fill;
|
||||
if(s.type==='start'||s.type==='sub'||s.type==='end'){
|
||||
h=s.v*sc; y=base-h; run=s.v;
|
||||
fill = s.type==='end'?col('--accent') : (s.type==='start'?col('--accent'):col('--ink'));
|
||||
if(s.type==='sub')fill=col('--faint');
|
||||
}else{
|
||||
h=Math.abs(s.v)*sc; y=base-(run*sc); run=run+s.v;
|
||||
fill=col('--neg');
|
||||
}
|
||||
svg.appendChild(el('rect',{x:x,y:y,width:bw,height:Math.max(2,h),rx:3,fill:fill,opacity:s.type==='sub'?0.5:0.92}));
|
||||
svg.appendChild(txt(x+bw/2,base+16,s.l,{anchor:'middle',fs:10.5,fill:col('--muted')}));
|
||||
svg.appendChild(txt(x+bw/2,y-6,(s.v>0?'':'−')+money(Math.abs(s.v)),{anchor:'middle',fs:11,mono:true,fw:600,fill:col('--ink')}));
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---------- COMPOSITION (stacked bar of one peso) ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('composition'); if(!svg)return;
|
||||
var parts=[
|
||||
{l:'Costo de ventas',p:48.6,c:col('--neg')},
|
||||
{l:'Gastos operativos',p:30.2,c:col('--warn')},
|
||||
{l:'Otros / ISR',p:5.3,c:col('--faint')},
|
||||
{l:'Utilidad neta',p:16.0,c:col('--pos')}
|
||||
];
|
||||
var x=90,y=24,w=54,H=250,total=100,sc=H/total,cy=y;
|
||||
parts.forEach(function(p){
|
||||
var h=p.p*sc;
|
||||
svg.appendChild(el('rect',{x:x,y:cy,width:w,height:h,fill:p.c,opacity:.9}));
|
||||
svg.appendChild(txt(x-10,cy+h/2+4,p.p.toFixed(1)+'%',{anchor:'end',mono:true,fs:12,fw:600,fill:col('--ink')}));
|
||||
svg.appendChild(txt(x+w+10,cy+h/2+4,p.l,{fs:11.5,fill:col('--muted')}));
|
||||
cy+=h;
|
||||
});
|
||||
svg.appendChild(txt(x+w/2,y-8,'RD$ 1.00',{anchor:'middle',fs:10,fill:col('--faint')}));
|
||||
})();
|
||||
|
||||
/* ---------- TREND (bars + line) ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('trend'); if(!svg)return;
|
||||
var data=[
|
||||
{m:'Ene',v:132.4,u:2.5},{m:'Feb',v:169.9,u:7.2},{m:'Mar',v:224.8,u:56.3},
|
||||
{m:'Abr',v:224.3,u:52.6},{m:'May',v:190.8,u:33.0},{m:'Jun',v:225.0,u:37.8},
|
||||
{m:'Jul',v:208.1,u:30.2}
|
||||
];
|
||||
var W=720,base=230,top=18,padL=34,padR=12;
|
||||
var max=240, sc=(base-top)/max;
|
||||
[0,60,120,180,240].forEach(function(g){
|
||||
var y=base-g*sc;
|
||||
svg.appendChild(el('line',{x1:padL,y1:y,x2:W-padR,y2:y,stroke:col('--grid'),'stroke-width':1}));
|
||||
svg.appendChild(txt(padL-6,y+3,g,{anchor:'end',fs:9.5,fill:col('--faint'),mono:true}));
|
||||
});
|
||||
var n=data.length, gap=18, bw=(W-padL-padR-gap*(n-1))/n;
|
||||
var pts=[];
|
||||
data.forEach(function(d,i){
|
||||
var x=padL+i*(bw+gap);
|
||||
var h=d.v*sc;
|
||||
svg.appendChild(el('rect',{x:x,y:base-h,width:bw,height:h,rx:3,fill:col('--accent-soft')}));
|
||||
svg.appendChild(txt(x+bw/2,base+15,d.m,{anchor:'middle',fs:10.5}));
|
||||
svg.appendChild(txt(x+bw/2,base-h-6,d.v.toFixed(0),{anchor:'middle',fs:10,mono:true,fill:col('--muted')}));
|
||||
pts.push([x+bw/2, base-d.u*sc]);
|
||||
});
|
||||
var dpath='M'+pts.map(function(p){return p[0]+','+p[1]}).join(' L');
|
||||
svg.appendChild(el('path',{d:dpath,fill:'none',stroke:col('--accent'),'stroke-width':2.4,'stroke-linejoin':'round'}));
|
||||
pts.forEach(function(p){svg.appendChild(el('circle',{cx:p[0],cy:p[1],r:3.4,fill:col('--surface'),stroke:col('--accent'),'stroke-width':2}));});
|
||||
})();
|
||||
|
||||
/* ---------- ANNUAL ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('annual'); if(!svg)return;
|
||||
var data=[{y:'2024',v:2401,u:462},{y:'2025',v:2401,u:457},{y:"2026*",v:1375,u:220}];
|
||||
var W=360,base=230,top=18,padL=30,padR=10;
|
||||
var max=2500,sc=(base-top)/max;
|
||||
var n=data.length,gap=40,grp=(W-padL-padR-gap*(n-1))/n, bw=grp/2-3;
|
||||
data.forEach(function(d,i){
|
||||
var x=padL+i*(grp+gap);
|
||||
var h1=d.v*sc,h2=d.u*sc;
|
||||
svg.appendChild(el('rect',{x:x,y:base-h1,width:bw,height:h1,rx:3,fill:col('--accent-soft')}));
|
||||
svg.appendChild(el('rect',{x:x+bw+6,y:base-h2,width:bw,height:h2,rx:3,fill:col('--accent')}));
|
||||
svg.appendChild(txt(x+grp/2,base+15,d.y,{anchor:'middle',fs:11}));
|
||||
svg.appendChild(txt(x+bw/2,base-h1-5,(d.v/1000).toFixed(2)+'k',{anchor:'middle',fs:9.5,mono:true,fill:col('--muted')}));
|
||||
svg.appendChild(txt(x+bw+6+bw/2,base-h2-5,d.u,{anchor:'middle',fs:9.5,mono:true,fill:col('--muted')}));
|
||||
});
|
||||
svg.appendChild(txt(padL,top-4,'RD$ M',{fs:9.5,fill:col('--faint')}));
|
||||
})();
|
||||
|
||||
/* ---------- GERENCIA (grouped horizontal) ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('ger'); if(!svg)return;
|
||||
var data=[
|
||||
{l:'Ventas y Mercadeo',a:184.5,b:178.3},
|
||||
{l:'Admin. y Materiales',a:104.8,b:92.5},
|
||||
{l:'Planta / Producción',a:78.1,b:79.9},
|
||||
{l:'Gerencia General',a:41.3,b:36.4},
|
||||
{l:'Planta Agregados',a:4.4,b:0},
|
||||
{l:'Caribbean',a:1.6,b:0}
|
||||
];
|
||||
var W=380,padL=8,padR=44,top=6,rowH=46,x0=padL, maxW=W-padL-padR, max=190, sc=maxW/max;
|
||||
data.forEach(function(d,i){
|
||||
var y=top+i*rowH;
|
||||
svg.appendChild(txt(x0,y+11,d.l,{fs:11,fw:500,fill:col('--ink')}));
|
||||
svg.appendChild(el('rect',{x:x0,y:y+16,width:Math.max(2,d.a*sc),height:9,rx:2,fill:col('--accent')}));
|
||||
svg.appendChild(el('rect',{x:x0,y:y+27,width:Math.max(2,d.b*sc),height:9,rx:2,fill:col('--accent-soft')}));
|
||||
svg.appendChild(txt(x0+d.a*sc+6,y+24,money(d.a),{fs:10,mono:true,fill:col('--muted')}));
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---------- SUBGRUPO table ---------- */
|
||||
(function(){
|
||||
var tb=document.getElementById('subg'); if(!tb)return;
|
||||
var rows=[
|
||||
['74 · Otros gastos y servicios',304.1,22.1],
|
||||
['71 · Compensación empleados',293.8,21.4],
|
||||
['73 · Gastos fijos',114.7,8.3],
|
||||
['72 · Otros rel. a empleados',27.8,2.0],
|
||||
['76 · Cierre fabricación (absorción)',-325.7,-23.7]
|
||||
];
|
||||
var max=310;
|
||||
rows.forEach(function(r){
|
||||
var tr=document.createElement('tr');
|
||||
var w=Math.abs(r[1])/max*100;
|
||||
tr.innerHTML='<td class="barcell"><div class="fill" style="width:'+w+'%;background:'+(r[1]<0?'color-mix(in srgb,var(--neg) 20%,transparent)':'var(--accent-soft)')+'"></div><span>'+r[0]+'</span></td>'+
|
||||
'<td class="r num" style="font-weight:600;color:'+(r[1]<0?'var(--neg)':'var(--ink)')+'">'+(r[1]<0?'−':'')+money(Math.abs(r[1]))+'</td>'+
|
||||
'<td class="r num" style="color:var(--muted)">'+r[2].toFixed(1)+'%</td>';
|
||||
tb.appendChild(tr);
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---------- GASTO TREND ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('gtrend'); if(!svg)return;
|
||||
var data=[
|
||||
{m:'Ene',g:55.1,r:41.6},{m:'Feb',g:54.8,r:32.2},{m:'Mar',g:59.2,r:26.3},
|
||||
{m:'Abr',g:59.9,r:26.7},{m:'May',g:57.7,r:30.3},{m:'Jun',g:61.5,r:27.3},{m:'Jul',g:66.6,r:32.0}
|
||||
];
|
||||
var W=720,base=200,top=16,padL=34,padR=40;
|
||||
var max=80,sc=(base-top)/max;
|
||||
[0,20,40,60,80].forEach(function(g){var y=base-g*sc;
|
||||
svg.appendChild(el('line',{x1:padL,y1:y,x2:W-padR,y2:y,stroke:col('--grid')}));
|
||||
svg.appendChild(txt(padL-6,y+3,g,{anchor:'end',fs:9.5,mono:true,fill:col('--faint')}));});
|
||||
var n=data.length,gap=20,bw=(W-padL-padR-gap*(n-1))/n, rpts=[];
|
||||
data.forEach(function(d,i){
|
||||
var x=padL+i*(bw+gap),h=d.g*sc;
|
||||
svg.appendChild(el('rect',{x:x,y:base-h,width:bw,height:h,rx:3,fill:col('--accent')}));
|
||||
svg.appendChild(txt(x+bw/2,base+15,d.m,{anchor:'middle',fs:10.5}));
|
||||
svg.appendChild(txt(x+bw/2,base-h-5,d.g.toFixed(0),{anchor:'middle',fs:9.5,mono:true,fill:col('--muted')}));
|
||||
rpts.push([x+bw/2, base-(d.r/ (80/60) )*sc]); // scale % on right (0-60 mapped)
|
||||
});
|
||||
// right axis % (gasto/ventas), scale 0-60 across same height
|
||||
var rsc=(base-top)/60;
|
||||
rpts=[];data.forEach(function(d,i){var x=padL+i*(bw+gap);rpts.push([x+bw/2, base-d.r*rsc]);});
|
||||
var dp='M'+rpts.map(function(p){return p[0]+','+p[1]}).join(' L');
|
||||
svg.appendChild(el('path',{d:dp,fill:'none',stroke:col('--pos'),'stroke-width':2.2,'stroke-dasharray':'1 0'}));
|
||||
rpts.forEach(function(p,i){svg.appendChild(el('circle',{cx:p[0],cy:p[1],r:3,fill:col('--surface'),stroke:col('--pos'),'stroke-width':2}));
|
||||
svg.appendChild(txt(p[0],p[1]-8,data[i].r.toFixed(0)+'%',{anchor:'middle',fs:9,mono:true,fill:col('--pos')}));});
|
||||
svg.appendChild(txt(padL,top-4,'RD$ M',{fs:9.5,fill:col('--faint')}));
|
||||
svg.appendChild(txt(W-padR+4,top+4,'% ventas',{fs:9.5,fill:col('--pos')}));
|
||||
})();
|
||||
|
||||
/* ---------- BALANCE stacked ---------- */
|
||||
(function(){
|
||||
var svg=document.getElementById('bal'); if(!svg)return;
|
||||
var W=380,base=250,top=20,bw=88;
|
||||
var max=6435, sc=(base-top)/max;
|
||||
// col 1 activos
|
||||
var xA=60;
|
||||
svg.appendChild(el('rect',{x:xA,y:base-6435*sc,width:bw,height:6435*sc,rx:4,fill:col('--accent'),opacity:.9}));
|
||||
svg.appendChild(txt(xA+bw/2,base-6435*sc-8,'6,435',{anchor:'middle',fs:12,mono:true,fw:600,fill:col('--ink')}));
|
||||
svg.appendChild(txt(xA+bw/2,base+16,'Activos',{anchor:'middle',fs:11}));
|
||||
// col 2 pasivo+patrimonio+result
|
||||
var xB=xA+bw+70, parts=[{l:'Pasivos',v:2322,c:col('--neg')},{l:'Patrimonio',v:3894,c:col('--pos')},{l:'Result. ejerc.',v:219,c:col('--warn')}];
|
||||
var cy=base;
|
||||
parts.forEach(function(p){var h=p.v*sc;cy-=h;
|
||||
svg.appendChild(el('rect',{x:xB,y:cy,width:bw,height:h,fill:p.c,opacity:.85}));
|
||||
svg.appendChild(txt(xB+bw+8,cy+h/2+4,p.l+' '+p.v.toLocaleString('en-US'),{fs:10.5,fill:col('--muted')}));
|
||||
});
|
||||
svg.appendChild(txt(xB+bw/2,base+16,'Pas. + Patrim.',{anchor:'middle',fs:11}));
|
||||
})();
|
||||
|
||||
/* ---------- ACTIVO / PASIVO tables ---------- */
|
||||
(function(){
|
||||
function fill(id,rows,max){
|
||||
var tb=document.getElementById(id); if(!tb)return;
|
||||
rows.forEach(function(r){
|
||||
var tr=document.createElement('tr');
|
||||
var neg=r[1]<0;
|
||||
tr.innerHTML='<td>'+r[0]+'</td><td class="r num" style="color:'+(neg?'var(--neg)':'var(--ink)')+'">'+(neg?'−':'')+Math.abs(r[1]).toLocaleString('en-US')+'</td>';
|
||||
tb.appendChild(tr);
|
||||
});
|
||||
}
|
||||
fill('act',[['Activos corrientes',3250],['Activos fijos',4140],['Depreciación acum.',-1136],['Otros activos',181],['Total activos',6435]]);
|
||||
fill('pas',[['Pasivos corrientes',1420],['Préstamos largo plazo',902],['Total pasivos',2322],['Patrimonio',3894]]);
|
||||
// bold totals
|
||||
['act','pas'].forEach(function(id){var t=document.getElementById(id);var rs=t.querySelectorAll('tr');
|
||||
rs.forEach(function(tr){if(/Total/.test(tr.textContent)){tr.style.fontWeight='700';tr.querySelectorAll('td').forEach(function(td){td.style.borderTop='1px solid var(--line)';});}});});
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,328 @@
|
||||
# Documentación de la base de datos **MarmotechBI**
|
||||
### Guía para el desarrollo de dashboards en Power BI
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| **Servidor** | `192.168.40.8` (SQL Server 2016) |
|
||||
| **Base de datos** | `MarmotechBI` |
|
||||
| **Origen de los datos** | Se actualiza en vivo desde los sistemas operativos de la empresa |
|
||||
| **Naturaleza** | Capa semántica de **vistas** (54 vistas + 2 tablas). No almacena datos propios salvo 2 tablas de carga manual |
|
||||
| **Propósito** | Esquema estrella para que usuarios de negocio armen sus propios dashboards con nombres de negocio |
|
||||
| **Fecha de este documento** | 2026-08-25 |
|
||||
|
||||
> **Idea clave:** casi todo en `MarmotechBI` es una **vista** que presenta la información con nombres de negocio (`vwFactVentas`, `vwDimProducto`, etc.). Como son vistas, **no existen llaves foráneas físicas**: las relaciones son *lógicas* y hay que **crearlas manualmente en Power BI** (ver la sección [Relaciones para Power BI](#relaciones-recomendadas-en-power-bi)).
|
||||
|
||||
---
|
||||
|
||||
## 1. Cómo conectarse desde Power BI
|
||||
|
||||
1. **Obtener datos → SQL Server**.
|
||||
2. Servidor: `192.168.40.8` · Base de datos: `MarmotechBI`.
|
||||
3. Modo: **Import** (recomendado para tableros publicados) o **DirectQuery** si se necesita tiempo real.
|
||||
4. Seleccionar las vistas del área que se va a analizar (ej. `vwFactVentas` + sus dimensiones `vwDim*`).
|
||||
5. En la vista **Modelo**, crear las relaciones según la sección 6.
|
||||
|
||||
> **Permisos:** el acceso es por login de Windows con rol de lectura (`db_datareader`) sobre `MarmotechBI`. Solicitarlo a Tecnología con el usuario de dominio.
|
||||
|
||||
---
|
||||
|
||||
## 2. Convenciones de nombres
|
||||
|
||||
| Prefijo | Significado | Rol en el modelo |
|
||||
|---|---|---|
|
||||
| `vwDim…` | **Dimensión** — describe (quién, qué, dónde, cuándo) | Tabla de "look up" |
|
||||
| `vwFact…` / `VWFACT…` | **Hecho** — mide (cuánto, cuántos) | Tabla central de valores |
|
||||
| `vwBridge…` | **Puente** — resuelve relaciones muchos-a-muchos | Entre dimensiones |
|
||||
| `VW_DIM_…` / `VW_HECHOS_…` | Esquema del **Balanced Scorecard / Indicadores** (área independiente) | Dim / Hecho de gestión |
|
||||
| Sin prefijo (`ventas_facturas`, `estadoResultado`, `item_conteo_ciclico`…) | **Vistas planas de reporte** — ya vienen denormalizadas | Se usan solas, no requieren relaciones |
|
||||
| `…_usuario` (`_cdelacruz`, `_jisa`, `_mpuig`…) | **Copias personales** filtradas por vendedor/supervisor | Uso individual, no para el modelo general |
|
||||
|
||||
**Claves compuestas** — se repiten en casi todo el modelo:
|
||||
|
||||
- **Producto** = `cod_n` + `cod_grupo` + `cod_tipo` + `cod_sec` (4 columnas). En `vwDimProducto` existe también `producto_id` que las concatena como texto (`cod_n-cod_grupo-cod_tipo-cod_sec`).
|
||||
- **Cliente** = `tipo_cliente` + `sec_cliente` (2 columnas).
|
||||
|
||||
---
|
||||
|
||||
## 3. Áreas temáticas (subject areas)
|
||||
|
||||
| # | Área | Hecho(s) principal(es) | Dimensiones que usa |
|
||||
|---|---|---|---|
|
||||
| A | **Comercial / Ventas** | `vwFactVentas`, `VWFACTCOTIZACIONES`, `vwfactPipeline`, `vwFactPresupuesto` | Fecha, Cliente, Vendedor, EquipoVentas, Producto, Categoría, Provincia, Zona, TipoVenta |
|
||||
| B | **Cuentas por Cobrar** | `vwFactCxC_Base`, `vwFactCxC_Real` | Cliente, Vendedor, TipoVenta |
|
||||
| C | **Despacho / Pendientes** | `vwOrdenesPendientesDespacho`, `vwReqCotizaciones`, `vwProductoDisponible` | Cliente, Vendedor, Producto |
|
||||
| D | **Producción** | `vwProduccion_pub` | DepartamentoProducción, Producto |
|
||||
| E | **Contabilidad / Finanzas** | `vwFactContabilidad`, `estadoResultado` | (Departamento, Cuenta — internas) |
|
||||
| F | **Inventario** | `vwRotacionInventario_pub`, `vwRotacionInventarioPorBodega_pub`, `item_conteo_ciclico` | (planas, autocontenidas) |
|
||||
| G | **Indicadores / Balanced Scorecard** | `VW_HECHOS_INDICADORES`, `VW_HECHOS_DOWNTIME`, `VW_HECHOS_TICKETS` | Calendario, Departamentos, Indicadores, Perspectivas, Procesos |
|
||||
| H | **Datos externos** (tabla física) | `FactMercadoEdificaciones` | (independiente) |
|
||||
|
||||
---
|
||||
|
||||
## 4. Diccionario de dimensiones (área comercial)
|
||||
|
||||
### `vwDimFecha` — Calendario (grano mensual)
|
||||
Grano = mes.
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `ano` | smallint | Año |
|
||||
| `numeroMes` | smallint | Número de mes (1-12) — **llave para ordenar** |
|
||||
| `mes` | char(10) | Nombre del mes |
|
||||
| `AnoMes` | varchar(7) | `AAAA-MM` |
|
||||
|
||||
### `vwDimCliente` — Clientes · PK = `tipo_cliente` + `sec_cliente`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `tipo_cliente` | smallint | Tipo/segmento de cliente (parte 1 de la llave) |
|
||||
| `sec_cliente` | int | Secuencia del cliente (parte 2 de la llave) |
|
||||
| `nombre` | char(100) | Razón social |
|
||||
| `num_rnc` | char(25) | RNC/Cédula |
|
||||
| `direccion` | varchar(173) | Dirección |
|
||||
|
||||
### `vwDimVendedor` — Vendedores · PK = `vendedor_id`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `vendedor_id` | smallint | Código de vendedor (corresponde al nº de empleado) |
|
||||
| `vendedor` | varchar(31) | Nombre y apellido |
|
||||
| `equipo_id` | smallint | **FK → `vwDimEquipoVentas.equipo_id`** |
|
||||
|
||||
### `vwDimEquipoVentas` — Equipos de venta · PK = `equipo_id`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `equipo_id` | smallint | Código del equipo/departamento comercial |
|
||||
| `equipoVentas` | nchar(200) | Nombre del equipo |
|
||||
|
||||
### `vwDimProducto` — Productos · PK = `cod_n`+`cod_grupo`+`cod_tipo`+`cod_sec`
|
||||
**Es la dimensión central de producto de todo el modelo.**
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `cod_n`, `cod_grupo`, `cod_tipo`, `cod_sec` | int | Llave compuesta del producto |
|
||||
| `producto_id` | varchar(43) | Llave concatenada (`cod_n-cod_grupo-cod_tipo-cod_sec`) — **usar esta para relacionar en Power BI** |
|
||||
| `descripcion_producto` | varchar(180) | Nombre del producto |
|
||||
| `unidad_med` | char(4) | Unidad de medida |
|
||||
| `clase` / `grupo` / `tipo` | char/nvarchar | Jerarquía de clasificación |
|
||||
| `origen` | char(20) | Origen (nacional/importado/producción) |
|
||||
| `categoria_titulo` | varchar(100) | Categoría comercial |
|
||||
| `GerenteMarcas` | varchar(31) | Gerente de marca responsable |
|
||||
|
||||
### `vwDimCategoria` — Categorías comerciales · PK = `cod_categoria`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `cod_categoria` | smallint | Código de categoría |
|
||||
| `categoria` | varchar(100) | Nombre de la categoría |
|
||||
|
||||
### `vwBridgeProductoCategoria` — Puente Producto ↔ Categoría
|
||||
Resuelve que un producto (por `cod_n`+`cod_grupo`+`cod_tipo`) pertenece a una categoría.
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `cod_n`, `cod_grupo`, `cod_tipo` | smallint | Parte de la llave del producto |
|
||||
| `cod_categoria` | smallint | **FK → `vwDimCategoria.cod_categoria`** |
|
||||
|
||||
### `vwDimProvincia` — Provincias · PK = `cod_provincia`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `cod_provincia` | smallint | Código de provincia |
|
||||
| `nombre_provincia` | char(30) | Nombre |
|
||||
| `pais` | nchar(20) | País |
|
||||
| `idZona` | smallint | **FK → `vwDimZona.cod_zona`** |
|
||||
|
||||
### `vwDimZona` — Zonas geográficas · PK = `cod_zona`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `cod_zona` | smallint | Código de zona |
|
||||
| `zonaGeografica` | char(30) | Nombre de la zona |
|
||||
|
||||
### `vwDimTipoVenta` — Tipo de venta / Moneda · PK = `ventas`
|
||||
Contiene la **tasa de cambio** usada para convertir a RD$.
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `ventas` | smallint | Código de tipo de venta |
|
||||
| `descripcion` | nvarchar(80) | Descripción |
|
||||
| `simbolo` | nvarchar(40) | Símbolo de moneda |
|
||||
| `descripcion_moneda` | nchar(40) | Moneda |
|
||||
| `tasa` | decimal | Tasa de cambio a RD$ |
|
||||
| `tipo_operacion` | varchar(11) | `LOCAL_RD` / `LOCAL_USD` / `EXPORTACION` / `EURO` / `OTRO` |
|
||||
|
||||
### `vwDimDepartamentoProduccion` — Departamentos de producción · PK = `codigodepto`
|
||||
| Columna | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `codigodepto` | smallint | Código de departamento |
|
||||
| `nombre_depto` | char(30) | Nombre |
|
||||
| `tipo_departamento` | nchar(40) | Tipo |
|
||||
| `proceso_agrupado` | varchar(13) | Agrupación de proceso |
|
||||
|
||||
---
|
||||
|
||||
## 5. Diccionario de hechos (measures)
|
||||
|
||||
### `vwFactVentas` — Ventas facturadas · grano: **línea de factura**
|
||||
Una fila por cada línea de factura. Solo incluye documentos activos (no anulados).
|
||||
| Columna | Tipo | Rol | Descripción |
|
||||
|---|---|---|---|
|
||||
| `factura`, `sucid` | int | Grano | Nº de factura + sucursal |
|
||||
| `fecha`, `ano`, `mes` | date/int | → Fecha | Fecha de factura |
|
||||
| `tipo_cliente`, `sec_cliente` | — | → Cliente | Llave del cliente |
|
||||
| `vendedor` | smallint | → Vendedor | `sec_vend` (código del vendedor) |
|
||||
| `ventas` | — | → TipoVenta | Código de moneda/tipo venta |
|
||||
| `tipoVenta`, `simbolo`, `tasa` | — | Atributo | Descripción de moneda y tasa |
|
||||
| `cod_provincia` | — | → Provincia | Provincia del cliente |
|
||||
| `cotizacion_no` | int | → Cotización | Cotización que originó la venta |
|
||||
| `cod_n`,`cod_grupo`,`cod_tipo`,`cod_sec` | — | → Producto | Llave del producto |
|
||||
| `cantidad` | numeric | Medida | Cantidad vendida |
|
||||
| `precio` | numeric | Medida | Precio unitario |
|
||||
| `porc_desc` | numeric | Medida | % de descuento |
|
||||
| `valor_bruto` | numeric | Medida | cantidad × precio |
|
||||
| `valor_descuento` | numeric | Medida | Monto del descuento |
|
||||
| `neto` | numeric | Medida | Neto en moneda original |
|
||||
| **`neto_rd`** | numeric | Medida | **Neto convertido a RD$ (neto × tasa)** — usar para totales |
|
||||
|
||||
### `VWFACTCOTIZACIONES` — Cotizaciones · grano: línea de cotización
|
||||
Llaves: `cotizacion_no`, `tipo_cliente`+`sec_cliente`, `vendedor_id`, `cod_zona`, `cod_provincia`, `cod_n…cod_sec`.
|
||||
Medidas: `cantidad`, `precio`, `porc_desc`, `neto_rd`, `monto_bruto`, `monto_descuento`, `estado`.
|
||||
|
||||
### `vwfactPipeline` — Embudo comercial (cotizado → vendido → despachado) · grano: cotización
|
||||
Medidas: `cotizado_rd`, `vendido_rd`, `pendiente_venta_rd`, `conversion_pct`, `despachado_rd`, `pendiente_despacho_rd`.
|
||||
Llaves: `cotizacion_no`, `tipo_cliente`+`sec_cliente`, `vendedor`, `cod_zona`, `cod_provincia`, `ventas`.
|
||||
|
||||
### `vwFactPresupuesto` — Presupuesto/meta de ventas
|
||||
Llaves: `ano`,`mes`, `vendedor`, `ventas`, `cod_n…cod_sec`, `cod_categoria`.
|
||||
Medidas: `cantidad`, `valor`, `valor_rd`.
|
||||
|
||||
### `vwFactCxC_Base` — Movimientos de Cuentas por Cobrar
|
||||
Llaves: `tipo_cliente`+`sec_cliente`, `vendedor`, `num_doc`, `tipo_doc`, `ventas`.
|
||||
Medidas: `monto`, `monto_rd`, `monto_signado`, `monto_signado_rd`, `dias_vencimiento`, `tipo_movimiento`.
|
||||
|
||||
### `vwFactCxC_Real` — Balance vigente de CxC por factura
|
||||
Llaves: `tipo_cliente`+`sec_cliente`, `vendedor`, `factura`, `ventas`.
|
||||
Medidas: `balance_rd`, `dias_vencimiento`.
|
||||
|
||||
### `vwProductoDisponible` — Disponibilidad de inventario (snapshot)
|
||||
Disponibilidad calculada con la misma lógica del sistema operativo de inventario. Llave: `producto_id` / `cod_n…cod_sec`.
|
||||
Medidas: `existencia`, `ordenes_abiertas`, `despachado`, `reservado`, `transito`, **`disponible`** (= existencia − (ordenes_abiertas − despachado) − reservado).
|
||||
|
||||
### `vwOrdenesPendientesDespacho` — Órdenes pendientes de despacho
|
||||
Llaves: `cotizacion_no`, `tipo_cliente`+`sec_cliente`, `vendedor_id`, `cod_n…cod_sec`.
|
||||
Medidas: `cantidadCotizada`, `cantidadDespachada`, `cantidadPendiente`, `valorCotizadoLinea`.
|
||||
|
||||
### `vwReqCotizaciones` — Requisiciones vs. cotizaciones
|
||||
Medidas: `cantidadCotizada`, `cantidadDespachada`, `cantidadPendiente`, `valorRequisicion`, `valorPendienteDespachar`.
|
||||
|
||||
### `vwProduccion_pub` — Producción diaria · grano: producto/día
|
||||
Llaves: `codigodepto` → DepartamentoProducción, `cod_n…cod_sec` → Producto.
|
||||
Medidas: `unidades`, `cantidad`, `existencia`, `cantidadVendida`.
|
||||
|
||||
### `vwFactContabilidad` — Movimientos contables
|
||||
Llaves: `cuenta`, `codigodepartamento`, `ano`, `mes`, `tipo`, `banco`.
|
||||
Medidas: `debito`, `credito`, `balance`, `presupuesto`. Incluye auditoría (`usuariocreador`, `fechacreacion`…).
|
||||
|
||||
---
|
||||
|
||||
## 6. Relaciones recomendadas en Power BI
|
||||
|
||||
> Como son vistas, **Power BI no detecta relaciones automáticamente**. Créalas a mano en la vista *Modelo*, con cardinalidad **Dimensión (1) → Hecho (\*)** y filtro en **dirección única**.
|
||||
|
||||
### 6.1 Área comercial (estrella)
|
||||
|
||||
| Dimensión (lado 1) | Columna | Hecho (lado \*) | Columna |
|
||||
|---|---|---|---|
|
||||
| `vwDimFecha` | `AnoMes` | `vwFactVentas` / cotizaciones / pipeline | `AnoMes` derivado de `ano`+`mes` |
|
||||
| `vwDimCliente` | *clave compuesta* | `vwFactVentas`, `VWFACTCOTIZACIONES`, CxC | `tipo_cliente` + `sec_cliente` |
|
||||
| `vwDimVendedor` | `vendedor_id` | `vwFactVentas` (`vendedor`), cotizaciones (`vendedor_id`) | vendedor |
|
||||
| `vwDimEquipoVentas` | `equipo_id` | `vwDimVendedor` | `equipo_id` |
|
||||
| `vwDimProducto` | `producto_id` | hechos con `cod_n…cod_sec` | *clave compuesta* |
|
||||
| `vwDimCategoria` | `cod_categoria` | `vwBridgeProductoCategoria` | `cod_categoria` |
|
||||
| `vwBridgeProductoCategoria` | `cod_n`+`cod_grupo`+`cod_tipo` | `vwDimProducto` | mismas columnas |
|
||||
| `vwDimProvincia` | `cod_provincia` | `vwFactVentas`, cotizaciones, pipeline | `cod_provincia` |
|
||||
| `vwDimZona` | `cod_zona` | `vwDimProvincia` | `idZona` |
|
||||
| `vwDimTipoVenta` | `ventas` | hechos con `ventas` | `ventas` |
|
||||
|
||||
### 6.2 Claves compuestas — cómo resolverlas
|
||||
|
||||
Power BI **solo permite relaciones por UNA columna**. Para `Cliente` y `Producto` (llaves de 2 y 4 columnas) crea una **columna llave concatenada** con la misma fórmula en la dimensión y en el hecho:
|
||||
|
||||
```
|
||||
// Cliente — en vwDimCliente y en cada hecho:
|
||||
ClienteKey = FORMAT([tipo_cliente],"00") & "-" & FORMAT([sec_cliente],"0000000")
|
||||
|
||||
// Producto — usar el producto_id que ya trae vwDimProducto; en los hechos:
|
||||
ProductoKey = FORMAT([cod_n],"0") & "-" & FORMAT([cod_grupo],"0") & "-" & FORMAT([cod_tipo],"0") & "-" & FORMAT([cod_sec],"0")
|
||||
```
|
||||
Luego relaciona por `ClienteKey` / `ProductoKey`.
|
||||
|
||||
### 6.3 Fechas
|
||||
Los hechos traen `ano` + `mes`/`numeroMes` (grano mensual). Recomendado:
|
||||
- Crear una **tabla de calendario** en Power BI (`CALENDAR`/`CALENDARAUTO`) y una columna `AnoMes` en cada hecho para relacionar; **o**
|
||||
- Reutilizar `VW_DIM_CALENDARIO` (grano diario) como calendario compartido cuando se cruce con Indicadores.
|
||||
|
||||
### 6.4 Moneda
|
||||
Los valores `*_rd` **ya vienen convertidos a RD$** usando la `tasa` de `vwDimTipoVenta`. Para totales monetarios usar siempre las columnas `neto_rd`, `monto_rd`, `valor_rd`, `balance_rd`.
|
||||
|
||||
---
|
||||
|
||||
## 7. Área de Indicadores / Balanced Scorecard (esquema `VW_*`)
|
||||
|
||||
Modelo estrella independiente para el tablero de gestión (indicadores, tiempos de caída, tickets de soporte).
|
||||
|
||||
**Dimensiones**
|
||||
| Vista | PK | Descripción |
|
||||
|---|---|---|
|
||||
| `VW_DIM_CALENDARIO` | `Fecha` | Calendario diario (Año, Mes, Trimestre, Semana, EsFinDeSemana) |
|
||||
| `VW_DIM_DEPARTAMENTOS` | `IdDepartamento` | Departamentos (Nombre, Tipo, Responsable, Activo) |
|
||||
| `VW_DIM_INDICADORES` | `IdIndicador` | Indicadores (Meta, Peso, Frecuencia, UnidadMedida; FK `IdDepartamento`) |
|
||||
| `VW_DIM_PERSPECTIVAS` | `IdPerspectiva` | Perspectivas del BSC (Financiera, Cliente, Procesos, Aprendizaje) |
|
||||
| `VW_DIM_PROCESOS` | `IdProceso` | Procesos (Área, Criticidad, Tipo; FK `IdDepartamento`) |
|
||||
|
||||
**Hechos**
|
||||
| Vista | Llaves | Medidas |
|
||||
|---|---|---|
|
||||
| `VW_HECHOS_INDICADORES` | `IdIndicador`, `Fecha`, `IdPerspectiva` | `ValorReal`, `ValorMeta`, `Cumplimiento`, `Score` |
|
||||
| `VW_HECHOS_DOWNTIME` | `Fecha`, `IdDepartamento`, `IdProceso` | `HorasCaidas`, `ImpactoEstimado` |
|
||||
| `VW_HECHOS_TICKETS` | `Fecha`, `IdProceso`, `IdDepartamento` | `HorasResolucion`, conteos por `status`/`priority`/`category` |
|
||||
| `VW_SCORE_DEPARTAMENTO` | (derivada) | `ScorePromedio` por Departamento/Año/Mes |
|
||||
|
||||
**Relaciones**
|
||||
- `VW_DIM_INDICADORES[IdIndicador]` → `VW_HECHOS_INDICADORES[IdIndicador]`
|
||||
- `VW_DIM_PERSPECTIVAS[IdPerspectiva]` → `VW_HECHOS_INDICADORES[IdPerspectiva]`
|
||||
- `VW_DIM_CALENDARIO[Fecha]` → `VW_HECHOS_INDICADORES / DOWNTIME / TICKETS[Fecha]`
|
||||
- `VW_DIM_DEPARTAMENTOS[IdDepartamento]` → `VW_DIM_INDICADORES / VW_DIM_PROCESOS / hechos[IdDepartamento]`
|
||||
- `VW_DIM_PROCESOS[IdProceso]` → `VW_HECHOS_DOWNTIME / VW_HECHOS_TICKETS[IdProceso]`
|
||||
|
||||
---
|
||||
|
||||
## 8. Tablas físicas (carga manual)
|
||||
|
||||
| Tabla | Contenido | Notas |
|
||||
|---|---|---|
|
||||
| `FactMercadoEdificaciones` | Datos de mercado de la construcción (municipio, barrio, tipo de destino, m² construidos, unidades, precio/m², situación del mercado, fuente) | Se carga con datos externos (ej. estadísticas de edificaciones) |
|
||||
|
||||
---
|
||||
|
||||
## 9. Vistas planas y personales (uso directo, fuera del modelo estrella)
|
||||
|
||||
Estas vistas **ya vienen denormalizadas** (traen las descripciones incorporadas): se conectan solas, sin relaciones.
|
||||
|
||||
| Vista | Uso |
|
||||
|---|---|
|
||||
| `ventas_facturas` | Vista completa de ventas con cliente, vendedor, producto, zona, moneda ya resueltos — ideal para una tabla dinámica rápida |
|
||||
| `vwRotacionInventario_pub` / `vwRotacionInventarioPorBodega_pub` | Rotación de inventario (global / por bodega): cantidad vendida, valor ventas, `rotacion` |
|
||||
| `item_conteo_ciclico` | Programación de conteo cíclico por clase ABC |
|
||||
| `estadoResultado` | Estado de resultados por mes (`aplica_a`, `Balance`) |
|
||||
| `vwProduccion_pub` | Producción diaria en formato plano |
|
||||
| `analisisCotizaciones`, `analisisRequisiciones` | Análisis de cotizaciones y requisiciones (unidades/valores cotizados vs. despachados) |
|
||||
|
||||
**Copias personales (filtradas por vendedor/supervisor)** — *no usar para el modelo corporativo*:
|
||||
`analisisCotizaciones_cdelacruz`, `_jefrancisco`, `_jisa`, `_mhurtado`, `_mpuig`, `_mvargas`;
|
||||
`analisisRequisiciones_cdelacruz`, `_jefrancisco`, `_JISA`, `_mhurtado`, `_mpuig`;
|
||||
`vwreportesfactura_cdelacruz`, `_jisa`, `_mpuig`;
|
||||
`vwDimProductoMariaAna` (copia de `vwDimProducto`).
|
||||
|
||||
---
|
||||
|
||||
## 10. Buenas prácticas para el equipo de dashboards
|
||||
|
||||
1. **Un modelo por área** — no mezclar el esquema comercial con el de Indicadores en un mismo reporte salvo que se comparta el calendario.
|
||||
2. **Usar siempre las columnas `*_rd`** para importes; la conversión de moneda ya está hecha.
|
||||
3. **Dimensión en el lado 1, hecho en el lado \*** y filtro cruzado **unidireccional** (evita ambigüedad).
|
||||
4. **Crear medidas DAX** (SUM, DISTINCTCOUNT…) en lugar de arrastrar columnas numéricas directamente.
|
||||
5. **No apuntar a las vistas `_usuario`** para tableros compartidos; usar la vista base y filtrar con seguridad a nivel de fila (RLS) si se requiere segmentar por vendedor.
|
||||
6. Ante dudas sobre el significado de una columna, consultar a Tecnología.
|
||||
@@ -0,0 +1,192 @@
|
||||
# Dashboard Ejecutivo de Presidencia — Guía de armado en Power BI
|
||||
|
||||
> Radiografía financiera para el Presidente, basada en el **Mayor General Analítico** (`cgprrp008.4gl`) y el **Análisis de Gastos por Departamento** (`cgprrp009.4gl`).
|
||||
> Datos servidos por la capa BI: **`192.168.40.8 / MarmotechBI`**, esquema **`presidencia`** (vistas creadas por el script `SQL_Vistas_Presidencia.sql`).
|
||||
> Fecha: 2026-08-26 · Autor: jsoto.
|
||||
|
||||
---
|
||||
|
||||
## 0. Lo que ya está hecho (capa de datos)
|
||||
|
||||
Se crearon 3 vistas en `MarmotechBI` — restringidas a `jsoto` (`DENY SELECT` a `public` + `GRANT` explícito a `MARMOTECH\jsoto` y `jsoto`; el resto del equipo `db_datareader` **no** las ve):
|
||||
|
||||
| Vista | Grano | Para qué | Columnas clave |
|
||||
|---|---|---|---|
|
||||
| `presidencia.vwPLMensual` | año × mes × cuenta | Estado de Resultados (cgprrp008) | `ano, numero_mes, mes, AnoMes, fecha_mes, grupo, linea, orden_linea, subgrupo_cod, subgrupo_desc, cuenta, cuenta_desc, debito, credito, resultado, costo_gasto` |
|
||||
| `presidencia.vwGastosDepto` | año × mes × depto × cuenta | Análisis de gastos (cgprrp009) | `…, gerencia_cod, gerencia, departamento, depto_nombre, subgrupo_cod, subgrupo_desc, cuenta, cuenta_desc, debito, credito, gasto` |
|
||||
| `presidencia.vwBalanceMensual` | año × mes × cuenta | Balance / liquidez | `…, grupo, grupo_desc, subgrupo_cod, subgrupo_desc, cuenta, cuenta_desc, movimiento_mes, saldo_natural, saldo_presentacion` |
|
||||
|
||||
**Reglas de negocio ya aplicadas dentro de las vistas** (no hay que replicarlas en DAX):
|
||||
- Estado de Resultados por **primer dígito** de la cuenta: `4` Ventas · `5` Costo · `7` Gastos · `8` Otros (incl. `88` = ISR).
|
||||
- **`resultado = credito − debito`** → la suma de todas las líneas del P&L = **Utilidad Neta**. Ventas suma positivo; costo, gastos e ISR restan.
|
||||
- Solo transacciones activas (`status_t IS NULL`).
|
||||
- Se **excluye el asiento de cierre anual** (`ref` tipo `ED.99-001/12AA`); sin esto, todo año cerrado neteaba a cero.
|
||||
|
||||
Validado contra el sistema: julio-2026 reproduce exactamente la imagen del `cgprrp008`.
|
||||
|
||||
---
|
||||
|
||||
## 1. Conexión y consultas (Power Query / M)
|
||||
|
||||
**Obtener datos → SQL Server** · Servidor `192.168.40.8` · Base `MarmotechBI` · Modo **Import** (o DirectQuery si se quiere en vivo).
|
||||
Traer las 3 vistas del esquema `presidencia`. Ejemplo de la consulta base (las otras dos son idénticas cambiando el nombre):
|
||||
|
||||
```m
|
||||
let
|
||||
Origen = Sql.Database("192.168.40.8", "MarmotechBI"),
|
||||
PL = Origen{[Schema="presidencia", Item="vwPLMensual"]}[Data]
|
||||
in
|
||||
PL
|
||||
```
|
||||
|
||||
### Tabla de calendario (necesaria para YoY / YTD)
|
||||
Crear una tabla calculada **DimCalendario** (grano día, contigua) y marcarla como *Tabla de fechas*:
|
||||
|
||||
```DAX
|
||||
DimCalendario =
|
||||
VAR MinD = DATE(2015,1,1) -- ajustar si se quiere histórico más largo
|
||||
VAR MaxD = DATE(2028,12,31)
|
||||
RETURN
|
||||
ADDCOLUMNS(
|
||||
CALENDAR(MinD, MaxD),
|
||||
"Año", YEAR([Date]),
|
||||
"MesNo", MONTH([Date]),
|
||||
"Mes", FORMAT([Date],"MMM","es-DO"),
|
||||
"AñoMes", FORMAT([Date],"yyyy-MM"),
|
||||
"PrimerDiaMes", DATE(YEAR([Date]),MONTH([Date]),1),
|
||||
"Trimestre", "T" & FORMAT([Date],"Q")
|
||||
)
|
||||
```
|
||||
> Modelado → seleccionar DimCalendario → **Marcar como tabla de fechas** (columna `Date`).
|
||||
|
||||
---
|
||||
|
||||
## 2. Relaciones (vista *Modelo*)
|
||||
|
||||
Las vistas traen `fecha_mes` = **primer día del mes**. Relacionar **una sola** dirección, Dimensión (1) → Hecho (\*):
|
||||
|
||||
| Desde (1) | Columna | Hacia (\*) | Columna |
|
||||
|---|---|---|---|
|
||||
| `DimCalendario` | `Date` | `vwPLMensual` | `fecha_mes` |
|
||||
| `DimCalendario` | `Date` | `vwGastosDepto` | `fecha_mes` |
|
||||
| `DimCalendario` | `Date` | `vwBalanceMensual` | `fecha_mes` |
|
||||
|
||||
Como cada mes tiene un solo `fecha_mes` (día 1), la relación con el calendario diario funciona perfecto para `TOTALYTD` y `SAMEPERIODLASTYEAR`.
|
||||
Los *slicers* de Año / Mes se ponen sobre **DimCalendario** (`Año`, `Mes`).
|
||||
|
||||
---
|
||||
|
||||
## 3. Medidas DAX
|
||||
|
||||
Crear una tabla de medidas vacía (`_Medidas`) o alojarlas en `vwPLMensual`.
|
||||
|
||||
### 3.1 Estado de Resultados (base)
|
||||
```DAX
|
||||
Ventas Netas = CALCULATE( SUM(vwPLMensual[resultado]), vwPLMensual[grupo] = "4" )
|
||||
Costo de Ventas = CALCULATE( SUM(vwPLMensual[costo_gasto]), vwPLMensual[grupo] = "5" )
|
||||
Gastos Operativos = CALCULATE( SUM(vwPLMensual[costo_gasto]), vwPLMensual[grupo] = "7" )
|
||||
Otros Ing. y Gastos = CALCULATE( SUM(vwPLMensual[costo_gasto]), vwPLMensual[linea] = "Otros Ingresos y Gastos" )
|
||||
ISR = CALCULATE( SUM(vwPLMensual[costo_gasto]), vwPLMensual[linea] = "Impuesto sobre la Renta" )
|
||||
|
||||
Utilidad Bruta = [Ventas Netas] - [Costo de Ventas]
|
||||
Utilidad Operativa = [Utilidad Bruta] - [Gastos Operativos]
|
||||
Utilidad antes ISR = [Utilidad Operativa] - [Otros Ing. y Gastos]
|
||||
Utilidad Neta = SUM( vwPLMensual[resultado] ) -- suma de todas las líneas
|
||||
```
|
||||
|
||||
### 3.2 Márgenes
|
||||
```DAX
|
||||
Margen Bruto % = DIVIDE( [Utilidad Bruta], [Ventas Netas] )
|
||||
Margen Operativo % = DIVIDE( [Utilidad Operativa], [Ventas Netas] )
|
||||
Margen Neto % = DIVIDE( [Utilidad Neta], [Ventas Netas] )
|
||||
Costo % Ventas = DIVIDE( [Costo de Ventas], [Ventas Netas] )
|
||||
Gastos % Ventas = DIVIDE( [Gastos Operativos], [Ventas Netas] )
|
||||
```
|
||||
|
||||
### 3.3 Comparativos (YoY y YTD)
|
||||
```DAX
|
||||
Ventas AA = CALCULATE( [Ventas Netas], SAMEPERIODLASTYEAR(DimCalendario[Date]) )
|
||||
Utilidad Neta AA = CALCULATE( [Utilidad Neta], SAMEPERIODLASTYEAR(DimCalendario[Date]) )
|
||||
Gastos AA = CALCULATE( [Gastos Operativos], SAMEPERIODLASTYEAR(DimCalendario[Date]) )
|
||||
|
||||
Ventas YoY % = DIVIDE( [Ventas Netas] - [Ventas AA], [Ventas AA] )
|
||||
Utilidad YoY % = DIVIDE( [Utilidad Neta] - [Utilidad Neta AA], [Utilidad Neta AA] )
|
||||
Gastos YoY % = DIVIDE( [Gastos Operativos] - [Gastos AA], [Gastos AA] )
|
||||
|
||||
Ventas YTD = TOTALYTD( [Ventas Netas], DimCalendario[Date] )
|
||||
Utilidad Neta YTD = TOTALYTD( [Utilidad Neta], DimCalendario[Date] )
|
||||
```
|
||||
|
||||
### 3.4 Gastos (vwGastosDepto)
|
||||
```DAX
|
||||
Gasto Total = SUM( vwGastosDepto[gasto] )
|
||||
Gasto AA = CALCULATE( [Gasto Total], SAMEPERIODLASTYEAR(DimCalendario[Date]) )
|
||||
Gasto YoY % = DIVIDE( [Gasto Total] - [Gasto AA], [Gasto AA] )
|
||||
Gasto % de Ventas = DIVIDE( [Gasto Total], [Ventas Netas] )
|
||||
```
|
||||
|
||||
### 3.5 Balance / liquidez (vwBalanceMensual)
|
||||
El saldo del balance es el **saldo acumulado al último mes del contexto**. Medidas:
|
||||
```DAX
|
||||
Saldo (fin periodo) =
|
||||
VAR ultima = MAX( vwBalanceMensual[fecha_mes] )
|
||||
RETURN CALCULATE( SUM(vwBalanceMensual[saldo_presentacion]),
|
||||
vwBalanceMensual[fecha_mes] = ultima )
|
||||
|
||||
Activos = CALCULATE( [Saldo (fin periodo)], vwBalanceMensual[grupo]="1" )
|
||||
Pasivos = CALCULATE( [Saldo (fin periodo)], vwBalanceMensual[grupo]="2" )
|
||||
Patrimonio = CALCULATE( [Saldo (fin periodo)], vwBalanceMensual[grupo]="3" )
|
||||
|
||||
Activo Corriente = CALCULATE( [Saldo (fin periodo)], vwBalanceMensual[subgrupo_cod]="11" )
|
||||
Pasivo Corriente = CALCULATE( [Saldo (fin periodo)],
|
||||
vwBalanceMensual[subgrupo_cod] IN {"20","21"} )
|
||||
|
||||
Razón Corriente = DIVIDE( [Activo Corriente], [Pasivo Corriente] )
|
||||
Capital de Trabajo= [Activo Corriente] - [Pasivo Corriente]
|
||||
Endeudamiento % = DIVIDE( [Pasivos], [Activos] )
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Formato de medidas
|
||||
- Importes: moneda RD$, 0 decimales (o en millones con formato personalizado `#,##0.0,, " M"`).
|
||||
- Porcentajes: 1 decimal.
|
||||
- Activar **tabular-nums** implícito (Power BI ya alinea) y usar la fuente del tema corporativo.
|
||||
|
||||
---
|
||||
|
||||
## 5. Páginas y visuales (ver prototipo `Dashboard_Presidencia_Mockup.html`)
|
||||
|
||||
### Página 1 — **Radiografía** (resumen ejecutivo)
|
||||
- **Fila de KPIs (tarjetas):** Ventas Netas + `Ventas YoY %` · Utilidad Bruta + Margen Bruto % · Utilidad Operativa + Margen Operativo % · Utilidad Neta + `Utilidad YoY %` + Margen Neto %.
|
||||
- **Cascada (Waterfall):** eje = campo `linea` de `vwPLMensual` (orden por `orden_linea`), valor = `[Utilidad Neta]` con desglose por línea → arranca en Ventas y aterriza en Utilidad Neta. (El visual *Waterfall* nativo suma correctamente porque `resultado` ya trae el signo).
|
||||
- **Comportamiento del periodo actual (columnas + línea):** eje `DimCalendario[Mes]`; columnas = `[Ventas Netas]`; línea = `[Utilidad Neta]`; línea secundaria opcional = `[Margen Neto %]`.
|
||||
- **Trayectoria anual (barras agrupadas):** eje `DimCalendario[Año]`; valores `[Ventas Netas]` y `[Utilidad Neta]`.
|
||||
- Slicers: Año, Mes.
|
||||
|
||||
### Página 2 — **Análisis de Gastos** (cgprrp009)
|
||||
- KPIs: Gasto Total + `Gasto YoY %` · `Gasto % de Ventas` · gerencia de mayor peso · mayor alza YoY.
|
||||
- **Barras por gerencia:** eje `vwGastosDepto[gerencia]`; valores `[Gasto Total]` y `[Gasto AA]`. *Drill-down* a `depto_nombre` y luego `cuenta_desc`.
|
||||
- **Naturaleza del gasto:** tabla o *treemap* por `subgrupo_desc` con `[Gasto Total]` y `[Gasto % de Ventas]`. (Nota: subgrupo `76 Cierre gtos fabricación` es una absorción negativa a costo).
|
||||
- **Gasto mensual + % de ventas:** columnas `[Gasto Total]` por `Mes` con línea `[Gasto % de Ventas]` (control de eficiencia).
|
||||
|
||||
### Página 3 — **Estructura Financiera** (balance / liquidez)
|
||||
- KPIs: Activos · Razón Corriente · Capital de Trabajo · Endeudamiento %.
|
||||
- **Activos = Pasivos + Patrimonio + resultado del ejercicio** (columnas apiladas): la diferencia contra Activos es la utilidad del año en curso aún no cerrada — es normal y se puede rotular como *"Resultado del ejercicio"*.
|
||||
- **Composición del activo / pasivo:** tabla por `subgrupo_desc` con `[Saldo (fin periodo)]`.
|
||||
- **Tendencia del patrimonio:** línea `[Patrimonio]` por `Año`.
|
||||
|
||||
---
|
||||
|
||||
## 6. Suscripción del Presidente
|
||||
Publicar en el workspace corporativo → **Suscribir** al Presidente (envío por correo con captura del reporte, p. ej. cada lunes). Requiere que el dataset tenga **actualización programada** (gateway sobre `192.168.40.8`).
|
||||
|
||||
---
|
||||
|
||||
## 7. Ideas de ampliación (opcional, reutilizando vistas existentes)
|
||||
Para una radiografía "de un vistazo" también semanal, se puede añadir una página **Panorama** que combine, con las vistas ya publicadas en `MarmotechBI` (sin crear nada nuevo):
|
||||
- Ventas vs. presupuesto del mes (`vwFactVentas` + `vwFactPresupuesto`).
|
||||
- Cuentas por cobrar y vencido (`vwFactCxC_Real`).
|
||||
- Backlog / órdenes pendientes de despacho (`vwOrdenesPendientesDespacho`).
|
||||
- Producción del periodo (`vwProduccion_pub`).
|
||||
> Se maneja como **modelo aparte** (área comercial) para no mezclar granos; ver `Documentacion_MarmotechBI.md`.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
PROYECTO POWER BI — RADIOGRAFÍA MARMOTECH (Dashboard de Presidencia)
|
||||
====================================================================
|
||||
|
||||
QUÉ ES ESTO
|
||||
-----------
|
||||
Un Proyecto de Power BI (.pbip) en formato de texto:
|
||||
- Radiografia_Marmotech.SemanticModel -> modelo de datos + TODAS las medidas DAX
|
||||
- Radiografia_Marmotech.Report -> 3 páginas (Radiografía / Gastos / Estructura)
|
||||
|
||||
Se conecta en vivo a las vistas del esquema "presidencia" en 192.168.40.8 / MarmotechBI.
|
||||
|
||||
CÓMO ABRIRLO Y CONVERTIRLO A .PBIX
|
||||
----------------------------------
|
||||
1. Abrir Power BI Desktop (v2.157 o superior).
|
||||
2. Archivo -> Abrir -> seleccionar Radiografia_Marmotech.pbip
|
||||
(o doble clic al .pbip).
|
||||
3. Si pide credenciales de la base: usar autenticación de Windows (tu usuario jsoto).
|
||||
4. Actualizar / cargar datos.
|
||||
5. Archivo -> Guardar como -> elegir tipo ".pbix" -> listo, ya tienes el .pbix.
|
||||
|
||||
REQUISITO (una sola vez, si no abre el reporte)
|
||||
-----------------------------------------------
|
||||
Archivo -> Opciones -> Características de vista previa ->
|
||||
activar "Almacenar informes con el formato de informe mejorado (PBIR)".
|
||||
Reiniciar Power BI Desktop y volver a abrir el .pbip.
|
||||
|
||||
NOTA
|
||||
----
|
||||
El MODELO (tablas, relaciones y medidas DAX) está completo y es la parte reutilizable.
|
||||
Si algún visual del reporte necesitara reacomodo, guíate por el prototipo
|
||||
"Dashboard_Presidencia_Mockup.html" y la "Guia_Dashboard_Presidencia_PowerBI.md":
|
||||
tienen la disposición exacta y las medidas ya existen en el modelo.
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
|
||||
"metadata": { "type": "Report", "displayName": "Radiografia_Marmotech" },
|
||||
"config": { "version": "2.0", "logicalId": "554add93-b301-4779-a780-de4189e02962" }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": "4.0",
|
||||
"datasetReference": { "byPath": { "path": "../Radiografia_Marmotech.SemanticModel" } }
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "8b8f836c-adf6-4122-94af-ca83a95f1186",
|
||||
"displayName": "Estructura Financiera",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "44ff5e53-b511-41e3-bdd8-48225cf9736d",
|
||||
"position": { "x": 648, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Capital de Trabajo" } }, "queryRef": "vwPLMensual.Capital de Trabajo", "nativeQueryRef": "Capital de Trabajo" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Capital de Trabajo'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "a03966b2-7a2b-4724-9b6f-9d2a82dfbf1a",
|
||||
"position": { "x": 16, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Activos" } }, "queryRef": "vwPLMensual.Activos", "nativeQueryRef": "Activos" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Activos Totales'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "aebdc78d-a3c5-45bd-a5a1-33956b52c2af",
|
||||
"position": { "x": 964, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Endeudamiento %" } }, "queryRef": "vwPLMensual.Endeudamiento %", "nativeQueryRef": "Endeudamiento %" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Endeudamiento'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "b45f71ca-ef58-4807-9ec8-b326c6cef118",
|
||||
"position": { "x": 16, "y": 170, "z": 0, "width": 620, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "clusteredColumnChart",
|
||||
"query": { "queryState": { "Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "vwBalanceMensual" } }, "Property": "grupo_desc" } }, "queryRef": "vwBalanceMensual.grupo_desc", "nativeQueryRef": "grupo_desc" } ] },
|
||||
"Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Saldo (fin periodo)" } }, "queryRef": "vwPLMensual.Saldo (fin periodo)", "nativeQueryRef": "Saldo (fin periodo)" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Activos / Pasivos / Patrimonio'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "b536c95a-a634-4891-9041-14d33dba3e31",
|
||||
"position": { "x": 652, "y": 170, "z": 0, "width": 612, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "tableEx",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "vwBalanceMensual" } }, "Property": "subgrupo_desc" } }, "queryRef": "vwBalanceMensual.subgrupo_desc", "nativeQueryRef": "subgrupo_desc" },
|
||||
{ "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Saldo (fin periodo)" } }, "queryRef": "vwPLMensual.Saldo (fin periodo)", "nativeQueryRef": "Saldo (fin periodo)" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Composicion'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "dfc8665b-ed52-4a78-ad7a-ceec1bd415d6",
|
||||
"position": { "x": 332, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Razon Corriente" } }, "queryRef": "vwPLMensual.Razon Corriente", "nativeQueryRef": "Razon Corriente" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Razon Corriente'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "b1d7c3f7-19f4-4e53-9f46-39c24299735d",
|
||||
"displayName": "Radiografia",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "0001fb8c-bfd0-48b4-8c87-ca2e91ded77e",
|
||||
"position": { "x": 16, "y": 16, "z": 0, "width": 280, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Ventas Netas" } }, "queryRef": "vwPLMensual.Ventas Netas", "nativeQueryRef": "Ventas Netas" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Ventas Netas'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "1c8b8064-507f-4d74-aafe-996d0e78abcc",
|
||||
"position": { "x": 652, "y": 484, "z": 0, "width": 300, "height": 120, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "slicer",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "DimCalendario" } }, "Property": "Anio" } }, "queryRef": "DimCalendario.Anio", "nativeQueryRef": "Anio" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Ano'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "41b6bf4e-59e7-43d8-bed5-00903f07cf14",
|
||||
"position": { "x": 16, "y": 170, "z": 0, "width": 620, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "waterfallChart",
|
||||
"query": { "queryState": { "Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "linea" } }, "queryRef": "vwPLMensual.linea", "nativeQueryRef": "linea" } ] },
|
||||
"Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Neta" } }, "queryRef": "vwPLMensual.Utilidad Neta", "nativeQueryRef": "Utilidad Neta" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Estado de Resultados (cascada)'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "7bc4f47e-ea03-4a86-85bc-7b0589403ff3",
|
||||
"position": { "x": 984, "y": 16, "z": 0, "width": 280, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Neta" } }, "queryRef": "vwPLMensual.Utilidad Neta", "nativeQueryRef": "Utilidad Neta" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Utilidad Neta'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "86346a78-aca0-4130-8fcc-df275187d223",
|
||||
"position": { "x": 688, "y": 16, "z": 0, "width": 280, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Operativa" } }, "queryRef": "vwPLMensual.Utilidad Operativa", "nativeQueryRef": "Utilidad Operativa" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Utilidad Operativa'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "bf867728-d557-4369-a08f-96be202ea340",
|
||||
"position": { "x": 652, "y": 170, "z": 0, "width": 612, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "lineClusteredColumnComboChart",
|
||||
"query": { "queryState": { "Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Ventas Netas" } }, "queryRef": "vwPLMensual.Ventas Netas", "nativeQueryRef": "Ventas Netas" } ] },
|
||||
"Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "DimCalendario" } }, "Property": "Mes" } }, "queryRef": "DimCalendario.Mes", "nativeQueryRef": "Mes" } ] },
|
||||
"Y2": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Neta" } }, "queryRef": "vwPLMensual.Utilidad Neta", "nativeQueryRef": "Utilidad Neta" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Comportamiento del periodo (Ventas vs Utilidad)'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "c16df67e-416b-4acb-8169-fbd21a916682",
|
||||
"position": { "x": 16, "y": 484, "z": 0, "width": 620, "height": 220, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "clusteredColumnChart",
|
||||
"query": { "queryState": { "Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "DimCalendario" } }, "Property": "Anio" } }, "queryRef": "DimCalendario.Anio", "nativeQueryRef": "Anio" } ] },
|
||||
"Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Ventas Netas" } }, "queryRef": "vwPLMensual.Ventas Netas", "nativeQueryRef": "Ventas Netas" },
|
||||
{ "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Neta" } }, "queryRef": "vwPLMensual.Utilidad Neta", "nativeQueryRef": "Utilidad Neta" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Trayectoria anual'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "ea44fc7d-26fd-4269-a605-7a460f6078bd",
|
||||
"position": { "x": 312, "y": 16, "z": 0, "width": 280, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Utilidad Bruta" } }, "queryRef": "vwPLMensual.Utilidad Bruta", "nativeQueryRef": "Utilidad Bruta" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Utilidad Bruta'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "e77fc1b2-6848-4091-910e-ab9079a10ae3",
|
||||
"displayName": "Analisis de Gastos",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "2970078c-5cf9-40ff-ad03-436e7f9d90c1",
|
||||
"position": { "x": 16, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto Total" } }, "queryRef": "vwPLMensual.Gasto Total", "nativeQueryRef": "Gasto Total" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Gastos Operativos'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "55c25809-9340-4b4f-ab44-ea947df2aa20",
|
||||
"position": { "x": 16, "y": 484, "z": 0, "width": 1248, "height": 220, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "columnChart",
|
||||
"query": { "queryState": { "Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "DimCalendario" } }, "Property": "Mes" } }, "queryRef": "DimCalendario.Mes", "nativeQueryRef": "Mes" } ] },
|
||||
"Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto Total" } }, "queryRef": "vwPLMensual.Gasto Total", "nativeQueryRef": "Gasto Total" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Gasto mensual'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "c5d3dccf-c735-4552-97e3-3409f290ae2c",
|
||||
"position": { "x": 16, "y": 170, "z": 0, "width": 620, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "barChart",
|
||||
"query": { "queryState": { "Category": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "vwGastosDepto" } }, "Property": "gerencia" } }, "queryRef": "vwGastosDepto.gerencia", "nativeQueryRef": "gerencia" } ] },
|
||||
"Y": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto Total" } }, "queryRef": "vwPLMensual.Gasto Total", "nativeQueryRef": "Gasto Total" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Gasto por gerencia'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "d56cf84c-d5d9-4d14-a4a5-c20b98f0aab6",
|
||||
"position": { "x": 652, "y": 170, "z": 0, "width": 612, "height": 300, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "tableEx",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Column": { "Expression": { "SourceRef": { "Entity": "vwGastosDepto" } }, "Property": "subgrupo_desc" } }, "queryRef": "vwGastosDepto.subgrupo_desc", "nativeQueryRef": "subgrupo_desc" },
|
||||
{ "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto Total" } }, "queryRef": "vwPLMensual.Gasto Total", "nativeQueryRef": "Gasto Total" },
|
||||
{ "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto % de Ventas" } }, "queryRef": "vwPLMensual.Gasto % de Ventas", "nativeQueryRef": "Gasto % de Ventas" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Naturaleza del gasto'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "f2193414-6ebe-4c68-bb63-1badcb5ffd09",
|
||||
"position": { "x": 332, "y": 16, "z": 0, "width": 300, "height": 140, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": { "queryState": { "Values": { "projections": [ { "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "vwPLMensual" } }, "Property": "Gasto % de Ventas" } }, "queryRef": "vwPLMensual.Gasto % de Ventas", "nativeQueryRef": "Gasto % de Ventas" } ] } } },
|
||||
"drillFilterOtherVisuals": true,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'Gasto / Ventas'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/pagesMetadata/1.0.0/schema.json",
|
||||
"pageOrder": [ "b1d7c3f7-19f4-4e53-9f46-39c24299735d", "e77fc1b2-6848-4091-910e-ab9079a10ae3", "8b8f836c-adf6-4122-94af-ca83a95f1186" ],
|
||||
"activePageName": "b1d7c3f7-19f4-4e53-9f46-39c24299735d"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/report/1.0.0/schema.json",
|
||||
"themeCollection": { "baseTheme": { "name": "CY24SU10" } },
|
||||
"layoutOptimization": "None"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"version": "2.0.0"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
|
||||
"metadata": { "type": "SemanticModel", "displayName": "Radiografia_Marmotech" },
|
||||
"config": { "version": "2.0", "logicalId": "9189c214-f719-4b14-9985-284d1156b518" }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": "4.0",
|
||||
"settings": {}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
database
|
||||
compatibilityLevel: 1550
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
model Model
|
||||
culture: es-ES
|
||||
defaultPowerBIDataSourceVersion: powerBI_V3
|
||||
sourceQueryCulture: es-ES
|
||||
|
||||
annotation PBI_QueryOrder = ["vwPLMensual","vwGastosDepto","vwBalanceMensual","DimCalendario"]
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
relationship a1bca91e-c68e-40d9-903e-6c0b3084d97e
|
||||
fromColumn: vwPLMensual.fecha_mes
|
||||
toColumn: DimCalendario.Date
|
||||
|
||||
relationship b8a2999c-fc54-47de-8f0b-85af0263c75b
|
||||
fromColumn: vwGastosDepto.fecha_mes
|
||||
toColumn: DimCalendario.Date
|
||||
|
||||
relationship ea96c86f-8345-4913-b1e6-6823b9a100f4
|
||||
fromColumn: vwBalanceMensual.fecha_mes
|
||||
toColumn: DimCalendario.Date
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
table DimCalendario
|
||||
column Date
|
||||
dataType: dateTime
|
||||
sourceColumn: [Date]
|
||||
formatString: General Date
|
||||
summarizeBy: none
|
||||
|
||||
column Anio
|
||||
dataType: int64
|
||||
sourceColumn: [Anio]
|
||||
summarizeBy: none
|
||||
|
||||
column MesNo
|
||||
dataType: int64
|
||||
sourceColumn: [MesNo]
|
||||
summarizeBy: none
|
||||
|
||||
column Mes
|
||||
dataType: string
|
||||
sourceColumn: [Mes]
|
||||
summarizeBy: none
|
||||
|
||||
column AnioMes
|
||||
dataType: string
|
||||
sourceColumn: [AnioMes]
|
||||
summarizeBy: none
|
||||
|
||||
column PrimerDiaMes
|
||||
dataType: dateTime
|
||||
sourceColumn: [PrimerDiaMes]
|
||||
formatString: General Date
|
||||
summarizeBy: none
|
||||
|
||||
column Trimestre
|
||||
dataType: string
|
||||
sourceColumn: [Trimestre]
|
||||
summarizeBy: none
|
||||
|
||||
partition DimCalendario = calculated
|
||||
mode: import
|
||||
source = ADDCOLUMNS ( CALENDAR ( DATE ( 2015, 1, 1 ), DATE ( 2028, 12, 31 ) ), "Anio", YEAR ( [Date] ), "MesNo", MONTH ( [Date] ), "Mes", FORMAT ( [Date], "MMM" ), "AnioMes", FORMAT ( [Date], "yyyy-MM" ), "PrimerDiaMes", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 ), "Trimestre", "T" & FORMAT ( [Date], "Q" ) )
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
table vwBalanceMensual
|
||||
column 'ano'
|
||||
dataType: int64
|
||||
sourceColumn: ano
|
||||
summarizeBy: none
|
||||
|
||||
column 'numero_mes'
|
||||
dataType: int64
|
||||
sourceColumn: numero_mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'mes'
|
||||
dataType: string
|
||||
sourceColumn: mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'AnoMes'
|
||||
dataType: string
|
||||
sourceColumn: AnoMes
|
||||
summarizeBy: none
|
||||
|
||||
column 'fecha_mes'
|
||||
dataType: dateTime
|
||||
sourceColumn: fecha_mes
|
||||
formatString: General Date
|
||||
summarizeBy: none
|
||||
|
||||
column 'grupo'
|
||||
dataType: string
|
||||
sourceColumn: grupo
|
||||
summarizeBy: none
|
||||
|
||||
column 'grupo_desc'
|
||||
dataType: string
|
||||
sourceColumn: grupo_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_cod'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_cod
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_desc'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta'
|
||||
dataType: string
|
||||
sourceColumn: cuenta
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta_desc'
|
||||
dataType: string
|
||||
sourceColumn: cuenta_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'movimiento_mes'
|
||||
dataType: decimal
|
||||
sourceColumn: movimiento_mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'saldo_natural'
|
||||
dataType: decimal
|
||||
sourceColumn: saldo_natural
|
||||
summarizeBy: none
|
||||
|
||||
column 'saldo_presentacion'
|
||||
dataType: decimal
|
||||
sourceColumn: saldo_presentacion
|
||||
summarizeBy: none
|
||||
|
||||
partition vwBalanceMensual = m
|
||||
mode: import
|
||||
source =
|
||||
let
|
||||
Origen = Sql.Database("192.168.40.8", "MarmotechBI"),
|
||||
Datos = Origen{[Schema="presidencia", Item="vwBalanceMensual"]}[Data]
|
||||
in
|
||||
Datos
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
table vwGastosDepto
|
||||
column 'ano'
|
||||
dataType: int64
|
||||
sourceColumn: ano
|
||||
summarizeBy: none
|
||||
|
||||
column 'numero_mes'
|
||||
dataType: int64
|
||||
sourceColumn: numero_mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'mes'
|
||||
dataType: string
|
||||
sourceColumn: mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'AnoMes'
|
||||
dataType: string
|
||||
sourceColumn: AnoMes
|
||||
summarizeBy: none
|
||||
|
||||
column 'fecha_mes'
|
||||
dataType: dateTime
|
||||
sourceColumn: fecha_mes
|
||||
formatString: General Date
|
||||
summarizeBy: none
|
||||
|
||||
column 'gerencia_cod'
|
||||
dataType: string
|
||||
sourceColumn: gerencia_cod
|
||||
summarizeBy: none
|
||||
|
||||
column 'gerencia'
|
||||
dataType: string
|
||||
sourceColumn: gerencia
|
||||
summarizeBy: none
|
||||
|
||||
column 'departamento'
|
||||
dataType: int64
|
||||
sourceColumn: departamento
|
||||
summarizeBy: none
|
||||
|
||||
column 'depto_nombre'
|
||||
dataType: string
|
||||
sourceColumn: depto_nombre
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_cod'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_cod
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_desc'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta'
|
||||
dataType: string
|
||||
sourceColumn: cuenta
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta_desc'
|
||||
dataType: string
|
||||
sourceColumn: cuenta_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'debito'
|
||||
dataType: decimal
|
||||
sourceColumn: debito
|
||||
summarizeBy: none
|
||||
|
||||
column 'credito'
|
||||
dataType: decimal
|
||||
sourceColumn: credito
|
||||
summarizeBy: none
|
||||
|
||||
column 'gasto'
|
||||
dataType: decimal
|
||||
sourceColumn: gasto
|
||||
summarizeBy: none
|
||||
|
||||
partition vwGastosDepto = m
|
||||
mode: import
|
||||
source =
|
||||
let
|
||||
Origen = Sql.Database("192.168.40.8", "MarmotechBI"),
|
||||
Datos = Origen{[Schema="presidencia", Item="vwGastosDepto"]}[Data]
|
||||
in
|
||||
Datos
|
||||
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
table vwPLMensual
|
||||
column 'ano'
|
||||
dataType: int64
|
||||
sourceColumn: ano
|
||||
summarizeBy: none
|
||||
|
||||
column 'numero_mes'
|
||||
dataType: int64
|
||||
sourceColumn: numero_mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'mes'
|
||||
dataType: string
|
||||
sourceColumn: mes
|
||||
summarizeBy: none
|
||||
|
||||
column 'AnoMes'
|
||||
dataType: string
|
||||
sourceColumn: AnoMes
|
||||
summarizeBy: none
|
||||
|
||||
column 'fecha_mes'
|
||||
dataType: dateTime
|
||||
sourceColumn: fecha_mes
|
||||
formatString: General Date
|
||||
summarizeBy: none
|
||||
|
||||
column 'grupo'
|
||||
dataType: string
|
||||
sourceColumn: grupo
|
||||
summarizeBy: none
|
||||
|
||||
column 'orden_linea'
|
||||
dataType: int64
|
||||
sourceColumn: orden_linea
|
||||
summarizeBy: none
|
||||
|
||||
column 'linea'
|
||||
dataType: string
|
||||
sourceColumn: linea
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_cod'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_cod
|
||||
summarizeBy: none
|
||||
|
||||
column 'subgrupo_desc'
|
||||
dataType: string
|
||||
sourceColumn: subgrupo_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta'
|
||||
dataType: string
|
||||
sourceColumn: cuenta
|
||||
summarizeBy: none
|
||||
|
||||
column 'cuenta_desc'
|
||||
dataType: string
|
||||
sourceColumn: cuenta_desc
|
||||
summarizeBy: none
|
||||
|
||||
column 'nivel'
|
||||
dataType: int64
|
||||
sourceColumn: nivel
|
||||
summarizeBy: none
|
||||
|
||||
column 'debito'
|
||||
dataType: decimal
|
||||
sourceColumn: debito
|
||||
summarizeBy: none
|
||||
|
||||
column 'credito'
|
||||
dataType: decimal
|
||||
sourceColumn: credito
|
||||
summarizeBy: none
|
||||
|
||||
column 'resultado'
|
||||
dataType: decimal
|
||||
sourceColumn: resultado
|
||||
summarizeBy: none
|
||||
|
||||
column 'costo_gasto'
|
||||
dataType: decimal
|
||||
sourceColumn: costo_gasto
|
||||
summarizeBy: none
|
||||
|
||||
|
||||
measure 'Ventas Netas' = CALCULATE ( SUM ( vwPLMensual[resultado] ), vwPLMensual[grupo] = "4" )
|
||||
formatString: \$ #,0,," M";\$ -#,0,," M";\$ 0
|
||||
measure 'Costo de Ventas' = CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[grupo] = "5" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Gastos Operativos' = CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[grupo] = "7" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Otros Ing. y Gastos' = CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[linea] = "Otros Ingresos y Gastos" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'ISR' = CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[linea] = "Impuesto sobre la Renta" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad Bruta' = [Ventas Netas] - [Costo de Ventas]
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad Operativa' = [Utilidad Bruta] - [Gastos Operativos]
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad antes ISR' = [Utilidad Operativa] - [Otros Ing. y Gastos]
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad Neta' = SUM ( vwPLMensual[resultado] )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Margen Bruto %' = DIVIDE ( [Utilidad Bruta], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Margen Operativo %' = DIVIDE ( [Utilidad Operativa], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Margen Neto %' = DIVIDE ( [Utilidad Neta], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Costo % Ventas' = DIVIDE ( [Costo de Ventas], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Gastos % Ventas' = DIVIDE ( [Gastos Operativos], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Ventas AA' = CALCULATE ( [Ventas Netas], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad Neta AA' = CALCULATE ( [Utilidad Neta], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Ventas YoY %' = DIVIDE ( [Ventas Netas] - [Ventas AA], [Ventas AA] )
|
||||
formatString: 0.0%
|
||||
measure 'Utilidad YoY %' = DIVIDE ( [Utilidad Neta] - [Utilidad Neta AA], [Utilidad Neta AA] )
|
||||
formatString: 0.0%
|
||||
measure 'Ventas YTD' = TOTALYTD ( [Ventas Netas], DimCalendario[Date] )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Utilidad Neta YTD' = TOTALYTD ( [Utilidad Neta], DimCalendario[Date] )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Gasto Total' = SUM ( vwGastosDepto[gasto] )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Gasto AA' = CALCULATE ( [Gasto Total], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Gasto YoY %' = DIVIDE ( [Gasto Total] - [Gasto AA], [Gasto AA] )
|
||||
formatString: 0.0%
|
||||
measure 'Gasto % de Ventas' = DIVIDE ( [Gasto Total], [Ventas Netas] )
|
||||
formatString: 0.0%
|
||||
measure 'Saldo (fin periodo)' = VAR u = MAX ( vwBalanceMensual[fecha_mes] ) RETURN CALCULATE ( SUM ( vwBalanceMensual[saldo_presentacion] ), vwBalanceMensual[fecha_mes] = u )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Activos' = CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = "1" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Pasivos' = CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = "2" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Patrimonio' = CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = "3" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Activo Corriente' = CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[subgrupo_cod] = "11" )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Pasivo Corriente' = CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[subgrupo_cod] IN {"20","21"} )
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Razon Corriente' = DIVIDE ( [Activo Corriente], [Pasivo Corriente] )
|
||||
formatString: 0.00
|
||||
measure 'Capital de Trabajo' = [Activo Corriente] - [Pasivo Corriente]
|
||||
formatString: \$ #,0,," M"
|
||||
measure 'Endeudamiento %' = DIVIDE ( [Pasivos], [Activos] )
|
||||
formatString: 0.0%
|
||||
partition vwPLMensual = m
|
||||
mode: import
|
||||
source =
|
||||
let
|
||||
Origen = Sql.Database("192.168.40.8", "MarmotechBI"),
|
||||
Datos = Origen{[Schema="presidencia", Item="vwPLMensual"]}[Data]
|
||||
in
|
||||
Datos
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"artifacts": [
|
||||
{ "report": { "path": "Radiografia_Marmotech.Report" } }
|
||||
],
|
||||
"settings": { "enableAutoRecovery": true }
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,226 @@
|
||||
/* ============================================================================
|
||||
MarmotechBI — Vistas para el Dashboard Ejecutivo de Presidencia
|
||||
----------------------------------------------------------------------------
|
||||
Autor : Juan F. Soto (jsoto)
|
||||
Fecha : 2026-08-26
|
||||
Servidor : 192.168.40.8 (SQL Server 2016)
|
||||
Base : MarmotechBI (capa semantica; los datos viven en marmotech.dbo.*)
|
||||
Objetivo : Radiografia financiera para el Presidente, a partir del
|
||||
Mayor General Analitico (cgprrp008) y el Analisis de Gastos
|
||||
por Departamento (cgprrp009).
|
||||
|
||||
Fuente de datos:
|
||||
marmotech.dbo.cgtb00004 = transacciones contables (debito/credito por cuenta/fecha)
|
||||
marmotech.dbo.cgtb00001 = catalogo de cuentas (nivel, descripcion)
|
||||
marmotech.dbo.prdtable = periodos contables (ano, mes -> rango de fechas)
|
||||
marmotech.dbo.mestable = nombres de meses
|
||||
marmotech.dbo.adtb00001 = departamentos (nom_dpto)
|
||||
|
||||
Reglas de negocio (validadas contra cgprrp008 / cgprrp009):
|
||||
* Estado de Resultados por PRIMER DIGITO de la cuenta:
|
||||
4 = VENTAS NETA (naturaleza credito)
|
||||
5 = COSTO DE VENTAS (naturaleza debito)
|
||||
7 = GASTOS (naturaleza debito)
|
||||
8 = OTROS INGRESOS Y GASTOS (incluye 88 = IMPUESTO S/RENTA)
|
||||
* resultado (aporte a la utilidad) = credito - debito
|
||||
-> Ventas suma positivo; Costo/Gastos/ISR restan; la suma de todas
|
||||
las lineas = Utilidad Neta del periodo.
|
||||
* Solo transacciones activas: status_t IS NULL.
|
||||
* Se EXCLUYE el asiento de cierre anual (ref 'ED.99-001/12YY' y
|
||||
'ED.99-002/12YY'); de lo contrario cada ano cerrado netearia a 0 porque
|
||||
el cierre revierte las cuentas de resultado contra Utilidades Retenidas.
|
||||
(2026 aun no tiene cierre, por eso muestra saldo operativo real.)
|
||||
|
||||
Seguridad (requisito): estas vistas solo deben ser legibles por jsoto.
|
||||
Se crean en el esquema [presidencia] y se hace DENY SELECT a [public].
|
||||
jsoto (MARMOTECH\jsoto y login SQL jsoto) es sysadmin/db_owner, por lo que
|
||||
ignora el DENY y conserva acceso; el resto del equipo (db_datareader) queda
|
||||
bloqueado a nivel de esquema.
|
||||
============================================================================ */
|
||||
|
||||
USE MarmotechBI;
|
||||
GO
|
||||
|
||||
/* ---- 1. Esquema dedicado ------------------------------------------------- */
|
||||
IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = 'presidencia')
|
||||
EXEC('CREATE SCHEMA presidencia AUTHORIZATION dbo;');
|
||||
GO
|
||||
|
||||
/* ---- 2. Estado de Resultados mensual (cgprrp008) ------------------------- */
|
||||
/* Grano: ano x mes x cuenta. Un renglon por cuenta contable de resultado. */
|
||||
IF OBJECT_ID('presidencia.vwPLMensual','V') IS NOT NULL
|
||||
DROP VIEW presidencia.vwPLMensual;
|
||||
GO
|
||||
CREATE VIEW presidencia.vwPLMensual
|
||||
AS
|
||||
WITH mov AS (
|
||||
SELECT p.ano,
|
||||
p.mes AS numero_mes,
|
||||
b.cuenta_no,
|
||||
SUM(b.debito) AS debito,
|
||||
SUM(b.credito) AS credito
|
||||
FROM marmotech.dbo.cgtb00004 b
|
||||
INNER JOIN marmotech.dbo.prdtable p
|
||||
ON b.fecha BETWEEN p.fecha_inicio AND p.fecha_corte
|
||||
WHERE b.status_t IS NULL
|
||||
AND LEFT(b.cuenta_no,1) IN ('4','5','7','8')
|
||||
AND b.ref NOT LIKE 'ED.99-001/12%' -- asiento de cierre anual
|
||||
AND b.ref NOT LIKE 'ED.99-002/12%' -- asiento de cierre anual (variante)
|
||||
GROUP BY p.ano, p.mes, b.cuenta_no
|
||||
)
|
||||
SELECT
|
||||
m.ano,
|
||||
m.numero_mes,
|
||||
ms.descrip AS mes,
|
||||
RIGHT('0000'+CONVERT(varchar(4),m.ano),4) + '-' +
|
||||
RIGHT('00'+CONVERT(varchar(2),m.numero_mes),2) AS AnoMes,
|
||||
DATEFROMPARTS(m.ano, m.numero_mes, 1) AS fecha_mes,
|
||||
LEFT(m.cuenta_no,1) AS grupo,
|
||||
CASE LEFT(m.cuenta_no,1)
|
||||
WHEN '4' THEN 1 WHEN '5' THEN 2 WHEN '7' THEN 3
|
||||
WHEN '8' THEN CASE WHEN m.cuenta_no LIKE '88%' THEN 5 ELSE 4 END
|
||||
END AS orden_linea,
|
||||
CASE LEFT(m.cuenta_no,1)
|
||||
WHEN '4' THEN 'Ventas Netas'
|
||||
WHEN '5' THEN 'Costo de Ventas'
|
||||
WHEN '7' THEN 'Gastos Operativos'
|
||||
WHEN '8' THEN CASE WHEN m.cuenta_no LIKE '88%'
|
||||
THEN 'Impuesto sobre la Renta'
|
||||
ELSE 'Otros Ingresos y Gastos' END
|
||||
END AS linea,
|
||||
LEFT(m.cuenta_no,2) AS subgrupo_cod,
|
||||
sg.descripcion AS subgrupo_desc,
|
||||
m.cuenta_no AS cuenta,
|
||||
ct.descripcion AS cuenta_desc,
|
||||
ct.nivel,
|
||||
m.debito,
|
||||
m.credito,
|
||||
CAST(m.credito - m.debito AS decimal(19,2)) AS resultado, -- + = aporta utilidad
|
||||
CAST(m.debito - m.credito AS decimal(19,2)) AS costo_gasto -- + = costo/gasto
|
||||
FROM mov m
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 ct ON ct.cuenta_no = m.cuenta_no
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 sg ON sg.cuenta_no = LEFT(m.cuenta_no,2)
|
||||
LEFT JOIN marmotech.dbo.mestable ms ON ms.mes = m.numero_mes;
|
||||
GO
|
||||
|
||||
/* ---- 3. Analisis de Gastos por Departamento (cgprrp009) ------------------ */
|
||||
/* Grano: ano x mes x departamento x cuenta. Solo grupo 7 (GASTOS). */
|
||||
IF OBJECT_ID('presidencia.vwGastosDepto','V') IS NOT NULL
|
||||
DROP VIEW presidencia.vwGastosDepto;
|
||||
GO
|
||||
CREATE VIEW presidencia.vwGastosDepto
|
||||
AS
|
||||
WITH mov AS (
|
||||
SELECT p.ano,
|
||||
p.mes AS numero_mes,
|
||||
ISNULL(b.departamento,0) AS departamento,
|
||||
b.cuenta_no,
|
||||
SUM(b.debito) AS debito,
|
||||
SUM(b.credito) AS credito
|
||||
FROM marmotech.dbo.cgtb00004 b
|
||||
INNER JOIN marmotech.dbo.prdtable p
|
||||
ON b.fecha BETWEEN p.fecha_inicio AND p.fecha_corte
|
||||
WHERE b.status_t IS NULL
|
||||
AND LEFT(b.cuenta_no,1) = '7'
|
||||
AND b.ref NOT LIKE 'ED.99-001/12%'
|
||||
AND b.ref NOT LIKE 'ED.99-002/12%'
|
||||
GROUP BY p.ano, p.mes, ISNULL(b.departamento,0), b.cuenta_no
|
||||
)
|
||||
SELECT
|
||||
m.ano,
|
||||
m.numero_mes,
|
||||
ms.descrip AS mes,
|
||||
RIGHT('0000'+CONVERT(varchar(4),m.ano),4) + '-' +
|
||||
RIGHT('00'+CONVERT(varchar(2),m.numero_mes),2) AS AnoMes,
|
||||
DATEFROMPARTS(m.ano, m.numero_mes, 1) AS fecha_mes,
|
||||
LEFT(CONVERT(varchar(4),m.departamento),1) AS gerencia_cod,
|
||||
CASE LEFT(CONVERT(varchar(4),m.departamento),1)
|
||||
WHEN '1' THEN 'Gerencia General'
|
||||
WHEN '2' THEN 'Administracion y Materiales'
|
||||
WHEN '3' THEN 'Gestion Humana'
|
||||
WHEN '4' THEN 'Ventas y Mercadeo'
|
||||
WHEN '5' THEN 'Canteras'
|
||||
WHEN '6' THEN 'Planta / Produccion'
|
||||
WHEN '7' THEN 'Planta Agregados'
|
||||
WHEN '8' THEN 'Marmotech en Caribbean'
|
||||
ELSE 'Sin Departamento'
|
||||
END AS gerencia,
|
||||
m.departamento,
|
||||
ISNULL(ad.nom_dpto,'SIN DEPARTAMENTO') AS depto_nombre,
|
||||
LEFT(m.cuenta_no,2) AS subgrupo_cod,
|
||||
sg.descripcion AS subgrupo_desc,
|
||||
m.cuenta_no AS cuenta,
|
||||
ct.descripcion AS cuenta_desc,
|
||||
m.debito,
|
||||
m.credito,
|
||||
CAST(m.debito - m.credito AS decimal(19,2)) AS gasto -- + = gasto neto
|
||||
FROM mov m
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 ct ON ct.cuenta_no = m.cuenta_no
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 sg ON sg.cuenta_no = LEFT(m.cuenta_no,2)
|
||||
LEFT JOIN marmotech.dbo.adtb00001 ad ON ad.departamento = m.departamento
|
||||
LEFT JOIN marmotech.dbo.mestable ms ON ms.mes = m.numero_mes;
|
||||
GO
|
||||
|
||||
/* ---- 4. Balance General / Estructura financiera (saldo acumulado) -------- */
|
||||
/* Grano: ano x mes x cuenta, grupos 1 (Activos) 2 (Pasivos) 3 (Capital). */
|
||||
/* saldo_acumulado = saldo contable al cierre del mes (deb-cred acumulado). */
|
||||
IF OBJECT_ID('presidencia.vwBalanceMensual','V') IS NOT NULL
|
||||
DROP VIEW presidencia.vwBalanceMensual;
|
||||
GO
|
||||
CREATE VIEW presidencia.vwBalanceMensual
|
||||
AS
|
||||
WITH mov AS (
|
||||
SELECT p.ano,
|
||||
p.mes AS numero_mes,
|
||||
b.cuenta_no,
|
||||
SUM(b.debito - b.credito) AS movimiento
|
||||
FROM marmotech.dbo.cgtb00004 b
|
||||
INNER JOIN marmotech.dbo.prdtable p
|
||||
ON b.fecha BETWEEN p.fecha_inicio AND p.fecha_corte
|
||||
WHERE b.status_t IS NULL
|
||||
AND LEFT(b.cuenta_no,1) IN ('1','2','3')
|
||||
GROUP BY p.ano, p.mes, b.cuenta_no
|
||||
),
|
||||
acum AS (
|
||||
SELECT m.*,
|
||||
SUM(m.movimiento) OVER (PARTITION BY m.cuenta_no
|
||||
ORDER BY m.ano, m.numero_mes
|
||||
ROWS UNBOUNDED PRECEDING) AS saldo_acumulado
|
||||
FROM mov m
|
||||
)
|
||||
SELECT
|
||||
a.ano,
|
||||
a.numero_mes,
|
||||
ms.descrip AS mes,
|
||||
RIGHT('0000'+CONVERT(varchar(4),a.ano),4) + '-' +
|
||||
RIGHT('00'+CONVERT(varchar(2),a.numero_mes),2) AS AnoMes,
|
||||
DATEFROMPARTS(a.ano, a.numero_mes, 1) AS fecha_mes,
|
||||
LEFT(a.cuenta_no,1) AS grupo,
|
||||
CASE LEFT(a.cuenta_no,1) WHEN '1' THEN 'Activos'
|
||||
WHEN '2' THEN 'Pasivos'
|
||||
WHEN '3' THEN 'Capital' END AS grupo_desc,
|
||||
LEFT(a.cuenta_no,2) AS subgrupo_cod,
|
||||
sg.descripcion AS subgrupo_desc,
|
||||
a.cuenta_no AS cuenta,
|
||||
ct.descripcion AS cuenta_desc,
|
||||
CAST(a.movimiento AS decimal(19,2)) AS movimiento_mes,
|
||||
CAST(a.saldo_acumulado AS decimal(19,2)) AS saldo_natural, -- deb-cred
|
||||
/* Presentacion: Activos positivos por debito; Pasivos/Capital por credito */
|
||||
CAST(CASE WHEN LEFT(a.cuenta_no,1) = '1' THEN a.saldo_acumulado
|
||||
ELSE -a.saldo_acumulado END AS decimal(19,2)) AS saldo_presentacion
|
||||
FROM acum a
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 ct ON ct.cuenta_no = a.cuenta_no
|
||||
LEFT JOIN marmotech.dbo.cgtb00001 sg ON sg.cuenta_no = LEFT(a.cuenta_no,2)
|
||||
LEFT JOIN marmotech.dbo.mestable ms ON ms.mes = a.numero_mes;
|
||||
GO
|
||||
|
||||
/* ---- 5. Seguridad: solo jsoto ------------------------------------------- */
|
||||
DENY SELECT ON SCHEMA::presidencia TO [public];
|
||||
GO
|
||||
/* Concesion explicita (documenta la intencion; jsoto ya es db_owner/sysadmin) */
|
||||
IF EXISTS (SELECT 1 FROM sys.database_principals WHERE name = 'MARMOTECH\jsoto')
|
||||
GRANT SELECT ON SCHEMA::presidencia TO [MARMOTECH\jsoto];
|
||||
GO
|
||||
IF EXISTS (SELECT 1 FROM sys.database_principals WHERE name = 'jsoto')
|
||||
GRANT SELECT ON SCHEMA::presidencia TO [jsoto];
|
||||
GO
|
||||
Binary file not shown.
@@ -0,0 +1,342 @@
|
||||
<# Genera el proyecto Power BI (.pbip) "Radiografia_Marmotech"
|
||||
Modelo (TMDL) con las 3 vistas de presidencia + DimCalendario + medidas DAX,
|
||||
y un reporte (PBIR) con 3 paginas. Abrir el .pbip en Power BI Desktop y
|
||||
Guardar como .pbix.
|
||||
Autor: jsoto · 2026-08-26
|
||||
#>
|
||||
param(
|
||||
[string]$Root = "C:\Users\jsoto\Documents\NACE\proyectos\Fuentes\MARMOTECH\Dashboards MARMOTECH\Radiografia_Marmotech"
|
||||
)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Name = "Radiografia_Marmotech"
|
||||
$SM = Join-Path $Root "$Name.SemanticModel"
|
||||
$RP = Join-Path $Root "$Name.Report"
|
||||
if(Test-Path $Root){ Remove-Item $Root -Recurse -Force }
|
||||
New-Item -ItemType Directory -Force -Path $Root,$SM,(Join-Path $SM "definition"),(Join-Path $SM "definition\tables"),$RP,(Join-Path $RP "definition"),(Join-Path $RP "definition\pages") | Out-Null
|
||||
|
||||
function W($path,$content){
|
||||
$dir = Split-Path $path -Parent
|
||||
if(!(Test-Path $dir)){ New-Item -ItemType Directory -Force -Path $dir | Out-Null }
|
||||
# UTF-8 sin BOM
|
||||
[System.IO.File]::WriteAllText($path, $content, (New-Object System.Text.UTF8Encoding($false)))
|
||||
}
|
||||
function G(){ [guid]::NewGuid().ToString() }
|
||||
$TAB = [char]9
|
||||
|
||||
# ---------------- .pbip ----------------
|
||||
W (Join-Path $Root "$Name.pbip") @"
|
||||
{
|
||||
"version": "1.0",
|
||||
"artifacts": [
|
||||
{ "report": { "path": "$Name.Report" } }
|
||||
],
|
||||
"settings": { "enableAutoRecovery": true }
|
||||
}
|
||||
"@
|
||||
|
||||
# ---------------- SemanticModel/.platform ----------------
|
||||
W (Join-Path $SM ".platform") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
|
||||
"metadata": { "type": "SemanticModel", "displayName": "$Name" },
|
||||
"config": { "version": "2.0", "logicalId": "$(G)" }
|
||||
}
|
||||
"@
|
||||
|
||||
# ---------------- SemanticModel/definition.pbism ----------------
|
||||
W (Join-Path $SM "definition.pbism") @"
|
||||
{
|
||||
"version": "4.0",
|
||||
"settings": {}
|
||||
}
|
||||
"@
|
||||
|
||||
# ---------------- database.tmdl ----------------
|
||||
W (Join-Path $SM "definition\database.tmdl") ("database`n${TAB}compatibilityLevel: 1550`n")
|
||||
|
||||
# ---------------- model.tmdl ----------------
|
||||
$model = @()
|
||||
$model += "model Model"
|
||||
$model += "${TAB}culture: es-ES"
|
||||
$model += "${TAB}defaultPowerBIDataSourceVersion: powerBI_V3"
|
||||
$model += "${TAB}sourceQueryCulture: es-ES"
|
||||
$model += ""
|
||||
$model += "annotation PBI_QueryOrder = [`"vwPLMensual`",`"vwGastosDepto`",`"vwBalanceMensual`",`"DimCalendario`"]"
|
||||
$model += ""
|
||||
W (Join-Path $SM "definition\model.tmdl") (($model -join "`n") + "`n")
|
||||
|
||||
# ---------------- helper: tabla desde vista SQL ----------------
|
||||
function Table-Sql($tname,$cols){
|
||||
# cols: array de "nombre|tipo"
|
||||
$l = @()
|
||||
$l += "table $tname"
|
||||
foreach($c in $cols){
|
||||
$p = $c.Split("|"); $cn=$p[0]; $ct=$p[1]
|
||||
$l += "${TAB}column '$cn'"
|
||||
$l += "${TAB}${TAB}dataType: $ct"
|
||||
$l += "${TAB}${TAB}sourceColumn: $cn"
|
||||
if($ct -eq "dateTime"){ $l += "${TAB}${TAB}formatString: General Date" }
|
||||
$l += "${TAB}${TAB}summarizeBy: none"
|
||||
$l += ""
|
||||
}
|
||||
$l += "${TAB}partition $tname = m"
|
||||
$l += "${TAB}${TAB}mode: import"
|
||||
$l += "${TAB}${TAB}source ="
|
||||
$l += "${TAB}${TAB}${TAB}${TAB}let"
|
||||
$l += "${TAB}${TAB}${TAB}${TAB} Origen = Sql.Database(`"192.168.40.8`", `"MarmotechBI`"),"
|
||||
$l += "${TAB}${TAB}${TAB}${TAB} Datos = Origen{[Schema=`"presidencia`", Item=`"$tname`"]}[Data]"
|
||||
$l += "${TAB}${TAB}${TAB}${TAB}in"
|
||||
$l += "${TAB}${TAB}${TAB}${TAB} Datos"
|
||||
$l += ""
|
||||
return ($l -join "`n") + "`n"
|
||||
}
|
||||
|
||||
$plCols = @("ano|int64","numero_mes|int64","mes|string","AnoMes|string","fecha_mes|dateTime","grupo|string","orden_linea|int64","linea|string","subgrupo_cod|string","subgrupo_desc|string","cuenta|string","cuenta_desc|string","nivel|int64","debito|decimal","credito|decimal","resultado|decimal","costo_gasto|decimal")
|
||||
$gsCols = @("ano|int64","numero_mes|int64","mes|string","AnoMes|string","fecha_mes|dateTime","gerencia_cod|string","gerencia|string","departamento|int64","depto_nombre|string","subgrupo_cod|string","subgrupo_desc|string","cuenta|string","cuenta_desc|string","debito|decimal","credito|decimal","gasto|decimal")
|
||||
$blCols = @("ano|int64","numero_mes|int64","mes|string","AnoMes|string","fecha_mes|dateTime","grupo|string","grupo_desc|string","subgrupo_cod|string","subgrupo_desc|string","cuenta|string","cuenta_desc|string","movimiento_mes|decimal","saldo_natural|decimal","saldo_presentacion|decimal")
|
||||
|
||||
# --- vwPLMensual (aloja las medidas) ---
|
||||
$pl = Table-Sql "vwPLMensual" $plCols
|
||||
# medidas
|
||||
$M = @()
|
||||
function Meas($n,$expr,$fmt){
|
||||
$s = @()
|
||||
$s += "${TAB}measure '$n' = $expr"
|
||||
if($fmt){ $s += "${TAB}${TAB}formatString: $fmt" }
|
||||
$s += ""
|
||||
return ($s -join "`n")
|
||||
}
|
||||
$m0 = "`n"
|
||||
$m0 += Meas "Ventas Netas" "CALCULATE ( SUM ( vwPLMensual[resultado] ), vwPLMensual[grupo] = `"4`" )" "\`$ #,0,,`" M`";\`$ -#,0,,`" M`";\`$ 0"
|
||||
$m0 += Meas "Costo de Ventas" "CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[grupo] = `"5`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Gastos Operativos" "CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[grupo] = `"7`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Otros Ing. y Gastos" "CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[linea] = `"Otros Ingresos y Gastos`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "ISR" "CALCULATE ( SUM ( vwPLMensual[costo_gasto] ), vwPLMensual[linea] = `"Impuesto sobre la Renta`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad Bruta" "[Ventas Netas] - [Costo de Ventas]" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad Operativa" "[Utilidad Bruta] - [Gastos Operativos]" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad antes ISR" "[Utilidad Operativa] - [Otros Ing. y Gastos]" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad Neta" "SUM ( vwPLMensual[resultado] )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Margen Bruto %" "DIVIDE ( [Utilidad Bruta], [Ventas Netas] )" "0.0%"
|
||||
$m0 += Meas "Margen Operativo %" "DIVIDE ( [Utilidad Operativa], [Ventas Netas] )" "0.0%"
|
||||
$m0 += Meas "Margen Neto %" "DIVIDE ( [Utilidad Neta], [Ventas Netas] )" "0.0%"
|
||||
$m0 += Meas "Costo % Ventas" "DIVIDE ( [Costo de Ventas], [Ventas Netas] )" "0.0%"
|
||||
$m0 += Meas "Gastos % Ventas" "DIVIDE ( [Gastos Operativos], [Ventas Netas] )" "0.0%"
|
||||
$m0 += Meas "Ventas AA" "CALCULATE ( [Ventas Netas], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad Neta AA" "CALCULATE ( [Utilidad Neta], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Ventas YoY %" "DIVIDE ( [Ventas Netas] - [Ventas AA], [Ventas AA] )" "0.0%"
|
||||
$m0 += Meas "Utilidad YoY %" "DIVIDE ( [Utilidad Neta] - [Utilidad Neta AA], [Utilidad Neta AA] )" "0.0%"
|
||||
$m0 += Meas "Ventas YTD" "TOTALYTD ( [Ventas Netas], DimCalendario[Date] )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Utilidad Neta YTD" "TOTALYTD ( [Utilidad Neta], DimCalendario[Date] )" "\`$ #,0,,`" M`""
|
||||
# medidas de gastos
|
||||
$m0 += Meas "Gasto Total" "SUM ( vwGastosDepto[gasto] )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Gasto AA" "CALCULATE ( [Gasto Total], SAMEPERIODLASTYEAR ( DimCalendario[Date] ) )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Gasto YoY %" "DIVIDE ( [Gasto Total] - [Gasto AA], [Gasto AA] )" "0.0%"
|
||||
$m0 += Meas "Gasto % de Ventas" "DIVIDE ( [Gasto Total], [Ventas Netas] )" "0.0%"
|
||||
# medidas de balance
|
||||
$m0 += Meas "Saldo (fin periodo)" "VAR u = MAX ( vwBalanceMensual[fecha_mes] ) RETURN CALCULATE ( SUM ( vwBalanceMensual[saldo_presentacion] ), vwBalanceMensual[fecha_mes] = u )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Activos" "CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = `"1`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Pasivos" "CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = `"2`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Patrimonio" "CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[grupo] = `"3`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Activo Corriente" "CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[subgrupo_cod] = `"11`" )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Pasivo Corriente" "CALCULATE ( [Saldo (fin periodo)], vwBalanceMensual[subgrupo_cod] IN {`"20`",`"21`"} )" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Razon Corriente" "DIVIDE ( [Activo Corriente], [Pasivo Corriente] )" "0.00"
|
||||
$m0 += Meas "Capital de Trabajo" "[Activo Corriente] - [Pasivo Corriente]" "\`$ #,0,,`" M`""
|
||||
$m0 += Meas "Endeudamiento %" "DIVIDE ( [Pasivos], [Activos] )" "0.0%"
|
||||
|
||||
# insertar medidas antes de la particion (deben ir dentro de la tabla, antes de 'partition')
|
||||
$pl = $pl -replace "(?s)(${TAB}partition vwPLMensual = m)", ($m0 + "`$1")
|
||||
W (Join-Path $SM "definition\tables\vwPLMensual.tmdl") $pl
|
||||
|
||||
W (Join-Path $SM "definition\tables\vwGastosDepto.tmdl") (Table-Sql "vwGastosDepto" $gsCols)
|
||||
W (Join-Path $SM "definition\tables\vwBalanceMensual.tmdl") (Table-Sql "vwBalanceMensual" $blCols)
|
||||
|
||||
# ---------------- DimCalendario (tabla calculada) ----------------
|
||||
$dc = @()
|
||||
$dc += "table DimCalendario"
|
||||
foreach($c in @("Date|dateTime","Anio|int64","MesNo|int64","Mes|string","AnioMes|string","PrimerDiaMes|dateTime","Trimestre|string")){
|
||||
$p=$c.Split("|");$cn=$p[0];$ct=$p[1]
|
||||
$dc += "${TAB}column $cn"
|
||||
$dc += "${TAB}${TAB}dataType: $ct"
|
||||
$dc += "${TAB}${TAB}sourceColumn: [$cn]"
|
||||
if($ct -eq "dateTime"){ $dc += "${TAB}${TAB}formatString: General Date" }
|
||||
$dc += "${TAB}${TAB}summarizeBy: none"
|
||||
$dc += ""
|
||||
}
|
||||
$dax = 'ADDCOLUMNS ( CALENDAR ( DATE ( 2015, 1, 1 ), DATE ( 2028, 12, 31 ) ), "Anio", YEAR ( [Date] ), "MesNo", MONTH ( [Date] ), "Mes", FORMAT ( [Date], "MMM" ), "AnioMes", FORMAT ( [Date], "yyyy-MM" ), "PrimerDiaMes", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 ), "Trimestre", "T" & FORMAT ( [Date], "Q" ) )'
|
||||
$dc += "${TAB}partition DimCalendario = calculated"
|
||||
$dc += "${TAB}${TAB}mode: import"
|
||||
$dc += "${TAB}${TAB}source = $dax"
|
||||
$dc += ""
|
||||
W (Join-Path $SM "definition\tables\DimCalendario.tmdl") (($dc -join "`n") + "`n")
|
||||
|
||||
# ---------------- relationships.tmdl ----------------
|
||||
$rel = @()
|
||||
foreach($t in @("vwPLMensual","vwGastosDepto","vwBalanceMensual")){
|
||||
$rel += "relationship $(G)"
|
||||
$rel += "${TAB}fromColumn: $t.fecha_mes"
|
||||
$rel += "${TAB}toColumn: DimCalendario.Date"
|
||||
$rel += ""
|
||||
}
|
||||
W (Join-Path $SM "definition\relationships.tmdl") (($rel -join "`n") + "`n")
|
||||
|
||||
Write-Output "SemanticModel escrito."
|
||||
|
||||
# =====================================================================
|
||||
# REPORTE (PBIR)
|
||||
# =====================================================================
|
||||
W (Join-Path $RP ".platform") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
|
||||
"metadata": { "type": "Report", "displayName": "$Name" },
|
||||
"config": { "version": "2.0", "logicalId": "$(G)" }
|
||||
}
|
||||
"@
|
||||
|
||||
W (Join-Path $RP "definition.pbir") @"
|
||||
{
|
||||
"version": "4.0",
|
||||
"datasetReference": { "byPath": { "path": "../$Name.SemanticModel" } }
|
||||
}
|
||||
"@
|
||||
|
||||
# PBIR exige version.json dentro de definition/
|
||||
W (Join-Path $RP "definition\version.json") @"
|
||||
{
|
||||
"version": "2.0.0"
|
||||
}
|
||||
"@
|
||||
|
||||
W (Join-Path $RP "definition\report.json") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/report/1.0.0/schema.json",
|
||||
"themeCollection": { "baseTheme": { "name": "CY24SU10" } },
|
||||
"layoutOptimization": "None"
|
||||
}
|
||||
"@
|
||||
|
||||
# ---- helpers de visuales PBIR ----
|
||||
function Field-Measure($entity,$prop){
|
||||
return @"
|
||||
{ "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "$entity" } }, "Property": "$prop" } }, "queryRef": "$entity.$prop", "nativeQueryRef": "$prop" }
|
||||
"@
|
||||
}
|
||||
function Field-Column($entity,$prop){
|
||||
return @"
|
||||
{ "field": { "Column": { "Expression": { "SourceRef": { "Entity": "$entity" } }, "Property": "$prop" } }, "queryRef": "$entity.$prop", "nativeQueryRef": "$prop" }
|
||||
"@
|
||||
}
|
||||
# roles: hashtable rol -> array de proyecciones json
|
||||
function Visual($pageDir,$vtype,$x,$y,$w,$h,$roles,$title){
|
||||
$vid = G
|
||||
$vdir = Join-Path $pageDir "visuals\$vid"
|
||||
New-Item -ItemType Directory -Force -Path $vdir | Out-Null
|
||||
$projBlocks = @()
|
||||
foreach($r in $roles.Keys){
|
||||
$items = ($roles[$r] -join ",`n")
|
||||
$projBlocks += "`"$r`": { `"projections`": [ $items ] }"
|
||||
}
|
||||
$queryState = ($projBlocks -join ",`n")
|
||||
$titleObj = ""
|
||||
if($title){
|
||||
$titleObj = @"
|
||||
,
|
||||
"objects": {
|
||||
"title": [ { "properties": { "text": { "expr": { "Literal": { "Value": "'$title'" } } }, "show": { "expr": { "Literal": { "Value": "true" } } } } } ]
|
||||
}
|
||||
"@
|
||||
}
|
||||
$json = @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
|
||||
"name": "$vid",
|
||||
"position": { "x": $x, "y": $y, "z": 0, "width": $w, "height": $h, "tabOrder": 0 },
|
||||
"visual": {
|
||||
"visualType": "$vtype",
|
||||
"query": { "queryState": { $queryState } },
|
||||
"drillFilterOtherVisuals": true$titleObj
|
||||
}
|
||||
}
|
||||
"@
|
||||
W (Join-Path $vdir "visual.json") $json
|
||||
return $vid
|
||||
}
|
||||
|
||||
$pageIds = @()
|
||||
|
||||
# ============ PAGINA 1: Radiografia ============
|
||||
$p1 = G; $pageIds += $p1
|
||||
$p1dir = Join-Path $RP "definition\pages\$p1"
|
||||
New-Item -ItemType Directory -Force -Path $p1dir | Out-Null
|
||||
W (Join-Path $p1dir "page.json") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "$p1",
|
||||
"displayName": "Radiografia",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
"@
|
||||
[void](Visual $p1dir "card" 16 16 280 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Ventas Netas")) } "Ventas Netas")
|
||||
[void](Visual $p1dir "card" 312 16 280 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Utilidad Bruta")) } "Utilidad Bruta")
|
||||
[void](Visual $p1dir "card" 688 16 280 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Utilidad Operativa")) } "Utilidad Operativa")
|
||||
[void](Visual $p1dir "card" 984 16 280 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Utilidad Neta")) } "Utilidad Neta")
|
||||
[void](Visual $p1dir "waterfallChart" 16 170 620 300 @{ "Category" = @((Field-Column "vwPLMensual" "linea")); "Y" = @((Field-Measure "vwPLMensual" "Utilidad Neta")) } "Estado de Resultados (cascada)")
|
||||
[void](Visual $p1dir "lineClusteredColumnComboChart" 652 170 612 300 @{ "Category" = @((Field-Column "DimCalendario" "Mes")); "Y" = @((Field-Measure "vwPLMensual" "Ventas Netas")); "Y2" = @((Field-Measure "vwPLMensual" "Utilidad Neta")) } "Comportamiento del periodo (Ventas vs Utilidad)")
|
||||
[void](Visual $p1dir "clusteredColumnChart" 16 484 620 220 @{ "Category" = @((Field-Column "DimCalendario" "Anio")); "Y" = @((Field-Measure "vwPLMensual" "Ventas Netas"),(Field-Measure "vwPLMensual" "Utilidad Neta")) } "Trayectoria anual")
|
||||
[void](Visual $p1dir "slicer" 652 484 300 120 @{ "Values" = @((Field-Column "DimCalendario" "Anio")) } "Ano")
|
||||
|
||||
# ============ PAGINA 2: Gastos ============
|
||||
$p2 = G; $pageIds += $p2
|
||||
$p2dir = Join-Path $RP "definition\pages\$p2"
|
||||
New-Item -ItemType Directory -Force -Path $p2dir | Out-Null
|
||||
W (Join-Path $p2dir "page.json") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "$p2",
|
||||
"displayName": "Analisis de Gastos",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
"@
|
||||
[void](Visual $p2dir "card" 16 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Gasto Total")) } "Gastos Operativos")
|
||||
[void](Visual $p2dir "card" 332 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Gasto % de Ventas")) } "Gasto / Ventas")
|
||||
[void](Visual $p2dir "barChart" 16 170 620 300 @{ "Category" = @((Field-Column "vwGastosDepto" "gerencia")); "Y" = @((Field-Measure "vwPLMensual" "Gasto Total")) } "Gasto por gerencia")
|
||||
[void](Visual $p2dir "tableEx" 652 170 612 300 @{ "Values" = @((Field-Column "vwGastosDepto" "subgrupo_desc"),(Field-Measure "vwPLMensual" "Gasto Total"),(Field-Measure "vwPLMensual" "Gasto % de Ventas")) } "Naturaleza del gasto")
|
||||
[void](Visual $p2dir "columnChart" 16 484 1248 220 @{ "Category" = @((Field-Column "DimCalendario" "Mes")); "Y" = @((Field-Measure "vwPLMensual" "Gasto Total")) } "Gasto mensual")
|
||||
|
||||
# ============ PAGINA 3: Estructura ============
|
||||
$p3 = G; $pageIds += $p3
|
||||
$p3dir = Join-Path $RP "definition\pages\$p3"
|
||||
New-Item -ItemType Directory -Force -Path $p3dir | Out-Null
|
||||
W (Join-Path $p3dir "page.json") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/page/1.0.0/schema.json",
|
||||
"name": "$p3",
|
||||
"displayName": "Estructura Financiera",
|
||||
"displayOption": "FitToPage",
|
||||
"height": 720,
|
||||
"width": 1280
|
||||
}
|
||||
"@
|
||||
[void](Visual $p3dir "card" 16 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Activos")) } "Activos Totales")
|
||||
[void](Visual $p3dir "card" 332 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Razon Corriente")) } "Razon Corriente")
|
||||
[void](Visual $p3dir "card" 648 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Capital de Trabajo")) } "Capital de Trabajo")
|
||||
[void](Visual $p3dir "card" 964 16 300 140 @{ "Values" = @((Field-Measure "vwPLMensual" "Endeudamiento %")) } "Endeudamiento")
|
||||
[void](Visual $p3dir "clusteredColumnChart" 16 170 620 300 @{ "Category" = @((Field-Column "vwBalanceMensual" "grupo_desc")); "Y" = @((Field-Measure "vwPLMensual" "Saldo (fin periodo)")) } "Activos / Pasivos / Patrimonio")
|
||||
[void](Visual $p3dir "tableEx" 652 170 612 300 @{ "Values" = @((Field-Column "vwBalanceMensual" "subgrupo_desc"),(Field-Measure "vwPLMensual" "Saldo (fin periodo)")) } "Composicion")
|
||||
|
||||
# ---------------- pages.json ----------------
|
||||
$order = ($pageIds | ForEach-Object { "`"$_`"" }) -join ", "
|
||||
W (Join-Path $RP "definition\pages\pages.json") @"
|
||||
{
|
||||
"`$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/pagesMetadata/1.0.0/schema.json",
|
||||
"pageOrder": [ $order ],
|
||||
"activePageName": "$($pageIds[0])"
|
||||
}
|
||||
"@
|
||||
|
||||
Write-Output "Reporte escrito."
|
||||
Write-Output ("PROYECTO GENERADO EN: " + $Root)
|
||||
Get-ChildItem -Recurse $Root | Measure-Object | ForEach-Object { Write-Output ("Archivos: " + $_.Count) }
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ManagedForm fileVersion="31400" gstVersion="3140a" name="ManagedForm" uid="{8f013df5-71e9-4123-ace5-57cb0d559141}">
|
||||
<AGSettings>
|
||||
<DynamicProperties version="2"/>
|
||||
</AGSettings>
|
||||
<Record name="scr_costos" uid="{1072830e-e04e-4a63-8f41-4aa8efa5ffaa}">
|
||||
<RecordField colName="tipo" fieldIdRef="11" name="tipo" sqlTabName="formonly" uid="{d9350682-2ead-47c0-8563-a7d127b1ec5d}"/>
|
||||
<RecordField fieldIdRef="5" name="codigo" uid="{7225c2f2-2ca5-4952-9439-39d6105683b2}"/>
|
||||
<RecordField colName="emp_no" fieldIdRef="8" name="emp_no" sqlTabName="formonly" sqlType="DECIMAL" uid="{ada70def-e69a-4c50-bd69-1fb91fd596cf}"/>
|
||||
<RecordField colName="h_directa" fieldIdRef="12" name="h_directa" sqlTabName="formonly" uid="{f0d26a13-bbd5-4de4-a3ad-9e26feb8ccb0}"/>
|
||||
<RecordField colName="h_indirecta" fieldIdRef="13" name="h_indirecta" sqlTabName="formonly" uid="{d3a40df7-5349-4812-82bc-a96aa2c4027b}"/>
|
||||
<RecordField colName="e_directa" fieldIdRef="14" name="e_directa" sqlTabName="formonly" uid="{d24a8ff5-f9b6-4fbb-a667-451a948c3f7b}"/>
|
||||
<RecordField colName="e_indirecta" fieldIdRef="15" name="e_indirecta" sqlTabName="formonly" uid="{9a0f1103-7db4-43c3-8147-f715eab9a3c1}"/>
|
||||
<RecordField colName="cod_prod" fieldIdRef="9" name="cod_prod" sqlTabName="formonly" uid="{e1b64282-cd3b-4615-bcb8-fde9313110e2}"/>
|
||||
<RecordField fieldIdRef="20" name="lado1" uid="{10db271d-bbce-4ae7-9e10-144888550c81}"/>
|
||||
<RecordField fieldIdRef="21" name="lado2" uid="{f134fcc5-822c-4f75-8b71-70263f00284c}"/>
|
||||
<RecordField fieldIdRef="22" name="lado3" uid="{98f897e4-b702-4356-bf11-25e1b93bb2ab}"/>
|
||||
<RecordField colName="cantidad" fieldIdRef="17" name="cantidad" sqlTabName="formonly" uid="{166ac25b-ad15-45f8-8b8e-7862ac3bccfe}"/>
|
||||
<RecordField fieldIdRef="23" name="medida1" uid="{c1b4ea3b-4927-423f-8dfd-a3dc80f64090}"/>
|
||||
<RecordField colName="codigo_bloque" fieldIdRef="2" name="codigo_bloque" sqlTabName="formonly" uid="{d03b323d-b9bb-4eea-9514-c14bcccd7a56}"/>
|
||||
<RecordField colName="turno" fieldIdRef="0" name="turno" sqlTabName="formonly" uid="{cea5543d-5e89-46ba-a306-d6d732238f3a}"/>
|
||||
<RecordField fieldIdRef="24" name="depto_receptor" uid="{33d0c1ec-7dc1-4ec0-b489-b23701305b3c}"/>
|
||||
<RecordField fieldIdRef="28" name="ref" uid="{e955cc32-7b71-4cec-90cd-379631ca8437}"/>
|
||||
<RecordField fieldIdRef="50" name="num_oc" uid="{b2c3d4e5-0050-4a00-9050-0d0c0b0a0950}"/>
|
||||
</Record>
|
||||
<Record name="record1" uid="{af6b78f0-189c-4e68-8607-46f11a433423}">
|
||||
<RecordField colName="num_doc" fieldIdRef="4" name="num_doc" sqlTabName="formonly" uid="{2bec5bf1-0623-4163-9235-ba4b878a0590}"/>
|
||||
<RecordField colName="fecha" fieldIdRef="7" name="fecha" sqlTabName="formonly" sqlType="DATE" uid="{77a2edd0-719f-44f1-83dc-e532b159653f}"/>
|
||||
<RecordField colName="factor" fieldIdRef="6" name="factor" sqlTabName="formonly" uid="{6dee7883-621c-45f7-8519-0cf206a8f484}"/>
|
||||
<RecordField colName="departamento" fieldIdRef="3" name="departamento" sqlTabName="formonly" uid="{b4139611-41fc-494f-9bba-b6dee92f1e87}"/>
|
||||
<RecordField colName="descripcion" fieldIdRef="18" name="descripcion" sqlTabName="formonly" uid="{f5f4d146-6d13-4504-b957-e3f116446c65}"/>
|
||||
<RecordField colName="medida" fieldIdRef="16" name="medida" sqlTabName="formonly" uid="{f4fcca96-d1c9-43fa-a343-4b1ed7441d3a}"/>
|
||||
<RecordField colName="nombre" fieldIdRef="19" name="nombre" sqlTabName="formonly" uid="{0b987b65-36cf-4e02-91a5-46831177aa0a}"/>
|
||||
<RecordField fieldIdRef="27" name="cod_mov" uid="{611b980b-7ec3-480b-82f2-c4509213bf31}"/>
|
||||
</Record>
|
||||
<Record name="s_docs" uid="{a1b2c3d4-0001-4a00-9001-0d0c0b0a0901}">
|
||||
<RecordField fieldIdRef="40" name="d_num_doc" uid="{a1b2c3d4-0002-4a00-9002-0d0c0b0a0902}"/>
|
||||
<RecordField fieldIdRef="41" name="d_fecha" uid="{a1b2c3d4-0003-4a00-9003-0d0c0b0a0903}"/>
|
||||
<RecordField fieldIdRef="42" name="d_departamento" uid="{a1b2c3d4-0004-4a00-9004-0d0c0b0a0904}"/>
|
||||
<RecordField fieldIdRef="43" name="d_movimiento" uid="{a1b2c3d4-0005-4a00-9005-0d0c0b0a0905}"/>
|
||||
<RecordField fieldIdRef="44" name="d_estado" uid="{a1b2c3d4-0006-4a00-9006-0d0c0b0a0906}"/>
|
||||
<RecordField fieldIdRef="45" name="d_bloques" uid="{a1b2c3d4-0007-4a00-9007-0d0c0b0a0907}"/>
|
||||
</Record>
|
||||
<Form gridHeight="20" gridWidth="258" name="prfmmt003" style="basic" text="CREACION DOCUMENTO PRODUCCION">
|
||||
<ToolBar name="toolbar1">
|
||||
<ToolBarItem comment="Nuevo Documento" image="new" name="nuevo" text="Produccion"/>
|
||||
<ToolBarItem comment="Criterio de busqueda" image="find" name="buscar" text="Buscar Documento"/>
|
||||
<ToolBarItem comment="Anula Registro en Screen" image="cancel" name="anular" text="Anular Registros"/>
|
||||
<ToolBarItem comment="Lista de documentos (mas recientes primero)" image="detail" name="documentos" text="Documentos"/>
|
||||
<ToolBarItem comment="Recorrido/trazabilidad del bloque" image="fa-sitemap" name="traza" text="Trazabilidad"/>
|
||||
<ToolBarSeparator name="toolbarseparator1"/>
|
||||
<ToolBarItem image="quit" name="salir" text="Salir"/>
|
||||
</ToolBar>
|
||||
<Folder gridHeight="20" gridWidth="258" name="folder1" posX="0" posY="0">
|
||||
<Page action="documentos" name="pg_docs" text="Documentos">
|
||||
<Grid gridHeight="18" gridWidth="257" name="grid_docs" posX="0" posY="0">
|
||||
<Table gridHeight="17" gridWidth="255" name="table_docs" posX="1" posY="0" totalRows="16" unitWidth="characters" width="150">
|
||||
<Edit fieldId="40" gridHeight="1" gridWidth="12" name="d_num_doc" noEntry="true" posX="0" posY="0" scroll="true" tabIndex="-1" title="NUM. DOC" widget="Edit"/>
|
||||
<Edit fieldId="41" gridHeight="1" gridWidth="14" name="d_fecha" noEntry="true" posX="12" posY="0" scroll="true" tabIndex="-1" title="FECHA" widget="Edit"/>
|
||||
<Edit fieldId="42" gridHeight="1" gridWidth="42" name="d_departamento" noEntry="true" posX="26" posY="0" scroll="true" tabIndex="-1" title="DEPARTAMENTO" widget="Edit"/>
|
||||
<Edit fieldId="43" gridHeight="1" gridWidth="36" name="d_movimiento" noEntry="true" posX="68" posY="0" scroll="true" tabIndex="-1" title="MOVIMIENTO" widget="Edit"/>
|
||||
<Edit fieldId="44" gridHeight="1" gridWidth="12" name="d_estado" noEntry="true" posX="104" posY="0" scroll="true" tabIndex="-1" title="ESTADO" widget="Edit"/>
|
||||
<Edit fieldId="45" gridHeight="1" gridWidth="34" name="d_bloques" noEntry="true" posX="116" posY="0" scroll="true" tabIndex="-1" title="BLOQUES" widget="Edit"/>
|
||||
</Table>
|
||||
</Grid>
|
||||
</Page>
|
||||
<Page name="pg_prod" text="Produccion">
|
||||
<Grid gridHeight="18" gridWidth="258" name="grid1" posX="0" posY="0">
|
||||
<Group gridHeight="6" gridWidth="62" name="group1" posX="1" posY="0" text="General">
|
||||
<Label gridHeight="1" gridWidth="10" name="label1" posX="3" posY="1" text="Secuencia"/>
|
||||
<Edit colName="num_doc" fieldId="4" gridHeight="1" gridWidth="5" name="num_doc" noEntry="false" posX="14" posY="1" sqlTabName="formonly" tabIndex="1" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="6" name="label2" posX="21" posY="1" text="Fecha"/>
|
||||
<DateEdit colName="fecha" fieldId="7" format="DD/MM/YYYY" gridHeight="1" gridWidth="9" name="fecha" posX="28" posY="1" required="true" sqlTabName="formonly" sqlType="DATE" tabIndex="2" widget="DateEdit"/>
|
||||
<Label gridHeight="1" gridWidth="6" name="label3" posX="3" posY="2" text="Factor"/>
|
||||
<Edit colName="factor" comment="Digite factor que desa calcular las horas normales" fieldId="6" gridHeight="1" gridWidth="5" name="factor" posX="14" posY="2" sqlTabName="formonly" tabIndex="3" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="8" name="label4" posX="3" posY="3" text="Departa."/>
|
||||
<ComboBox colName="departamento" fieldId="3" gridHeight="1" gridWidth="32" items="" name="departamento" posX="14" posY="3" required="true" sqlTabName="formonly" tabIndex="4" widget="ComboBox"/>
|
||||
<Label gridHeight="1" gridWidth="10" name="label6" posX="3" posY="4" text="Cod. Movimiento"/>
|
||||
<ComboBox fieldId="27" gridHeight="1" gridWidth="35" items="" name="cod_mov" posX="14" posY="4" tabIndex="-1" title="combobox1" widget="ComboBox"/>
|
||||
</Group>
|
||||
<Group gridHeight="8" gridWidth="257" name="group2" posX="1" posY="6" text="Detalle">
|
||||
<Table gridHeight="6" gridWidth="254" name="table1" posX="2" posY="1" totalRows="5" unitWidth="characters" width="76">
|
||||
<ComboBox colName="tipo" comment="Digite Codigo de la Maquina" fieldId="11" gridHeight="1" gridWidth="30" items="" name="tipo" posX="0" posY="0" scroll="true" sqlTabName="formonly" tabIndex="5" title="OPERACION" widget="ComboBox"/>
|
||||
<ComboBox fieldId="5" gridHeight="1" gridWidth="48" items="" name="codigo" posX="30" posY="0" scroll="true" tabIndex="-1" title="Equipo" unhidable="true" unmovable="true" unsortable="true" widget="ComboBox"/>
|
||||
<ButtonEdit action="empleado" autoNext="true" colName="emp_no" fieldId="8" gridHeight="1" gridWidth="10" name="emp_no" posX="78" posY="0" sqlTabName="formonly" sqlType="DECIMAL" tabIndex="6" title="EMPLEADO" widget="ButtonEdit"/>
|
||||
<Edit autoNext="true" colName="h_directa" fieldId="12" gridHeight="1" gridWidth="6" name="h_directa" posX="88" posY="0" sqlTabName="formonly" tabIndex="7" title="N.DIRECTA" widget="Edit"/>
|
||||
<Edit autoNext="true" colName="h_indirecta" fieldId="13" gridHeight="1" gridWidth="6" name="h_indirecta" posX="94" posY="0" sqlTabName="formonly" tabIndex="8" title="N.IND." widget="Edit"/>
|
||||
<Edit autoNext="true" colName="e_directa" fieldId="14" gridHeight="1" gridWidth="6" name="e_directa" posX="100" posY="0" sqlTabName="formonly" tabIndex="9" title="E. DIRECTAS" widget="Edit"/>
|
||||
<Edit autoNext="true" colName="e_indirecta" fieldId="15" gridHeight="1" gridWidth="5" name="e_indirecta" posX="106" posY="0" sqlTabName="formonly" tabIndex="10" title="E.INDIRECTAS" widget="Edit"/>
|
||||
<ButtonEdit action="semielaborado" colName="cod_prod" fieldId="9" gridHeight="1" gridWidth="10" name="cod_prod" posX="111" posY="0" sqlTabName="formonly" tabIndex="11" title="SEMI-ELABORADO" widget="ButtonEdit"/>
|
||||
<Edit fieldId="20" gridHeight="1" gridWidth="8" name="lado1" posX="121" posY="0" tabIndex="-1" title="Ancho" widget="Edit"/>
|
||||
<Edit fieldId="21" gridHeight="1" gridWidth="8" name="lado2" posX="129" posY="0" tabIndex="-1" title="Largo" widget="Edit"/>
|
||||
<Edit fieldId="22" gridHeight="1" gridWidth="8" name="lado3" posX="137" posY="0" tabIndex="-1" title="Espesor" widget="Edit"/>
|
||||
<Edit colName="cantidad" comment="Digite Cantidad Producida" fieldId="17" gridHeight="1" gridWidth="12" name="cantidad" posX="145" posY="0" sqlTabName="formonly" tabIndex="12" title="CANTIDAD" widget="Edit"/>
|
||||
<Edit fieldId="23" gridHeight="1" gridWidth="8" name="medida1" noEntry="true" posX="157" posY="0" tabIndex="-1" title="Medida" widget="Edit"/>
|
||||
<Edit case="upper" colName="codigo_bloque" fieldId="2" gridHeight="1" gridWidth="20" name="codigo_bloque" posX="165" posY="0" scroll="true" sqlTabName="formonly" tabIndex="13" title="BLOQUE" widget="Edit"/>
|
||||
<ComboBox colName="turno" fieldId="0" gridHeight="1" gridWidth="20" items="" name="turno" posX="185" posY="0" sqlTabName="formonly" tabIndex="14" title="TURNO" widget="ComboBox"/>
|
||||
<ComboBox fieldId="24" gridHeight="1" gridWidth="13" items="" name="depto_receptor" notNull="false" posX="205" posY="0" required="false" tabIndex="-1" title="DEPTO. RECEPTOR" widget="ComboBox"/>
|
||||
<ButtonEdit action="ordenped" fieldId="50" gridHeight="1" gridWidth="12" name="num_oc" posX="218" posY="0" scroll="true" tabIndex="18" title="ORDEN PED." widget="ButtonEdit"/>
|
||||
<Phantom fieldId="28" name="ref" widget="Phantom"/>
|
||||
</Table>
|
||||
</Group>
|
||||
<Group gridHeight="4" gridWidth="56" name="group3" posX="1" posY="14" text="INFORMACION">
|
||||
<Label gridHeight="1" gridWidth="7" name="label5" posX="1" posY="1" text="Produce"/>
|
||||
<Edit colName="descripcion" fieldId="18" gridHeight="1" gridWidth="31" name="descripcion" noEntry="true" posX="12" posY="1" sqlTabName="formonly" tabIndex="15" widget="Edit"/>
|
||||
<Edit colName="medida" fieldId="16" gridHeight="1" gridWidth="3" name="medida" noEntry="true" posX="44" posY="1" sqlTabName="formonly" tabIndex="16" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="8" name="label9" posX="1" posY="2" text="Empleado"/>
|
||||
<Edit colName="nombre" fieldId="19" gridHeight="1" gridWidth="31" name="nombre" noEntry="true" posX="12" posY="2" sqlTabName="formonly" tabIndex="17" widget="Edit"/>
|
||||
</Group>
|
||||
</Grid>
|
||||
</Page>
|
||||
</Folder>
|
||||
</Form>
|
||||
<DiagramLayout>
|
||||
<![CDATA[AAAAAgAAAEwAewAxADAANwAyADgAMwAwAGUALQBlADAANABlAC0ANABhADYAMwAtADgAZgA0ADEALQA0AGEAYQA4AGUAZgBhADUAZgBmAGEAYQB9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAEwAewBhADEAYgAyAGMAMwBkADQALQAwADAAMAAxAC0ANABhADAAMAAtADkAMAAwADEALQAwAGQAMABjADAAYgAwAGEAMAA5ADAAMQB9QDAAAAQAAABAMAAABAAAAAAAAAAAAAAAAQAAAEwAewBhAGYANgBiADcAOABmADAALQAxADgAOQBjAC0ANABlADYAOAAtADgANgAwADcALQA0ADYAZgAxADEAYQA0ADMAMwA0ADIAMwB9QHMAAEhgAHpAPVVV1VVWYD9QYk3S8an8AQ==]]>
|
||||
</DiagramLayout>
|
||||
</ManagedForm>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ManagedForm databaseName="smarmotech" fileVersion="40100" gstVersion="60003" name="ManagedForm" uid="{9ab131cc-e3f5-494e-91de-5c09b774e85d}">
|
||||
<AGSettings>
|
||||
<DynamicProperties version="4"/>
|
||||
</AGSettings>
|
||||
<Record name="record1" uid="{443dc023-d478-4ecd-b508-5a36ada894a4}">
|
||||
<RecordField colName="area_num" fieldIdRef="0" fieldType="TABLE_COLUMN" name="prtb00016.area_num" sqlTabName="prtb00016" uid="{b8203607-0471-4c7e-8ab9-ac7bdafd7886}"/>
|
||||
<RecordField colName="nombre_area" fieldIdRef="1" fieldType="TABLE_COLUMN" name="prtb00016.nombre_area" sqlTabName="prtb00016" uid="{2b1fdb6d-375f-4d84-aa7d-ae809175a607}"/>
|
||||
<RecordField colName="status_t" fieldIdRef="2" fieldType="TABLE_COLUMN" name="prtb00016.status_t" sqlTabName="prtb00016" uid="{b8200b51-c72d-4706-a20a-b0385227b951}"/>
|
||||
<RecordField colName="us_crea" fieldIdRef="3" fieldType="TABLE_COLUMN" name="prtb00016.us_crea" sqlTabName="prtb00016" uid="{f55a0f80-bb96-418d-a961-e4e8ec620b54}"/>
|
||||
<RecordField colName="us_mod" fieldIdRef="4" fieldType="TABLE_COLUMN" name="prtb00016.us_mod" sqlTabName="prtb00016" uid="{26703a61-e09e-4233-a55b-114ae9719153}"/>
|
||||
<RecordField colName="fech_crea" fieldIdRef="5" fieldType="TABLE_COLUMN" name="prtb00016.fech_crea" sqlTabName="prtb00016" uid="{5a2a88ed-161c-40bd-89e5-6f8ccd84b675}"/>
|
||||
<RecordField colName="fech_mod" fieldIdRef="6" fieldType="TABLE_COLUMN" name="prtb00016.fech_mod" sqlTabName="prtb00016" uid="{6cd4a9f5-97ad-4424-9a3d-5b5c283c03a4}"/>
|
||||
</Record>
|
||||
<Form gridHeight="24" gridWidth="80" name="prfmmt010" text="ADMINISTRACION AREAS">
|
||||
<Grid gridHeight="24" gridWidth="80" name="grid1" posX="0" posY="0">
|
||||
<Label gridHeight="1" gridWidth="4" name="label1" posX="3" posY="0" text="Area"/>
|
||||
<Edit colName="area_num" comment="Digite el Numero del Area" fieldId="0" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="5" name="prtb00016.area_num" posX="22" posY="0" sqlTabName="prtb00016" tabIndex="1" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="16" name="label2" posX="3" posY="1" text="Descripcion Area"/>
|
||||
<Edit case="upper" colName="nombre_area" comment="Digite la descripcion del Area" fieldId="1" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="29" name="prtb00016.nombre_area" posX="22" posY="1" required="true" sqlTabName="prtb00016" tabIndex="2" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="6" name="label3" posX="3" posY="2" text="Status"/>
|
||||
<Edit colName="status_t" fieldId="2" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="1" name="prtb00016.status_t" noEntry="true" posX="22" posY="2" sqlTabName="prtb00016" tabIndex="3" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="16" name="label4" posX="3" posY="4" text="Usuario Creador"/>
|
||||
<Edit colName="us_crea" fieldId="3" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="8" name="prtb00016.us_crea" noEntry="true" posX="20" posY="4" sqlTabName="prtb00016" tabIndex="4" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="20" name="label5" posX="41" posY="4" text="Usuario Modificador"/>
|
||||
<Edit colName="us_mod" fieldId="4" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="8" name="prtb00016.us_mod" noEntry="true" posX="62" posY="4" sqlTabName="prtb00016" tabIndex="5" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="14" name="label6" posX="3" posY="5" text="Fecha Creacion"/>
|
||||
<Edit colName="fech_crea" fieldId="5" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="16" name="prtb00016.fech_crea" noEntry="true" posX="20" posY="5" sqlTabName="prtb00016" tabIndex="6" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="20" name="label7" posX="41" posY="5" text="Usuario Modificador"/>
|
||||
<Edit colName="fech_mod" fieldId="6" fieldType="TABLE_COLUMN" gridHeight="1" gridWidth="16" name="prtb00016.fech_mod" noEntry="true" posX="62" posY="5" sqlTabName="prtb00016" tabIndex="7" widget="Edit"/>
|
||||
</Grid>
|
||||
</Form>
|
||||
</ManagedForm>
|
||||
@@ -40,7 +40,7 @@
|
||||
<Label gridHeight="1" gridWidth="8" name="label2" posX="24" posY="1" text="FECHA FINAL"/>
|
||||
<DateEdit fieldId="16" gridHeight="1" gridWidth="13" name="fech_final" posX="33" posY="1" tabIndex="-1" title="dateedit2" widget="DateEdit"/>
|
||||
<Label gridHeight="1" gridWidth="6" name="label3" posX="47" posY="1" text="ESTADO "/>
|
||||
<ComboBox fieldId="17" gridHeight="1" gridWidth="12" items="ABIERTA, CERRADA" name="estado1" posX="54" posY="1" tabIndex="-1" title="combobox1" widget="ComboBox">
|
||||
<ComboBox fieldId="17" gridHeight="1" gridWidth="12" items="ABIERTA, CERRADA" name="estado1" notNull="true" posX="54" posY="1" tabIndex="-1" title="combobox1" widget="ComboBox">
|
||||
<Item lstrtext="false" name="ABIERTA" text="ABIERTA"/>
|
||||
<Item lstrtext="false" name="CERRADA" text="CERRADA"/>
|
||||
</ComboBox>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ManagedForm databaseName="smarmotech" fileVersion="40100" gstVersion="60003" name="ManagedForm" uid="{50926d70-025d-4be1-a15f-45acbf1b2888}">
|
||||
<AGSettings>
|
||||
<DynamicProperties version="4"/>
|
||||
</AGSettings>
|
||||
<Record name="record1" uid="{ae577ed1-a849-40c1-a3a8-3df0bfba35f6}">
|
||||
<RecordField colName="cotizacion_no" fieldIdRef="5" name="cotizacion_no" sqlTabName="formonly" uid="{34fb79d0-ea3c-45e5-bd43-bd2484db0e24}"/>
|
||||
<RecordField colName="num_oc" fieldIdRef="12" name="num_oc" sqlTabName="formonly" uid="{1b817c74-fb63-4453-9c9e-580cd0ebe8dd}"/>
|
||||
<RecordField colName="cerrada" fieldIdRef="10" name="cerrada" sqlTabName="formonly" uid="{a0ade89e-f809-4801-83fc-82267e75339d}"/>
|
||||
<RecordField colName="sec_vend" fieldIdRef="13" name="sec_vend" sqlTabName="formonly" uid="{532f53e9-4b3f-4c15-8919-c4afedd6e638}"/>
|
||||
<RecordField colName="historico" defaultValue="N" fieldIdRef="0" name="historico" sqlTabName="formonly" uid="{a297c185-81e7-4ae6-8988-2224946811de}"/>
|
||||
<RecordField colName="fecha" fieldIdRef="11" name="fecha" sqlTabName="formonly" sqlType="DATE" uid="{62430a14-a00f-413f-b6b1-766e90f9315e}"/>
|
||||
<RecordField colName="tipo_cliente" fieldIdRef="7" name="tipo_cliente" sqlTabName="formonly" uid="{7cf8df86-dc57-4cd8-9b40-6636785559c9}"/>
|
||||
<RecordField colName="sec_cliente" fieldIdRef="8" name="sec_cliente" sqlTabName="formonly" uid="{c77b4cbf-8ab9-4072-b566-5ce5401f170b}"/>
|
||||
<RecordField colName="nombre_cliente" fieldIdRef="6" name="nombre_cliente" sqlTabName="formonly" uid="{b775b626-23dd-4f6c-8fda-b729a1e40605}"/>
|
||||
<RecordField colName="telefono_r" fieldIdRef="9" name="telefono_r" sqlTabName="formonly" uid="{c545bc0e-23c1-465b-9688-5d5039b27597}"/>
|
||||
<RecordField colName="cod_n" fieldIdRef="1" name="cod_n" sqlTabName="formonly" uid="{a8bcc1fa-5503-4b65-8249-fdaa1e91c258}"/>
|
||||
<RecordField colName="cod_grupo" fieldIdRef="2" name="cod_grupo" sqlTabName="formonly" uid="{71e68d6d-8151-44c2-a42c-4e9465dd3c2b}"/>
|
||||
<RecordField colName="cod_tipo" fieldIdRef="3" name="cod_tipo" sqlTabName="formonly" uid="{a5d7c1ab-90d7-4feb-b86d-6a74f1966b44}"/>
|
||||
<RecordField colName="cod_sec" fieldIdRef="4" name="cod_sec" sqlTabName="formonly" uid="{0fed854c-cd15-4a85-b593-c3a9f114d277}"/>
|
||||
<RecordField colName="salida" defaultValue="Detallado" fieldIdRef="14" name="salida" sqlTabName="formonly" uid="{72b478e3-81f8-4d24-ad49-d777be1c0608}"/>
|
||||
<RecordField colName="visualiza" defaultValue="PANTALLA" fieldIdRef="15" name="visualiza" sqlTabName="formonly" uid="{7c7aa938-7433-4dd6-bcc2-c27d6b3e2e34}"/>
|
||||
</Record>
|
||||
<Form gridHeight="10" gridWidth="67" name="prfmrp116" text="STATUS ORDENES PEDIDOS">
|
||||
<ActionDefaultList name="actiondefaultlist1">
|
||||
<ActionDefault image="print" name="ejecutar" text="Genera Reporte"/>
|
||||
</ActionDefaultList>
|
||||
<Grid gridHeight="10" gridWidth="67" name="grid1" posX="0" posY="0">
|
||||
<Label gridHeight="1" gridWidth="10" name="label1" posX="3" posY="0" text="Cotizacion"/>
|
||||
<Edit colName="cotizacion_no" comment="Digite un numero de cotizacion o deje en blanco para todas" fieldId="5" gridHeight="1" gridWidth="10" name="cotizacion_no" posX="19" posY="0" sqlTabName="formonly" tabIndex="1" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="5" name="label2" posX="3" posY="1" text="Orden"/>
|
||||
<Edit colName="num_oc" comment="Digite un numero de orden o deje en blanco para todas" fieldId="12" gridHeight="1" gridWidth="10" name="num_oc" posX="19" posY="1" sqlTabName="formonly" tabIndex="2" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="12" name="label3" posX="34" posY="1" text="Status Orden"/>
|
||||
<ComboBox colName="cerrada" fieldId="10" gridHeight="1" gridWidth="14" items="Cerrada, Abiertas" name="cerrada" notNull="true" posX="47" posY="1" sqlTabName="formonly" tabIndex="3" widget="ComboBox">
|
||||
<Item name="S" text="Cerrada"/>
|
||||
<Item name="N" text="Abiertas"/>
|
||||
</ComboBox>
|
||||
<Label gridHeight="1" gridWidth="8" name="label4" posX="3" posY="2" text="Vendedor"/>
|
||||
<Edit colName="sec_vend" comment="Digite un numero de vendedor o deje en blanco para todos" fieldId="13" gridHeight="1" gridWidth="10" name="sec_vend" posX="19" posY="2" sqlTabName="formonly" tabIndex="4" widget="Edit"/>
|
||||
<RadioGroup colName="historico" defaultValue="N" fieldId="0" gridHeight="1" gridWidth="26" items="HISTORICO, ACTUAL" name="historico" posX="35" posY="2" sqlTabName="formonly" tabIndex="5" widget="RadioGroup">
|
||||
<Item name="H" text="HISTORICO"/>
|
||||
<Item name="N" text="ACTUAL"/>
|
||||
</RadioGroup>
|
||||
<Label gridHeight="1" gridWidth="5" name="label5" posX="3" posY="3" text="Fecha"/>
|
||||
<DateEdit colName="fecha" fieldId="11" format="dd/mm/yyyy" gridHeight="1" gridWidth="10" name="fecha" posX="19" posY="3" sqlTabName="formonly" sqlType="DATE" tabIndex="6" widget="DateEdit"/>
|
||||
<Label gridHeight="1" gridWidth="15" name="label6" posX="3" posY="4" text="Codigo Cliente"/>
|
||||
<Edit colName="tipo_cliente" fieldId="7" gridHeight="1" gridWidth="3" name="tipo_cliente" posX="19" posY="4" sqlTabName="formonly" tabIndex="7" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="1" name="label7" posX="23" posY="4" text="-"/>
|
||||
<Edit colName="sec_cliente" fieldId="8" gridHeight="1" gridWidth="6" name="sec_cliente" posX="25" posY="4" sqlTabName="formonly" tabIndex="8" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="15" name="label8" posX="3" posY="5" text="Nombre Cliente"/>
|
||||
<Edit colName="nombre_cliente" comment="Utilice el simbolo (*) para buscar nombres similares al que desea" fieldId="6" gridHeight="1" gridWidth="47" name="nombre_cliente" posX="19" posY="5" sqlTabName="formonly" tabIndex="9" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="13" name="label9" posX="3" posY="6" text="Telefono Res."/>
|
||||
<Edit colName="telefono_r" fieldId="9" gridHeight="1" gridWidth="15" name="telefono_r" posX="19" posY="6" sqlTabName="formonly" tabIndex="10" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="8" name="label10" posX="3" posY="7" text="Producto"/>
|
||||
<Edit colName="cod_n" fieldId="1" gridHeight="1" gridWidth="5" name="cod_n" posX="19" posY="7" sqlTabName="formonly" tabIndex="11" widget="Edit"/>
|
||||
<Edit colName="cod_grupo" fieldId="2" gridHeight="1" gridWidth="6" name="cod_grupo" posX="26" posY="7" sqlTabName="formonly" tabIndex="12" widget="Edit"/>
|
||||
<Edit colName="cod_tipo" fieldId="3" gridHeight="1" gridWidth="6" name="cod_tipo" posX="34" posY="7" sqlTabName="formonly" tabIndex="13" widget="Edit"/>
|
||||
<Edit colName="cod_sec" fieldId="4" gridHeight="1" gridWidth="7" name="cod_sec" posX="42" posY="7" sqlTabName="formonly" tabIndex="14" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="15" name="label11" posX="3" posY="8" text="Salida Reporte"/>
|
||||
<ComboBox colName="salida" defaultValue="Detallado" fieldId="14" gridHeight="1" gridWidth="15" items="Detallado, Resumido" name="salida" posX="19" posY="8" sqlTabName="formonly" tabIndex="15" widget="ComboBox">
|
||||
<Item name="prprrp116.4rp" text="Detallado"/>
|
||||
<Item name="prprrp016a.4rp" text="Resumido"/>
|
||||
</ComboBox>
|
||||
<Label gridHeight="1" gridWidth="13" name="label12" posX="3" posY="9" text="Visualizacion"/>
|
||||
<ComboBox colName="visualiza" defaultValue="PANTALLA" fieldId="15" gridHeight="1" gridWidth="15" items="PANTALLA, ACROBAT READER, EXCEL" name="visualiza" posX="19" posY="9" sqlTabName="formonly" tabIndex="16" widget="ComboBox">
|
||||
<Item name="SVG" text="PANTALLA"/>
|
||||
<Item name="PDF" text="ACROBAT READER"/>
|
||||
<Item name="XLSX" text="EXCEL"/>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Form>
|
||||
</ManagedForm>
|
||||
@@ -48,7 +48,7 @@ DATEEDIT f1 = formonly.fecha type date,format = "dd/mm/yyyy";
|
||||
o1 = formonly.num_oc,comments="Digite un numero de orden o deje en blanco para todas";
|
||||
v1 = formonly.sec_vend,comments="Digite un numero de vendedor o deje en blanco para todos";
|
||||
COMBOBOX s=formonly.salida,ITEMS=(("prprrp116.4rp","Detallado"),("prprrp016a.4rp","Resumido")),default="Detallado";
|
||||
COMBOBOX v=formonly.visualiza,ITEMS=(("SVG","PANTALLA"),("PDF","ACROBAT READER")),default="PANTALLA";
|
||||
COMBOBOX v=formonly.visualiza,ITEMS=(("SVG","PANTALLA"),("PDF","ACROBAT READER"),("XLSX","EXCEL")),default="PANTALLA";
|
||||
instructions
|
||||
delimiters " "
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
END RECORD,
|
||||
nombre_cia STRING
|
||||
FUNCTION impresion(pnumoc)
|
||||
FUNCTION impresion_oc(pnumoc)
|
||||
DEFINE pnumoc,I INT
|
||||
|
||||
DECLARE busca_orden CURSOR FOR
|
||||
|
||||
@@ -32,7 +32,8 @@ FUNCTION imprime (datos_c, arr_costos)
|
||||
codigo_bloque LIKE cttb00003.codigo_bloque,
|
||||
turno SMALLINT,
|
||||
depto_receptor SMALLINT,
|
||||
ref INT
|
||||
ref INT,
|
||||
num_oc INT
|
||||
END RECORD
|
||||
|
||||
DEFINE nombre, descripcion, movimiento, departamento, turno, maquina, depto_receptor STRING
|
||||
@@ -125,7 +126,8 @@ REPORT p_diaria(datos_c, arr_costos, nombre, descripcion, movimiento, departamen
|
||||
codigo_bloque LIKE cttb00003.codigo_bloque,
|
||||
turno SMALLINT,
|
||||
depto_receptor SMALLINT,
|
||||
ref INT
|
||||
ref INT,
|
||||
num_oc INT
|
||||
END RECORD
|
||||
|
||||
DEFINE nombre, descripcion, movimiento, departamento, descrip_turno,
|
||||
|
||||
@@ -71,7 +71,9 @@ DEFINE hoy DATE
|
||||
END INPUT
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente,
|
||||
a.num_oc,a.fecha
|
||||
a.num_oc,a.fecha_oc
|
||||
FROM tipo_cliente,sec_cliente,
|
||||
num_oc,fecha
|
||||
|
||||
AFTER CONSTRUCT
|
||||
IF tipo_orden = 'N' THEN
|
||||
|
||||
@@ -57,15 +57,6 @@ GLOBALS
|
||||
nombre LIKE vetb00004.nombre
|
||||
END RECORD
|
||||
|
||||
DEFINE arrprtb08 DYNAMIC ARRAY OF RECORD
|
||||
cod_n_c LIKE prtb00008.cod_n,
|
||||
cod_grupo_c LIKE prtb00008.cod_grupo,
|
||||
cod_tipo_c LIKE prtb00008.cod_tipo,
|
||||
cod_sec_c LIKE prtb00008.cod_sec,
|
||||
cantidad_c LIKE prtb00008.cantidad ,
|
||||
descrip_esp_c LIKE intb00001.descrip_esp,
|
||||
unidad_c LIKE intb00001.unidad_med
|
||||
END RECORD
|
||||
|
||||
DEFINE nombre_dia DYNAMIC ARRAY OF char(10)
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ FUNCTION prprmt003()
|
||||
|
||||
CLEAR SCREEN
|
||||
|
||||
OPEN FORM prfmmt003 FROM "prfmmt003"
|
||||
DISPLAY FORM prfmmt003
|
||||
OPEN FORM prfmmt003pr FROM "prfmmt003pr"
|
||||
DISPLAY FORM prfmmt003pr
|
||||
DISPLAY "Registro de Produccion Diaria" AT 4,25
|
||||
DISPLAY "prprmt003" AT 4,3
|
||||
# CALL pantalla1()
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "prprgb000.4gl"
|
||||
|
||||
DEFINE arrprtb08 DYNAMIC ARRAY OF RECORD
|
||||
cod_n_c LIKE prtb00008.cod_n,
|
||||
cod_grupo_c LIKE prtb00008.cod_grupo,
|
||||
cod_tipo_c LIKE prtb00008.cod_tipo,
|
||||
cod_sec_c LIKE prtb00008.cod_sec,
|
||||
cantidad_c LIKE prtb00008.cantidad,
|
||||
descrip_esp_c LIKE intb00001.descrip_esp,
|
||||
unidad_c LIKE intb00001.unidad_med
|
||||
END RECORD
|
||||
DEFINE nombre LIKE vetb00004.nombre,
|
||||
descrip_esp_c,descrip_esp LIKE iptb00002.descrip_esp,
|
||||
unidad LIKE iptb00002.unidad_med,
|
||||
@@ -41,10 +51,11 @@ END MAIN
|
||||
FORM LINE 9,
|
||||
ERROR LINE 23,
|
||||
COMMENT LINE 21
|
||||
CALL pantalla()
|
||||
# (pantalla() es el encabezado de la pantalla de texto antigua; no aplica en GUI)
|
||||
OPEN FORM ctfmmt006 FROM "prfmmt006"
|
||||
DISPLAY FORM ctfmmt006
|
||||
CALL pantalla()
|
||||
CALL ui.Window.getCurrent().setText("Ordenes de Produccion")
|
||||
# (pantalla() es el encabezado de la pantalla de texto antigua; no aplica en GUI)
|
||||
DISPLAY "prprmt006" AT 4,3
|
||||
DISPLAY "Ordenes De Produccion" AT 6,32
|
||||
|
||||
@@ -280,13 +291,13 @@ FUNCTION prpcad006()
|
||||
b.cod_sec = prtb07.cod_sec AND
|
||||
a.num_oc = b.num_oc
|
||||
LET idx = 1
|
||||
FOREACH buscame INTO prtb08[idx].*
|
||||
FOREACH buscame INTO arrprtb08[idx].*
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
|
||||
CALL set_count(idx-1)
|
||||
}
|
||||
INPUT ARRAY prtb08 FROM s_orden.*
|
||||
INPUT ARRAY arrprtb08 FROM s_orden.*
|
||||
|
||||
ON KEY(CONTROL-W)
|
||||
CALL busca_material()
|
||||
@@ -295,13 +306,13 @@ FUNCTION prpcad006()
|
||||
LET scr_l = scr_line()
|
||||
AFTER FIELD cod_sec_c
|
||||
LET descrip_esp_c = NULL
|
||||
IF prtb08[curr].cod_sec_c IS NOT NULL THEN
|
||||
IF arrprtb08[curr].cod_sec_c IS NOT NULL THEN
|
||||
SELECT a.descrip_esp,a.unidad_med INTO descrip_esp_c,unidad_c
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = prtb08[curr].cod_n_c AND
|
||||
a.cod_grupo = prtb08[curr].cod_grupo_c AND
|
||||
a.cod_tipo = prtb08[curr].cod_tipo_c AND
|
||||
a.cod_sec = prtb08[curr].cod_sec_c AND
|
||||
WHERE a.cod_n = arrprtb08[curr].cod_n_c AND
|
||||
a.cod_grupo = arrprtb08[curr].cod_grupo_c AND
|
||||
a.cod_tipo = arrprtb08[curr].cod_tipo_c AND
|
||||
a.cod_sec = arrprtb08[curr].cod_sec_c AND
|
||||
a.status_t IS NULL
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 3
|
||||
@@ -309,15 +320,15 @@ FUNCTION prpcad006()
|
||||
NEXT FIELD cod_n_c
|
||||
END IF
|
||||
END IF
|
||||
LET prtb08[curr].descrip_esp_c = descrip_esp_c
|
||||
LET prtb08[curr].unidad_c = unidad_c
|
||||
DISPLAY prtb08[curr].descrip_esp_c TO s_orden[scr_l].descrip_esp_c
|
||||
LET arrprtb08[curr].descrip_esp_c = descrip_esp_c
|
||||
LET arrprtb08[curr].unidad_c = unidad_c
|
||||
DISPLAY arrprtb08[curr].descrip_esp_c TO s_orden[scr_l].descrip_esp_c
|
||||
ATTRIBUTE(BLUE)
|
||||
DISPLAY prtb08[curr].unidad_c TO s_orden[scr_l].unidad_c
|
||||
DISPLAY arrprtb08[curr].unidad_c TO s_orden[scr_l].unidad_c
|
||||
ATTRIBUTE(BLUE)
|
||||
AFTER FIELD cantidad_c
|
||||
IF prtb08[curr].cod_n_c IS NOT NULL THEN
|
||||
IF prtb08[curr].cantidad_c IS NULL THEN
|
||||
IF arrprtb08[curr].cod_n_c IS NOT NULL THEN
|
||||
IF arrprtb08[curr].cantidad_c IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad_c
|
||||
@@ -347,23 +358,23 @@ FUNCTION prpcad006()
|
||||
# SE ESTA VALIDANDO EL PRODUCTO TERMINADO EN EL CODIGO DE LA MATERIA PRIMA
|
||||
# PARA CUANDO LA ORDEN SEA PARA PRODUCTOS IMPORTADOS QUE NO TIENEN COMPOSICION
|
||||
|
||||
IF prtb08[1].cod_n_c IS NULL THEN
|
||||
LET prtb08[1].cod_n_c = prtb07.cod_n
|
||||
LET prtb08[1].cod_grupo_c = prtb07.cod_grupo
|
||||
LET prtb08[1].cod_tipo_c = prtb07.cod_tipo
|
||||
LET prtb08[1].cod_sec_c = prtb07.cod_Sec
|
||||
OUTPUT TO REPORT ordenes(prtb07.num_oc,prtb08[idx].*)
|
||||
IF arrprtb08[1].cod_n_c IS NULL THEN
|
||||
LET arrprtb08[1].cod_n_c = prtb07.cod_n
|
||||
LET arrprtb08[1].cod_grupo_c = prtb07.cod_grupo
|
||||
LET arrprtb08[1].cod_tipo_c = prtb07.cod_tipo
|
||||
LET arrprtb08[1].cod_sec_c = prtb07.cod_Sec
|
||||
OUTPUT TO REPORT ordenes(prtb07.num_oc,arrprtb08[idx].*)
|
||||
END IF
|
||||
FOR idx = 1 TO arr_count()
|
||||
IF prtb08[idx].cod_n_c IS NOT NULL THEN
|
||||
IF arrprtb08[idx].cod_n_c IS NOT NULL THEN
|
||||
INSERT INTO prtb00008 VALUES (prtb07.num_oc,
|
||||
prtb08[idx].cod_n_c,
|
||||
prtb08[idx].cod_grupo_c,
|
||||
prtb08[idx].cod_tipo_c,
|
||||
prtb08[idx].cod_sec_c,
|
||||
prtb08[idx].cantidad_c,
|
||||
arrprtb08[idx].cod_n_c,
|
||||
arrprtb08[idx].cod_grupo_c,
|
||||
arrprtb08[idx].cod_tipo_c,
|
||||
arrprtb08[idx].cod_sec_c,
|
||||
arrprtb08[idx].cantidad_c,
|
||||
SUSER_SNAME(),current,null,null)
|
||||
OUTPUT TO REPORT ordenes(prtb07.num_oc,prtb08[idx].*)
|
||||
OUTPUT TO REPORT ordenes(prtb07.num_oc,arrprtb08[idx].*)
|
||||
END IF
|
||||
END FOR
|
||||
FINISH REPORT ordenes
|
||||
@@ -534,24 +545,24 @@ LABEL sale9:
|
||||
END FUNCTION
|
||||
FUNCTION limpia()
|
||||
FOR idx = 1 TO 10
|
||||
LET prtb08[idx].cod_n_c = null
|
||||
LET prtb08[idx].cod_grupo_c = null
|
||||
LET prtb08[idx].cod_tipo_c = null
|
||||
LET prtb08[idx].cod_sec_c = null
|
||||
LET prtb08[idx].unidad_c = null
|
||||
LET prtb08[idx].cantidad_c = null
|
||||
LET prtb08[idx].descrip_esp_c = null
|
||||
LET arrprtb08[idx].cod_n_c = null
|
||||
LET arrprtb08[idx].cod_grupo_c = null
|
||||
LET arrprtb08[idx].cod_tipo_c = null
|
||||
LET arrprtb08[idx].cod_sec_c = null
|
||||
LET arrprtb08[idx].unidad_c = null
|
||||
LET arrprtb08[idx].cantidad_c = null
|
||||
LET arrprtb08[idx].descrip_esp_c = null
|
||||
END FOR
|
||||
FOR idx = 1 TO 5
|
||||
DISPLAY prtb08[idx].cod_n_c TO s_orden[idx].cod_n_c
|
||||
DISPLAY prtb08[idx].cod_grupo_c TO s_orden[idx].cod_grupo_c
|
||||
DISPLAY prtb08[idx].cod_tipo_c TO s_orden[idx].cod_tipo_c
|
||||
DISPLAY prtb08[idx].cod_sec_c TO s_orden[idx].cod_sec_c
|
||||
DISPLAY prtb08[idx].cantidad_c TO s_orden[idx].cantidad_c
|
||||
DISPLAY arrprtb08[idx].cod_n_c TO s_orden[idx].cod_n_c
|
||||
DISPLAY arrprtb08[idx].cod_grupo_c TO s_orden[idx].cod_grupo_c
|
||||
DISPLAY arrprtb08[idx].cod_tipo_c TO s_orden[idx].cod_tipo_c
|
||||
DISPLAY arrprtb08[idx].cod_sec_c TO s_orden[idx].cod_sec_c
|
||||
DISPLAY arrprtb08[idx].cantidad_c TO s_orden[idx].cantidad_c
|
||||
|
||||
DISPLAY prtb08[idx].descrip_esp_c TO s_orden[idx].descrip_esp_c
|
||||
DISPLAY arrprtb08[idx].descrip_esp_c TO s_orden[idx].descrip_esp_c
|
||||
ATTRIBUTE(BLUE)
|
||||
DISPLAY prtb08[idx].unidad_c TO s_orden[idx].unidad_c
|
||||
DISPLAY arrprtb08[idx].unidad_c TO s_orden[idx].unidad_c
|
||||
ATTRIBUTE(BLUE)
|
||||
|
||||
END FOR
|
||||
@@ -565,28 +576,28 @@ FUNCTION busca_detalle()
|
||||
WHERE a.num_oc = numero_oc
|
||||
|
||||
LET idx = 1
|
||||
FOREACH busca_d INTO prtb08[idx].*
|
||||
FOREACH busca_d INTO arrprtb08[idx].*
|
||||
SELECT a.descrip_esp,a.unidad_med INTO descrip_esp_c,unidad_c
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = prtb08[idx].cod_n_c AND
|
||||
a.cod_grupo = prtb08[idx].cod_grupo_c AND
|
||||
a.cod_tipo = prtb08[idx].cod_tipo_c AND
|
||||
a.cod_sec = prtb08[idx].cod_sec_c AND
|
||||
WHERE a.cod_n = arrprtb08[idx].cod_n_c AND
|
||||
a.cod_grupo = arrprtb08[idx].cod_grupo_c AND
|
||||
a.cod_tipo = arrprtb08[idx].cod_tipo_c AND
|
||||
a.cod_sec = arrprtb08[idx].cod_sec_c AND
|
||||
a.status_t IS NULL
|
||||
IF idx > 5 THEN
|
||||
EXIT FOREACH
|
||||
END IF
|
||||
LET prtb08[idx].descrip_esp_c = descrip_esp_c
|
||||
LET prtb08[idx].unidad_c = unidad_c
|
||||
DISPLAY prtb08[idx].cod_n_c TO s_orden[idx].cod_n_c
|
||||
DISPLAY prtb08[idx].cod_grupo_c TO s_orden[idx].cod_grupo_c
|
||||
DISPLAY prtb08[idx].cod_tipo_c TO s_orden[idx].cod_tipo_c
|
||||
DISPLAY prtb08[idx].cod_sec_c TO s_orden[idx].cod_sec_c
|
||||
DISPLAY prtb08[idx].cantidad_c TO s_orden[idx].cantidad_c
|
||||
LET arrprtb08[idx].descrip_esp_c = descrip_esp_c
|
||||
LET arrprtb08[idx].unidad_c = unidad_c
|
||||
DISPLAY arrprtb08[idx].cod_n_c TO s_orden[idx].cod_n_c
|
||||
DISPLAY arrprtb08[idx].cod_grupo_c TO s_orden[idx].cod_grupo_c
|
||||
DISPLAY arrprtb08[idx].cod_tipo_c TO s_orden[idx].cod_tipo_c
|
||||
DISPLAY arrprtb08[idx].cod_sec_c TO s_orden[idx].cod_sec_c
|
||||
DISPLAY arrprtb08[idx].cantidad_c TO s_orden[idx].cantidad_c
|
||||
|
||||
DISPLAY prtb08[idx].descrip_esp_c TO s_orden[idx].descrip_esp_c
|
||||
DISPLAY arrprtb08[idx].descrip_esp_c TO s_orden[idx].descrip_esp_c
|
||||
ATTRIBUTE(BLUE)
|
||||
DISPLAY prtb08[idx].unidad_c TO s_orden[idx].unidad_c
|
||||
DISPLAY arrprtb08[idx].unidad_c TO s_orden[idx].unidad_c
|
||||
ATTRIBUTE(BLUE)
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
|
||||
@@ -64,7 +64,7 @@ GLOBALS "prprgb000.4gl"
|
||||
nombre_vend,nombres,apellidos CHAR(40),fcalle CHAR(25),
|
||||
fcasa_num CHAR(5), fbarrio,furbanizacion CHAR(15),
|
||||
monto_desc,total1,p_costos1,total_i,total_mo DECIMAL(12,2),
|
||||
ult_numero,cuenta INTEGER,
|
||||
ult_numero,cuenta,existe_oc INTEGER,
|
||||
vetb05 RECORD LIKE vetb00005.*,
|
||||
cuenta_p,ridx SMALLINT,
|
||||
pbalance1,pbalance2 DEC(12,2),
|
||||
@@ -798,19 +798,26 @@ FUNCTION prpcad008()
|
||||
# SE COLOCO QUE EL NUMERO SE GENERARA A PARTIR DEL 01/01/2003 HACIA ATRAS POR MODIFICACION DEL
|
||||
# SISTEMA Y LA INCLUSION DEL NCF A PARTIR DEL 01/01/2007
|
||||
# FECHA MODIFICACION: 11/01/2007
|
||||
SELECT num_oc INTO ult_numero FROM prtb00020
|
||||
IF nuevo = "S" THEN
|
||||
IF ult_numero IS NULL THEN
|
||||
LET ult_numero = 0
|
||||
END IF
|
||||
LET ult_numero = ult_numero + 1
|
||||
LET prtb08.num_oc = ult_numero
|
||||
DISPLAY BY NAME prtb08.num_oc
|
||||
|
||||
UPDATE prtb00020 set num_oc = ult_numero,
|
||||
# CONSECUTIVO ATOMICO: el UPDATE incrementa y bloquea la fila de prtb00020
|
||||
# hasta el COMMIT, asi dos usuarios no pueden tomar el mismo num_oc
|
||||
# (antes se leia y luego se escribia -> PK_prtb00012 duplicada)
|
||||
BEGIN WORK
|
||||
UPDATE prtb00020 SET num_oc = ISNULL(num_oc, 0) + 1,
|
||||
us_crea = SUSER_SNAME(),
|
||||
fech_crea = GETDATE()
|
||||
|
||||
SELECT num_oc INTO ult_numero FROM prtb00020
|
||||
# AUTOCORRECCION: si el contador quedo por detras de prtb00012, salta al siguiente libre
|
||||
LET existe_oc = 0
|
||||
SELECT COUNT(*) INTO existe_oc FROM prtb00012 WHERE num_oc = ult_numero
|
||||
IF existe_oc > 0 THEN
|
||||
SELECT MAX(num_oc) + 1 INTO ult_numero FROM prtb00012
|
||||
UPDATE prtb00020 SET num_oc = ult_numero
|
||||
END IF
|
||||
COMMIT WORK
|
||||
LET prtb08.num_oc = ult_numero
|
||||
DISPLAY BY NAME prtb08.num_oc
|
||||
|
||||
{ CALL defecto(usuarios,clave,impresor) RETURNING imprime,negrilla_on,negrillas_of,
|
||||
doble_on,doble_off,comp_on,comp_off,
|
||||
doce,normal,archivo,copia1
|
||||
@@ -851,9 +858,8 @@ CALL seleccionarsalida() RETURNING r_output
|
||||
fech_crea = GETDATE()
|
||||
WHERE @num_oc = prtb09.num_oc
|
||||
|
||||
UPDATE prtb00020 SET num_oc = ult_numero,
|
||||
us_Crea = SUSER_SNAME(),
|
||||
fech_crea = GETDATE()
|
||||
# (se elimino la re-escritura de prtb00020 aqui: el consecutivo ya se tomo
|
||||
# arriba de forma atomica y re-escribirlo podia retroceder el contador)
|
||||
|
||||
# ACTUALIZA NUMERO TEMPORAL PARA EL DESPIECE
|
||||
UPDATE prtb00022 SET num_oc = prtb08.num_oc WHERE num_oc = tmpnumero
|
||||
|
||||
@@ -249,7 +249,7 @@ FUNCTION prpcmf010()
|
||||
CALL msg(numero_msg)
|
||||
|
||||
## AQUI SE ELIMINAN LOS REGISTROS
|
||||
COMMAND KEY ("L") "eLiminar"
|
||||
COMMAND KEY ("L") "Eliminar"
|
||||
UPDATE prtb00016 SET status_t = "E"
|
||||
WHERE a.area_num = prtb16.area_num
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ FUNCTION prprmt011()
|
||||
--fechaSolDespacho
|
||||
|
||||
OPEN WINDOW prfmmt011 AT 10,10 WITH FORM "prfmmt011"
|
||||
CALL ui.Window.getCurrent().setText("Administracion Ordenes")
|
||||
#WHENEVER ERROR CONTINUE
|
||||
|
||||
LET w = ui.Window.getCurrent()
|
||||
@@ -201,7 +202,7 @@ FUNCTION prprmt011()
|
||||
IF busqueda IS NULL THEN
|
||||
LET selec1 =
|
||||
" SELECT 'N', x.cerrada, x1.estado_produccion,x1.estado_producto,x1.departamento,x3.nom_dpto,RTRIM(CAST(x.sec_vend AS CHAR)) + ' ' + RTRIM(b.nom1_emp), b.apell1_emp, ",
|
||||
" CONVERT(CHAR(10), x.fecha_oc,103) AS fecha_orden , CONVERT(char(10),x1.fecha_compromiso,103) ,x1.fecha_llegada, x1.fecha_disp_entrega, ",
|
||||
" x.fecha_oc AS fecha_orden , x1.fecha_compromiso ,x1.fecha_llegada, x1.fecha_disp_entrega, ",
|
||||
" x1.fecha_solic_despacho, x1.fecha_instalacion, x.cotizacion_no, x.num_oc,x5.num_oc, x.observacion,g.descripcion, CAST(e.tipo_cliente AS CHAR(2)) ",
|
||||
" + '-' + CAST(e.sec_cliente AS CHAR(6)) + ' ' + RTRIM(e.nombre) ,x4.descripcion, CAST(x1.cod_n AS VARCHAR(4)) + '-' + CAST(x1.cod_grupo AS VARCHAR(4)) ",
|
||||
" + '-' + CAST(x1.cod_tipo AS VARCHAR(4)) + '-' + CAST(x1.cod_sec AS VARCHAR(7)) + ' ' + RTRIM(x2.descrip_esp), ",
|
||||
@@ -243,7 +244,7 @@ FUNCTION prprmt011()
|
||||
END IF
|
||||
LET selec1 =
|
||||
" SELECT 'N', x.cerrada, x1.estado_produccion,x1.estado_producto,x1.departamento,x3.nom_dpto,RTRIM(CAST(x.sec_vend AS CHAR)) + ' ' + RTRIM(b.nom1_emp), b.apell1_emp, ",
|
||||
" CONVERT(CHAR(10), x.fecha_oc,103) AS fecha_orden , CONVERT(char(10),x1.fecha_compromiso,103) ,
|
||||
" x.fecha_oc AS fecha_orden , x1.fecha_compromiso ,
|
||||
x1.fecha_llegada,x1.fecha_disp_entrega, ",
|
||||
" x1.fecha_solic_despacho, x1.fecha_instalacion, x.cotizacion_no, x.num_oc,x5.num_oc, x.observacion,g.descripcion, CAST(e.tipo_cliente AS CHAR(2)) ",
|
||||
" + '-' + CAST(e.sec_cliente AS CHAR(6)) + ' ' + RTRIM(e.nombre) ,x4.descripcion, CAST(x1.cod_n AS VARCHAR(4)) + '-' + CAST(x1.cod_grupo AS VARCHAR(4)) ",
|
||||
@@ -281,7 +282,7 @@ FUNCTION prprmt011()
|
||||
IF actualiza_log_produccion="SI" THEN
|
||||
LET selec1=
|
||||
" SELECT 'N', x.cerrada, x1.estado_produccion,x1.departamento,x3.nom_dpto,RTRIM(CAST(x.sec_vend AS CHAR)) + ' ' + RTRIM(b.nom1_emp), b.apell1_emp, ",
|
||||
" CONVERT(CHAR(10), x.fecha_oc,103) AS fecha_orden , CONVERT(char(10),x1.fecha_compromiso,103) ,' ', x.cotizacion_no, x.num_oc, x.observacion,g.descripcion, CAST(e.tipo_cliente AS CHAR(2)) ",
|
||||
" x.fecha_oc AS fecha_orden , x1.fecha_compromiso ,' ', x.cotizacion_no, x.num_oc, x.observacion,g.descripcion, CAST(e.tipo_cliente AS CHAR(2)) ",
|
||||
" + '-' + CAST(e.sec_cliente AS CHAR(6)) + ' ' + RTRIM(e.nombre) , CAST(x1.cod_n AS VARCHAR(4)) + '-' + CAST(x1.cod_grupo AS VARCHAR(4)) ",
|
||||
" + '-' + CAST(x1.cod_tipo AS VARCHAR(4)) + '-' + CAST(x1.cod_sec AS VARCHAR(4)) + ' ' + RTRIM(x2.descrip_esp), ",
|
||||
" SUM(x1.cantidad), '0' , '0' , '0' , x.sec_vend, x1.cod_n, x1.cod_grupo, x1.cod_tipo, x1.cod_Sec, e.tipo_cliente, e.sec_cliente, ",
|
||||
@@ -440,7 +441,7 @@ FUNCTION prprmt011()
|
||||
IF veces > 1 THEN
|
||||
LET att[idx].col7 = 'blue reverse'
|
||||
ELSE
|
||||
SELECT CONVERT(CHAR(10),a.fecha_llegada,103) INTO arr_ordenes[idx].fecha_llegada
|
||||
SELECT a.fecha_llegada INTO arr_ordenes[idx].fecha_llegada
|
||||
FROM cctb00026 a
|
||||
WHERE a.num_oc = arr_ordenes[idx].num_oc AND
|
||||
a.cod_n = arr_ordenes[idx].cod_n AND
|
||||
@@ -1091,7 +1092,7 @@ FUNCTION fparciales(xnum_oc,xcodn,xcodgrupo,xcodtipo,xcodsec,xfecha,xproducto)
|
||||
|
||||
|
||||
DECLARE busca_parcial CURSOR FOR
|
||||
SELECT CONVERT(CHAR(10),a.fecha_compromiso,103),a.cantidad FROM prtb00028 a
|
||||
SELECT a.fecha_compromiso,a.cantidad FROM prtb00028 a
|
||||
WHERE a.num_oc = xnum_oc AND
|
||||
a.cod_n = xcodn AND
|
||||
a.cod_grupo = xcodgrupo AND
|
||||
@@ -1313,7 +1314,7 @@ FUNCTION vepcmf008(num_cotizacion)
|
||||
LET SELEC = " SELECT DISTINCT a.cod_cia,a.ventas,a.cotizacion_no,a.tipo_cliente,a.sec_cliente,a.nombre_cliente, " ||
|
||||
" a.rnc,a.nombre_proyecto,a.direccion_cliente,a.cod_provincia,a.direccion_proyecto, " ||
|
||||
" a.telefono_r,a.telefono_o,a.email,a.tipo_precio,a.beeper,a.celular,a.prima,a.fax1,a.celular1, " ||
|
||||
" a.fax, CONVERT(CHAR(10),a.fecha,103),CONVERT(CHAR(10),a.fecha_entrega,103), " ||
|
||||
" a.fax, a.fecha,a.fecha_entrega, " ||
|
||||
" a.plazo_entrega,a.comentario,a.contacto, a.cond_pago,a.sec_Vend,a.porc_itbi," ||
|
||||
" a.total_bruto,a.sub_total,a.monto_Desc,a.monto_itbi,a.total_neto,a.monto_dolar,a.num_emp_inst, " ||
|
||||
" a.codigo_dgii,a.tipo_ncf,a.cliente_generico,a.sec_vend_aux,a.codigo,a.cod_zona,a.sincronizado, "||
|
||||
|
||||
@@ -54,7 +54,7 @@ FUNCTION prprmt020()
|
||||
|
||||
OPEN WINDOW w1 WITH FORM "prfmmt012"
|
||||
DIALOG ATTRIBUTES(UNBUFFERED,FIELD ORDER FORM)
|
||||
INPUT BY NAME prtb09.num_oc
|
||||
INPUT BY NAME prtb08.num_oc
|
||||
|
||||
BEFORE INPUT
|
||||
LET d_tipos="PDF"
|
||||
@@ -86,7 +86,7 @@ FUNCTION prprmt020()
|
||||
AFTER FIELD num_oc
|
||||
SELECT a.cotizacion_no,b.nombre,a.sec_vend,ISNULL(c.nom1_emp,' ')+ISNULL(c.apell1_emp,' '),
|
||||
a.tipo_cliente,a.sec_cliente
|
||||
INTO prtb09.cotizacion_no,nombre_cliente,psec_vend,vendedor,
|
||||
INTO prtb08.cotizacion_no,nombre_cliente,psec_vend,vendedor,
|
||||
prtb08.tipo_cliente,prtb08.sec_cliente
|
||||
FROM prtb00012 a,vetb00004 b,adtb00003 c
|
||||
WHERE a.num_oc = prtb08.num_oc AND
|
||||
|
||||
@@ -177,7 +177,7 @@ END RECORD
|
||||
" ORDEN ECOMMERCE ",orden_externa USING "&&&&&&&"
|
||||
INPUT ARRAY detalle FROM sdetalle.* ATTRIBUTE(WITHOUT DEFAULTS)
|
||||
ON ACTION impresion ATTRIBUTE(TEXT="Orden",IMAGE="printer")
|
||||
CALL impresion(pnum_oc)
|
||||
CALL impresion_oc(pnum_oc)
|
||||
ON ACTION etiqueta ATTRIBUTE(TEXT="Label",IMAGE="fa-tag")
|
||||
LET datos.celular = orden.celular
|
||||
LET datos.cliente = orden.nombre_envio
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<LAYOUTNODE name="Layout Node9" y="max-33.3652" width="214.531" length="26.3906" anchorY="1" alignment="center" layoutDirection="topToBottom" floatingBehavior="free">
|
||||
<WORDBOX name="WordBox34" width="213.984" length="14.3281" alignment="far" fontSize="20" fontBold="true" underline="true" layoutDirection="topToBottom" baselineType="leftleft" textAlignment="center" text="ANÁLISIS PRODUCCIÓN" trimText="both"/>
|
||||
</LAYOUTNODE>
|
||||
<IMAGEBOX name="ImageBox1_1" y="6.5535" width="230.836" length="92.4741" floatingBehavior="enclosed" url="file:///F:/MARMOTECHC/IMAGENES/logo.png" intendedResolution="120"/>
|
||||
<IMAGEBOX name="ImageBox1_1" y="6.5535" width="230.836" length="92.4741" floatingBehavior="enclosed" url="IMAGENES/Logo.png" intendedResolution="120"/>
|
||||
<rtl:input-variable name="fecha_reporte" type="FGLString" expectedLocation="expectedAhead"/>
|
||||
<WORDBOX name="fecha_reporte Value1" class="grwDateValue" x="4.0943" y="414.196" width="103.969" anchorX="0" anchorY="0" floatingBehavior="enclosed" textAlignment="right" text="{{fecha_reporte}}"/>
|
||||
</MINIPAGE>
|
||||
|
||||
@@ -79,6 +79,8 @@ FUNCTION prprrp016()
|
||||
END RECORD,
|
||||
salida,visualiza CHAR(20)
|
||||
|
||||
DEFINE hay_datos SMALLINT
|
||||
|
||||
OPTIONS
|
||||
PROMPT LINE 23,
|
||||
FORM LINE 8,
|
||||
@@ -201,12 +203,46 @@ FUNCTION prprrp016()
|
||||
"WHERE ",criterio clipped,
|
||||
" and a.status_t is null and f.status_t is null "
|
||||
|
||||
END IF
|
||||
END IF
|
||||
PREPARE comando FROM selec
|
||||
DECLARE busca CURSOR FOR comando
|
||||
|
||||
-- Verifica primero si hay registros: si el reporte se inicia sin filas,
|
||||
-- el motor de reportes falla al no poder resolver p_compania.nombre
|
||||
-- (variable "look ahead" del encabezado) porque nunca se llega a imprimir nada.
|
||||
OPEN busca
|
||||
FETCH busca INTO busqueda.cotizacion_no,busqueda.fecha,busqueda.tipo_cliente,
|
||||
busqueda.sec_cliente,busqueda.nombre_proyecto,busqueda.direccion_proyecto,
|
||||
busqueda.telefono_r,busqueda.nombre,busqueda.num_oc,busqueda.fecha_oc,
|
||||
busqueda.fecha_entrega,busqueda.fecha_cierre,busqueda.cod_n,
|
||||
busqueda.cod_grupo,busqueda.cod_tipo,busqueda.cod_sec,
|
||||
busqueda.descrip_esp,busqueda.unidad_med,busqueda.cantidad,
|
||||
busqueda.precio,busqueda.cantidad_2,busqueda.cod_mov,
|
||||
busqueda.fecha_doc,busqueda.documento,busqueda.status_mov,
|
||||
busqueda.simbolo,busqueda.vendedor,busqueda.monto_cotizacion,
|
||||
busqueda.condicion,busqueda.estado_orden,busqueda.telefono,
|
||||
busqueda.celular,busqueda.email,busqueda.contacto
|
||||
IF STATUS = NOTFOUND THEN
|
||||
CALL fgl_winmessage("WARNING","NO EXISTEN REGISTROS CON ESA CONDICION","SOP")
|
||||
LET hay_datos = FALSE
|
||||
ELSE
|
||||
LET hay_datos = TRUE
|
||||
END IF
|
||||
|
||||
# El formulario solo guarda el texto visible del combo (no el valor interno
|
||||
# que tenia el .per original), asi que aqui se traduce de vuelta.
|
||||
CASE salida CLIPPED
|
||||
WHEN "Detallado" LET salida = "prprrp116.4rp"
|
||||
WHEN "Resumido" LET salida = "prprrp016a.4rp"
|
||||
END CASE
|
||||
CASE visualiza CLIPPED
|
||||
WHEN "PANTALLA" LET visualiza = "SVG"
|
||||
WHEN "ACROBAT READER" LET visualiza = "PDF"
|
||||
WHEN "EXCEL" LET visualiza = "XLSX"
|
||||
END CASE
|
||||
|
||||
LET r_filename = salida CLIPPED
|
||||
|
||||
|
||||
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
||||
LET r_output=visualiza CLIPPED
|
||||
LET preview=1
|
||||
@@ -216,30 +252,13 @@ FUNCTION prprrp016()
|
||||
END IF
|
||||
|
||||
|
||||
IF handler IS NOT NULL THEN -- report engine was configured ok
|
||||
IF handler IS NOT NULL AND hay_datos THEN -- report engine was configured ok and there is data to print
|
||||
|
||||
START REPORT reporte_16 TO XML HANDLER handler
|
||||
|
||||
|
||||
|
||||
FOREACH busca INTO busqueda.cotizacion_no,busqueda.fecha,busqueda.tipo_cliente,
|
||||
busqueda.sec_cliente,busqueda.nombre_proyecto,busqueda.direccion_proyecto,
|
||||
busqueda.telefono_r,busqueda.nombre,busqueda.num_oc,busqueda.fecha_oc,
|
||||
busqueda.fecha_entrega,busqueda.fecha_cierre,busqueda.cod_n,
|
||||
busqueda.cod_grupo,busqueda.cod_tipo,busqueda.cod_sec,
|
||||
busqueda.descrip_esp,busqueda.unidad_med,busqueda.cantidad,
|
||||
busqueda.precio,busqueda.cantidad_2,busqueda.cod_mov,
|
||||
busqueda.fecha_doc,busqueda.documento,busqueda.status_mov,
|
||||
busqueda.simbolo,busqueda.vendedor,busqueda.monto_cotizacion,
|
||||
busqueda.condicion,busqueda.estado_orden,busqueda.telefono,
|
||||
busqueda.celular,busqueda.email,busqueda.contacto
|
||||
|
||||
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
CALL fgl_winmessage("WARNING","NO EXISTEN REGISTROS CON ESA CONDICION","SOP")
|
||||
EXIT FOREACH
|
||||
END IF
|
||||
-- La primera fila ya fue leida arriba (para saber si hay_datos); aqui se
|
||||
-- procesa esa fila y se sigue con FETCH manual hasta agotar el cursor.
|
||||
WHILE hay_datos
|
||||
IF busqueda.cantidad_2 IS NULL THEN
|
||||
LET busqueda.cantidad_2 = 0
|
||||
END IF
|
||||
@@ -247,7 +266,7 @@ IF handler IS NOT NULL THEN -- report engine was configured ok
|
||||
LET busqueda.fecha_avance= NULL
|
||||
LET busqueda.monto_avance = NULL
|
||||
|
||||
SELECT MAX(a.num_doc),MAX(a.fecha_orig)
|
||||
SELECT MAX(a.num_doc),MAX(a.fecha_orig)
|
||||
INTO busqueda.avance,busqueda.fecha_avance,
|
||||
busqueda.monto_avance
|
||||
FROM cctb00001 a
|
||||
@@ -255,7 +274,7 @@ IF handler IS NOT NULL THEN -- report engine was configured ok
|
||||
a.tipo_Doc = 'AV' and a.tipo_cliente = busqueda.tipo_cliente and
|
||||
a.sec_cliente = busqueda.sec_cliente and a.status_t is null and
|
||||
a.fecha_orig > '08/01/2009'
|
||||
|
||||
|
||||
LET busqueda.codigo = busqueda.cod_n using "&&&&","-",
|
||||
busqueda.cod_grupo USING "&&&&","-",
|
||||
busqueda.cod_tipo USING "&&&&","-",
|
||||
@@ -266,11 +285,27 @@ IF handler IS NOT NULL THEN -- report engine was configured ok
|
||||
IF busqueda.estado_orden = "S" THEN
|
||||
LET busqueda.estado_orden = "CERRADA"
|
||||
END IF
|
||||
|
||||
|
||||
OUTPUT TO REPORT reporte_16(busqueda.*)
|
||||
END FOREACH
|
||||
|
||||
FETCH busca INTO busqueda.cotizacion_no,busqueda.fecha,busqueda.tipo_cliente,
|
||||
busqueda.sec_cliente,busqueda.nombre_proyecto,busqueda.direccion_proyecto,
|
||||
busqueda.telefono_r,busqueda.nombre,busqueda.num_oc,busqueda.fecha_oc,
|
||||
busqueda.fecha_entrega,busqueda.fecha_cierre,busqueda.cod_n,
|
||||
busqueda.cod_grupo,busqueda.cod_tipo,busqueda.cod_sec,
|
||||
busqueda.descrip_esp,busqueda.unidad_med,busqueda.cantidad,
|
||||
busqueda.precio,busqueda.cantidad_2,busqueda.cod_mov,
|
||||
busqueda.fecha_doc,busqueda.documento,busqueda.status_mov,
|
||||
busqueda.simbolo,busqueda.vendedor,busqueda.monto_cotizacion,
|
||||
busqueda.condicion,busqueda.estado_orden,busqueda.telefono,
|
||||
busqueda.celular,busqueda.email,busqueda.contacto
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET hay_datos = FALSE
|
||||
END IF
|
||||
END WHILE
|
||||
FINISH REPORT reporte_16
|
||||
END IF
|
||||
CLOSE busca
|
||||
|
||||
|
||||
AFTER DIALOG
|
||||
@@ -349,7 +384,7 @@ BEFORE GROUP OF x.cotizacion_no
|
||||
|
||||
PRINTX x.cotizacion_no,x.direccion_proyecto,x.nombre_proyecto,
|
||||
x.tipo_cliente,x.sec_cliente,x.telefono_r,x.num_oc,x.fecha,x.fecha_cierre,
|
||||
x.fecha_entrega,x.fecha_oc
|
||||
x.fecha_entrega,x.fecha_oc,p_compania.nombre
|
||||
|
||||
|
||||
BEFORE GROUP OF x.codigo
|
||||
|
||||
@@ -35,14 +35,16 @@
|
||||
<RecordField colName="" fieldIdRef="26" name="xnum_emp" sqlTabName="" table_alias_name="" uid="{cbe6a079-16f8-4d94-8834-508b8802f0eb}"/>
|
||||
<RecordField colName="" fieldIdRef="27" name="nombre_empleado" sqlTabName="" table_alias_name="" uid="{025a8c47-52a6-46a7-809d-068fce546410}"/>
|
||||
<RecordField colName="" fieldIdRef="28" name="bloque" sqlTabName="" table_alias_name="" uid="{1fdfddbb-c15b-430b-900a-277fe124636e}"/>
|
||||
<RecordField colName="" fieldIdRef="29" name="xnum_ocp" sqlTabName="" table_alias_name="" uid="{3b6f1c2e-8d4a-4f7b-9e21-6a5c0d9e7f11}"/>
|
||||
<RecordField colName="" fieldIdRef="30" name="proveedor" sqlTabName="" table_alias_name="" uid="{9c2e7a41-5b3d-4e8f-a1c6-2d7f8e0b4a22}"/>
|
||||
</Record>
|
||||
<Form gridHeight="31" gridWidth="163" name="acfmrp010" style="basic" text="ETIQUETAS">
|
||||
<Form gridHeight="33" gridWidth="163" name="acfmrp010" style="basic" text="ETIQUETAS">
|
||||
<ActionDefaultList name="ActionDefaultList1">
|
||||
<ActionDefault image="cancel" name="cancel" text="Cancela operacion"/>
|
||||
<ActionDefault image="find" name="busca" text="Busca informacion"/>
|
||||
<ActionDefault image="printer" name="imprime" text="Imprimir"/>
|
||||
</ActionDefaultList>
|
||||
<Grid gridHeight="28" gridWidth="163" name="Grid1" posX="0" posY="1">
|
||||
<Grid gridHeight="30" gridWidth="163" name="Grid1" posX="0" posY="1">
|
||||
<Group gridHeight="10" gridWidth="138" name="Group1" posX="1" posY="1" text="INFORMACIONES SOBRE EL TAMANO DE LA ETIQUETA E INVENTARIO">
|
||||
<Label posX="1" posY="1" text="INVENTARIO"/>
|
||||
<ComboBox aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="inventario" defaultValue="PRODUCTOS TERMINADOS" fieldId="9" gridHeight="1" gridWidth="43" include="ACTIVOS FIJOS|PRODUCTOS TERMINADOS|MATERIA PRIMA|REPUESTOS" items="ACTIVOS FIJOS, PRODUCTOS TERMINADOS, MATERIA PRIMA, REPUESTOS" name="inventario" posX="20" posY="1" sqlTabName="formonly" tabIndex="1" table_alias_name="" widget="ComboBox">
|
||||
@@ -99,7 +101,7 @@
|
||||
<Label posX="2" posY="4" text="DEPARTAMENTO"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="codigo_dp" fieldId="13" gridHeight="1" gridWidth="7" name="codigo_dp" posX="21" posY="4" sqlTabName="formonly" tabIndex="13" table_alias_name="" widget="Edit"/>
|
||||
</Group>
|
||||
<Group gridHeight="6" gridWidth="70" name="Group4" posX="70" posY="11" text="Informacion Orden">
|
||||
<Group gridHeight="8" gridWidth="70" name="Group4" posX="70" posY="11" text="Informacion Orden">
|
||||
<Label gridHeight="1" gridWidth="10" name="Label2" posX="3" posY="1" text="Orden"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="23" gridHeight="1" gridWidth="10" name="xnum_oc" posX="17" posY="1" sqlTabName="" tabIndex="25" table_alias_name="" title="Edit1" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="10" name="Label3" posX="3" posY="2" text="Cliente"/>
|
||||
@@ -109,8 +111,12 @@
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="27" gridHeight="1" gridWidth="40" name="nombre_empleado" posX="28" posY="3" sqlTabName="" tabIndex="28" table_alias_name="" title="Edit3" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="10" name="Label5" posX="3" posY="4" text="Bloque"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" case="upper" colName="" fieldId="28" gridHeight="1" gridWidth="27" name="bloque" posX="17" posY="4" scroll="true" sqlTabName="" tabIndex="29" table_alias_name="" title="Edit1" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="12" name="Label6" posX="3" posY="5" text="Orden Compra"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" comment="Orden de compra (cotb00014)" fieldId="29" gridHeight="1" gridWidth="10" name="xnum_ocp" posX="17" posY="5" sqlTabName="" tabIndex="30" table_alias_name="" title="Edit4" widget="Edit"/>
|
||||
<Label gridHeight="1" gridWidth="10" name="Label7" posX="3" posY="6" text="Proveedor"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="30" gridHeight="1" gridWidth="51" name="proveedor" posX="17" posY="6" sqlTabName="" tabIndex="31" table_alias_name="" title="Edit5" widget="Edit"/>
|
||||
</Group>
|
||||
<Group gridHeight="9" gridWidth="161" name="Group3" posX="1" posY="17" text="MEDIDAS, SOLO PARA MATERIA PRIMA O PRODUCTOS TERMINADOS">
|
||||
<Group gridHeight="9" gridWidth="161" name="Group3" posX="1" posY="19" text="MEDIDAS, SOLO PARA MATERIA PRIMA O PRODUCTOS TERMINADOS">
|
||||
<Table gridHeight="5" gridWidth="157" name="Table1" posX="2" posY="2" totalRows="4" unitWidth="characters" width="157">
|
||||
<CheckBox aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="imp" defaultValue="NO" fieldId="14" gridHeight="1" gridWidth="3" name="imp" notNull="true" posX="0" posY="0" required="true" sqlTabName="formonly" tabIndex="14" table_alias_name="" title="IMPRIME" valueChecked="SI" valueUnchecked="NO" widget="CheckBox"/>
|
||||
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="pcodid" fieldId="0" gridHeight="1" gridWidth="10" name="pcodid" posX="3" posY="0" scroll="true" sqlTabName="formonly" tabIndex="15" table_alias_name="" widget="Edit"/>
|
||||
|
||||
@@ -442,6 +442,11 @@ FUNCTION acpcad001() --Consultar Datos Activo
|
||||
LET i = i + 1
|
||||
|
||||
END FOREACH
|
||||
-- el FOREACH deja un elemento vacio al final; al seleccionarlo getdata armaba
|
||||
-- "WHERE a.codigo = " sin valor (-201) y el programa se caia
|
||||
IF DisArray.getLength() >= i THEN
|
||||
CALL DisArray.deleteElement(i)
|
||||
END IF
|
||||
|
||||
END FUNCTION
|
||||
|
||||
@@ -470,12 +475,12 @@ FUNCTION getdata(idx INT)
|
||||
,a.id_MaintainX
|
||||
,a.id_codigo
|
||||
,b.nombre
|
||||
FROM actb00001 a left join irtb00009 b on a.id_codigo = b.codigo
|
||||
WHERE a.codigo = " || DisArray[idx].codigo1 || "
|
||||
AND a.status_t is null and b.status_t is null
|
||||
FROM actb00001 a left join irtb00009 b on a.id_codigo = b.codigo AND b.status_t is null
|
||||
WHERE a.codigo = ?
|
||||
AND a.status_t is null
|
||||
ORDER BY a.codigo"
|
||||
|
||||
EXECUTE query INTO infoArray.*
|
||||
EXECUTE query USING DisArray[idx].codigo1 INTO infoArray.*
|
||||
|
||||
SELECT a.descripcion
|
||||
INTO des.descripcion2
|
||||
@@ -568,6 +573,9 @@ FUNCTION insertData()
|
||||
|
||||
IF infoArray.id_MaintainX IS NULL THEN
|
||||
ROLLBACK WORK
|
||||
-- antes seguia grabando fuera de la transaccion (el COMMIT caia -255)
|
||||
CALL fgl_winmessage("MaintainX", "NO SE PUDO REGISTRAR EN MAINTAINX, OPERACION CANCELADA", "stop")
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
@@ -701,6 +709,8 @@ INITIALIZE checking TO NULL
|
||||
|
||||
IF answer IS NULL THEN
|
||||
ROLLBACK WORK
|
||||
CALL fgl_winmessage("MaintainX", "NO SE PUDO ACTUALIZAR MAINTAINX, OPERACION CANCELADA", "stop")
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
@@ -811,11 +821,13 @@ INITIALIZE checking TO NULL
|
||||
END IF
|
||||
|
||||
IF infoArray.id_MaintainX IS NOT NULL THEN
|
||||
CALL ApiMaintainX('DELETE',infoArray.id_MaintainX,maquinaria.*, infoArray.*,extraCampos.*,NULL)
|
||||
CALL ApiMaintainX('DELETE',infoArray.id_MaintainX,infoArray.*,maquinaria.*,extraCampos.*,NULL) -- antes maquinaria/infoArray invertidos
|
||||
RETURNING answer
|
||||
|
||||
IF answer != 1 THEN
|
||||
IF answer != 1 OR answer IS NULL THEN
|
||||
ROLLBACK WORK
|
||||
CALL fgl_winmessage("MaintainX", "NO SE PUDO ELIMINAR EN MAINTAINX, OPERACION CANCELADA", "stop")
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
END IF
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
-- acprmt001 (version ene-2025, integracion MaintainX) usa 4 columnas que nunca se
|
||||
-- crearon en actb00001: proveedor del activo, tipo de activo y activo padre.
|
||||
-- Todas NULL: no afectan filas existentes ni a los programas que no las usan.
|
||||
-- Ejecutar primero en la .250 (QA G6); en produccion (.40.8) solo cuando se apruebe.
|
||||
USE marmotech;
|
||||
GO
|
||||
IF COL_LENGTH('dbo.actb00001','cod_sp') IS NULL
|
||||
ALTER TABLE dbo.actb00001 ADD cod_sp INT NULL; -- cotb00001.cod_sp (proveedor)
|
||||
IF COL_LENGTH('dbo.actb00001','cod_sp_sec') IS NULL
|
||||
ALTER TABLE dbo.actb00001 ADD cod_sp_sec INT NULL; -- cotb00001.cod_sp_sec
|
||||
IF COL_LENGTH('dbo.actb00001','tipo_activo') IS NULL
|
||||
ALTER TABLE dbo.actb00001 ADD tipo_activo VARCHAR(30) NULL; -- CAMIONES, IT HARDWARE, MAQUINARIAS, MONTACARGAS, EDIFICIOS
|
||||
IF COL_LENGTH('dbo.actb00001','activo_padre') IS NULL
|
||||
ALTER TABLE dbo.actb00001 ADD activo_padre INT NULL; -- actb00001.codigo del activo padre
|
||||
GO
|
||||
SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('dbo.actb00001')
|
||||
AND name IN ('cod_sp','cod_sp_sec','tipo_activo','activo_padre');
|
||||
@@ -235,11 +235,12 @@ FUNCTION acpcmf004()
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
-- G6: trans LIKE actb00004.* incluye rowid; sin el 2o a.rowid todo quedaba corrido una columna (-1213)
|
||||
LET SELEC =
|
||||
|
||||
|
||||
|
||||
"SELECT a.rowid,a.codigo
|
||||
"SELECT a.rowid,a.rowid,a.codigo
|
||||
,a.num_doc
|
||||
,CONVERT(VARCHAR(10),a.fecha,103)
|
||||
,a.cod_mov
|
||||
@@ -419,7 +420,7 @@ FUNCTION acpcmf004()
|
||||
CALL fgl_winmessage("INFO","NO SE ACTUALIZARON REGISTROS","INFO")
|
||||
EXIT PROGRAM
|
||||
END IF
|
||||
SELECT MIN(convert(varchar(10),a.fecha,103)) INTO fecha6 FROM actb00004 a
|
||||
SELECT MIN(a.fecha) INTO fecha6 FROM actb00004 a -- G6: MIN sobre texto dd/mm/yyyy no da la fecha menor
|
||||
WHERE a.codigo = trans.codigo AND a.status_t IS NULL
|
||||
|
||||
IF fecha6 IS NULL THEN
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user