Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
sismiop-models
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 128fcdb9
authored
Jul 01, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Modul tangsel memperhatikan field sppt.faktor_pengurang_sppt
1 parent
0309da2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
sismiop/scripts/available_invoice.py
sismiop/services/tangsel/__init__.py
sismiop/scripts/available_invoice.py
View file @
128fcdb
...
...
@@ -43,6 +43,7 @@ def get_option_tangsel(argv):
pars
.
add_argument
(
'conf'
)
pars
.
add_argument
(
'--tahun'
)
pars
.
add_argument
(
'--discount-penuh'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--faktor-pengurang'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--count'
,
type
=
int
,
default
=
default_count
,
help
=
help_count
)
return
pars
.
parse_args
(
argv
)
...
...
sismiop/services/tangsel/__init__.py
View file @
128fcdb
...
...
@@ -83,6 +83,9 @@ class Inquiry(BaseInquiry):
return
0
def
hitung_discount_pokok
(
self
):
faktor_pengurang
=
self
.
invoice
.
faktor_pengurang_sppt
or
0
if
faktor_pengurang
>
0
:
return
0
if
self
.
invoice
.
thn_pajak_sppt
not
in
TAHUN_PAJAK_DISC_POKOK
:
return
0
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
...
...
@@ -143,6 +146,9 @@ class Reversal(BaseReversal):
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
def
get_inquiry_class
(
self
):
return
Inquiry
...
...
@@ -162,15 +168,17 @@ class AvailableInvoiceTangsel(AvailableInvoice):
def
get_msg
(
self
,
inq
):
s
=
AvailableInvoice
.
get_msg
(
self
,
inq
)
if
not
inq
.
discount_pokok
:
if
inq
.
discount_pokok
:
s
=
'{}, Discount Pokok {}'
.
format
(
s
,
thousand
(
inq
.
discount_pokok
))
if
inq
.
invoice
.
faktor_pengurang_sppt
:
s
=
'{}, Faktor Pengurang {}'
.
format
(
s
,
thousand
(
inq
.
invoice
.
faktor_pengurang_sppt
))
return
s
return
'{}, Discount Pokok {}'
.
format
(
s
,
thousand
(
inq
.
discount_pokok
))
def
get_filter
(
self
,
q
):
# Override
if
self
.
option
.
discount_penuh
:
DBSession
=
get_db_session
()
Sppt
=
self
.
get_invoice_model
()
if
self
.
option
.
discount_penuh
:
Sppt1
=
aliased
(
Sppt
)
Sppt2
=
aliased
(
Sppt
)
subq1
=
DBSession
.
query
(
Sppt1
)
.
filter
(
...
...
@@ -192,8 +200,10 @@ class AvailableInvoiceTangsel(AvailableInvoice):
Sppt2
.
kd_jns_op
==
Sppt
.
kd_jns_op
,
Sppt2
.
thn_pajak_sppt
.
in_
(
THN_DISC
),
Sppt2
.
status_pembayaran_sppt
!=
'1'
)
return
q
.
filter
(
q
=
q
.
filter
(
Sppt
.
thn_pajak_sppt
<
str
(
THN_AWAL
),
subq1
.
exists
(),
~
subq2
.
exists
())
if
self
.
option
.
faktor_pengurang
:
q
=
q
.
filter
(
Sppt
.
faktor_pengurang_sppt
>
0
)
return
q
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment