Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Dokos
Dokos
Commits
34f303f1
Commit
34f303f1
authored
Mar 09, 2020
by
Charles-Henri Decultot
Browse files
Merge branch 'staging'
parents
14195bb1
144d51ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
erpnext/__init__.py
erpnext/__init__.py
+1
-1
erpnext/accounts/doctype/payment_request/payment_request.py
erpnext/accounts/doctype/payment_request/payment_request.py
+8
-2
erpnext/accounts/doctype/subscription/subscription.py
erpnext/accounts/doctype/subscription/subscription.py
+5
-2
No files found.
erpnext/__init__.py
View file @
34f303f1
...
...
@@ -5,7 +5,7 @@ import frappe
from
erpnext.hooks
import
regional_overrides
from
frappe.utils
import
getdate
__version__
=
'1.3.1
0
'
__version__
=
'1.3.1
1
'
def
get_default_company
(
user
=
None
):
'''Get default company for user'''
...
...
erpnext/accounts/doctype/payment_request/payment_request.py
View file @
34f303f1
...
...
@@ -134,11 +134,17 @@ class PaymentRequest(Document):
def
check_if_immediate_payment_is_autorized
(
self
):
try
:
output
=
[]
f
or
gateway
in
self
.
payment_gateway
s
:
result
=
self
.
check_immediate_payment_for_gateway
(
gateway
.
payment_gateway
)
i
f
self
.
payment_gateway
:
result
=
self
.
check_immediate_payment_for_gateway
(
self
.
payment_gateway
)
if
result
:
output
.
append
(
result
)
else
:
for
gateway
in
self
.
payment_gateways
:
result
=
self
.
check_immediate_payment_for_gateway
(
gateway
.
payment_gateway
)
if
result
:
output
.
append
(
result
)
return
output
or
False
except
Exception
:
...
...
erpnext/accounts/doctype/subscription/subscription.py
View file @
34f303f1
...
...
@@ -104,6 +104,7 @@ class Subscription(Document):
self
.
generate_invoice
(
payment_entry
=
payment_entry
)
elif
not
self
.
has_invoice_for_period
()
and
self
.
period_has_passed
(
add_days
(
self
.
current_invoice_start
,
-
1
)):
self
.
generate_sales_order
()
self
.
generate_invoice
(
payment_entry
=
payment_entry
)
self
.
save
()
...
...
@@ -147,9 +148,11 @@ class Subscription(Document):
return
data
def
set_subscription_status
(
self
):
if
self
.
is_trial
()
and
self
.
status
!=
'Trial'
:
if
self
.
is_cancelled
()
and
self
.
status
!=
'Cancelled'
:
self
.
db_set
(
'status'
,
'Cancelled'
)
elif
not
self
.
is_cancelled
()
and
self
.
is_trial
()
and
self
.
status
!=
'Trial'
:
self
.
db_set
(
'status'
,
'Trial'
)
elif
not
self
.
is_trial
()
and
self
.
status
!=
'Cancelled'
:
elif
not
self
.
is_cancelled
()
and
not
self
.
is_trial
()
and
self
.
status
!=
'Cancelled'
:
self
.
db_set
(
'status'
,
'Active'
)
self
.
reload
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment