Commit bc8dec58 by taufikyu

revisi laporan per opd per rekening, laporan per rekening per opd, cetak skrd

1 parent 2f250ffc
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Laporan 16 OPD Per Kode Rekening" pageWidth="595" pageHeight="842" columnWidth="537" leftMargin="29" rightMargin="29" topMargin="28" bottomMargin="20" uuid="f6a60c56-b035-4a92-be49-643a93f0c3a7">
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Laporan 16 OPD Per Kode Rekening" pageWidth="595" pageHeight="842" columnWidth="537" leftMargin="29" rightMargin="29" topMargin="28" bottomMargin="20">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<property name="ireport.zoom" value="3.2153832150000103"/>
<property name="ireport.x" value="597"/>
<property name="ireport.y" value="192"/>
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
......@@ -53,7 +53,6 @@
<field name="status" class="java.lang.String">
<fieldDescription><![CDATA[status]]></fieldDescription>
</field>
<field name="pokok" class="java.lang.String"/>
<variable name="jum_inv" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[Double.valueOf($F{jumlah})]]></variableExpression>
</variable>
......@@ -65,7 +64,7 @@
<groupHeader>
<band height="12">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="537" height="12" uuid="6099fbad-61a9-4291-b334-1e984a272269"/>
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="537" height="12"/>
<box leftPadding="2">
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
......@@ -83,7 +82,7 @@
<groupFooter>
<band height="13">
<textField>
<reportElement x="0" y="0" width="459" height="13" uuid="a95624ee-483e-42bb-a501-80e4e74b98de"/>
<reportElement x="0" y="0" width="448" height="13"/>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
......@@ -97,7 +96,7 @@
<textFieldExpression><![CDATA["SUB TOTAL "+$F{un_nm}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="459" y="0" width="78" height="13" uuid="625689a7-52ec-4d8c-bf73-0527cd937554"/>
<reportElement stretchType="RelativeToBandHeight" x="448" y="0" width="89" height="13"/>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
......@@ -119,18 +118,18 @@
<title>
<band height="89" splitType="Stretch">
<staticText>
<reportElement x="55" y="52" width="482" height="15" uuid="f3b545fc-8625-4414-bd53-c03d88c9f870"/>
<reportElement x="55" y="52" width="482" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Laporan OPD Per Kode Rekening]]></text>
</staticText>
<image>
<reportElement x="0" y="1" width="55" height="46" uuid="2fa11bdb-3ed9-4a04-9de7-94f4439a5529"/>
<reportElement x="0" y="1" width="55" height="46"/>
<imageExpression><![CDATA[$F{logo}]]></imageExpression>
</image>
<staticText>
<reportElement x="0" y="49" width="537" height="8" uuid="b47cb704-57f9-4bee-8ed1-cedd2ec2bb9f"/>
<reportElement x="0" y="49" width="537" height="8"/>
<box>
<topPen lineWidth="0.25"/>
<bottomPen lineWidth="0.0"/>
......@@ -141,14 +140,14 @@
<text><![CDATA[]]></text>
</staticText>
<staticText>
<reportElement x="55" y="3" width="482" height="15" uuid="a41deea1-8710-44ae-a3c3-a558b7d579d1"/>
<reportElement x="55" y="3" width="482" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[PEMERINTAH DAERAH PROVINSI JAWA BARAT]]></text>
</staticText>
<staticText>
<reportElement x="303" y="66" width="27" height="15" uuid="e1246e11-a1ec-484f-a693-cbced0f17d99"/>
<reportElement x="303" y="66" width="27" height="15"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.0"/>
......@@ -161,7 +160,7 @@
<text><![CDATA[s.d]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="328" y="66" width="57" height="15" uuid="a230d467-ed77-4938-9acf-a0bafee8ca49"/>
<reportElement stretchType="RelativeToBandHeight" x="328" y="66" width="57" height="15"/>
<box leftPadding="2">
<leftPen lineWidth="0.0"/>
<rightPen lineWidth="0.0"/>
......@@ -172,7 +171,7 @@
<textFieldExpression><![CDATA[$F{akhir}.substring(8,10)+"-"+$F{akhir}.substring(5,7)+"-"+$F{akhir}.substring(0,4)]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="253" y="66" width="57" height="15" uuid="b077cddb-b34e-4f11-bf71-e12be81d1b31"/>
<reportElement stretchType="RelativeToBandHeight" x="253" y="66" width="57" height="15"/>
<box leftPadding="2">
<leftPen lineWidth="0.0"/>
<rightPen lineWidth="0.0"/>
......@@ -183,7 +182,7 @@
<textFieldExpression><![CDATA[$F{awal}.substring(8,10)+"-"+$F{awal}.substring(5,7)+"-"+$F{awal}.substring(0,4)]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="205" y="66" width="54" height="15" uuid="1cddf468-fbcd-4cf9-9383-c1d56a3fcbaf"/>
<reportElement x="205" y="66" width="54" height="15"/>
<box>
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.0"/>
......@@ -196,14 +195,14 @@
<text><![CDATA[Periode]]></text>
</staticText>
<staticText>
<reportElement x="55" y="18" width="482" height="15" uuid="8e3f5db9-0c55-4f82-b5f2-2c62f54fccd0"/>
<reportElement x="55" y="18" width="482" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Badan Pendapatan Daerah]]></text>
</staticText>
<staticText>
<reportElement x="55" y="32" width="482" height="15" uuid="46c8574a-2dc7-42ad-91cc-df339a4eed32"/>
<reportElement x="55" y="32" width="482" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
......@@ -214,7 +213,7 @@
<pageHeader>
<band height="12" splitType="Stretch">
<staticText>
<reportElement x="68" y="0" width="103" height="12" uuid="b9004cf0-3295-438a-b80e-0a4272a34fdd"/>
<reportElement x="68" y="0" width="169" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -227,7 +226,7 @@
<text><![CDATA[Nama Rekening]]></text>
</staticText>
<staticText>
<reportElement x="0" y="0" width="68" height="12" uuid="d993cef6-3b7c-438f-bb5f-b90cc184e488"/>
<reportElement x="0" y="0" width="68" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -240,7 +239,7 @@
<text><![CDATA[Kode Rekening]]></text>
</staticText>
<staticText>
<reportElement x="459" y="0" width="78" height="12" uuid="9d0d064f-93de-4575-b89a-3d283a6401e0"/>
<reportElement x="448" y="0" width="89" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -253,20 +252,7 @@
<text><![CDATA[Jumlah]]></text>
</staticText>
<staticText>
<reportElement x="312" y="0" width="42" height="12" uuid="d3fea8cc-2eed-450e-afad-fe317f7fc8e5"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Bayar via]]></text>
</staticText>
<staticText>
<reportElement x="171" y="0" width="74" height="12" uuid="ede6835a-c382-4874-8879-1bd815b9ee86"/>
<reportElement x="237" y="0" width="81" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -279,21 +265,7 @@
<text><![CDATA[No. Bayar]]></text>
</staticText>
<staticText>
<reportElement mode="Transparent" x="245" y="0" width="67" height="12" forecolor="#000000" backcolor="#FFFFFF" uuid="c085b4eb-1637-4671-b41d-de8992ac66a7"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<text><![CDATA[Penyetor]]></text>
</staticText>
<staticText>
<reportElement x="354" y="0" width="52" height="12" uuid="cd047812-f9a8-452e-bdd6-410699deb723"/>
<reportElement x="318" y="0" width="88" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -303,10 +275,10 @@
<textElement textAlignment="Center">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Pokok]]></text>
<text><![CDATA[Penyetor]]></text>
</staticText>
<staticText>
<reportElement x="406" y="0" width="53" height="12" uuid="db8438e3-8b17-47ee-86df-776372cb081a"/>
<reportElement x="406" y="0" width="42" height="12"/>
<box>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
......@@ -316,7 +288,7 @@
<textElement textAlignment="Center">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Denda]]></text>
<text><![CDATA[Bayar via]]></text>
</staticText>
</band>
</pageHeader>
......@@ -326,7 +298,7 @@
<detail>
<band height="12" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="459" y="0" width="78" height="12" uuid="c86d1640-2af4-42c8-becc-e43aebf252ca"/>
<reportElement stretchType="RelativeToTallestObject" x="448" y="0" width="89" height="12"/>
<box leftPadding="0" rightPadding="1">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -337,7 +309,7 @@
<textFieldExpression><![CDATA[NumberFormat.getInstance().getNumberInstance(Locale.ITALIAN).format(Double.parseDouble($F{jumlah}))]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="171" y="0" width="74" height="12" uuid="ca5fa4f1-9b9e-4167-afeb-616e94802c23"/>
<reportElement stretchType="RelativeToTallestObject" x="237" y="0" width="81" height="12"/>
<box leftPadding="0" rightPadding="1">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -348,7 +320,7 @@
<textFieldExpression><![CDATA[$F{kd}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="68" height="12" uuid="909465b3-26a8-45b1-8812-44230066ec62"/>
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="68" height="12"/>
<box leftPadding="0" rightPadding="1">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -359,7 +331,7 @@
<textFieldExpression><![CDATA[$F{rek_kd}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="68" y="0" width="103" height="12" uuid="041ca267-c853-4f28-9ba2-29f79492df9a"/>
<reportElement stretchType="RelativeToTallestObject" x="68" y="0" width="169" height="12"/>
<box leftPadding="2">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -370,7 +342,7 @@
<textFieldExpression><![CDATA[$F{rek_nm}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="245" y="0" width="67" height="12" uuid="3f7adeef-bca9-43f4-9b8e-d3b50703203d"/>
<reportElement stretchType="RelativeToTallestObject" x="318" y="0" width="88" height="12"/>
<box leftPadding="2">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -381,7 +353,7 @@
<textFieldExpression><![CDATA[$F{wp_nm}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="312" y="0" width="42" height="12" uuid="75c50542-5dd9-4f2d-8389-3b4c05247cf6"/>
<reportElement stretchType="RelativeToTallestObject" x="406" y="0" width="42" height="12"/>
<box leftPadding="2">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
......@@ -391,28 +363,6 @@
</textElement>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="354" y="0" width="52" height="12" uuid="e245809b-0ca5-4fcd-ad75-081af55a48fa"/>
<box leftPadding="2">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[NumberFormat.getInstance().getNumberInstance(Locale.ITALIAN).format(Double.parseDouble($F{pokok}))]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="406" y="0" width="53" height="12" uuid="b02ff476-3b8e-4f3b-a604-22ac04032d5b"/>
<box leftPadding="2">
<leftPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[NumberFormat.getInstance().getNumberInstance(Locale.ITALIAN).format(Double.parseDouble($F{bunga}))]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
......@@ -424,13 +374,13 @@
<summary>
<band height="17" splitType="Stretch">
<line>
<reportElement x="0" y="0" width="537" height="1" uuid="b2edd059-5260-476b-82dc-25a31de2ea85"/>
<reportElement x="0" y="0" width="537" height="1"/>
<graphicElement>
<pen lineWidth="0.25"/>
</graphicElement>
</line>
<staticText>
<reportElement x="0" y="0" width="459" height="13" uuid="be20153d-8de1-4ad1-8eb2-8fce597360b2"/>
<reportElement x="0" y="0" width="448" height="13"/>
<box>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
......@@ -442,7 +392,7 @@
<text><![CDATA[TOTAL KESELURUHAN]]></text>
</staticText>
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" x="459" y="0" width="78" height="13" uuid="a14b4c62-ac63-47b0-9fa3-094e229a40d6"/>
<reportElement stretchType="RelativeToBandHeight" x="448" y="0" width="89" height="13"/>
<box>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
......
No preview for this file type
......@@ -12,7 +12,7 @@ from sqlalchemy import func
from ..models import (DBSession, User,)
from ..models.isipkd import(
ARSspd, ARInvoice, Unit
ARSspd, ARInvoice, Unit, Rekening
)
from pyramid.view import notfound_view_config
......@@ -65,7 +65,6 @@ def view_home(request):
week = int(now.strftime('%W')),
day = now,
)
opd_ls = Unit.query().order_by(Unit.kode).all()
data_dashboard = dict(
tabular = dict(
tahun = dict(q=0,n=0),
......@@ -77,17 +76,22 @@ def view_home(request):
q = [0,0,0,0,0,0,0,0,0,0,0,0],
n = [0,0,0,0,0,0,0,0,0,0,0,0],
),
opd= [],
rek= [],
sopd10= [],
sopd= [],
)
opd_ls = Unit.query().filter(Unit.level_id==3).order_by(Unit.kode).all()
reks = Rekening.query().filter(Rekening.level_id==3, Rekening.kode.ilike('4.1.%')).order_by(Rekening.kode).all()
for r in reks:
data_dashboard['rek'].append(dict(kode=r.kode.strip(), nama=r.nama.strip(), jumlah=0))
payments = DBSession.query(
ARSspd.tgl_bayar.label('tanggal'),
ARSspd.bayar.label('jumlah'),
ARInvoice.rek_kode.label('rek_kode'),
Unit.kode.label('kode'),
Unit.nama.label('nama'),
).join(ARInvoice, ARInvoice.id == ARSspd.arinvoice_id).\
join(Unit, func.trim(Unit.kode) == func.trim(ARInvoice.unit_kode)).\
join(Unit, func.trim(Unit.kode) == func.trim(ARInvoice.unit_kode)).\
filter(ARSspd.tahun_id==dates['year']).order_by(ARInvoice.unit_kode)
payments = payments.all()
for p in payments:
......@@ -124,33 +128,30 @@ def view_home(request):
if p.tanggal.month == x+1:
data_dashboard['chart']['q'][x] += int(1)
data_dashboard['chart']['n'][x] += int(p.jumlah)
for r in data_dashboard['rek']:
if p.rek_kode.strip().startswith(r['kode']):
r['jumlah'] += int(p.jumlah)
##RANKING##
tanggal_berjalan = datetime.now()
tahun_berjalan = tanggal_berjalan.year
opd = DBSession.query(
ARSspd.tgl_bayar.label('tanggal'),
ARSspd.bayar.label('jumlah'),
Unit.kode.label('kode'),
Unit.nama.label('nama'),
func.sum(ARSspd.bayar).label('jumlah'),
func.max(Unit.kode).label('kode'),
func.max(Unit.nama).label('nama'),
).join(ARInvoice, ARInvoice.id == ARSspd.arinvoice_id).\
join(Unit, func.trim(Unit.kode) == func.trim(ARInvoice.unit_kode)).\
filter(ARSspd.tahun_id==tahun_berjalan).order_by(ARInvoice.unit_kode).all()
join(Unit, func.trim(Unit.kode) == func.trim(ARInvoice.unit_kode)).\
filter(ARSspd.tahun_id==tahun_berjalan)\
.group_by(func.trim(Unit.kode))\
.order_by(func.sum(ARSspd.bayar).desc()).all()
prev_opd = ''
i = -1
for o in opd:
##OPD SESUAI TANGGAL
if prev_opd != o.kode:
i += 1
data_dashboard['opd'].append(dict(kode=o.kode.strip(),unit=o.nama.strip(),jumlah=0))
prev_opd = o.kode
data_dashboard['opd'][i]['jumlah']+=int(o.jumlah)
sort_opd = sorted(data_dashboard['opd'], key = lambda i: (i['jumlah']), reverse=True)
i = -1
for sopd in sort_opd:
for sopd in opd:
i += 1
if i < 10:
data_dashboard['sopd10'].append(dict(peringkat=i+1, kode=sopd['kode'], unit=sopd['unit'], nominal=sopd['jumlah']))
data_dashboard['sopd'].append(dict(peringkat=i+1, kode=sopd['kode'], unit=sopd['unit'], nominal=sopd['jumlah']))
data_dashboard['sopd10'].append(dict(peringkat=i+1, kode=sopd.kode, unit=sopd.nama, nominal=sopd.jumlah))
data_dashboard['sopd'].append(dict(peringkat=i+1, kode=sopd.kode, unit=sopd.nama, nominal=sopd.jumlah))
return dict(project='esipkd', dates=dates, data = data_dashboard, opds=opd_ls, statusadmin=statusadmin)
else:
return dict(project='esipkd', statusadmin=statusadmin)
......
......@@ -810,7 +810,30 @@ def view_pdf(request):
file = '/tmp/skrd'
template= Template(path+'skrd.odt', file+'.odt')
row = DBSession.query(ARInvoice).filter_by(id=params['id']).first()
row = DBSession.query(ARInvoice.unit_nama.label('unit_nama'),
ARInvoice.wp_nama.label('wp_nama'),
ARInvoice.wp_alamat_1.label('wp_alamat_1'),
ARInvoice.wp_alamat_2.label('wp_alamat_2'),
ARInvoice.wp_kode.label('wp_kode'),
ARInvoice.rek_nama.label('rek_nama'),
ARInvoice.rek_kode.label('rek_kode'),
ARInvoice.periode_1.label('periode_1'),
ARInvoice.periode_2.label('periode_2'),
ARInvoice.kode.label('kode'),
ARInvoice.no_skrd.label('no_skrd'),
ARInvoice.tahun_id.label('tahun_id'),
ARInvoice.tgl_tetap.label('tgl_tetap'),
ARInvoice.jumlah.label('jumlah'),
ARInvoice.jatuh_tempo.label('jatuh_tempo'),
ARInvoice.pokok.label('pokok'),
ARInvoice.denda.label('denda'),
ARSspd.ntp.label('ntp'),
ARSspd.ntb.label('ntb'),
ARSspd.tgl_bayar.label('tgl_bayar'),
ARSspd.bunga.label('bunga'),
ARSspd.bayar.label('bayar'))\
.outerjoin(ARSspd, ARSspd.arinvoice_id==ARInvoice.id)\
.filter(ARInvoice.id==params['id']).first()
item = Item()
item.opd = row.unit_nama
item.wp_nama = row.wp_nama
......@@ -831,6 +854,11 @@ def view_pdf(request):
item.jumlah = thousand(row.jumlah)
item.jatuh_tempo = dmy(row.jatuh_tempo)
item.terbilang = terbilang(row.jumlah) + ' Rupiah'
item.status_pembayaran = (row.ntb) and 'H2H Bank' or (row.ntp) and 'Manual' or '-'
item.tgl_pembayaran = row.tgl_bayar and dmy(row.tgl_bayar) or '-'
item.pokok = row.pokok and thousand(row.pokok) or '-'
item.denda = (row.tgl_bayar) and thousand(row.bunga) or (row.denda) and thousand(row.denda) or '0'
item.bayar = row.bayar and thousand(row.bayar) or (row.jumlah) and thousand(row.jumlah) or (int(item.pokok)+int(item.denda))
data = {}
data['item'] = item
......
......@@ -1497,13 +1497,67 @@ class ViewLaporan(BaseViews):
'rows': rows,
}
return csv_response(req, value, filename)
generator = lap16Generator()
pdf = generator.generate(query)
response=req.response
response.content_type="application/pdf"
response.content_disposition='filename=output.pdf'
response.write(pdf)
return response
##ODT
import os
from py3o.template import Template
from ..tools import odt_export, date_from_str, dmy
class Item(object):
pass
_here = os.path.dirname(__file__)
path = os.path.dirname(_here)
sourcepath = os.path.join(path, 'reports/')
filename = '16'
filepath = '/tmp/'
template = Template(sourcepath+filename+'.odt', filepath+filename+'.odt')
item = Item()
item.awal = dmy(date_from_str(awal))
item.akhir = dmy(date_from_str(akhir))
opds = []
rekenings = []
prevopd = ''
i = -1
total = 0
for row in query.all():
if row.un_kd.strip() != prevopd:
prevopd = row.un_kd.strip()
if i >= 0:
opds[i].total = thousand(subtotal)
subtotal = 0
opd = Item()
opd.kode = row.un_kd.strip()
opd.uraian = row.un_nm.strip()
opd.total = 0
opds.append(opd)
i+=1
subtotal += int(row.jumlah)
rek = Item()
rek.opd_kode = row.un_kd.strip()
rek.kode = row.rek_kd.strip()
rek.nama = row.rek_nm.strip()
rek.no_bayar = row.kd.strip()
rek.penyetor = row.wp_nm.strip()
rek.bayar = row.status
rek.pokok = thousand(row.pokok)
rek.denda = thousand(row.bunga)
rek.jumlah = thousand(row.jumlah)
rekenings.append(rek)
total += int(row.jumlah)
item.total = thousand(total)
data = dict(item=item, opds=opds, rekenings = rekenings)
template.render(data)
return odt_export(req, filepath+filename, 'pdf')
##JASPER
# generator = lap16Generator()
# pdf = generator.generate(query)
# response=req.response
# response.content_type="application/pdf"
# response.content_disposition='filename=output.pdf'
# response.write(pdf)
# return response
elif url_dict['act']=='Laporan_17' :
query = DBSession.query(ARSspd.tgl_bayar.label('tgl'),
......@@ -1573,13 +1627,84 @@ class ViewLaporan(BaseViews):
'rows': rows,
}
return csv_response(req, value, filename)
generator = lap17Generator()
pdf = generator.generate(query)
response=req.response
response.content_type="application/pdf"
response.content_disposition='filename=output.pdf'
response.write(pdf)
return response
##ODT
import os
from py3o.template import Template
from ..tools import odt_export, date_from_str, dmy
class Item(object):
pass
_here = os.path.dirname(__file__)
path = os.path.dirname(_here)
sourcepath = os.path.join(path, 'reports/')
filename = '17'
filepath = '/tmp/'
template = Template(sourcepath+filename+'.odt', filepath+filename+'.odt')
item = Item()
item.awal = dmy(date_from_str(awal))
item.akhir = dmy(date_from_str(akhir))
rekenings = []
opds = []
opddets = []
prevopd = ''
prevrek = ''
i = -1
j = -1
total = 0
for row in query.all():
if row.rek_kd.strip() != prevrek:
prevrek = row.rek_kd.strip()
if i >= 0:
rekenings[i].total = thousand(subtotaldet)
subtotaldet = 0
rekening = Item()
rekening.kode = row.rek_kd.strip()
rekening.uraian = row.rek_nm.strip()
rekening.total = 0
rekenings.append(rekening)
i+=1
subtotaldet += int(row.jumlah)
if row.un_kd.strip() != prevopd:
prevopd = row.un_kd.strip()
if j >=0:
opds[j].total = thousand(subtotal)
subtotal = 0
opd = Item()
opd.rek_kode = row.rek_kd.strip()
opd.unit_kode = row.un_kd.strip()
opd.total = 0
opds.append(opd)
j+=1
subtotal += int(row.jumlah)
opddet = Item()
opddet.rek_kode = row.rek_kd.strip()
opddet.kode = row.un_kd.strip()
opddet.nama = row.un_nm.strip()
opddet.no_bayar = row.kd.strip()
opddet.penyetor = row.wp_nm.strip()
opddet.bayar = row.status
opddet.pokok = thousand(row.pokok)
opddet.denda = thousand(row.bunga)
opddet.jumlah = thousand(row.jumlah)
opddets.append(opddet)
total += int(row.jumlah)
item.total = thousand(total)
data = dict(item=item, opds=opds, opddets=opddets, rekenings = rekenings)
template.render(data)
return odt_export(req, filepath+filename, 'pdf')
##JASPER
# generator = lap17Generator()
# pdf = generator.generate(query)
# response=req.response
# response.content_type="application/pdf"
# response.content_disposition='filename=output.pdf'
# response.write(pdf)
# return response
elif url_dict['act']=='Laporan_18' :
......@@ -3248,8 +3373,7 @@ class lap16Generator(JasperGenerator):
def __init__(self):
super(lap16Generator, self).__init__()
self.reportname = get_rpath('Lap16.jrxml')
# self.xpath = '/webr/lap16'
self.xpath = '/tmp'
self.xpath = '/webr/lap16'
self.root = ET.Element('webr')
def generate_xml(self, tobegreeted):
......
......@@ -108,6 +108,7 @@ Selamat datang di aplikasi SIPANDU
<tal:block tal:condition="statusadmin">
<div class="col-md-6">
<h4>REALISASI PENDAPATAN DAERAH TAHUN ${dates['year']}</h4>
<font class="labeltab">Tanggal : ${request.session['date']}</font>
</div>
<div class="col-md-6">
<form method="get">
......@@ -183,11 +184,11 @@ Selamat datang di aplikasi SIPANDU
</div>
</div>
<div class="col-md-12">
<tal:block tal:repeat="opd data['opd']">
<tal:block tal:repeat="r data['rek']">
<div class="col-md-3 wrapopd">
<font class="kodeopd">${opd['kode']}</font>
<font class="namaopd">${opd['unit']}</font>
<font class="jmlopd">${'{:n}'.format(opd['jumlah'])}</font>
<font class="kodeopd">${r['kode']}</font>
<font class="namaopd">${r['nama']}</font>
<font class="jmlopd">${'{:n}'.format(r['jumlah'])}</font>
</div>
</tal:block>
</div>
......@@ -269,6 +270,10 @@ Selamat datang di aplikasi SIPANDU
}
});
Chart.defaults.global.scaleLabel = function(label){
return label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
};
//BAR
var config = {
type: 'bar',
......@@ -297,9 +302,10 @@ Selamat datang di aplikasi SIPANDU
return '';
},
label: function(tooltipItem, data) {
var label = data.labels[tooltipItem.index];
var val = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
return val;
//var label = data.labels[tooltipItem.index];
//var val = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
//return val;
return tooltipItem.yLabel.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
},
labelTextColor: function(tooltipItem, data) {
return 'rgba(0,0,0,0.8)';
......@@ -332,7 +338,14 @@ Selamat datang di aplikasi SIPANDU
labelString: 'Value'
},
ticks: {
beginAtZero: true
beginAtZero: true,
callback: function(value, index, values) {
if(parseInt(value) >= 1000){
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
} else {
return value;
}
}
}
}]
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!