Commit ab6acf1c by aagusti

gilang-020217

1 parent d1c5b406
Showing 77 changed files with 996 additions and 162 deletions
File mode changed
......@@ -382,44 +382,6 @@ class ARInvoice(CommonModel, Base):
wilayahs = relationship("Wilayah", backref=backref('arinvoices'))
units = relationship("Unit", backref=backref('arinvoices'))
UniqueConstraint(tahun_id,unit_id,no_id,name='arinvoice_uq')
## Untuk Item Invoice di SPTPD ##
class InvoiceDet(CommonModel, Base):
__tablename__ = 'invoicedets'
id = Column(Integer, primary_key=True)
#-------------------------------Relasi--------------------------------------------------#
invoice_id = Column(Integer, ForeignKey("arinvoices.id"))
wilayah_id = Column(Integer, ForeignKey("wilayahs.id"))
subjek_pajak_id = Column(Integer, ForeignKey("subjekpajaks.id"))
objek_pajak_id = Column(Integer, ForeignKey("objekpajaks.id"))
produk_id = Column(Integer, ForeignKey("produks.id")) ## Jenis BBM ##
pajak_id = Column(Integer, ForeignKey("pajaks.id"))
peruntukan_id = Column(Integer, ForeignKey("peruntukans.id")) ## Peruntukan BBM ##
#---------------------------------------------------------------------------------------#
sektor_nm = Column(String(64)) ## Sektor Peruntukan BBM ##
wilayah_nm = Column(String(64))
nama = Column(String(64))
alamat = Column(String(255))
peruntukan_nm = Column(String(64))
produk_nm = Column(String(64))
#------------------------------Perhitungan----------------------------------------------#
volume = Column(BigInteger, default=0)
harga_jual = Column(BigInteger, default=0)
dpp = Column(BigInteger, default=0) ## Volume * Harga_jual ##
tarif = Column(Float , default=0) ## Dari pajak_id berupa persen ##
total_pajak = Column(BigInteger, default=0) ## dpp * tarif ##
#---------------------------------------------------------------------------------------#
keterangan = Column(String(255))
#status = Column(Integer, default=0) ## 0-> Tidak Aktif, 1-> Aktif ##
arinvoices = relationship("ARInvoice", backref=backref('invoicedets'))
subjekpajaks = relationship("SubjekPajak", backref=backref('invoicedets'))
objekpajaks = relationship("ObjekPajak", backref=backref('invoicedets'))
wilayahs = relationship("Wilayah", backref=backref('invoicedets'))
pajaks = relationship('Pajak', backref=backref('invoicedets'))
produks = relationship("Produk", backref=backref('invoicedets'))
peruntukans = relationship('Peruntukan', backref=backref('invoicedets'))
UniqueConstraint(subjek_pajak_id,objek_pajak_id,wilayah_id,pajak_id,name='inv_det_uq')
class ARSspd(CommonModel, Base):
__tablename__ = 'arsspds'
......@@ -532,4 +494,79 @@ class ARTbp(CommonModel, Base):
objekpajaks = relationship("ObjekPajak", backref=backref('artbp'))
wilayahs = relationship("Wilayah", backref=backref('artbp'))
units = relationship("Unit", backref=backref('artbp'))
UniqueConstraint(tahun_id,unit_id,no_id,name='artbp_uq')
\ No newline at end of file
UniqueConstraint(tahun_id,unit_id,no_id,name='artbp_uq')
class Sptpd(CommonModel, Base):
__tablename__ = 'sptpds'
id = Column(Integer, primary_key=True)
kode = Column(String(32), unique=True) #Tahun(2)-unit_kode(6)-no_id(8) 00.000.000
nama = Column(String(255))
tahun_id = Column(Integer)
unit_id = Column(Integer, ForeignKey("units.id"))
unit_kode = Column(String(32))
unit_nama = Column(String(255))
unit_alamat = Column(String(255))
no_id = Column(Integer)
subjek_pajak_id = Column(Integer, ForeignKey("subjekpajaks.id"))
wp_kode = Column(String(50))
wp_nama = Column(String(100))
wp_alamat_1 = Column(String(255))
wp_alamat_2 = Column(String(255))
rekening_id = Column(Integer, ForeignKey("rekenings.id"))
rek_kode = Column(String(16))
rek_nama = Column(String(64))
jumlah = Column(BigInteger)
periode_1 = Column(Date)
periode_2 = Column(Date)
tgl_sptpd = Column(Date)
status_invoice = Column(SmallInteger, nullable=False, default=0) # 0 belum dibuat invoice - 1 sudah dibuat - 2 batal
invoice_id = Column(Integer, nullable=True, default=0)
invoice_kode = Column(String(32))
create_uid = Column(Integer)
update_uid = Column(Integer)
create_date = Column(DateTime(timezone=True))
update_date = Column(DateTime(timezone=True))
subjekpajaks = relationship("SubjekPajak", backref=backref('sptpds'))
rekenings = relationship("Rekening", backref=backref('sptpds'))
units = relationship("Unit", backref=backref('sptpds'))
UniqueConstraint(tahun_id,unit_id,no_id,name='sptpd_uq')
## Untuk Item Invoice di SPTPD ##
class InvoiceDet(CommonModel, Base):
__tablename__ = 'invoicedets'
id = Column(Integer, primary_key=True)
#-------------------------------Relasi--------------------------------------------------#
sptpd_id = Column(Integer, ForeignKey("sptpds.id"))
sektor_id = Column(Integer, ForeignKey("sektors.id"))
produk_id = Column(Integer, ForeignKey("produks.id")) ## Jenis BBM ##
wilayah_id = Column(Integer, ForeignKey("wilayahs.id"))
peruntukan_id = Column(Integer, ForeignKey("peruntukans.id")) ## Peruntukan BBM ##
subjek_pajak_id = Column(Integer, ForeignKey("subjekpajaks.id"))
#pajak_id = Column(Integer, ForeignKey("pajaks.id"))
#objek_pajak_id = Column(Integer, ForeignKey("objekpajaks.id"))
#---------------------------------------------------------------------------------------#
sektor_nm = Column(String(64)) ## Sektor Peruntukan BBM ##
wilayah_nm = Column(String(64))
nama = Column(String(64))
alamat = Column(String(255))
peruntukan_nm = Column(String(64))
produk_nm = Column(String(64))
#------------------------------Perhitungan----------------------------------------------#
volume = Column(BigInteger, default=0)
harga_jual = Column(BigInteger, default=0)
dpp = Column(BigInteger, default=0) ## Volume * Harga_jual ##
tarif = Column(Float , default=0) ## Dari pajak_id berupa persen ##
total_pajak = Column(BigInteger, default=0) ## dpp * tarif ##
#---------------------------------------------------------------------------------------#
keterangan = Column(String(255))
#status = Column(Integer, default=0) ## 0-> Tidak Aktif, 1-> Aktif ##
sptpds = relationship("Sptpd", backref=backref('invoicedets'))
subjekpajaks = relationship("SubjekPajak", backref=backref('invoicedets'))
wilayahs = relationship("Wilayah", backref=backref('invoicedets'))
sektors = relationship("Sektor", backref=backref('invoicedets'))
produks = relationship("Produk", backref=backref('invoicedets'))
peruntukans = relationship('Peruntukan', backref=backref('invoicedets'))
#pajaks = relationship('Pajak', backref=backref('invoicedets'))
#objekpajaks = relationship("ObjekPajak", backref=backref('invoicedets'))
#UniqueConstraint(sptpd_id,subjek_pajak_id,sektor_id,wilayah_id,peruntukan_id,produk_id,name='inv_det_uq')
\ No newline at end of file
File mode changed
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">Badan Pendapatan Daerah</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document>
<template pagesize="29.7cm, 21cm" orientation="auto">
<pageTemplate id="main">
<!--pageGraphics>
<setFont name="Helvetica" size="10"/>
<drawString x="2cm" y="27.7cm">PT. Properindo Jasatama</drawString>
<drawRightString x="19cm" y="27.7cm">www.opensipkd.com</drawRightString>
</pageGraphics-->
<pageGraphics>
<lines> 20 520 825 520</lines>
<lineMode width="20"/>
<setFont name="Helvetica" size="10"/>
<drawString x="2cm" y="1.5cm">{waktu}</drawString>
<drawRightString x="27cm" y="1.5cm">Halaman <pageNumber/> / <getName id="last-page" default="1"/></drawRightString>
</pageGraphics>
<frame id="content" x1="2cm" y1="3.5cm" width="26cm" height="17cm"/>
</pageTemplate>
</template>
<stylesheet>
<paraStyle name="title1"
fontName="Helvetica-Bold"
fontSize="14"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="title2"
fontName="Helvetica-Bold"
fontSize="12"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="title3"
fontName="Helvetica-Bold"
fontSize="11"
spaceAfter="23"
alignment="CENTER"/>
<paraStyle name="title4"
fontName="Helvetica-Bold"
fontSize="11"
spaceAfter="6"
alignment="CENTER"/>
<paraStyle name="heading1"
fontName="Helvetica-Bold"
fontSize="12"
spaceAfter="8"
alignment="CENTER"/>
<paraStyle name="heading2"
fontName="Helvetica-Bold"
fontSize="10"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="heading3"
fontName="Helvetica-Bold"
fontSize="10"
spaceAfter="10"
alignment="CENTER"/>
<paraStyle name="body"
fontName="Helvetica"
fontSize="12"
spaceAfter="10"/>
<blockTableStyle id="table">
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
<para style="title3">Jl. Soekarno Hatta, No. 528, Bandung</para>
<para style="heading1">REGISTER NOMOR BAYAR</para>
<para style="heading3">Periode {awal} s.d {akhir}</para>
</imageAndFlowables>
<drawCenteredString x="2cm" y="1.5cm"></drawCenteredString>
<blockTable colWidths="4cm,4cm,4cm,5cm,2.5cm,3cm,5cm" style="table" repeatRows="1">
<tr>
<td><para style="heading2">No. Bayar</para></td>
<td><para style="heading2">Penyetor</para></td>
<td><para style="heading2">Objek</para></td>
<td><para style="heading2">Uraian</para></td>
<td><para style="heading2">Tgl. Tetap</para></td>
<td><para style="heading2">Jumlah</para></td>
<td><para style="heading2">OPD</para></td>
</tr>
{rows2}
</blockTable>
<namedString id="last-page"><pageNumber/></namedString>
</story>
</document>
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">Badan Pendapatan Daerah</para>
......
......@@ -68,7 +68,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -68,7 +68,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">Badan Pendapatan Daerah</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
......
......@@ -63,7 +63,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -58,7 +58,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
......
......@@ -58,7 +58,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -58,7 +58,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -10,8 +10,8 @@ from string import ascii_lowercase
from z3c.rml import rml2pdf
#rpt_path = "/home/opensid/domains/webr-devel.opensipkd.com/webr/webr/reports/"
rpt_path = "/home/web-r/e-sipkd/esipkd/reports/"
#rpt_path = "/home/aagusti/env/e-sipkd/esipkd/reports/"
#rpt_path = "/home/web-r/e-sipkd/esipkd/reports/"
rpt_path = "/home/aagusti/env/e-sipkd/esipkd/reports/"
import pkg_resources
print pkg_resources.resource_filename('os.path', 'reports')
......
No preview for this file type
......@@ -58,7 +58,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
......
......@@ -58,7 +58,7 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
......
......@@ -9,6 +9,8 @@
<drawRightString x="19cm" y="27.7cm">www.opensipkd.com</drawRightString>
</pageGraphics-->
<pageGraphics>
<lines> 20 520 825 520</lines>
<lineMode width="20"/>
<setFont name="Helvetica" size="10"/>
<drawString x="2cm" y="1.5cm">{waktu}</drawString>
<drawRightString x="27.6cm" y="1.5cm">Halaman <pageNumber/> / <getName id="last-page" default="1"/></drawRightString>
......@@ -30,7 +32,7 @@
<paraStyle name="title3"
fontName="Helvetica-Bold"
fontSize="11"
spaceAfter="1"
spaceAfter="25"
alignment="CENTER"/>
<paraStyle name="title4"
fontName="Helvetica-Bold"
......@@ -56,13 +58,12 @@
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="e-sipkd/esipkd/static/img/logo-pemda-small.png"
imageWidth="76" imageHeight="76" imageSide="left">
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">BADAN PENDAPATAN DAERAH</para>
<para style="title3">Jl. Soekarno Hatta, No. 528, Bandung</para>
<para style="title4">_________________________________________________________________________________________________</para>
<para style="heading1">DAFTAR WAJIB PAJAK</para>
<para style="heading1">DAFTAR WAJIB PUNGUT</para>
</imageAndFlowables>
<drawCenteredString x="2cm" y="1.5cm"></drawCenteredString>
<blockTable colWidths="3.1cm,3.5cm,5cm,2.7cm,2.7cm,3.3cm,3.5cm,4.3cm" style="table" repeatRows="1">
......
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document>
<template pagesize="29.7cm, 21cm" orientation="auto">
<pageTemplate id="main">
<!--pageGraphics>
<setFont name="Helvetica" size="10"/>
<drawString x="2cm" y="27.7cm">PT. Properindo Jasatama</drawString>
<drawRightString x="19cm" y="27.7cm">www.opensipkd.com</drawRightString>
</pageGraphics-->
<pageGraphics>
<lines> 20 520 825 520</lines>
<lineMode width="20"/>
<setFont name="Helvetica" size="10"/>
<drawString x="2cm" y="1.5cm">{waktu}</drawString>
<drawRightString x="27.6cm" y="1.5cm">Halaman <pageNumber/> / <getName id="last-page" default="1"/></drawRightString>
</pageGraphics>
<frame id="content" x1="2cm" y1="3.5cm" width="26cm" height="17cm"/>
</pageTemplate>
</template>
<stylesheet>
<paraStyle name="title1"
fontName="Helvetica-Bold"
fontSize="14"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="title2"
fontName="Helvetica-Bold"
fontSize="12"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="title3"
fontName="Helvetica-Bold"
fontSize="11"
spaceAfter="23"
alignment="CENTER"/>
<paraStyle name="title4"
fontName="Helvetica-Bold"
fontSize="11"
spaceAfter="6"
alignment="CENTER"/>
<paraStyle name="heading1"
fontName="Helvetica-Bold"
fontSize="12"
spaceAfter="7"
alignment="CENTER"/>
<paraStyle name="heading2"
fontName="Helvetica"
fontSize="9"
spaceAfter="5"
alignment="CENTER"/>
<paraStyle name="body"
fontName="Helvetica"
fontSize="12"
spaceAfter="10"/>
<blockTableStyle id="table">
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
</stylesheet>
<story>
<imageAndFlowables imageName="esipkd/static/img/logo-pemda-small.png"
imageWidth="60" imageHeight="60" imageSide="left">
<para style="title1">PEMERINTAH PROVINSI JAWA BARAT</para>
<para style="title2">{un_nm}</para>
<para style="title3">{un_al}</para>
<para style="heading1">DAFTAR WAJIB PUNGUT</para>
</imageAndFlowables>
<drawCenteredString x="2cm" y="1.5cm"></drawCenteredString>
<blockTable colWidths="3.1cm,3.5cm,5cm,2.7cm,2.7cm,3.3cm,3.5cm,4.3cm" style="table" repeatRows="1">
<tr>
<td><para style="heading2">NPWPD</para></td>
<td><para style="heading2">Nama</para></td>
<td><para style="heading2">Alamat</para></td>
<td><para style="heading2">Kelurahan</para></td>
<td><para style="heading2">Kecamatan</para></td>
<td><para style="heading2">Kabupaten/Kota</para></td>
<td><para style="heading2">E-mail</para></td>
<td><para style="heading2">OPD</para></td>
</tr>
{rows2}
</blockTable>
<namedString id="last-page"><pageNumber/></namedString>
</story>
</document>
File mode changed
id,kode,nama,status
1,"001","Digunakan Sendiri",1
2,"002","Pengguna Akhir",1
3,"003","Dijual Kembali",1
\ No newline at end of file
1,"001","DIGUNAKAN SENDIRI",1
2,"002","PENGGUNA AKHIR",1
3,"003","DIJUAL KEMBALI",1
\ No newline at end of file
id,kode,nama,status
1,"001","Bio Solar",1
2,"002","Bio Premium",1
3,"003","Bio Pertamax",1
4,"004","Solar",1
5,"005","Premium",1
6,"006","Pertalite",1
7,"007","Pertamax",1
8,"008","Pertamax Plus",1
9,"009","Pertamax Racing",1
10,"010","Pertamina Dex",1
1,"001","BIO SOLAR",1
2,"002","BIO PREMIUM",1
3,"003","BIO PERTAMAX",1
4,"004","SOLAR",1
5,"005","PREMIUM",1
6,"006","PERTALITE",1
7,"007","PERTAMAX",1
8,"008","PERTAMAX PLUS",1
9,"009","PERTAMAX RACING",1
10,"010","PERTAMINA DEX",1
11,"011","BBG",1
\ No newline at end of file
File mode changed
id,kode,nama,status
1,"001","Umum",1
2,"002","Transportasi dan Kontraktor Jalan",1
3,"003","Pertambangan dan Kehutanan",1
4,"004","Industri",1
5,"005","WAPU PBBKB Lainnya",1
\ No newline at end of file
1,"001","UMUM",1
2,"002","TRANSPORTASI DAN KONTRAKTOR JALAN",1
3,"003","PERTAMBANGAN DAN KEHUTANAN",1
4,"004","INDUSTRI",1
5,"005","WAPU PBBKB LAINNYA",1
\ No newline at end of file
id,kode,nama,level_id,parent_id
1,"32.00","PROPINSI JAWA BARAT",2,
1,"32.00","PROVINSI JAWA BARAT",2,
2,"32.01","KABUPATEN BOGOR",2,1
3,"32.02","KABUPATEN SUKABUMI",2,1
4,"32.03","KABUPATEN CIANJUR",2,1
......
......@@ -8,6 +8,9 @@ import colander
import locale
import pytz
import io
import random
from string import ascii_uppercase,ascii_lowercase,digits
from email.utils import parseaddr
from types import (
IntType,
......@@ -358,13 +361,33 @@ class CSVRenderer(object):
return fout.getvalue()
########
# File #
########
# http://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits-in-python
def get_random_string():
return ''.join(random.choice(ascii_uppercase + ascii_lowercase + digits) \
for _ in range(6))
def get_ext(filename):
return os.path.splitext(filename)[-1]
def file_type(filename):
ctype, encoding = mimetypes.guess_type(filename)
if ctype is None or encoding is not None:
ctype = 'application/octet-stream'
return ctype
class SaveFile(object):
def __init__(self, dir_path):
self.dir_path = dir_path
# Awalan nama file diacak sedangkan akhirannya tidak berubah
def create_fullpath(self, ext=''):
return fullpath
while True:
filename = get_random_string() + ext
fullpath = os.path.join(self.dir_path, filename)
if not os.path.exists(fullpath):
return fullpath
def save(self, content, filename=None):
fullpath = create_fullpath()
......@@ -373,24 +396,11 @@ class SaveFile(object):
f.close()
return fullpath
def get_random_string():
return ''.join(choice(ascii_uppercase + ascii_lowercase + digits) \
for _ in range(6))
def get_ext(filename):
return os.path.splitext(filename)[-1]
class Upload(SaveFile):
def __init__(self):
settings = get_settings()
dir_path = os.path.realpath(settings['static_files'])
SaveFile.__init__(self, dir_path)
def save(self, file):
input_file = file['fp']
ext = get_ext(file['filename'])
filename = '%s%s' % (uuid.uuid4(),ext)
fullpath = os.path.join(self.dir_path, filename)
def save(self, request, name):
input_file = request.POST[name].file
ext = get_ext(request.POST[name].filename)
fullpath = self.create_fullpath(ext)
output_file = open(fullpath, 'wb')
input_file.seek(0)
while True:
......@@ -399,7 +409,23 @@ class Upload(SaveFile):
break
output_file.write(data)
output_file.close()
return filename
return fullpath
class UploadFiles(SaveFile):
def save(self, fs):
input_file = fs.file
ext = get_ext(fs.filename)
fullpath = self.create_fullpath(ext)
output_file = open(fullpath, 'wb')
input_file.seek(0)
while True:
data = input_file.read(2<<16)
if not data:
break
output_file.write(data)
output_file.close()
return fullpath
def to_str(v):
typ = type(v)
print typ, v
......
......@@ -413,8 +413,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==0,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1)
ARInvoice.is_sspd==1
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1)
).group_by(ARInvoice.unit_id,
ARInvoice.unit_kode,
ARInvoice.unit_nama
......@@ -462,8 +463,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==0,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1),
ARInvoice.is_sspd==1,
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1),
ARInvoice.unit_id==b1
).order_by(ARInvoice.rek_kode,
ARInvoice.kode)
......
......@@ -110,6 +110,18 @@ class AddSchema(colander.Schema):
widget=widget.HiddenWidget(),
oid = "subjek_pajak_un"
)
wp_nama = colander.SchemaNode(
colander.String(),
#widget=auto_wp_nm3,
title="Nama Lainnya",
oid = "wp_nama"
)
wp_alamat_1 = colander.SchemaNode(
colander.String(),
#widget=auto_wp_nm3,
title="Alamat",
oid = "wp_alamat_1"
)
objek_pajak_id = colander.SchemaNode(
colander.Integer(),
title="Objek",
......@@ -228,8 +240,8 @@ def save(request, values, row=None):
row.unit_nama = ref.nama
ref = SubjekPajak.get_by_id(row.subjek_pajak_id)
row.wp_kode = ref.kode
row.wp_nama = ref.nama
row.wp_alamat_1 = ref.alamat_1
#row.wp_nama = ref.nama
#row.wp_alamat_1 = ref.alamat_1
row.wp_alamat_2 = ref.alamat_2
ref = ObjekPajak.get_by_id(row.objek_pajak_id)
......@@ -359,7 +371,7 @@ def view_edit(request):
row = query_id(request).first()
uid = row.id
kode = row.kode
if not row:
return id_not_found(request)
if row.status_bayar:
......@@ -386,11 +398,14 @@ def view_edit(request):
return route_list(request)
elif SESS_EDIT_FAILED in request.session:
return session_failed(request, SESS_EDIT_FAILED)
print "---------------",row
values = row.to_dict()
values['objek_pajak_nm'] = row.objekpajaks.nama
values['subjek_pajak_nm'] = row.subjekpajaks.nama
values['subjek_pajak_us'] = row.subjekpajaks.user_id
values['subjek_pajak_un'] = row.subjekpajaks.unit_id
values['objek_pajak_nm'] = row.objekpajaks and row.objekpajaks.nama or row.op_nama
values['subjek_pajak_nm'] = row.subjekpajaks and row.subjekpajaks.nama or row.wp_nama
values['objek_pajak_id'] = row.objek_pajak_id or 0
values['subjek_pajak_id'] = row.subjek_pajak_id or 0
values['subjek_pajak_us'] = row.subjekpajaks and row.subjekpajaks.user_id or 0
values['subjek_pajak_un'] = row.subjekpajaks and row.subjekpajaks.unit_id or 0
values['unit_nm'] = row.units.nama
form.set_appstruct(values)
return dict(form=form)
......@@ -422,8 +437,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==0,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1)
ARInvoice.is_sspd==1,
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1)
).group_by(ARInvoice.unit_id,
ARInvoice.unit_kode,
ARInvoice.unit_nama
......@@ -471,8 +487,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==0,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1),
ARInvoice.is_sspd==1,
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1),
ARInvoice.unit_id==b1
).order_by(ARInvoice.rek_kode,
ARInvoice.kode)
......@@ -584,7 +601,7 @@ def view_act(request):
columns.append(ColumnDT('is_sspd'))
columns.append(ColumnDT('is_sts'))
query = DBSession.query(ARInvoice
).filter(ARInvoice.status_grid==0,
).filter(#ARInvoice.status_grid==0,
ARInvoice.tgl_tetap.between(awal,akhir)
).order_by(desc(ARInvoice.tgl_tetap),desc(ARInvoice.kode))
if u != 1:
......
......@@ -606,7 +606,8 @@ def view_pdf(request):
unit_al = DBSession.query(Unit.alamat).filter(UserUnit.unit_id==unit_id, Unit.id==unit_id).first()
unit_al = '%s' % unit_al
#unal = DBSession.query(Unit.alamat).filter(UserUnit.unit_id==unit_id, Unit.id==unit_id).first()
awal = 'awal' in request.params and request.params['awal']\
or datetime.now().strftime('%Y-%m-%d')
akhir = 'akhir' in request.params and request.params['akhir']\
......
......@@ -309,6 +309,7 @@ def query_invoice(kode):
return DBSession.query(ARInvoice).\
filter(ARInvoice.kode==kode,
ARInvoice.status_bayar==0,
ARInvoice.jumlah!=0,
ARInvoice.is_sspd==0,
#ARInvoice.is_tbp==0,
ARInvoice.is_sts==0).first()
......@@ -340,7 +341,7 @@ def view_add(request):
values['bayar'] = pokok+denda
values['tgl_bayar'] = datetime.now()
else:
request.session.flash('Tagihan %s tidak ditemukan atau Tagihan tersebut hasil dari TBP.' % kode)
request.session.flash('Nomor bayar %s tidak ditemukan atau jumlah tagihannya Nol Rupiah.' % kode)
form.set_appstruct(values)
return dict(form=form)
......
......@@ -110,12 +110,14 @@ class MasterAddSchema(colander.Schema):
wp_alamat_1 = colander.SchemaNode(
colander.String(),
title="Alamat Pertama",
missing = colander.drop,
oid = "wp_alamat_1"
)
wp_alamat_2 = colander.SchemaNode(
colander.String(),
title="Alamat Kedua",
missing = colander.drop,
oid = "wp_alamat_2"
)
......@@ -141,12 +143,14 @@ class MasterAddSchema(colander.Schema):
op_alamat_1 = colander.SchemaNode(
colander.String(),
title="Alamat Pertama",
missing = colander.drop,
oid = "op_alamat_1"
)
op_alamat_2 = colander.SchemaNode(
colander.String(),
title="Alamat Kedua",
missing = colander.drop,
oid = "op_alamat_2"
)
......@@ -288,7 +292,14 @@ def save(request, values, row=None):
if not row.tahun_id:
row.tahun_id = datetime.now().strftime('%Y')
if not row.wp_alamat_1:
row.wp_alamat_1 = '-'
if not row.wp_alamat_2:
row.wp_alamat_2 = '-'
if not row.op_alamat_1:
row.op_alamat_1 = '-'
if not row.op_alamat_2:
row.op_alamat_2 = '-'
# unit = Unit.get_by_id(row.unit_id)
# row.unit_kd = unit.kode
# row.unit_nm = unit.nama
......@@ -432,7 +443,7 @@ def view_add(request):
########
def query_id(request):
query = DBSession.query(ARTbp).filter(ARTbp.id==request.matchdict['id'])
if request.user.id != 1:
if group_in(request, 'bendahara'):
query = query.join(Unit).join(UserUnit).\
filter(UserUnit.user_id==request.user.id)
return query
......@@ -533,7 +544,8 @@ def view_posting(request):
func.sum(ARTbp.bunga).label('bunga'),
func.sum(ARTbp.jumlah).label('jumlah')
).filter(ARTbp.tgl_terima.between(awal,akhir),
ARTbp.status_invoice==0
ARTbp.status_invoice==0,
ARTbp.jumlah!=0
).group_by(ARTbp.wilayah_id,
ARTbp.unit_id,
ARTbp.unit_kode,
......@@ -646,6 +658,7 @@ def view_posting(request):
rows1 = DBSession.query(ARTbp
).filter(ARTbp.tgl_terima.between(awal,akhir),
ARTbp.status_invoice==0,
ARTbp.jumlah!=0,
ARTbp.wilayah_id==row.wil_id,
ARTbp.unit_id==row.un_id,
ARTbp.rek_kode==row.rek_kd
......
......@@ -288,6 +288,11 @@ def daftar_route():
######################################
## Kumpulan Headofkode & Headofname ##
######################################
auto_unit_nm_sptpd = widget.AutocompleteInputWidget(
size=60,
values = '/skpd/hon_sptpd/act',
min_length=1)
auto_unit_nm2 = widget.AutocompleteInputWidget(
size=60,
values = '/skpd/hon_tbp/act',
......
No preview for this file type
......@@ -450,8 +450,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==1,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1)
ARInvoice.is_sspd==1
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1)
).group_by(ARInvoice.unit_id,
ARInvoice.unit_kode,
ARInvoice.unit_nama
......@@ -499,8 +500,9 @@ def view_posting(request):
).filter(ARInvoice.status_grid==1,
ARInvoice.tgl_tetap.between(awal,akhir),
ARInvoice.is_sts==0,
or_(ARInvoice.is_tbp==1,
ARInvoice.is_sspd==1),
ARInvoice.is_sspd==1,
#or_(ARInvoice.is_tbp==1,
# ARInvoice.is_sspd==1),
ARInvoice.unit_id==b1
).order_by(ARInvoice.rek_kode,
ARInvoice.kode)
......
......@@ -273,4 +273,29 @@ def view_act(request):
d['kode'] = k[2]
r.append(d)
print '------------- Rekening --------- ',r
return r
\ No newline at end of file
return r
elif url_dict['act']=='hon_sptpd':
print "-- Lewat ----------------- "
u = request.user.id
term = 'term' in params and params['term'] or ''
rows = DBSession.query(Rekening.id, Rekening.nama, Rekening.kode).\
filter(Rekening.level_id.in_([5]),
Rekening.kode=='4.1.1.05.01.',
Rekening.nama.ilike('%%%s%%' % term))
if group_in(request, 'bendahara'):
x = DBSession.query(UserUnit.unit_id).filter(UserUnit.user_id==u).first()
y = '%s' % x
z = int(y)
print "-- Unit ID ----------------- ",z
rows = rows.join(UnitRekening).filter(UnitRekening.unit_id==z)
r = []
for k in rows.all():
d={}
d['id'] = k[0]
d['value'] = k[1]
d['nama'] = k[1]
d['kode'] = k[2]
r.append(d)
print '------------- Rekening --------- ',r
return r
\ No newline at end of file
......@@ -327,6 +327,23 @@ def view_act(request):
r.append(d)
print '---------------Unit------------------',r
return r
elif url_dict['act']=='hon_sptpd':
term = 'term' in params and params['term'] or ''
rows = DBSession.query(Unit.id, Unit.nama, Unit.kode
).filter(Unit.nama.ilike('%%%s%%' % term),
Unit.level_id.in_([3,4])
).all()
r = []
for k in rows:
d={}
d['id'] = k[0]
d['value'] = k[1]
d['nama'] = k[1]
d['kode'] = k[2]
r.append(d)
print '---------------Unit------------------',r
return r
elif url_dict['act']=='hon_fast':
term = 'term' in params and params['term'] or ''
......
......@@ -61,6 +61,28 @@
${error}</p>
</div>
</div>
<div class="form-group" tal:define="field form['wp_nama']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-3" id="req-${field.oid}">
${field.title}<span id="error-${field.oid}" class="text text-danger"
tal:condition="field.required">&nbsp*</span></label>
<div class="col-md-9">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<div class="form-group" tal:define="field form['wp_alamat_1']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-3" id="req-${field.oid}">
${field.title}<span id="error-${field.oid}" class="text text-danger"
tal:condition="field.required">&nbsp*</span></label>
<div class="col-md-9">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<!--unit_nm ------------------------------->
<div class="form-group" tal:define="field form['unit_nm']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-3" id="req-${field.oid}">
......@@ -242,7 +264,10 @@
$('#subjek_pajak_nm').bind('typeahead:selected', function(obj, datum, name) {
$('#subjek_pajak_id').val(datum.id);
$('#subjek_pajak_us').val(datum.user);
$('#subjek_pajak_un').val(datum.unit);
$('#subjek_pajak_un').val(datum.unit);
$('#wp_nama').val(datum.value);
$('#wp_alamat_1').val(datum.alamat);
//Untuk headof Objek
$('#objek_pajak_nm').typeahead({
......
......@@ -34,7 +34,7 @@
<tr>
<th>ID</th>
<th>No. TBP</th>
<th>Subjek</th>
<th>Penyetor</th>
<th>Objek</th>
<th>Rekening</th>
<th>Terima</th>
......
......@@ -50,25 +50,16 @@
<li class="dropdown" tal:attributes="class request.matched_route.name in ['wp', 'wp-add', 'wp-edit', 'wp-delete'] and 'active'">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">e-Payment<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/wp">Penyetor</a></li>
<li><a href="/op">Objek</a></li>
<li><a href="/artbp">TBP</a></li>
<li><a href="/fast-pay">No. Bayar</a></li>
<li><a href="/arinvoice">No. Bayar (BUD)</a></li>
<li><a href="/arinvoiceb">No. Bayar (Bendahara)</a></li>
<li><a href="/arinvoicewp">No. Bayar (WP)</a></li>
<li><a href="/artbp">TBP</a></li>
<li><a href="/wp">Penyetor</a></li>
<li><a href="/op">Objek</a></li>
<li><a href="/report">Laporan</a></li>
</ul>
</li>
<!--li class="dropdown" tal:attributes="class request.matched_route.name in ['sptpd-wapu', 'sptpd-wapu-add', 'sptpd-wapu-edit', 'sptpd-wapu-delete'] and 'active'">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">e-SPTPD<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/sptpd/wajib">Wajib Pajak</a></li>
<li><a href="/sptpd/objek">Objek Pajak</a></li>
<li><a href="/sptpd/wapu">SPTPD WAPU</a></li>
<li><a href="/sptpd/report">Laporan</a></li>
</ul>
</li-->
<li class="dropdown" tal:attributes="class request.matched_route.name in ['arsspd', 'arsspd-add', 'arsspd-edit', 'arsspd-delete'] and 'active'">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Penerimaan<b class="caret"></b></a>
<ul class="dropdown-menu">
......@@ -76,6 +67,15 @@
<li><a href="/report/sspd">Laporan</a></li>
</ul>
</li>
<li class="dropdown" tal:attributes="class request.matched_route.name in ['sptpd-wapu', 'sptpd-wapu-add', 'sptpd-wapu-edit', 'sptpd-wapu-delete'] and 'active'">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">e-SPTPD<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/sptpd/wajib">Wajib Pungut</a></li>
<!--li><a href="/sptpd/objek">Objek Pajak</a></li-->
<li><a href="/sptpd/wapu">SPTPD</a></li>
<li><a href="/sptpd/report">Laporan</a></li>
</ul>
</li>
<!--li tal:attributes="class request.path == '/arsspd' and 'active'"><a href="/arsspd">Penerimaan</a></li-->
<li tal:attributes="class request.path == '/arsts' and 'active'"><a href="/arsts">STS</a></li>
......
<html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content">
<link href="/static/datatables/extensions/TableTools/css/dataTables.tableTools.min.css" rel="stylesheet">
<link href="/static/datatables/media/css/dataTables.bootstrap.css" rel="stylesheet">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Tambah SPTPD</h3>
</div>
<div class="panel-body">
<form id="myform" method="post" enctype="multipart/form-data" accept-charset="utf-8"
class="form-horizontal">
<fieldset class="deformFormFieldset">
<input type="hidden" name="_charset_" />
<input type="hidden" name="__formid__" value="deform"/>
<div tal:condition="'id' in form">
<div tal:define="field form['id']">
${structure:field.serialize()}
</div>
</div>
<div class="form-group">
<div tal:define="field form['unit_id']" style="display: none;">
${structure:field.serialize()}
</div>
<div tal:define="field form['unit_kd']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-2">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<div tal:define="field form['unit_nm']" id="item-${field.oid}">
<div class="col-md-6">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group">
<div tal:define="field form['subjek_pajak_id']" style="display: none;">
${structure:field.serialize()}
</div>
<div tal:define="field form['subjek_pajak_nm']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-5">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group">
<div tal:define="field form['nama']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-5">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group">
<div tal:define="field form['periode_1']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-2">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<div tal:define="field form['periode_2']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-1" id="req-${field.oid}">
s.d</label>
<div class="col-md-2">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group">
<div tal:define="field form['tgl_sptpd']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-2">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<div tal:define="field form['jumlah']" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-1" id="req-${field.oid}">
${field.title}</label>
<div class="col-md-2">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
<script>
//$("#kode").attr('readonly',true);
//$("#das").attr('readonly',true);
//$("#pok").attr('readonly',true);
$("#jum").attr('readonly',true);
$("#tar").attr('readonly',true);
$("#unit_kd").attr('readonly',true);
</script>
</div>
<div class="form-group">
<div class="form-group col-md-2">
</div>
<div class="form-group col-md-6">
<div tal:define="field form['uploads']" id="item-${field.oid}">
<div class="col-md-12">
${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error"
tal:repeat="error field.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<label class="control-label col-md-4"></label>
<button id="deformsave" name="simpan" type="submit" class="btn btn-primary "
value="simpan">Simpan</button>
<button id="deformcancel" name="batal" type="submit" class="btn btn-danger "
value="batal">Batal</button>
</div><br><br>
</fieldset>
</form>
<script>
$(document).ready( function(){
$('#unit_nm').bind('typeahead:selected', function(obj, datum, name) {
$('#unit_id').val(datum.id);
$('#unit_kd').val(datum.kode);
$('#subjek_pajak_nm').typeahead('setQuery', '');
$('#subjek_pajak_id').val('');
});
$('#subjek_pajak_nm').typeahead({
remote: {
url: "/sptpd/wajib/hon_sptpd/act?term=%QUERY&unit_id=",
replace: function () {
var q = "/sptpd/wajib/hon_sptpd/act?term="+$('#subjek_pajak_nm').val();
if ($('#unit_id').val()) {
q += "&unit_id="+encodeURIComponent($('#unit_id').val());
}
return q;
}
},
"hint" : true,
"cache" : false,
"highlight" : true,
"minLength" : 1,
"limit" : 15
},{
"name" : 'subjek_pajak_nm',
"displayKey": 'value',
});
$('#subjek_pajak_nm').bind('typeahead:selected', function(obj, datum, name) {
$('#subjek_pajak_id').val(datum.id);
//$('#wp_nama').val(datum.value);
//$('#wp_alamat_1').val(datum.alamat_1);
});
});
</script>
</div>
</div>
</div>
</html>
\ No newline at end of file
<html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Warning</h3>
</div>
<div class="panel-body">
Hapus SPTPD Wapu dengan No.Bayar ${row.kode} ?
</div>
</div>
<div tal:content="structure form"/>
</div>
</html>
<html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content">
<link href="/static/datatables/extensions/TableTools/css/dataTables.tableTools.min.css" rel="stylesheet">
<link href="/static/datatables/media/css/dataTables.bootstrap.css" rel="stylesheet">
<h4>Surat Pemberitahuan Pajak Daerah (SPTPD)</h4>
<hr>
<table id="table1" name="table1" class="table table-bordered table-hover table-condensed" >
<thead>
<tr>
<th>ID</th>
<th>No. SPTPD</th>
<th>Uraian</th>
<th>Wajib Pungut</th>
<th>Tgl. SPTPD</th>
<th>Jumlah</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script src="/static/datatables/media/js/jquery.dataTables.min.js"></script>
<!--script src="/static/datatables/media/js/jquery.jeditable.js')}"></script-->
<script src="/static/datatables/media/js/jquery.dataTables.ext.js"></script>
<script src="/static/datatables/extensions/TableTools/media/js/ZeroClipboard.js"></script>
<script src="/static/datatables/media/js/dataTables.bootstrap.js"></script>
<script>
var mID;
var oTable;
var iPos;
var oFormUrl = "/sptpd/wapu/";
var oTableUrl = oFormUrl+"grid/act";
$(document).ready(function () {
oTable = $('#table1').DataTable({
ajaxSource : oTableUrl,
//"bStateSave" : true,
serverSide : true,
"bProcessing" : true,
"sDom" : '<"toolbar">lfrtip',
"bScrollCollapse" : true,
"bSort" : true,
"bSearch" : true,
"bInfo" : false,
"bFilter" : true,
"bAutoWidth" : false,
"bPaginate" : true,
"sPaginationType" : "full_numbers",
"lengthMenu": [
[10, 25, 50, 100],
[10, 25, 50, 100]
],
"aoColumnDefs": [
{ "bSearchable": false,
"bVisible" : false,
"aTargets" : [0]
},{
"aTargets" : [6], // Untuk status invoice
"mRender" : function (data, type, full) {
if (data == "0") {
return 'N';
} else if (data == "1") {
return 'Posting';
}
}
}],
"aoColumns": [
null,
{"sWidth": "50px"},
{"sWidth": "100px"},
{"sWidth": "70px"},
{"sWidth": "50px"},
{"sWidth": "75px", "sClass": "right"},
{"sWidth": "20px", "sClass": "center"},
],
"fnRowCallback": function (nRow, aData, iDisplayIndex) {
$(nRow).on("click", function (event) {
if ($(this).hasClass('row_selected')) {
/* mID = '';
$(this).removeClass('row_selected'); */
} else {
var data = oTable.fnGetData(this);
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
})
//Kondisi Background-color Invoice
switch(aData[6]){
case '1' :
$('td',nRow).css("background-color","#ddffdd")
break;
}
},
"language": {
"search": "Cari: ",
"paginate":{
"first": "Pertama ",
"last": "Terakhir ",
"previous": "Sebelumnya ",
"next": "Selanjutnya ",
},
"lengthMenu": "Tampil _MENU_ baris "
}
});
var tb_array = [
'<div class="btn-group pull-left">',
' <button id="btn_tambah" class="btn btn btn-primary pull-left" type="button">Tambah</button>',
' <button id="btn_edit" class="btn btn btn-primary pull-left" type="button">Edit</button>',
' <button id="btn_delete" class="btn btn btn-danger pull-left" type="button">Hapus</button>',
' <button id="btn_rincian" class="btn btn btn-primary pull-left" type="button">Rincian</button>',
' <button id="btn_sspd" class="btn btn btn-primary pull-left" type="button">SSPD</button>',
' <button id="btn_lampiran" class="btn btn btn-primary pull-left" type="button">Lampiran</button>',
' <button id="btn_sptpd" class="btn btn btn-primary pull-left" type="button">SPTPD</button>',
' <button id="btn_close" class="btn btn btn-warning" type="button">Tutup</button>',
' &nbsp;',
' <label class="pull-left">Periode',
' <input id="awal" class="input-sm" name="awal" type="text" value="${rows.awal}">',
' s.d <input id="akhir" class="input-sm" name="akhir" type="text" value="${rows.akhir}">',
' </label>',
' &nbsp;',
'</div>',
];
var tb = tb_array.join(' ');
$("div.toolbar").html(tb);
var tb_periode = [
];
var tb = tb_periode.join(' ');
$("div.periode").html(tb);
$('#awal').pickadate({"selectMonths": true,
"submitFormat": "yyyy-mm-dd",
"selectYears": true, "format": "yyyy-mm-dd"});
$('#akhir').pickadate({"selectMonths": true,
"submitFormat": "yyyy-mm-dd",
"selectYears": true, "format": "yyyy-mm-dd"});
$('#awal, #akhir').change(function(){
oTableUrl = oFormUrl+"grid/act?awal="+$('#awal').val()+"&akhir="+$('#akhir').val();
oTable.ajax.url(oTableUrl).load();
});
$('#table1 tbody').on('click', 'tr', function () {
if ($(this).hasClass('selected')) {
mID = '';
$(this).removeClass('selected');
} else {
var aData = oTable.row( this ).data();
mID = aData[0];
oTable.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
}
});
$('#btn_tambah').click(function () {
window.location = oFormUrl+'add';
});
$('#btn_edit').click(function () {
if (mID) {
window.location = oFormUrl+mID+'/edit';
} else {
alert('Silahkan pilih data yang akan diedit');
}
});
$('#btn_rincian').click(function () {
url = '/reports/act/sptpd_rincian?sptpd_id='+mID
if(mID) window.open(url);
else alert('Silahkan pilih data yang akan dicetak');
});
$('#btn_sspd').click(function () {
url = '/reports/act/sptpd_sspd?sptpd_id='+mID
if(mID) window.open(url);
else alert('Silahkan pilih data yang akan dicetak');
});
$('#btn_lampiran').click(function () {
url = '/reports/act/sptpd_lampiran?sptpd_id='+mID
if(mID) window.open(url);
else alert('Silahkan pilih data yang akan dicetak');
});
$('#btn_sptpd').click(function () {
url = '/reports/act/sptpd?sptpd_id='+mID
if(mID) window.open(url);
else alert('Silahkan pilih data yang akan dicetak');
});
$('#btn_close').click(function () {
window.location = "/"
});
$('#btn_delete').click(function () {
if (mID) {
var hapus = confirm('Hapus data ini?');
if (hapus == true) {
window.location = oFormUrl+mID+'/delete';
};
} else {
alert('Silahkan pilih data yang akan dihapus');
}
});
});
</script>
</div>
</html>
\ No newline at end of file
......@@ -16,7 +16,7 @@
<thead>
<tr>
<th>ID</th>
<th>NPWPD/ Registrasi</th>
<th>No. Registrasi</th>
<th>Nama</th>
<th>Alamat</th>
<th>Alamat ke-2</th>
......
<html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content" class="form-550">
<h4>Tambah Wajib Pajak</h4>
<h4>Tambah Wajib Pungut</h4>
<hr>
<form id="deform" method="POST" enctype="multipart/form-data" accept-charset="utf-8"
class="form-horizontal">
......
......@@ -6,7 +6,7 @@
<h3 class="panel-title">Warning</h3>
</div>
<div class="panel-body">
Hapus Wajib Pajak dengan NPWPD # ${row.kode} ${row.nama} ?
Hapus Wajib Pungut dengan NPWPD # ${row.kode} ${row.nama} ?
</div>
</div>
......
<html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content" class="form-550">
<h4>Edit Wajib Pajak</h4>
<h4>Edit Wajib Pungut</h4>
<hr>
<form id="deform" method="POST" enctype="multipart/form-data" accept-charset="utf-8"
class="form-horizontal">
......
......@@ -2,7 +2,7 @@
<div metal:fill-slot="content">
<link href="/static/datatables/extensions/TableTools/css/dataTables.tableTools.min.css" rel="stylesheet">
<link href="/static/datatables/media/css/dataTables.bootstrap.css" rel="stylesheet">
<h4>Wajib Pajak</h4>
<h4>Wajib Pungut</h4>
<hr>
<div class="container">
<!--form class="form-inline" role="form" id="frm_upload" name="frm_upload">
......
......@@ -106,7 +106,7 @@ class AddSchema(colander.Schema):
kode = colander.SchemaNode(
colander.String(),
missing=colander.drop,
title ="NPWPD/No.Reg"
title ="No. Registrasi"
)
nama = colander.SchemaNode(
colander.String()
......@@ -181,7 +181,7 @@ def get_form(request, class_form):
schema.request = request
return Form(schema, buttons=('simpan','batal'))
def save(request,values, row=None):
def save(request, values, row=None):
login = None
if not row:
......@@ -226,7 +226,7 @@ def save(request,values, row=None):
login.status = values['status']
login.user_name = values['email']
login.email = values['email']
login.password = values['kode']
login.password = row.kode
DBSession.add(login)
DBSession.flush()
......@@ -548,7 +548,11 @@ def view_act(request):
elif url_dict['act']=='hon2':
term = 'term' in params and params['term'] or ''
u = request.user.id
rows = DBSession.query(SubjekPajak.id, SubjekPajak.nama, SubjekPajak.user_id, SubjekPajak.unit_id
rows = DBSession.query(SubjekPajak.id,
SubjekPajak.nama,
SubjekPajak.user_id,
SubjekPajak.unit_id,
SubjekPajak.alamat_1
).join(Unit
).outerjoin(UserUnit
).filter(SubjekPajak.nama.ilike('%%%s%%' % term),
......@@ -565,6 +569,7 @@ def view_act(request):
d['value'] = k[1]
d['user'] = k[2]
d['unit'] = k[3]
d['alamat'] = k[4]
r.append(d)
return r
......@@ -770,4 +775,4 @@ def view_pdf(request):
un_al=unit_al)
else:
pdf, filename = open_rml_pdf('wp.rml', rows2=rows)
return pdf_response(request, pdf, filename)
return pdf_response(request, pdf, filename)
\ No newline at end of file
......@@ -231,7 +231,7 @@ def save_request(values, request, row=None):
row = save(request, values, row)
print '----------------ROW-------------------',row
if row:
request.session.flash('Wajib Pajak %s %s sudah disimpan.' % (row.kode, row.nama))
request.session.flash('Wajib Pungut %s %s sudah disimpan.' % (row.kode, row.nama))
def route_list(request):
return HTTPFound(location=request.route_url('sptpd-wajib'))
......@@ -333,7 +333,7 @@ def view_edit(request):
return id_not_found(request)
x = DBSession.query(ARInvoice).filter(ARInvoice.subjek_pajak_id==uid).first()
if x:
request.session.flash('Tidak bisa diedit, karena penyetor sudah digunakan di daftar bayar.','error')
request.session.flash('Tidak bisa diedit, karena Wajib Pungut sudah digunakan di daftar bayar.','error')
return route_list(request)
y = DBSession.query(User.email).filter(User.email==email).first()
......@@ -405,12 +405,12 @@ def view_delete(request):
x = DBSession.query(ObjekPajak).filter(ObjekPajak.subjekpajak_id==id).first()
if x:
request.session.flash('Tidak bisa dihapus, karena penyetor sudah digunakan di Objek Pajak.','error')
request.session.flash('Tidak bisa dihapus, karena Wajib Pungut sudah digunakan di Objek Pajak.','error')
return route_list(request)
y = DBSession.query(ARInvoice).filter(ARInvoice.subjek_pajak_id==id).first()
if y:
request.session.flash('Tidak bisa dihapus, karena penyetor sudah digunakan di daftar bayar.','error')
request.session.flash('Tidak bisa dihapus, karena Wajib Pungut sudah digunakan di daftar bayar.','error')
return route_list(request)
if not row:
......@@ -418,7 +418,7 @@ def view_delete(request):
form = Form(colander.Schema(), buttons=('hapus','batal'))
if request.POST:
if 'hapus' in request.POST:
msg = 'Wajib pajak dengan NPWPD %s %s sudah dihapus.' % (row.kode, row.nama)
msg = 'Wajib pungut dengan NPWPD %s %s sudah dihapus.' % (row.kode, row.nama)
q.delete()
DBSession.flush()
request.session.flash(msg)
......@@ -472,8 +472,10 @@ def view_act(request):
SubjekPajak.kode,
SubjekPajak.nama,
SubjekPajak.user_id,
SubjekPajak.unit_id
SubjekPajak.unit_id,
SubjekPajak.alamat_1,
).filter(SubjekPajak.status_grid==1,
SubjekPajak.status==1,
SubjekPajak.nama.ilike('%%%s%%' % term)
).all()
r = []
......@@ -484,8 +486,47 @@ def view_act(request):
d['kode'] = k[1]
d['user'] = k[3]
d['unit'] = k[4]
d['alamat_1'] = k[5]
r.append(d)
return r
elif url_dict['act']=='hon_sptpd':
term = 'term' in params and params['term'] or ''
unit_id = 'unit_id' in params and params['unit_id'] or ''
if group_in(request, 'bendahara'):
print "----- Unit SPTPD ----- ",unit_id
rows = DBSession.query(SubjekPajak.id,
SubjekPajak.nama,
SubjekPajak.alamat_1,
SubjekPajak.alamat_2
).join(Unit
).outerjoin(UserUnit
).filter(SubjekPajak.nama.ilike('%%%s%%' % term),
SubjekPajak.status==1,
SubjekPajak.status_grid==1,
Unit.id==SubjekPajak.unit_id,
UserUnit.unit_id==Unit.id,
UserUnit.user_id==u
).all()
else:
rows = DBSession.query(SubjekPajak.id,
SubjekPajak.nama,
SubjekPajak.alamat_1,
SubjekPajak.alamat_2
).filter(SubjekPajak.nama.ilike('%%%s%%' % term),
SubjekPajak.status==1,
SubjekPajak.status_grid==1,
SubjekPajak.unit_id==unit_id
).all()
r = []
for k in rows:
d={}
d['id'] = k[0]
d['value'] = k[1]
d['alamat_1'] = k[2]
d['alamat_2'] = k[3]
r.append(d)
return r
return r
elif url_dict['act']=='hon_tbp':
term = 'term' in params and params['term'] or ''
......@@ -726,9 +767,25 @@ def view_csv(request):
##########
@view_config(route_name='sptpd-wajib-pdf', permission='read')
def view_pdf(request):
global awal,akhir,unit_nm,unit_al,unit_kd
params = request.params
url_dict = request.matchdict
u = request.user.id
if group_in(request, 'bendahara'):
unit_id = DBSession.query(UserUnit.unit_id).filter(UserUnit.user_id==u).first()
unit_id = '%s' % unit_id
unit_id = int(unit_id)
unit_kd = DBSession.query(Unit.kode).filter(UserUnit.unit_id==unit_id, Unit.id==unit_id).first()
unit_kd = '%s' % unit_kd
unit_nm = DBSession.query(Unit.nama).filter(UserUnit.unit_id==unit_id, Unit.id==unit_id).first()
unit_nm = '%s' % unit_nm
unit_al = DBSession.query(Unit.alamat).filter(UserUnit.unit_id==unit_id, Unit.id==unit_id).first()
unit_al = '%s' % unit_al
if url_dict['pdf']=='reg' :
query = query_reg()
if group_in(request, 'bendahara'):
......@@ -746,6 +803,11 @@ def view_pdf(request):
email=r.email,
unit=r.unit)
rows.append(s)
print "--- ROWS ---- ",rows
pdf, filename = open_rml_pdf('wp_sptpd.rml', rows2=rows)
print "--- ROWS ---- ",rows
if group_in(request, 'bendahara'):
pdf, filename = open_rml_pdf('wp_sptpd_ben.rml', rows2=rows,
un_nm=unit_nm,
un_al=unit_al)
else:
pdf, filename = open_rml_pdf('wp_sptpd.rml', rows2=rows)
return pdf_response(request, pdf, filename)
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!