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
8d242f9c
Commit
8d242f9c
authored
Mar 11, 2020
by
Charles-Henri Decultot
Browse files
Merge branch 'staging'
parents
34f303f1
257ae0bd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
614 deletions
+199
-614
erpnext/__init__.py
erpnext/__init__.py
+1
-1
erpnext/accounts/doctype/payment_request/payment_request.py
erpnext/accounts/doctype/payment_request/payment_request.py
+24
-16
erpnext/accounts/doctype/payment_schedule/payment_schedule.json
...t/accounts/doctype/payment_schedule/payment_schedule.json
+67
-233
erpnext/accounts/doctype/payment_term/payment_term.json
erpnext/accounts/doctype/payment_term/payment_term.json
+105
-363
erpnext/erpnext_integrations/webhooks_controller.py
erpnext/erpnext_integrations/webhooks_controller.py
+1
-0
erpnext/templates/print_formats/includes/taxes.html
erpnext/templates/print_formats/includes/taxes.html
+1
-1
No files found.
erpnext/__init__.py
View file @
8d242f9c
...
...
@@ -5,7 +5,7 @@ import frappe
from
erpnext.hooks
import
regional_overrides
from
frappe.utils
import
getdate
__version__
=
'1.3.1
1
'
__version__
=
'1.3.1
2
'
def
get_default_company
(
user
=
None
):
'''Get default company for user'''
...
...
erpnext/accounts/doctype/payment_request/payment_request.py
View file @
8d242f9c
...
...
@@ -156,6 +156,30 @@ class PaymentRequest(Document):
if
hasattr
(
controller
,
'on_payment_request_submission'
):
return
controller
.
on_payment_request_submission
(
self
)
@
frappe
.
whitelist
()
def
process_payment_immediately
(
self
):
try
:
if
self
.
payment_gateway
:
result
=
self
.
get_immediate_payment_for_gateway
(
self
.
payment_gateway
)
if
result
:
return
result
for
gateway
in
self
.
payment_gateways
:
result
=
self
.
get_immediate_payment_for_gateway
(
gateway
.
payment_gateway
)
if
result
:
return
result
return
except
Exception
as
e
:
frappe
.
log_error
(
frappe
.
get_traceback
(),
_
(
"Payment gateways validation error"
))
frappe
.
throw
(
e
,
_
(
"Payment gateways validation error"
))
def
get_immediate_payment_for_gateway
(
self
,
gateway
):
controller
=
get_payment_gateway_controller
(
gateway
)
if
hasattr
(
controller
,
'immediate_payment_processing'
):
return
controller
.
immediate_payment_processing
(
self
)
def
generate_payment_key
(
self
):
self
.
db_set
(
'payment_key'
,
frappe
.
generate_hash
(
self
.
name
))
...
...
@@ -389,22 +413,6 @@ class PaymentRequest(Document):
if
subscription
:
return
frappe
.
get_doc
(
"Subscription"
,
subscription
)
@
frappe
.
whitelist
()
def
process_payment_immediately
(
self
):
try
:
result
=
[]
for
gateway
in
self
.
payment_gateways
:
controller
=
get_payment_gateway_controller
(
gateway
.
payment_gateway
)
if
hasattr
(
controller
,
'immediate_payment_processing'
):
result
.
append
(
controller
.
immediate_payment_processing
(
self
))
break
return
result
except
Exception
as
e
:
frappe
.
log_error
(
frappe
.
get_traceback
(),
_
(
"Payment gateways validation error"
))
frappe
.
throw
(
e
,
_
(
"Payment gateways validation error"
))
def
create_subscription_event
(
self
):
subscription
=
frappe
.
get_doc
(
"Subscription"
,
self
.
is_linked_to_a_subscription
())
subscription
.
add_subscription_event
(
"Payment request created"
,
**
{
...
...
erpnext/accounts/doctype/payment_schedule/payment_schedule.json
View file @
8d242f9c
{
"a
llow_copy"
:
0
,
"
allow_guest_to_view"
:
0
,
"
allow_import"
:
0
,
"
allow_rename"
:
0
,
"
autoname"
:
"
"
,
"
beta"
:
0
,
"
creation"
:
"2017-08-10 15:38:00.080575
"
,
"
custom"
:
0
,
"d
ocstatus"
:
0
,
"
doctype"
:
"DocType
"
,
"
docu
ment_
type"
:
"
"
,
"
editable_grid"
:
1
,
"engine"
:
"InnoDB"
,
"a
ctions"
:
[],
"
creation"
:
"2017-08-10 15:38:00.080575"
,
"
doctype"
:
"DocType"
,
"
editable_grid"
:
1
,
"
engine"
:
"InnoDB
"
,
"
field_order"
:
[
"
payment_term
"
,
"
description"
,
"d
ue_date"
,
"
invoice_portion
"
,
"
pay
ment_
amount
"
,
"
mode_of_payment"
],
"fields"
:
[
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
2
,
"fieldname"
:
"payment_term"
,
"fieldtype"
:
"Link"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Payment Term"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
"Payment Term"
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
1
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"columns"
:
2
,
"fieldname"
:
"payment_term"
,
"fieldtype"
:
"Link"
,
"in_list_view"
:
1
,
"label"
:
"Payment Term"
,
"options"
:
"Payment Term"
,
"print_hide"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
2
,
"fetch_from"
:
""
,
"fieldname"
:
"description"
,
"fieldtype"
:
"Small Text"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Description"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
""
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"columns"
:
2
,
"fieldname"
:
"description"
,
"fieldtype"
:
"Small Text"
,
"in_list_view"
:
1
,
"label"
:
"Description"
,
"translatable"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
2
,
"fieldname"
:
"due_date"
,
"fieldtype"
:
"Date"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Due Date"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
""
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
1
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"columns"
:
2
,
"fieldname"
:
"due_date"
,
"fieldtype"
:
"Date"
,
"in_list_view"
:
1
,
"label"
:
"Due Date"
,
"reqd"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
2
,
"fetch_from"
:
""
,
"fieldname"
:
"invoice_portion"
,
"fieldtype"
:
"Percent"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Invoice Portion"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
""
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
1
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"columns"
:
2
,
"fieldname"
:
"invoice_portion"
,
"fieldtype"
:
"Percent"
,
"in_list_view"
:
1
,
"label"
:
"Invoice Portion"
,
"print_hide"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
2
,
"fieldname"
:
"payment_amount"
,
"fieldtype"
:
"Currency"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Payment Amount"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
"currency"
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
1
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"columns"
:
2
,
"fieldname"
:
"payment_amount"
,
"fieldtype"
:
"Currency"
,
"in_list_view"
:
1
,
"label"
:
"Payment Amount"
,
"options"
:
"currency"
,
"reqd"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"mode_of_payment"
,
"fieldtype"
:
"Link"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
0
,
"in_standard_filter"
:
0
,
"label"
:
"Mode of Payment"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
"Mode of Payment"
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
"fieldname"
:
"mode_of_payment"
,
"fieldtype"
:
"Link"
,
"label"
:
"Mode of Payment"
,
"options"
:
"Mode of Payment"
}
],
"has_web_view"
:
0
,
"hide_heading"
:
0
,
"hide_toolbar"
:
0
,
"idx"
:
0
,
"image_view"
:
0
,
"in_create"
:
0
,
"is_submittable"
:
0
,
"issingle"
:
0
,
"istable"
:
1
,
"max_attachments"
:
0
,
"modified"
:
"2018-09-06 17:35:44.580209"
,
"modified_by"
:
"Administrator"
,
"module"
:
"Accounts"
,
"name"
:
"Payment Schedule"
,
"name_case"
:
""
,
"owner"
:
"Administrator"
,
"permissions"
:
[],
"quick_entry"
:
1
,
"read_only"
:
0
,
"read_only_onload"
:
0
,
"show_name_in_global_search"
:
0
,
"sort_field"
:
"modified"
,
"sort_order"
:
"DESC"
,
"track_changes"
:
1
,
"track_seen"
:
0
,
"track_views"
:
0
],
"istable"
:
1
,
"links"
:
[],
"modified"
:
"2020-03-10 22:05:29.460427"
,
"modified_by"
:
"Administrator"
,
"module"
:
"Accounts"
,
"name"
:
"Payment Schedule"
,
"owner"
:
"Administrator"
,
"permissions"
:
[],
"quick_entry"
:
1
,
"sort_field"
:
"modified"
,
"sort_order"
:
"DESC"
,
"track_changes"
:
1
}
\ No newline at end of file
erpnext/accounts/doctype/payment_term/payment_term.json
View file @
8d242f9c
{
"allow_copy"
:
0
,
"allow_guest_to_view"
:
0
,
"allow_import"
:
1
,
"allow_rename"
:
1
,
"autoname"
:
"field:payment_term_name"
,
"beta"
:
0
,
"creation"
:
"2017-08-10 15:24:54.876365"
,
"custom"
:
0
,
"docstatus"
:
0
,
"doctype"
:
"DocType"
,
"document_type"
:
""
,
"editable_grid"
:
1
,
"engine"
:
"InnoDB"
,
"actions"
:
[],
"allow_import"
:
1
,
"allow_rename"
:
1
,
"autoname"
:
"field:payment_term_name"
,
"creation"
:
"2017-08-10 15:24:54.876365"
,
"doctype"
:
"DocType"
,
"editable_grid"
:
1
,
"engine"
:
"InnoDB"
,
"field_order"
:
[
"payment_term_name"
,
"invoice_portion"
,
"mode_of_payment"
,
"column_break_3"
,
"due_date_based_on"
,
"credit_days"
,
"credit_months"
,
"section_break_6"
,
"description"
],
"fields"
:
[
{
"allow_bulk_edit"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
1
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"payment_term_name"
,
"fieldtype"
:
"Data"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
0
,
"in_standard_filter"
:
0
,
"label"
:
"Payment Term Name"
,
"length"
:
0
,
"no_copy"
:
0
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"bold"
:
1
,
"fieldname"
:
"payment_term_name"
,
"fieldtype"
:
"Data"
,
"label"
:
"Payment Term Name"
,
"translatable"
:
1
,
"unique"
:
1
},
{
"allow_bulk_edit"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
1
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"invoice_portion"
,
"fieldtype"
:
"Float"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
0
,
"in_standard_filter"
:
0
,
"label"
:
"Invoice Portion"
,
"length"
:
0
,
"no_copy"
:
0
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"bold"
:
1
,
"fieldname"
:
"invoice_portion"
,
"fieldtype"
:
"Float"
,
"label"
:
"Invoice Portion"
},
{
"allow_bulk_edit"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"mode_of_payment"
,
"fieldtype"
:
"Link"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
0
,
"in_standard_filter"
:
0
,
"label"
:
"Mode of Payment"
,
"length"
:
0
,
"no_copy"
:
0
,
"options"
:
"Mode of Payment"
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"fieldname"
:
"mode_of_payment"
,
"fieldtype"
:
"Link"
,
"label"
:
"Mode of Payment"
,
"options"
:
"Mode of Payment"
},
{
"allow_bulk_edit"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"column_break_3"
,
"fieldtype"
:
"Column Break"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
0
,
"in_standard_filter"
:
0
,
"length"
:
0
,
"no_copy"
:
0
,
"permlevel"
:
0
,
"precision"
:
""
,
"print_hide"
:
0
,
"print_hide_if_no_value"
:
0
,
"read_only"
:
0
,
"remember_last_selected_value"
:
0
,
"report_hide"
:
0
,
"reqd"
:
0
,
"search_index"
:
0
,
"set_only_once"
:
0
,
"translatable"
:
0
,
"unique"
:
0
},
"fieldname"
:
"column_break_3"
,
"fieldtype"
:
"Column Break"
},
{
"allow_bulk_edit"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
1
,
"collapsible"
:
0
,
"columns"
:
0
,
"fieldname"
:
"due_date_based_on"
,
"fieldtype"
:
"Select"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_v