minor fixes
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index 2ae085d..5522d6e 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -1448,7 +1448,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1457,10 +1457,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -1520,7 +1520,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-04-16 17:34:38.429196",
+ "modified": "2018-04-30 17:34:38.429196",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json
index 60a54c2..564a93c 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.json
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json
@@ -1749,7 +1749,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1758,10 +1758,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -1848,7 +1848,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-02-19 16:58:23.899015",
+ "modified": "2018-03-10 07:31:49.264576",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index f983868..5bd57f9 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -507,7 +507,7 @@
doc = frappe.get_doc("Expense Claim", d.reference_name)
update_reimbursed_amount(doc)
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
self.reference_date = nowdate()
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index d707436..f6faf11 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -105,6 +107,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -138,6 +141,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -169,6 +173,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -200,6 +205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -290,6 +298,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -322,6 +331,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -353,6 +363,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -385,6 +396,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -417,6 +429,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -448,6 +461,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -480,6 +494,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -509,6 +524,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -540,6 +556,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -571,6 +588,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -602,6 +620,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -634,6 +653,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -664,6 +684,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -694,6 +715,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -724,6 +746,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -754,6 +777,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -783,6 +807,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -812,6 +837,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -841,6 +867,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -870,6 +897,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -902,6 +930,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -932,6 +961,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -962,6 +992,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -994,6 +1025,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1027,6 +1059,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1055,6 +1088,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1085,6 +1119,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1115,6 +1150,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1145,6 +1181,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1174,6 +1211,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1205,6 +1243,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1236,6 +1275,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1268,6 +1308,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1296,6 +1337,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1327,6 +1369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1360,6 +1403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1388,6 +1432,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1419,6 +1464,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1451,6 +1497,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1481,6 +1528,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1512,6 +1560,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1544,6 +1593,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1573,6 +1623,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1604,6 +1655,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1633,6 +1685,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1665,6 +1718,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1695,6 +1749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1725,6 +1780,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1756,6 +1812,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1788,6 +1845,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1820,6 +1878,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1852,6 +1911,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1881,6 +1941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1913,6 +1974,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1945,6 +2007,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1976,6 +2039,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2007,6 +2071,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2039,6 +2104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2070,6 +2136,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2099,6 +2166,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2129,6 +2197,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2160,6 +2229,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2189,6 +2259,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2221,6 +2292,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2252,6 +2324,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2284,6 +2357,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2316,6 +2390,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2345,6 +2420,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2378,6 +2454,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2409,6 +2486,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2441,6 +2519,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2472,6 +2551,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2504,6 +2584,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2536,6 +2617,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2567,6 +2649,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2599,6 +2682,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2630,6 +2714,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2661,6 +2746,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2690,6 +2776,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2722,6 +2809,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2753,6 +2841,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2785,6 +2874,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2815,6 +2905,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2846,6 +2937,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2875,6 +2967,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2906,6 +2999,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2937,6 +3031,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2969,6 +3064,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3000,6 +3096,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3032,6 +3129,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3063,6 +3161,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3094,6 +3193,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3125,6 +3225,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3156,6 +3257,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3186,6 +3288,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3215,6 +3318,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3245,6 +3349,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3277,6 +3382,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3309,6 +3415,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50px"
},
@@ -3341,6 +3448,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3371,6 +3479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3402,6 +3511,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3434,6 +3544,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3464,6 +3575,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3495,6 +3607,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3528,6 +3641,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3559,6 +3673,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3593,6 +3708,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3624,6 +3740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3652,6 +3769,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3684,6 +3802,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3715,6 +3834,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3747,6 +3867,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3777,6 +3898,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3808,6 +3930,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3839,6 +3962,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3868,6 +3992,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3876,7 +4001,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3885,10 +4010,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -3899,6 +4024,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3914,7 +4040,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-01-11 14:44:22.982512",
+ "modified": "2018-03-10 07:33:12.760250",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index d7e14e1..569664d 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -694,7 +694,7 @@
if account_type != 'Fixed Asset':
frappe.throw(_("Row {0}# Account must be of type 'Fixed Asset'").format(d.idx))
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.due_date = None
@frappe.whitelist()
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index cfcc341..5441122 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1304,6 +1304,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1334,6 +1335,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1365,6 +1367,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1394,6 +1397,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1425,6 +1429,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1456,6 +1461,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1488,6 +1494,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1518,6 +1525,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1548,6 +1556,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1577,6 +1586,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1609,6 +1619,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1640,6 +1651,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1671,6 +1683,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1699,6 +1712,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1730,6 +1744,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1762,6 +1777,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1790,6 +1806,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1821,6 +1838,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1851,6 +1869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1881,6 +1900,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1912,6 +1932,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1944,6 +1965,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1972,6 +1994,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2003,6 +2026,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2031,6 +2055,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2063,6 +2088,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2093,6 +2119,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2123,6 +2150,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2151,6 +2179,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2183,6 +2212,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2212,6 +2242,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2242,6 +2273,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2273,6 +2305,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2305,6 +2338,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2336,6 +2370,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2364,6 +2399,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2394,6 +2430,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2424,6 +2461,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2455,6 +2493,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2487,6 +2526,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2518,6 +2558,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2550,6 +2591,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2582,6 +2624,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2611,6 +2654,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2644,6 +2688,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2675,6 +2720,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2707,6 +2753,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2738,6 +2785,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2770,6 +2818,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2802,6 +2851,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2834,6 +2884,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2865,6 +2916,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2897,6 +2949,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2928,6 +2981,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2960,6 +3014,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2992,6 +3047,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3024,6 +3080,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3057,6 +3114,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3089,6 +3147,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3118,6 +3177,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3149,6 +3209,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3178,6 +3239,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3211,6 +3273,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3240,6 +3303,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3272,6 +3336,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3301,6 +3366,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3333,6 +3399,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3365,6 +3432,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3396,6 +3464,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3428,6 +3497,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3459,6 +3529,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3489,6 +3560,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3519,6 +3591,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3550,6 +3623,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3581,6 +3655,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3613,6 +3688,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3645,6 +3721,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3676,6 +3753,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3706,6 +3784,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3738,6 +3817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3768,6 +3848,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3797,6 +3878,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3829,6 +3911,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3860,6 +3943,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3891,6 +3975,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3924,6 +4009,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3952,6 +4038,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3985,6 +4072,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4017,6 +4105,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4048,6 +4137,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4081,6 +4171,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4112,6 +4203,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4146,6 +4238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4176,6 +4269,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4206,6 +4300,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4235,6 +4330,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4266,6 +4362,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4298,6 +4395,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4330,6 +4428,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4359,6 +4458,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -4391,6 +4491,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4423,6 +4524,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4453,6 +4555,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4485,6 +4588,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4515,6 +4619,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4546,6 +4651,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4577,6 +4683,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4606,6 +4713,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4614,7 +4722,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -4623,10 +4731,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -4637,6 +4745,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4668,6 +4777,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4698,6 +4808,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -4713,8 +4824,8 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-03-16 15:19:54.711885",
- "modified_by": "Administrator",
+ "modified": "2018-04-30 16:19:54.711885",
+ "modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
"name_case": "Title Case",
@@ -4812,4 +4923,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 78dcee9..a3ad049 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -110,7 +110,7 @@
def on_submit(self):
self.validate_pos_paid_amount()
- if not self.subscription:
+ if not self.auto_repeat:
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
self.company, self.base_grand_total, self)
@@ -828,7 +828,7 @@
for dn in set(updated_delivery_notes):
frappe.get_doc("Delivery Note", dn).update_billing_percentage(update_modified=update_modified)
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
for fieldname in ("c_form_applicable", "c_form_no", "write_off_amount"):
self.set(fieldname, reference_doc.get(fieldname))
diff --git a/erpnext/accounts/doctype/subscriber/__init__.py b/erpnext/accounts/doctype/subscriber/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/__init__.py
diff --git a/erpnext/accounts/doctype/subscriber/subscriber.js b/erpnext/accounts/doctype/subscriber/subscriber.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscriber/subscriber.json b/erpnext/accounts/doctype/subscriber/subscriber.json
new file mode 100644
index 0000000..28a57d8
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.json
@@ -0,0 +1,126 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:subscriber_name",
+ "beta": 0,
+ "creation": "2018-02-24 11:17:46.809140",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "subscriber_name",
+ "fieldtype": "Data",
+ "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": "Subscriber 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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer",
+ "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": "Customer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer",
+ "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
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-02-26 04:40:16.510290",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscriber",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscriber/subscriber.py b/erpnext/accounts/doctype/subscriber/subscriber.py
new file mode 100644
index 0000000..03eb0f5
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class Subscriber(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscriber/test_subscriber.js b/erpnext/accounts/doctype/subscriber/test_subscriber.js
new file mode 100644
index 0000000..1fd4a1e
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/test_subscriber.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscriber", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscriber
+ () => frappe.tests.make('Subscriber', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscriber/test_subscriber.py b/erpnext/accounts/doctype/subscriber/test_subscriber.py
new file mode 100644
index 0000000..3e2fc07
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/test_subscriber.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriber(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription/subscription.js b/erpnext/accounts/doctype/subscription/subscription.js
index 8db5be8..dcbec12 100644
--- a/erpnext/accounts/doctype/subscription/subscription.js
+++ b/erpnext/accounts/doctype/subscription/subscription.js
@@ -1,75 +1,78 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Subscription', {
- setup: function(frm) {
- frm.fields_dict['reference_doctype'].get_query = function(doc) {
- return {
- query: "erpnext.accounts.doctype.subscription.subscription.subscription_doctype_query"
- };
- };
-
- frm.fields_dict['reference_document'].get_query = function() {
- return {
- filters: {
- "docstatus": 1,
- "subscription": ''
- }
- };
- };
-
- frm.fields_dict['print_format'].get_query = function() {
- return {
- filters: {
- "doc_type": frm.doc.reference_doctype
- }
- };
- };
- },
-
refresh: function(frm) {
- if(frm.doc.docstatus == 1) {
- let label = __('View {0}', [frm.doc.reference_doctype]);
- frm.add_custom_button(__(label),
- function() {
- frappe.route_options = {
- "subscription": frm.doc.name,
- };
- frappe.set_route("List", frm.doc.reference_doctype);
- }
- );
-
- if(frm.doc.status != 'Stopped') {
- frm.add_custom_button(__("Stop"),
- function() {
- frm.events.stop_resume_subscription(frm, "Stopped");
- }
+ if(!frm.is_new()){
+ if(frm.doc.status !== 'Cancelled'){
+ frm.add_custom_button(
+ __('Cancel Subscription'),
+ () => frm.events.cancel_this_subscription(frm)
+ );
+ frm.add_custom_button(
+ __('Fetch Subscription Updates'),
+ () => frm.events.get_subscription_updates(frm)
);
}
-
- if(frm.doc.status == 'Stopped') {
- frm.add_custom_button(__("Resume"),
- function() {
- frm.events.stop_resume_subscription(frm, "Resumed");
- }
+ else if(frm.doc.status === 'Cancelled'){
+ frm.add_custom_button(
+ __('Restart Subscription'),
+ () => frm.events.renew_this_subscription(frm)
);
}
}
},
- stop_resume_subscription: function(frm, status) {
+ cancel_this_subscription: function(frm) {
+ const doc = frm.doc;
+ frappe.confirm(
+ __('This action will stop future billing. Are you sure you want to cancel this subscription?'),
+ function() {
+ frappe.call({
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.cancel_subscription",
+ args: {name: doc.name},
+ callback: function(data){
+ if(!data.exc){
+ frm.reload_doc();
+ }
+ }
+ });
+ }
+ );
+ },
+
+ renew_this_subscription: function(frm) {
+ const doc = frm.doc;
+ frappe.confirm(
+ __('You will lose records of previously generated invoices. Are you sure you want to restart this subscription?'),
+ function() {
+ frappe.call({
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.restart_subscription",
+ args: {name: doc.name},
+ callback: function(data){
+ if(!data.exc){
+ frm.reload_doc();
+ }
+ }
+ });
+ }
+ );
+ },
+
+ get_subscription_updates: function(frm) {
+ const doc = frm.doc;
frappe.call({
- method: "erpnext.accounts.doctype.subscription.subscription.stop_resume_subscription",
- args: {
- subscription: frm.doc.name,
- status: status
- },
- callback: function(r) {
- if(r.message) {
- frm.set_value("status", r.message);
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.get_subscription_updates",
+ args: {name: doc.name},
+ freeze: true,
+ callback: function(data){
+ if(!data.exc){
frm.reload_doc();
}
}
});
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/accounts/doctype/subscription/subscription.json b/erpnext/accounts/doctype/subscription/subscription.json
index 7ff2e4b..1165bed 100644
--- a/erpnext/accounts/doctype/subscription/subscription.json
+++ b/erpnext/accounts/doctype/subscription/subscription.json
@@ -1,9 +1,9 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "naming_series:",
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "SUBC.####",
"beta": 0,
"creation": "2017-07-18 17:50:43.967266",
"custom": 0,
@@ -19,67 +19,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "section_break_1",
- "fieldtype": "Section 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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "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": "Series",
- "length": 0,
- "no_copy": 0,
- "options": "SUB-",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "reference_doctype",
+ "fieldname": "subscriber",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -88,10 +28,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Reference Doctype",
+ "label": "Subscriber",
"length": 0,
"no_copy": 0,
- "options": "DocType",
+ "options": "Subscriber",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -101,7 +41,8 @@
"report_hide": 0,
"reqd": 1,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -110,127 +51,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "reference_document",
- "fieldtype": "Dynamic 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": "Reference Document",
- "length": 0,
- "no_copy": 1,
- "options": "reference_doctype",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_5",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "start_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": "Start Date",
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "end_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": "End Date",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "submit_on_creation",
+ "fieldname": "cancel_at_period_end",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -239,9 +60,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Submit on Creation",
+ "label": "Cancel At End Of Period",
"length": 0,
"no_copy": 0,
+ "options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -252,36 +74,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "disabled",
- "fieldtype": "Check",
- "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": "Disabled",
- "length": 0,
- "no_copy": 1,
- "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
},
{
@@ -290,127 +83,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "section_break_10",
- "fieldtype": "Section 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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "frequency",
- "fieldtype": "Select",
- "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": "Frequency",
- "length": 0,
- "no_copy": 0,
- "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_13",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: in_list([\"Monthly\", \"Quarterly\", \"Yearly\"], doc.frequency)",
- "fieldname": "repeat_on_day",
- "fieldtype": "Int",
- "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": "Repeat on Day",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "next_schedule_date",
+ "fieldname": "start",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -419,12 +92,45 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Next Schedule Date",
+ "label": "Subscription Start Date",
"length": 0,
- "no_copy": 1,
+ "no_copy": 0,
+ "options": "",
"permlevel": 0,
"precision": "",
- "print_hide": 1,
+ "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": 1,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cancelation_date",
+ "fieldtype": "Date",
+ "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": "Cancelation Date",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
@@ -432,16 +138,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 1,
+ "collapsible": 0,
"columns": 0,
- "fieldname": "notification",
- "fieldtype": "Section Break",
+ "fieldname": "current_invoice_start",
+ "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -449,7 +156,69 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Notification",
+ "label": "Current Invoice Start Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "current_invoice_end",
+ "fieldtype": "Date",
+ "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": "Current Invoice End Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trial_period_start",
+ "fieldtype": "Date",
+ "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": "Trial Period Start Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -461,7 +230,8 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -470,8 +240,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
+ "depends_on": "eval:doc.trial_period_start",
+ "fieldname": "trial_period_end",
+ "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -479,7 +250,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Notify by Email",
+ "label": "Trial Period End Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -491,48 +262,17 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval: doc.notify_by_email",
- "description": "To add dynamic subject, use jinja tags like\n\n<div><pre><code>New {{ doc.doctype }} #{{ doc.name }}</code></pre></div>",
- "fieldname": "subject",
- "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": "Subject",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_17",
+ "fieldname": "cb_1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -541,161 +281,6 @@
"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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "notify_by_email",
- "fieldname": "recipients",
- "fieldtype": "Small Text",
- "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": "Recipients",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "notify_by_email",
- "fieldname": "print_format",
- "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": "Print Format",
- "length": 0,
- "no_copy": 0,
- "options": "Print Format",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "eval:doc.notify_by_email",
- "fieldname": "section_break_20",
- "fieldtype": "Section 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,
- "label": "Message",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Please find attached {{ doc.doctype }} #{{ doc.name }}",
- "fieldname": "message",
- "fieldtype": "Text",
- "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": "Message",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "eval: !doc.__islocal",
- "fieldname": "section_break_16",
- "fieldtype": "Section 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,
"label": "",
"length": 0,
"no_copy": 0,
@@ -709,15 +294,15 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 1,
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
"hidden": 0,
@@ -725,12 +310,12 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"in_standard_filter": 0,
"label": "Status",
"length": 0,
"no_copy": 0,
- "options": "\nDraft\nStopped\nSubmitted\nCancelled\nCompleted",
+ "options": "\nTrialling\nActive\nPast Due Date\nCancelled\nUnpaid",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -741,6 +326,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -749,7 +335,168 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "amended_from",
+ "default": "0",
+ "description": "Number of days that the subscriber has to pay invoices generated by this subscription",
+ "fieldname": "days_until_due",
+ "fieldtype": "Int",
+ "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": "Days Until Due",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "quantity",
+ "fieldtype": "Int",
+ "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": "Quantity",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "sb_4",
+ "fieldtype": "Section 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,
+ "label": "Plans",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "plans",
+ "fieldtype": "Table",
+ "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": "Plans",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Plan Detail",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sb_1",
+ "fieldtype": "Section 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,
+ "label": "Taxes",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "tax_template",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -758,19 +505,249 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Amended From",
+ "label": "Sales Taxes and Charges Template",
"length": 0,
- "no_copy": 1,
- "options": "Subscription",
+ "no_copy": 0,
+ "options": "Sales Taxes and Charges Template",
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "sb_2",
+ "fieldtype": "Section 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,
+ "label": "Discounts",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "apply_additional_discount",
+ "fieldtype": "Select",
+ "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": "Apply Additional Discount On",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nGrand Total\nNet total",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "cb_2",
+ "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,
+ "label": "",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "additional_discount_percentage",
+ "fieldtype": "Percent",
+ "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": "Additional DIscount Percentage",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "additional_discount_amount",
+ "fieldtype": "Currency",
+ "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": "Additional DIscount Amount",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.invoices",
+ "fieldname": "sb_3",
+ "fieldtype": "Section 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,
+ "label": "Invoices",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "invoices",
+ "fieldtype": "Table",
+ "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": "Invoices",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Invoice",
+ "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
}
],
@@ -780,11 +757,11 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "is_submittable": 1,
+ "is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-23 18:28:08.966403",
+ "modified": "2018-03-12 00:34:52.243133",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",
@@ -794,7 +771,7 @@
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -808,13 +785,13 @@
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -828,13 +805,13 @@
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -848,18 +825,18 @@
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
- "search_fields": "reference_document",
+ "search_fields": "",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "reference_document",
+ "title_field": "",
"track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index 480abd4..1edc138 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -1,315 +1,500 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
+
import frappe
-import calendar
from frappe import _
-from frappe.desk.form import assign_to
-from frappe.utils.jinja import validate_template
-from dateutil.relativedelta import relativedelta
-from frappe.utils.user import get_system_managers
-from frappe.utils import cstr, getdate, split_emails, add_days, today, get_last_day, get_first_day
from frappe.model.document import Document
+from frappe.utils.data import nowdate, getdate, cint, add_days, date_diff, get_last_day, add_to_date, flt
-month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12}
+
class Subscription(Document):
- def validate(self):
- self.update_status()
- self.validate_reference_doctype()
- self.validate_dates()
- self.validate_next_schedule_date()
- self.validate_email_id()
+ def before_insert(self):
+ # update start just before the subscription doc is created
+ self.update_subscription_period(self.start)
- validate_template(self.subject or "")
- validate_template(self.message or "")
+ def update_subscription_period(self, date=None):
+ """
+ Subscription period is the period to be billed. This method updates the
+ beginning of the billing period and end of the billing period.
- def before_submit(self):
- if not self.next_schedule_date:
- self.next_schedule_date = get_next_schedule_date(self.start_date,
- self.frequency, self.repeat_on_day)
+ The beginning of the billing period is represented in the doctype as
+ `current_invoice_start` and the end of the billing period is represented
+ as `current_invoice_end`.
+ """
+ self.set_current_invoice_start(date)
+ self.set_current_invoice_end()
- def on_submit(self):
- self.update_subscription_id()
+ def set_current_invoice_start(self, date=None):
+ """
+ This sets the date of the beginning of the current billing period.
+ If the `date` parameter is not given , it will be automatically set as today's
+ date.
+ """
+ if self.trial_period_start and self.is_trialling():
+ self.current_invoice_start = self.trial_period_start
+ elif not date:
+ self.current_invoice_start = nowdate()
+ elif date:
+ self.current_invoice_start = date
- def on_update_after_submit(self):
- self.validate_dates()
- self.set_next_schedule_date()
+ def set_current_invoice_end(self):
+ """
+ This sets the date of the end of the current billing period.
- def before_cancel(self):
- self.unlink_subscription_id()
- self.next_schedule_date = None
+ If the subscription is in trial period, it will be set as the end of the
+ trial period.
- def unlink_subscription_id(self):
- frappe.db.sql("update `tab{0}` set subscription = null where subscription=%s"
- .format(self.reference_doctype), self.name)
-
- def validate_reference_doctype(self):
- if not frappe.get_meta(self.reference_doctype).has_field('subscription'):
- frappe.throw(_("Add custom field Subscription in the doctype {0}").format(self.reference_doctype))
-
- def validate_dates(self):
- if self.end_date and getdate(self.start_date) > getdate(self.end_date):
- frappe.throw(_("End date must be greater than start date"))
-
- def validate_next_schedule_date(self):
- if self.repeat_on_day and self.next_schedule_date:
- next_date = getdate(self.next_schedule_date)
- if next_date.day != self.repeat_on_day:
- # if the repeat day is the last day of the month (31)
- # and the current month does not have as many days,
- # then the last day of the current month is a valid date
- lastday = calendar.monthrange(next_date.year, next_date.month)[1]
- if self.repeat_on_day < lastday:
-
- # the specified day of the month is not same as the day specified
- # or the last day of the month
- frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
-
- def validate_email_id(self):
- if self.notify_by_email:
- if self.recipients:
- email_list = split_emails(self.recipients.replace("\n", ""))
-
- from frappe.utils import validate_email_add
- for email in email_list:
- if not validate_email_add(email):
- frappe.throw(_("{0} is an invalid email address in 'Recipients'").format(email))
- else:
- frappe.throw(_("'Recipients' not specified"))
-
- def set_next_schedule_date(self):
- if self.repeat_on_day:
- self.next_schedule_date = get_next_date(self.next_schedule_date, 0, self.repeat_on_day)
-
- def update_subscription_id(self):
- frappe.db.set_value(self.reference_doctype, self.reference_document, "subscription", self.name)
-
- def update_status(self, status=None):
- self.status = {
- '0': 'Draft',
- '1': 'Submitted',
- '2': 'Cancelled'
- }[cstr(self.docstatus or 0)]
-
- if status and status != 'Resumed':
- self.status = status
-
-def get_next_schedule_date(start_date, frequency, repeat_on_day):
- mcount = month_map.get(frequency)
- if mcount:
- next_date = get_next_date(start_date, mcount, repeat_on_day)
- else:
- days = 7 if frequency == 'Weekly' else 1
- next_date = add_days(start_date, days)
- return next_date
-
-def make_subscription_entry(date=None):
- date = date or today()
- for data in get_subscription_entries(date):
- schedule_date = getdate(data.next_schedule_date)
- while schedule_date <= getdate(today()):
- create_documents(data, schedule_date)
- schedule_date = get_next_schedule_date(schedule_date,
- data.frequency, data.repeat_on_day)
-
- if schedule_date and not frappe.db.get_value('Subscription', data.name, 'disabled'):
- frappe.db.set_value('Subscription', data.name, 'next_schedule_date', schedule_date)
-
-def get_subscription_entries(date):
- return frappe.db.sql(""" select * from `tabSubscription`
- where docstatus = 1 and next_schedule_date <=%s
- and reference_document is not null and reference_document != ''
- and next_schedule_date <= ifnull(end_date, '2199-12-31')
- and ifnull(disabled, 0) = 0 and status != 'Stopped' """, (date), as_dict=1)
-
-def create_documents(data, schedule_date):
- try:
- doc = make_new_document(data, schedule_date)
- if data.notify_by_email and data.recipients:
- print_format = data.print_format or "Standard"
- send_notification(doc, data, print_format=print_format)
-
- frappe.db.commit()
- except Exception:
- frappe.db.rollback()
- frappe.db.begin()
- frappe.log_error(frappe.get_traceback())
- disable_subscription(data)
- frappe.db.commit()
- if data.reference_document and not frappe.flags.in_test:
- notify_error_to_user(data)
-
-def disable_subscription(data):
- subscription = frappe.get_doc('Subscription', data.name)
- subscription.db_set('disabled', 1)
-
-def notify_error_to_user(data):
- party = ''
- party_type = ''
-
- if data.reference_doctype in ['Sales Order', 'Sales Invoice', 'Delivery Note']:
- party_type = 'customer'
- elif data.reference_doctype in ['Purchase Order', 'Purchase Invoice', 'Purchase Receipt']:
- party_type = 'supplier'
-
- if party_type:
- party = frappe.db.get_value(data.reference_doctype, data.reference_document, party_type)
-
- notify_errors(data.reference_document, data.reference_doctype, party, data.owner, data.name)
-
-def make_new_document(args, schedule_date):
- doc = frappe.get_doc(args.reference_doctype, args.reference_document)
- new_doc = frappe.copy_doc(doc, ignore_no_copy=False)
- update_doc(new_doc, doc , args, schedule_date)
- new_doc.insert(ignore_permissions=True)
-
- if args.submit_on_creation:
- new_doc.submit()
-
- return new_doc
-
-def update_doc(new_document, reference_doc, args, schedule_date):
- new_document.docstatus = 0
- if new_document.meta.get_field('set_posting_time'):
- new_document.set('set_posting_time', 1)
-
- mcount = month_map.get(args.frequency)
-
- if new_document.meta.get_field('subscription'):
- new_document.set('subscription', args.name)
-
- for fieldname in ['naming_series', 'ignore_pricing_rule', 'posting_time'
- 'select_print_heading', 'remarks', 'owner']:
- if new_document.meta.get_field(fieldname):
- new_document.set(fieldname, reference_doc.get(fieldname))
-
- # copy item fields
- if new_document.meta.get_field('items'):
- for i, item in enumerate(new_document.items):
- for fieldname in ("page_break",):
- item.set(fieldname, reference_doc.items[i].get(fieldname))
-
- for data in new_document.meta.fields:
- if data.fieldtype == 'Date' and data.reqd:
- new_document.set(data.fieldname, schedule_date)
-
- set_subscription_period(args, mcount, new_document)
-
- new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args)
-
-def set_subscription_period(args, mcount, new_document):
- if mcount and new_document.meta.get_field('from_date') and new_document.meta.get_field('to_date'):
- last_ref_doc = frappe.db.sql("""
- select name, from_date, to_date
- from `tab{0}`
- where subscription=%s and docstatus < 2
- order by creation desc
- limit 1
- """.format(args.reference_doctype), args.name, as_dict=1)
-
- if not last_ref_doc:
- return
-
- from_date = get_next_date(last_ref_doc[0].from_date, mcount)
-
- if (cstr(get_first_day(last_ref_doc[0].from_date)) == cstr(last_ref_doc[0].from_date)) and \
- (cstr(get_last_day(last_ref_doc[0].to_date)) == cstr(last_ref_doc[0].to_date)):
- to_date = get_last_day(get_next_date(last_ref_doc[0].to_date, mcount))
+ If is not in a trial period, it will be `x` days from the beginning of the
+ current billing period where `x` is the billing interval from the
+ `Subscription Plan` in the `Subscription`.
+ """
+ if self.is_trialling():
+ self.current_invoice_end = self.trial_period_end
else:
- to_date = get_next_date(last_ref_doc[0].to_date, mcount)
+ billing_cycle_info = self.get_billing_cycle()
+ if billing_cycle_info:
+ self.current_invoice_end = add_to_date(self.current_invoice_start, **billing_cycle_info)
+ else:
+ self.current_invoice_end = get_last_day(self.current_invoice_start)
- new_document.set('from_date', from_date)
- new_document.set('to_date', to_date)
+ def get_billing_cycle(self):
+ """
+ Returns a dict containing billing cycle information deduced from the
+ `Subscription Plan` in the `Subscription`.
+ """
+ return self.get_billing_cycle_data()
-def get_next_date(dt, mcount, day=None):
- dt = getdate(dt)
- dt += relativedelta(months=mcount, day=day)
+ @staticmethod
+ def validate_plans_billing_cycle(billing_cycle_data):
+ """
+ Makes sure that all `Subscription Plan` in the `Subscription` have the
+ same billing interval
+ """
+ if billing_cycle_data and len(billing_cycle_data) != 1:
+ frappe.throw(_('You can only have Plans with the same billing cycle in a Subscription'))
- return dt
+ def get_billing_cycle_and_interval(self):
+ """
+ Returns a dict representing the billing interval and cycle for this `Subscription`.
-def send_notification(new_rv, subscription_doc, print_format='Standard'):
- """Notify concerned persons about recurring document generation"""
- print_format = print_format
- subject = subscription_doc.subject or ''
- message = subscription_doc.message or ''
+ You shouldn't need to call this directly. Use `get_billing_cycle` instead.
+ """
+ plan_names = [plan.plan for plan in self.plans]
+ billing_info = frappe.db.sql(
+ 'select distinct `billing_interval`, `billing_interval_count` '
+ 'from `tabSubscription Plan` '
+ 'where name in %s',
+ (plan_names,), as_dict=1
+ )
- if not subscription_doc.subject:
- subject = _("New {0}: #{1}").format(new_rv.doctype, new_rv.name)
- elif "{" in subscription_doc.subject:
- subject = frappe.render_template(subscription_doc.subject, {'doc': new_rv})
+ return billing_info
- if not subscription_doc.message:
- message = _("Please find attached {0} #{1}").format(new_rv.doctype, new_rv.name)
- elif "{" in subscription_doc.message:
- message = frappe.render_template(subscription_doc.message, {'doc': new_rv})
+ def get_billing_cycle_data(self):
+ """
+ Returns dict contain the billing cycle data.
- attachments = [frappe.attach_print(new_rv.doctype, new_rv.name,
- file_name=new_rv.name, print_format=print_format)]
+ You shouldn't need to call this directly. Use `get_billing_cycle` instead.
+ """
+ billing_info = self.get_billing_cycle_and_interval()
- frappe.sendmail(subscription_doc.recipients,
- subject=subject, message=message, attachments=attachments)
+ self.validate_plans_billing_cycle(billing_info)
-def notify_errors(doc, doctype, party, owner, name):
- recipients = get_system_managers(only_name=True)
- frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")],
- subject=_("[Urgent] Error while creating recurring %s for %s" % (doctype, doc)),
- message = frappe.get_template("templates/emails/recurring_document_failed.html").render({
- "type": _(doctype),
- "name": doc,
- "party": party or "",
- "subscription": name
- }))
+ if billing_info:
+ data = dict()
+ interval = billing_info[0]['billing_interval']
+ interval_count = billing_info[0]['billing_interval_count']
+ if interval not in ['Day', 'Week']:
+ data['days'] = -1
+ if interval == 'Day':
+ data['days'] = interval_count - 1
+ elif interval == 'Month':
+ data['months'] = interval_count
+ elif interval == 'Year':
+ data['years'] = interval_count
+ # todo: test week
+ elif interval == 'Week':
+ data['days'] = interval_count * 7 - 1
- assign_task_to_owner(name, "Recurring Documents Failed", recipients)
+ return data
-def assign_task_to_owner(name, msg, users):
- for d in users:
- args = {
- 'doctype' : 'Subscription',
- 'assign_to' : d,
- 'name' : name,
- 'description' : msg,
- 'priority' : 'High'
- }
- assign_to.add(args)
+ def set_status_grace_period(self):
+ """
+ Sets the `Subscription` `status` based on the preference set in `Subscription Settings`.
+
+ Used when the `Subscription` needs to decide what to do after the current generated
+ invoice is past it's due date and grace period.
+ """
+ subscription_settings = frappe.get_single('Subscription Settings')
+ if self.status == 'Past Due Date' and self.is_past_grace_period():
+ self.status = 'Cancelled' if cint(subscription_settings.cancel_after_grace) else 'Unpaid'
+
+ def set_subscription_status(self):
+ """
+ Sets the status of the `Subscription`
+ """
+ if self.is_trialling():
+ self.status = 'Trialling'
+ elif self.status == 'Past Due Date' and self.is_past_grace_period():
+ subscription_settings = frappe.get_single('Subscription Settings')
+ self.status = 'Cancelled' if cint(subscription_settings.cancel_after_grace) else 'Unpaid'
+ elif self.status == 'Past Due Date' and not self.has_outstanding_invoice():
+ self.status = 'Active'
+ elif self.current_invoice_is_past_due():
+ self.status = 'Past Due Date'
+ elif self.is_new_subscription():
+ self.status = 'Active'
+ # todo: then generate new invoice
+ self.save()
+
+ def is_trialling(self):
+ """
+ Returns `True` if the `Subscription` is trial period.
+ """
+ return not self.period_has_passed(self.trial_period_end) and self.is_new_subscription()
+
+ @staticmethod
+ def period_has_passed(end_date):
+ """
+ Returns true if the given `end_date` has passed
+ """
+ # todo: test for illegal time
+ if not end_date:
+ return True
+
+ end_date = getdate(end_date)
+ return getdate(nowdate()) > getdate(end_date)
+
+ def is_past_grace_period(self):
+ """
+ Returns `True` if the grace period for the `Subscription` has passed
+ """
+ current_invoice = self.get_current_invoice()
+ if self.current_invoice_is_past_due(current_invoice):
+ subscription_settings = frappe.get_single('Subscription Settings')
+ grace_period = cint(subscription_settings.grace_period)
+
+ return getdate(nowdate()) > add_days(current_invoice.due_date, grace_period)
+
+ def current_invoice_is_past_due(self, current_invoice=None):
+ """
+ Returns `True` if the current generated invoice is overdue
+ """
+ if not current_invoice:
+ current_invoice = self.get_current_invoice()
+
+ if not current_invoice:
+ return False
+ else:
+ return getdate(nowdate()) > getdate(current_invoice.due_date)
+
+ def get_current_invoice(self):
+ """
+ Returns the most recent generated invoice.
+ """
+ if len(self.invoices):
+ current = self.invoices[-1]
+ if frappe.db.exists('Sales Invoice', current.invoice):
+ doc = frappe.get_doc('Sales Invoice', current.invoice)
+ return doc
+ else:
+ frappe.throw(_('Invoice {0} no longer exists'.format(current.invoice)))
+
+ def is_new_subscription(self):
+ """
+ Returns `True` if `Subscription` has never generated an invoice
+ """
+ return len(self.invoices) == 0
+
+ def validate(self):
+ self.validate_trial_period()
+ self.validate_plans_billing_cycle(self.get_billing_cycle_and_interval())
+
+ def validate_trial_period(self):
+ """
+ Runs sanity checks on trial period dates for the `Subscription`
+ """
+ if self.trial_period_start and self.trial_period_end:
+ if getdate(self.trial_period_end) < getdate(self.trial_period_start):
+ frappe.throw(_('Trial Period End Date Cannot be before Trial Period Start Date'))
+
+ elif self.trial_period_start or self.trial_period_end:
+ frappe.throw(_('Both Trial Period Start Date and Trial Period End Date must be set'))
+
+ def after_insert(self):
+ # todo: deal with users who collect prepayments. Maybe a new Subscription Invoice doctype?
+ self.set_subscription_status()
+
+ def generate_invoice(self, prorate=0):
+ """
+ Creates a `Sales Invoice` for the `Subscription`, updates `self.invoices` and
+ saves the `Subscription`.
+ """
+ invoice = self.create_invoice(prorate)
+ self.append('invoices', {'invoice': invoice.name})
+ self.save()
+
+ return invoice
+
+ def create_invoice(self, prorate):
+ """
+ Creates a `Sales Invoice`, submits it and returns it
+ """
+ invoice = frappe.new_doc('Sales Invoice')
+ invoice.set_posting_time = 1
+ invoice.posting_date = self.current_invoice_start
+ invoice.customer = self.get_customer(self.subscriber)
+
+ # Subscription is better suited for service items. I won't update `update_stock`
+ # for that reason
+ items_list = self.get_items_from_plans(self.plans, prorate)
+ for item in items_list:
+ item['qty'] = self.quantity
+ invoice.append('items', item)
+
+ # Taxes
+ if self.tax_template:
+ invoice.taxes_and_charges = self.tax_template
+ invoice.set_taxes()
+
+ # Due date
+ invoice.append(
+ 'payment_schedule',
+ {
+ 'due_date': add_days(self.current_invoice_end, cint(self.days_until_due)),
+ 'invoice_portion': 100
+ }
+ )
+
+ # Discounts
+ if self.additional_discount_percentage:
+ invoice.additional_discount_percentage = self.additional_discount_percentage
+
+ if self.additional_discount_amount:
+ invoice.discount_amount = self.additional_discount_amount
+
+ if self.additional_discount_percentage or self.additional_discount_amount:
+ discount_on = self.apply_additional_discount
+ invoice.apply_additional_discount = discount_on if discount_on else 'Grand Total'
+
+ invoice.flags.ignore_mandatory = True
+ invoice.save()
+ invoice.submit()
+
+ return invoice
+
+ @staticmethod
+ def get_customer(subscriber_name):
+ """
+ Returns the `Customer` linked to the `Subscriber`
+ """
+ return frappe.get_value('Subscriber', subscriber_name)
+
+ def get_items_from_plans(self, plans, prorate=0):
+ """
+ Returns the `Item`s linked to `Subscription Plan`
+ """
+ plan_items = [plan.plan for plan in plans]
+ item_names = None
+
+ if plan_items and not prorate:
+ item_names = frappe.db.sql(
+ 'select item as item_code, cost as rate from `tabSubscription Plan` where name in %s',
+ (plan_items,), as_dict=1
+ )
+
+ elif plan_items:
+ prorate_factor = get_prorata_factor(self.current_invoice_end, self.current_invoice_start)
+
+ item_names = frappe.db.sql(
+ 'select item as item_code, cost * %s as rate from `tabSubscription Plan` where name in %s',
+ (prorate_factor, plan_items,), as_dict=1
+ )
+
+ return item_names
+
+ def process(self):
+ """
+ To be called by task periodically. It checks the subscription and takes appropriate action
+ as need be. It calls either of these methods depending the `Subscription` status:
+ 1. `process_for_active`
+ 2. `process_for_past_due`
+ """
+ if self.status == 'Active':
+ self.process_for_active()
+ elif self.status in ['Past Due Date', 'Unpaid']:
+ self.process_for_past_due_date()
+
+ self.save()
+
+ def process_for_active(self):
+ """
+ Called by `process` if the status of the `Subscription` is 'Active'.
+
+ The possible outcomes of this method are:
+ 1. Generate a new invoice
+ 2. Change the `Subscription` status to 'Past Due Date'
+ 3. Change the `Subscription` status to 'Cancelled'
+ """
+ if getdate(nowdate()) > getdate(self.current_invoice_end) and not self.has_outstanding_invoice():
+ self.generate_invoice()
+ if self.current_invoice_is_past_due():
+ self.status = 'Past Due Date'
+
+ if self.current_invoice_is_past_due() and getdate(nowdate()) > getdate(self.current_invoice_end):
+ self.status = 'Past Due Date'
+
+ if self.cancel_at_period_end and getdate(nowdate()) > self.current_invoice_end:
+ self.cancel_subscription_at_period_end()
+
+ def cancel_subscription_at_period_end(self):
+ """
+ Called when `Subscription.cancel_at_period_end` is truthy
+ """
+ self.status = 'Cancelled'
+ if not self.cancelation_date:
+ self.cancelation_date = nowdate()
+
+ def process_for_past_due_date(self):
+ """
+ Called by `process` if the status of the `Subscription` is 'Past Due Date'.
+
+ The possible outcomes of this method are:
+ 1. Change the `Subscription` status to 'Active'
+ 2. Change the `Subscription` status to 'Cancelled'
+ 3. Change the `Subscription` status to 'Unpaid'
+ """
+ current_invoice = self.get_current_invoice()
+ if not current_invoice:
+ frappe.throw(_('Current invoice {0} is missing'.format(current_invoice.invoice)))
+ else:
+ if self.is_not_outstanding(current_invoice):
+ self.status = 'Active'
+ self.update_subscription_period(nowdate())
+ else:
+ self.set_status_grace_period()
+
+ @staticmethod
+ def is_not_outstanding(invoice):
+ """
+ Return `True` if the given invoice is paid
+ """
+ return invoice.status == 'Paid'
+
+ def has_outstanding_invoice(self):
+ """
+ Returns `True` if the most recent invoice for the `Subscription` is not paid
+ """
+ current_invoice = self.get_current_invoice()
+ if not current_invoice:
+ return False
+ else:
+ return not self.is_not_outstanding(current_invoice)
+
+ def cancel_subscription(self):
+ """
+ This sets the subscription as cancelled. It will stop invoices from being generated
+ but it will not affect already created invoices.
+ """
+ if self.status != 'Cancelled':
+ to_generate_invoice = True if self.status == 'Active' else False
+ to_prorate = frappe.db.get_single_value('Subscription Settings', 'prorate')
+ self.status = 'Cancelled'
+ self.cancelation_date = nowdate()
+ if to_generate_invoice:
+ self.generate_invoice(prorate=to_prorate)
+ self.save()
+
+ def restart_subscription(self):
+ """
+ This sets the subscription as active. The subscription will be made to be like a new
+ subscription and the `Subscription` will lose all the history of generated invoices
+ it has.
+ """
+ if self.status == 'Cancelled':
+ self.status = 'Active'
+ self.db_set('start', nowdate())
+ self.update_subscription_period(nowdate())
+ self.invoices = []
+ self.save()
+ else:
+ frappe.throw(_('You cannot restart a Subscription that is not cancelled.'))
+
+ def get_precision(self):
+ invoice = self.get_current_invoice()
+ if invoice:
+ return invoice.precision('grand_total')
+
+
+def get_prorata_factor(period_end, period_start):
+ diff = flt(date_diff(nowdate(), period_start) + 1)
+ plan_days = flt(date_diff(period_end, period_start) + 1)
+ prorate_factor = diff / plan_days
+
+ return prorate_factor
+
+
+def process_all():
+ """
+ Task to updates the status of all `Subscription` apart from those that are cancelled
+ """
+ subscriptions = get_all_subscriptions()
+ for subscription in subscriptions:
+ process(subscription)
+
+
+def get_all_subscriptions():
+ """
+ Returns all `Subscription` documents
+ """
+ return frappe.db.sql(
+ 'select name from `tabSubscription` where status != "Cancelled"',
+ as_dict=1
+ )
+
+
+def process(data):
+ """
+ Checks a `Subscription` and updates it status as necessary
+ """
+ if data:
+ try:
+ subscription = frappe.get_doc('Subscription', data['name'])
+ subscription.process()
+ frappe.db.commit()
+ except frappe.ValidationError:
+ frappe.db.rollback()
+ frappe.db.begin()
+ frappe.log_error(frappe.get_traceback())
+ frappe.db.commit()
+
@frappe.whitelist()
-def make_subscription(doctype, docname):
- doc = frappe.new_doc('Subscription')
+def cancel_subscription(name):
+ """
+ Cancels a `Subscription`. This will stop the `Subscription` from further invoicing the
+ `Subscriber` but all already outstanding invoices will not be affected.
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.cancel_subscription()
- reference_doc = frappe.get_doc(doctype, docname)
- doc.reference_doctype = doctype
- doc.reference_document = docname
- doc.start_date = reference_doc.get('posting_date') or reference_doc.get('transaction_date')
- return doc
@frappe.whitelist()
-def stop_resume_subscription(subscription, status):
- doc = frappe.get_doc('Subscription', subscription)
- frappe.msgprint(_("Subscription has been {0}").format(status))
- if status == 'Resumed':
- doc.next_schedule_date = get_next_schedule_date(today(),
- doc.frequency, doc.repeat_on_day)
+def restart_subscription(name):
+ """
+ Restarts a cancelled `Subscription`. The `Subscription` will 'forget' the history of
+ all invoices it has generated
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.restart_subscription()
- doc.update_status(status)
- doc.save()
- return doc.status
-
-def subscription_doctype_query(doctype, txt, searchfield, start, page_len, filters):
- return frappe.db.sql("""select parent from `tabDocField`
- where fieldname = 'subscription'
- and parent like %(txt)s
- order by
- if(locate(%(_txt)s, parent), locate(%(_txt)s, parent), 99999),
- parent
- limit %(start)s, %(page_len)s""".format(**{
- 'key': searchfield,
- }), {
- 'txt': "%%%s%%" % txt,
- '_txt': txt.replace("%", ""),
- 'start': start,
- 'page_len': page_len
- })
\ No newline at end of file
+@frappe.whitelist()
+def get_subscription_updates(name):
+ """
+ Use this to get the latest state of the given `Subscription`
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.process()
diff --git a/erpnext/accounts/doctype/subscription/subscription_list.js b/erpnext/accounts/doctype/subscription/subscription_list.js
index 71e3cce..abcfc5e 100644
--- a/erpnext/accounts/doctype/subscription/subscription_list.js
+++ b/erpnext/accounts/doctype/subscription/subscription_list.js
@@ -1,16 +1,15 @@
frappe.listview_settings['Subscription'] = {
- add_fields: ["next_schedule_date"],
get_indicator: function(doc) {
- if(doc.disabled) {
- return [__("Disabled"), "red"];
- } else if(doc.next_schedule_date >= frappe.datetime.get_today() && doc.status != 'Stopped') {
+ if(doc.status === 'Trialling') {
+ return [__("Trialling"), "green"];
+ } else if(doc.status === 'Active') {
return [__("Active"), "green"];
- } else if(doc.docstatus === 0) {
- return [__("Draft"), "red", "docstatus,=,0"];
- } else if(doc.status === 'Stopped') {
- return [__("Stopped"), "red"];
- } else {
- return [__("Expired"), "darkgrey"];
+ } else if(doc.status === 'Past Due Date') {
+ return [__("Past Due Date"), "orange"];
+ } else if(doc.status === 'Unpaid') {
+ return [__("Unpaid"), "red"];
+ } else if(doc.status === 'Cancelled') {
+ return [__("Cancelled"), "darkgrey"];
}
}
};
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py
index 118188c..47efa45 100644
--- a/erpnext/accounts/doctype/subscription/test_subscription.py
+++ b/erpnext/accounts/doctype/subscription/test_subscription.py
@@ -1,93 +1,498 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
-import frappe
import unittest
-from frappe.utils import today, add_days, getdate
-from erpnext.accounts.utils import get_fiscal_year
-from erpnext.accounts.report.financial_statements import get_months
-from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
-from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
-from erpnext.accounts.doctype.subscription.subscription import make_subscription_entry
+
+import frappe
+from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor
+from frappe.utils.data import nowdate, add_days, add_to_date, add_months, date_diff, flt
+
+
+def create_plan():
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 900
+ plan.billing_interval = 'Month'
+ plan.billing_interval_count = 1
+ plan.insert()
+
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name 2'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name 2'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 1999
+ plan.billing_interval = 'Month'
+ plan.billing_interval_count = 1
+ plan.insert()
+
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name 3'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name 3'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 1999
+ plan.billing_interval = 'Day'
+ plan.billing_interval_count = 14
+ plan.insert()
+
+
+def create_subscriber():
+ if not frappe.db.exists('Subscriber', '_Test Customer'):
+ subscriber = frappe.new_doc('Subscriber')
+ subscriber.subscriber_name = '_Test Customer'
+ subscriber.customer = '_Test Customer'
+ subscriber.insert()
+
class TestSubscription(unittest.TestCase):
- def test_daily_subscription(self):
- qo = frappe.copy_doc(quotation_records[0])
- qo.submit()
- doc = make_subscription(reference_document=qo.name)
- self.assertEqual(doc.next_schedule_date, today())
- make_subscription_entry()
- frappe.db.commit()
+ def setUp(self):
+ create_plan()
+ create_subscriber()
- quotation = frappe.get_doc(doc.reference_doctype, doc.reference_document)
- self.assertEqual(quotation.subscription, doc.name)
+ def test_create_subscription_with_trial_with_correct_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_start = nowdate()
+ subscription.trial_period_end = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
- new_quotation = frappe.db.get_value('Quotation',
- {'subscription': doc.name, 'name': ('!=', quotation.name)}, 'name')
+ self.assertEqual(subscription.trial_period_start, nowdate())
+ self.assertEqual(subscription.trial_period_end, add_days(nowdate(), 30))
+ self.assertEqual(subscription.trial_period_start, subscription.current_invoice_start)
+ self.assertEqual(subscription.trial_period_end, subscription.current_invoice_end)
+ self.assertEqual(subscription.invoices, [])
+ self.assertEqual(subscription.status, 'Trialling')
- new_quotation = frappe.get_doc('Quotation', new_quotation)
+ subscription.delete()
- for fieldname in ['customer', 'company', 'order_type', 'total', 'net_total']:
- self.assertEqual(quotation.get(fieldname), new_quotation.get(fieldname))
+ def test_create_subscription_without_trial_with_correct_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
- for fieldname in ['item_code', 'qty', 'rate', 'amount']:
- self.assertEqual(quotation.items[0].get(fieldname),
- new_quotation.items[0].get(fieldname))
+ self.assertEqual(subscription.trial_period_start, None)
+ self.assertEqual(subscription.trial_period_end, None)
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ # No invoice is created
+ self.assertEqual(len(subscription.invoices), 0)
+ self.assertEqual(subscription.status, 'Active')
- def test_monthly_subscription_for_so(self):
- current_fiscal_year = get_fiscal_year(today(), as_dict=True)
- start_date = current_fiscal_year.year_start_date
- end_date = current_fiscal_year.year_end_date
+ subscription.delete()
- for doctype in ['Sales Order', 'Sales Invoice']:
- if doctype == 'Sales Invoice':
- docname = create_sales_invoice(posting_date=start_date)
- else:
- docname = make_sales_order()
+ def test_create_subscription_trial_with_wrong_dates(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_end = nowdate()
+ subscription.trial_period_start = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
- self.monthly_subscription(doctype, docname.name, start_date, end_date)
+ self.assertRaises(frappe.ValidationError, subscription.save)
+ subscription.delete()
- def monthly_subscription(self, doctype, docname, start_date, end_date):
- doc = make_subscription(reference_doctype=doctype, frequency = 'Monthly',
- reference_document = docname, start_date=start_date, end_date=end_date)
+ def test_create_subscription_multi_with_different_billing_fails(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_end = nowdate()
+ subscription.trial_period_start = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.append('plans', {'plan': '_Test Plan Name 3'})
- doc.disabled = 1
- doc.save()
- frappe.db.commit()
+ self.assertRaises(frappe.ValidationError, subscription.save)
+ subscription.delete()
- make_subscription_entry()
- docnames = frappe.get_all(doc.reference_doctype, {'subscription': doc.name})
- self.assertEqual(len(docnames), 1)
+ def test_invoice_is_generated_at_end_of_billing_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.start = '2018-01-01'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.insert()
- doc = frappe.get_doc('Subscription', doc.name)
- doc.disabled = 0
- doc.save()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, '2018-01-01')
+ self.assertEqual(subscription.current_invoice_end, '2018-01-31')
+ subscription.process()
- months = get_months(getdate(start_date), getdate(today()))
- make_subscription_entry()
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.current_invoice_start, '2018-01-01')
+ self.assertEqual(subscription.status, 'Past Due Date')
+ subscription.delete()
- docnames = frappe.get_all(doc.reference_doctype, {'subscription': doc.name})
- self.assertEqual(len(docnames), months)
+ def test_status_goes_back_to_active_after_invoice_is_paid(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.status, 'Past Due Date')
-quotation_records = frappe.get_test_records('Quotation')
+ subscription.get_current_invoice()
+ current_invoice = subscription.get_current_invoice()
-def make_subscription(**args):
- args = frappe._dict(args)
- doc = frappe.get_doc({
- 'doctype': 'Subscription',
- 'reference_doctype': args.reference_doctype or 'Quotation',
- 'reference_document': args.reference_document or \
- frappe.db.get_value('Quotation', {'docstatus': 1}, 'name'),
- 'frequency': args.frequency or 'Daily',
- 'start_date': args.start_date or add_days(today(), -1),
- 'end_date': args.end_date or add_days(today(), 1),
- 'submit_on_creation': args.submit_on_creation or 0
- }).insert(ignore_permissions=True)
+ self.assertIsNotNone(current_invoice)
- if not args.do_not_submit:
- doc.submit()
+ current_invoice.db_set('outstanding_amount', 0)
+ current_invoice.db_set('status', 'Paid')
+ subscription.process()
- return doc
\ No newline at end of file
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(len(subscription.invoices), 1)
+
+ subscription.delete()
+
+ def test_subscription_cancel_after_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_unpaid_after_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_invoice_days_until_due(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.days_until_due = 10
+ subscription.start = add_months(nowdate(), -1)
+ subscription.insert()
+ subscription.process() # generate first invoice
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.delete()
+
+ def test_subscription_is_past_due_doesnt_change_within_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ grace_period = settings.grace_period
+ settings.grace_period = 1000
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # Grace period is 1000 days so status should remain as Past Due Date
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ settings.grace_period = grace_period
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_remains_active_during_invoice_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.process() # no changes expected
+
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process() # no changes expected still
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process() # no changes expected yet still
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.delete()
+
+ def test_subscription_cancelation(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.delete()
+
+ def test_subscription_cancellation_invoices(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.cancel_subscription()
+ # Invoice must have been generated
+ self.assertEqual(len(subscription.invoices), 1)
+
+ invoice = subscription.get_current_invoice()
+ diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
+ plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
+ prorate_factor = flt(diff/plan_days)
+
+ self.assertEqual(
+ flt(
+ get_prorata_factor(subscription.current_invoice_end, subscription.current_invoice_start),
+ 2),
+ flt(prorate_factor, 2)
+ )
+ self.assertEqual(flt(invoice.grand_total, 2), flt(prorate_factor * 900, 2))
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.delete()
+ settings.prorate = to_prorate
+ settings.save()
+
+ def test_subscription_cancellation_invoices_with_prorata_false(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.grand_total, 900)
+
+ settings.prorate = to_prorate
+ settings.save()
+
+ subscription.delete()
+
+ def test_subscription_cancellation_invoices_with_prorata_true(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+ diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
+ plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
+ prorate_factor = flt(diff / plan_days)
+
+ self.assertEqual(flt(invoice.grand_total, 2), flt(prorate_factor * 900, 2))
+
+ settings.prorate = to_prorate
+ settings.save()
+
+ subscription.delete()
+
+ def test_subcription_cancellation_and_process(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+ invoices = len(subscription.invoices)
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.cancel_subscription()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_restart_and_process(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.grace_period = 0
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ subscription.cancel_subscription()
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.restart_subscription()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_unpaid_back_to_active(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ invoice = subscription.get_current_invoice()
+ invoice.db_set('outstanding_amount', 0)
+ invoice.db_set('status', 'Paid')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_restart_active_subscription(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+
+ self.assertRaises(frappe.ValidationError, subscription.restart_subscription)
+
+ subscription.delete()
+
+ def test_subscription_invoice_discount_percentage(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.additional_discount_percentage = 10
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.additional_discount_percentage, 10)
+ self.assertEqual(invoice.apply_discount_on, 'Grand Total')
+
+ subscription.delete()
+
+ def test_subscription_invoice_discount_amount(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.additional_discount_amount = 11
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.discount_amount, 11)
+ self.assertEqual(invoice.apply_discount_on, 'Grand Total')
+
+ subscription.delete()
diff --git a/erpnext/accounts/doctype/subscription_invoice/__init__.py b/erpnext/accounts/doctype/subscription_invoice/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json
new file mode 100644
index 0000000..c4bae1d
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json
@@ -0,0 +1,73 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-26 04:21:41.265055",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "invoice",
+ "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": "Invoice",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "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-02-26 10:48:07.033422",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Invoice",
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py
new file mode 100644
index 0000000..6f459b4
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionInvoice(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js
new file mode 100644
index 0000000..15d3df2
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Invoice", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Invoice
+ () => frappe.tests.make('Subscription Invoice', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py
new file mode 100644
index 0000000..e60a4ee
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionInvoice(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_plan/__init__.py b/erpnext/accounts/doctype/subscription_plan/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.js b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.json b/erpnext/accounts/doctype/subscription_plan/subscription_plan.json
new file mode 100644
index 0000000..ab58e7c
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.json
@@ -0,0 +1,255 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "autoname": "field:plan_name",
+ "beta": 0,
+ "creation": "2018-02-24 11:31:23.066506",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "plan_name",
+ "fieldtype": "Data",
+ "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": "Plan 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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item",
+ "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": "Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "currency",
+ "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": "Currency",
+ "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": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cost",
+ "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": "Cost",
+ "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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Day",
+ "fieldname": "billing_interval",
+ "fieldtype": "Select",
+ "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": "Billing Interval",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Day\nWeek\nMonth\nYear",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "description": "Number of intervals for the interval field e.g if Interval is 'Days' and Billing Interval Count is 3, invoices will be generated every 3 days",
+ "fieldname": "billing_interval_count",
+ "fieldtype": "Int",
+ "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": "Billing Interval Count",
+ "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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-02-27 09:12:58.330140",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Plan",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
new file mode 100644
index 0000000..4b8c8fc
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class SubscriptionPlan(Document):
+ def validate(self):
+ self.validate_interval_count()
+
+ def validate_interval_count(self):
+ if self.billing_interval_count < 1:
+ frappe.throw('Billing Interval Count cannot be less than 1')
diff --git a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js
new file mode 100644
index 0000000..3ceb9a6
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Plan", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Plan
+ () => frappe.tests.make('Subscription Plan', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py
new file mode 100644
index 0000000..73afbf6
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionPlan(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_plan_detail/__init__.py b/erpnext/accounts/doctype/subscription_plan_detail/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json
new file mode 100644
index 0000000..c112923
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json
@@ -0,0 +1,73 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-25 07:35:07.736146",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "plan",
+ "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": "Plan",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Plan",
+ "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
+ }
+ ],
+ "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-02-25 07:35:07.736146",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Plan Detail",
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py
new file mode 100644
index 0000000..1d9606f
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionPlanDetail(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_settings/__init__.py b/erpnext/accounts/doctype/subscription_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.js b/erpnext/accounts/doctype/subscription_settings/subscription_settings.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.json b/erpnext/accounts/doctype/subscription_settings/subscription_settings.json
new file mode 100644
index 0000000..8c7c6f3
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.json
@@ -0,0 +1,179 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-26 06:13:37.910139",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "description": "Number of days after invoice date has elapsed before canceling subscription or marking subscription as unpaid",
+ "fieldname": "grace_period",
+ "fieldtype": "Int",
+ "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": "Grace Period",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "cancel_after_grace",
+ "fieldtype": "Check",
+ "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": "Cancel Invoice After Grace Period",
+ "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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "prorate",
+ "fieldtype": "Check",
+ "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": "Prorate",
+ "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
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 1,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-02-26 13:58:09.455832",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Settings",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Administrator",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py
new file mode 100644
index 0000000..cc378e4
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionSettings(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js
new file mode 100644
index 0000000..5a751ea
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Settings", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Settings
+ () => frappe.tests.make('Subscription Settings', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py
new file mode 100644
index 0000000..82c7e1d
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionSettings(unittest.TestCase):
+ pass
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index fc1779a..35d2cf0 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -3522,7 +3522,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3531,10 +3531,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -3560,8 +3560,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-03-28 14:09:02.393746",
- "modified_by": "Administrator",
+ "modified": "2018-03-30 14:09:02.393746",
+ "modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
"owner": "Administrator",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index b94710f..722c2d2 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -71,6 +72,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -103,6 +105,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -136,6 +139,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -229,6 +235,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -261,6 +268,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -294,6 +302,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -324,6 +333,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -354,6 +364,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -384,6 +395,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -413,6 +425,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -442,6 +455,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -471,6 +485,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -501,6 +516,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -531,6 +547,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -563,6 +580,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -596,6 +614,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -625,6 +644,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -656,6 +676,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -687,6 +708,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -718,6 +740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -747,6 +770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -778,6 +802,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -810,6 +835,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -841,6 +867,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -869,6 +896,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -900,6 +928,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -932,6 +961,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -960,6 +990,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -991,6 +1022,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1023,6 +1055,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1053,6 +1086,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1084,6 +1118,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1117,6 +1152,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1146,6 +1182,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1177,6 +1214,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1206,6 +1244,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1238,6 +1277,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1268,6 +1308,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1298,6 +1339,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1329,6 +1371,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1361,6 +1404,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1393,6 +1437,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1425,6 +1470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1454,6 +1500,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1486,6 +1533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1518,6 +1566,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1549,6 +1598,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1580,6 +1630,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1612,6 +1663,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1643,6 +1695,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1672,6 +1725,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1702,6 +1756,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1733,6 +1788,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1762,6 +1818,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1794,6 +1851,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1825,6 +1883,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1857,6 +1916,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1889,6 +1949,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1918,6 +1979,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1950,6 +2012,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1981,6 +2044,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2012,6 +2076,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2044,6 +2109,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2076,6 +2142,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2107,6 +2174,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2137,6 +2205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2169,6 +2238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2201,6 +2271,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2231,6 +2302,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2248,7 +2320,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2261,6 +2333,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2269,7 +2342,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2278,10 +2351,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2292,6 +2365,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2323,6 +2397,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2355,6 +2430,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2383,6 +2459,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2414,6 +2491,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2444,6 +2522,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2475,6 +2554,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2490,7 +2570,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-11-29 14:07:56.698355",
+ "modified": "2018-03-10 07:37:33.662363",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/docs/assets/img/articles/subscriber.png b/erpnext/docs/assets/img/articles/subscriber.png
new file mode 100644
index 0000000..e4ce64d
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscriber.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-1.png b/erpnext/docs/assets/img/articles/subscription-1.png
new file mode 100644
index 0000000..cbff30f9
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-plan.png b/erpnext/docs/assets/img/articles/subscription-plan.png
new file mode 100644
index 0000000..b60f796
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-plan.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-settings.png b/erpnext/docs/assets/img/articles/subscription-settings.png
new file mode 100644
index 0000000..405f0bf
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-settings.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md b/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md
new file mode 100644
index 0000000..97e6638
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md
@@ -0,0 +1,104 @@
+# How To Manage Subscriptions With ERPNext
+
+ERPNext now allows you to manage your subscriptions easily. A single subscription can contain multiple plans. At
+the same time, A single subscriber can also have multiple subscriptions. ERPNext also automatically manages your
+subscriptions for you by generating new invoices when due and changing the subscription status for you.
+
+## Related Doctypes
+### Subscriber
+Like its name suggests, the Subscriber Doctype represents your subscribers and each record is linked to a single
+Customer.
+
+<img alt="Subscriber form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscriber.png">
+
+### Subscription Plan
+Each Subscription Plan is linked to a single Item and contains billing and pricing information on the Item. You can have
+multiple Subscription Plans for a single Item. An example of a situation where you would want this is where you have
+different prices for the same Item like when you have a basic option and premium option for a service.
+
+<img alt="Subscription Plan Form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-plan.png">
+
+### Subscription Settings
+Subscription Settings is where you tweak the behaviour of the Subscription Doctype. For example, you can set a grace
+period for overdue invoices from it. You can also elect to have a subscription cancelled if an overdue invoice is not
+paid after the grace period.
+
+<img alt="Subscription Settings Form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-settings.png">
+
+## Creating A Subscription
+To create a Subscription, go to the Subscription creation form
+`Explore > Accounts > Subscriptions`
+
+<img alt="Subscription form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-1.png">
+
+Select a Subscriber.
+
+If you want to cancel a subscription at the end of the present billing cycle, check the 'Cancel At End Of Period'
+check box.
+
+Select the start date for the subscription. By default, the start date is today's date. (Optional).
+
+If you are giving the subscriber a trial, enter the Trial Period Start Date and Trial Period End Date.
+
+If your invoice is not payable immediately, you can set the number of days before the invoice will be due in the
+'Days Until Due' field.
+
+If you require more than one unit of a plan, set it in the 'Quantity' field. For instance, a web developer is subscribed
+to your web hosting service. The developer buys a plan for each customer. Instead of having multiple subscriptions for
+the same plan, you can simply increase the quantity as needed.
+
+In the 'Plan' table, add Subscription Plans as required. You may have multiple Subscription Plans in a single
+Subscription as long as they all have the same billing period cycle. If the same Subscriber needs to subscribe to
+plans with different billing cycles, you will have to use a separate subscription.
+
+Select a Sales Taxes and Charges Template if you need to charge tax in your invoices.
+
+Fill the relevant fields in the 'Discounts' section if you need to add discounts to your invoices.
+
+Click Save.
+
+### Subscription Status
+ERPNext Subscription has five status values:
+- **Trialling** - A subscription that is in trial period
+- **Active** - A subscription that does not have any unpaid invoice
+- **Past Due** - A subscription whose most recent invoice is unpaid but is still within the grace period
+- **Unpaid** - A subscription whose most recent invoice is unpaid and past the grace period
+- **Canceled** - A subscription whose most recent invoice is unpaid and past the grace period. In this state, ERPNext no longer monitors the subscription.
+
+### Subscription Processing In The Background
+Every one hour interval, ERPNext processes all Subscriptions and updates each for any change in status. It will
+create new invoices if need be. When an outstanding invoice is paid, ERPNext updates the subscription accordingly.
+
+### Manually Updating Subscriptions
+Once you have saved a subscription, you can change the 'Days Until Due', 'Quantity', 'Plans', 'Sales Taxes and Charges
+Template', 'Apply Additional Discount On', 'Additional Discount Percentage' and 'Additional Discount Amount' fields.
+
+Note that changing any of the values will reflect in newly generated invoices only. Previously generated invoices will
+not be changed.
+
+### Cancelling Subscriptions
+To cancel a Subscription, simply click the 'Cancel Subscription' button. The subscription will update its 'Cancellation
+Date' field and the subscription will no longer be monitored.
+
+If you are cancelling an active subscription, an invoice will immediately be generated. The generated invoice will be on
+pro-rata basis by default. If you want ERPNext always create an invoice for the full amount, uncheck the 'Prorate' field
+in Subsciption Settings.
+
+### Restarting Subscriptions
+To restart a canceled subscription, simply click the 'Restart Subscription' button. Note the Subscription will empty
+its invoices table. Note that the invoices will still exist but the Subscription will no longer track them. The start
+date of the subscription will also be changed to the date the Subscription is restarted. The start of the billing
+cycle will also be set to the date the Subscription is restarted.
+
+### Recalculating Subscriptions
+Some times, a Subscription's status might have changed but might not yet be reflected in the Subscription. You can force
+ERPNext to update the subscription by clicking 'Fetch Subscription Updates'.
+
+### Subscription Settings
+**Grace Period** represents the number of days after a subscriber's invoice becomes overdue that ERPNext should delay
+before changing the Subscription status to 'Canceled' or 'Unpaid'.
+
+**Cancel Invoice After Grace Period** would cause ERPNext to automatically cancel a subscription if it is not paid before the grace period elapses. This setting is off by default.
+
+**Prorate** would cause ERPNext to generate a prorated invoice when an active subscription is canceled by default.
+If you would prefer a full invoice, uncheck the setting.
\ No newline at end of file
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 57e83e6..e77ed6f 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -216,8 +216,8 @@
scheduler_events = {
"hourly": [
- "erpnext.accounts.doctype.subscription.subscription.make_subscription_entry",
- 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails'
+ 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
+ "erpnext.accounts.doctype.subscription.subscription.process_all"
],
"daily": [
"erpnext.stock.reorder_item.reorder_item",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 71802b4..982a721 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -523,3 +523,5 @@
erpnext.patches.v11_0.add_default_email_template_for_leave
erpnext.patches.v11_0.set_default_email_template_in_hr
erpnext.patches.v10_0.taxes_issue_with_pos
+erpnext.patches.v10_1.transfer_subscription_to_auto_repeat
+erpnext.patches.v10_1.drop_old_subscription_records
diff --git a/erpnext/patches/v10_1/__init__.py b/erpnext/patches/v10_1/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v10_1/__init__.py
diff --git a/erpnext/patches/v10_1/drop_old_subscription_records.py b/erpnext/patches/v10_1/drop_old_subscription_records.py
new file mode 100644
index 0000000..7573f15
--- /dev/null
+++ b/erpnext/patches/v10_1/drop_old_subscription_records.py
@@ -0,0 +1,6 @@
+from __future__ import unicode_literals
+import frappe
+
+
+def execute():
+ frappe.db.sql('DELETE from `tabSubscription`')
diff --git a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
new file mode 100644
index 0000000..481c557
--- /dev/null
+++ b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
@@ -0,0 +1,31 @@
+from __future__ import unicode_literals
+import frappe
+from frappe.model.utils.rename_field import rename_field
+
+
+def execute():
+ to_rename = ['Purchase Order', 'Journal Entry', 'Sales Invoice', 'Payment Entry',
+ 'Delivery Note', 'Purchase Invoice', 'Quotation', 'Sales Order',
+ 'Purchase Receipt', 'Supplier Quotation']
+
+ frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
+ frappe.reload_doc('accounts', 'doctype', 'purchase_invoice')
+ frappe.reload_doc('accounts', 'doctype', 'payment_entry')
+ frappe.reload_doc('accounts', 'doctype', 'journal_entry')
+ frappe.reload_doc('buying', 'doctype', 'purchase_order')
+ frappe.reload_doc('buying', 'doctype', 'supplier_quotation')
+ frappe.reload_doc('desk', 'doctype', 'auto_repeat')
+ frappe.reload_doc('selling', 'doctype', 'quotation')
+ frappe.reload_doc('selling', 'doctype', 'sales_order')
+ frappe.reload_doc('stock', 'doctype', 'purchase_receipt')
+ frappe.reload_doc('stock', 'doctype', 'delivery_note')
+
+ for doctype in to_rename:
+ rename_field(doctype, 'subscription', 'auto_repeat')
+
+ subscriptions = frappe.db.sql('select * from `tabSubscription`', as_dict=1)
+
+ for doc in subscriptions:
+ doc['doctype'] = 'Auto Repeat'
+ auto_repeat = frappe.get_doc(doc)
+ auto_repeat.db_insert()
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 0d4835e..b58cd4e 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -71,6 +72,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -103,6 +105,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -136,6 +139,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -169,6 +173,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -202,6 +207,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -232,6 +238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -261,6 +268,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -294,6 +302,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -328,6 +337,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -361,6 +371,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -392,6 +403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -425,6 +437,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -457,6 +470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -487,6 +501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -518,6 +533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -551,6 +567,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -580,6 +597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -609,6 +627,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -639,6 +658,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -668,6 +688,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -699,6 +720,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -728,6 +750,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -762,6 +785,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -793,6 +817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -823,6 +848,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -855,6 +881,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -889,6 +916,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -918,6 +946,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -951,6 +980,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -982,6 +1012,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1013,6 +1044,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1042,6 +1074,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1073,6 +1106,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1105,6 +1139,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "40px"
},
@@ -1134,6 +1169,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1165,6 +1201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1197,6 +1234,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1226,6 +1264,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1257,6 +1296,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1287,6 +1327,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1317,6 +1358,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1348,6 +1390,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1380,6 +1423,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1408,6 +1452,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1439,6 +1484,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1499,6 +1546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1529,6 +1577,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1559,6 +1608,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1587,6 +1637,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1619,6 +1670,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1647,6 +1699,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1677,6 +1730,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1708,6 +1762,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1740,6 +1795,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1771,6 +1827,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1800,6 +1857,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1830,6 +1888,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1860,6 +1919,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1891,6 +1951,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1923,6 +1984,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -1955,6 +2017,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1987,6 +2050,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2020,6 +2084,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2050,6 +2115,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2083,6 +2149,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2115,6 +2182,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2147,6 +2215,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2179,6 +2248,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2212,6 +2282,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2243,6 +2314,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2274,6 +2346,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2306,6 +2379,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2338,6 +2412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2369,6 +2444,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2399,6 +2475,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2431,6 +2508,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2463,6 +2541,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2492,6 +2571,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2522,6 +2602,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2539,7 +2620,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2552,6 +2633,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2560,7 +2642,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2569,10 +2651,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2583,6 +2665,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2614,6 +2697,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2646,6 +2730,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2678,6 +2763,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2710,6 +2796,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2739,6 +2826,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2773,6 +2861,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2804,6 +2893,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2835,6 +2925,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2866,6 +2957,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2881,7 +2973,7 @@
"istable": 0,
"max_attachments": 1,
"menu_index": 0,
- "modified": "2018-01-11 14:42:22.052380",
+ "modified": "2018-03-10 07:34:23.971888",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 6d9c170..dbb1e9f 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -103,7 +103,7 @@
print_lst.append(lst1)
return print_lst
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.valid_till = None
def get_list_context(context=None):
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index f302c1c..221eca7 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,6 +137,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -292,6 +300,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -326,6 +335,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -359,6 +369,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "160px"
},
@@ -390,6 +401,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -423,6 +435,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -457,6 +470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -488,6 +502,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -521,6 +536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -551,6 +567,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -580,6 +597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -610,6 +628,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -639,6 +658,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -668,6 +688,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -698,6 +719,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -726,6 +748,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -757,6 +780,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -786,6 +810,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -817,6 +842,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -848,6 +874,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -878,6 +905,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -910,6 +938,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -944,6 +973,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -973,6 +1003,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1006,6 +1037,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1037,6 +1069,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1068,6 +1101,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1097,6 +1131,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1128,6 +1163,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1160,6 +1196,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1188,6 +1225,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1216,6 +1254,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1247,6 +1286,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1279,6 +1319,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1308,6 +1349,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1339,6 +1381,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1369,6 +1412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1399,6 +1443,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1430,6 +1475,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1462,6 +1508,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1490,6 +1537,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1521,6 +1569,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1549,6 +1598,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1581,6 +1631,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1611,6 +1662,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1641,6 +1693,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1669,6 +1722,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1701,6 +1755,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1731,6 +1786,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1761,6 +1817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1792,6 +1849,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1824,6 +1882,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1855,6 +1914,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1883,6 +1943,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1914,6 +1975,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1945,6 +2007,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1976,6 +2039,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2008,6 +2072,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2040,6 +2105,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2072,6 +2138,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2105,6 +2172,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2135,6 +2203,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2168,6 +2237,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2201,6 +2271,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2233,6 +2304,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2265,6 +2337,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2296,6 +2369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2329,6 +2403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2360,6 +2435,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2391,6 +2467,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2422,6 +2499,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2453,6 +2531,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2485,6 +2564,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2517,6 +2597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2548,6 +2629,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2580,6 +2662,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2613,6 +2696,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2644,6 +2728,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2673,6 +2758,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2705,6 +2791,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2738,6 +2825,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2768,6 +2856,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2798,6 +2887,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2830,6 +2920,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2859,6 +2950,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2892,6 +2984,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2922,6 +3015,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2952,6 +3046,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2986,6 +3081,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3017,6 +3113,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3050,6 +3147,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3079,6 +3177,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3112,6 +3211,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3143,6 +3243,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3175,6 +3276,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3207,6 +3309,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3236,6 +3339,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3268,6 +3372,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3301,6 +3406,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3331,6 +3437,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3363,6 +3470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3380,7 +3488,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@@ -3393,6 +3501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3424,6 +3533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3455,6 +3565,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3484,6 +3595,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3492,7 +3604,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3501,10 +3613,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 0,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -3515,6 +3627,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3529,7 +3642,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-01-12 15:56:12.483019",
+ "modified": "2018-03-10 07:35:33.258624",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 40c2cf0..4ac29fd 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -13,7 +13,7 @@
from frappe.desk.notifications import clear_doctype_notifications
from frappe.contacts.doctype.address.address import get_company_address
from erpnext.controllers.selling_controller import SellingController
-from erpnext.accounts.doctype.subscription.subscription import get_next_schedule_date
+from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
from erpnext.selling.doctype.customer.customer import check_credit_limit
form_grid_templates = {
@@ -369,16 +369,16 @@
))
return items
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.set("delivery_date", get_next_schedule_date(reference_doc.delivery_date,
- subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
+ auto_repeat_doc.frequency, cint(auto_repeat_doc.repeat_on_day)))
for d in self.get("items"):
reference_delivery_date = frappe.db.get_value("Sales Order Item",
{"parent": reference_doc.name, "item_code": d.item_code, "idx": d.idx}, "delivery_date")
d.set("delivery_date", get_next_schedule_date(reference_delivery_date,
- subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
+ auto_repeat_doc.frequency, cint(auto_repeat_doc.repeat_on_day)))
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index f2c7fcb..552483a 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,6 +137,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -197,6 +202,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -226,6 +232,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -294,6 +302,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -312,7 +321,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"in_standard_filter": 0,
"label": "Date",
"length": 0,
@@ -329,6 +338,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -364,6 +374,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -396,6 +407,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -426,6 +438,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -458,6 +471,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -489,6 +503,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -521,6 +536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -551,6 +567,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -584,6 +601,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -616,6 +634,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -646,6 +665,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -675,6 +695,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -705,6 +726,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -734,6 +756,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -763,6 +786,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -793,6 +817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -822,6 +847,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -854,6 +880,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -884,6 +911,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -913,6 +941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -944,6 +973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -974,6 +1004,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1004,6 +1035,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1036,6 +1068,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1069,6 +1102,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1097,6 +1131,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1129,6 +1164,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1159,6 +1195,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1190,6 +1227,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1219,6 +1257,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1250,6 +1289,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1282,6 +1322,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1314,6 +1355,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1346,6 +1388,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1375,6 +1418,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1403,6 +1447,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1434,6 +1479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1496,6 +1543,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1527,6 +1575,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1557,6 +1606,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1587,6 +1637,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1618,6 +1669,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1651,6 +1703,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1679,6 +1732,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1710,6 +1764,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1738,6 +1793,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1770,6 +1826,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1800,6 +1857,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1830,6 +1888,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1858,6 +1917,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1891,6 +1951,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1921,6 +1982,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1951,6 +2013,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1982,6 +2045,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2014,6 +2078,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2045,6 +2110,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2073,6 +2139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2103,6 +2170,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2133,6 +2201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2164,6 +2233,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2197,6 +2267,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2229,6 +2300,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2262,6 +2334,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2296,6 +2369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2326,6 +2400,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2359,6 +2434,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2391,6 +2467,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2424,6 +2501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2458,6 +2536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2491,95 +2570,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "payment_terms_template_section",
- "fieldtype": "Section 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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "payment_terms_template",
- "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": "Payment Terms Template",
- "length": 0,
- "no_copy": 0,
- "options": "Payment Terms Template",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "terms_section",
- "fieldtype": "Section 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
},
{
@@ -2612,6 +2603,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2643,6 +2635,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2674,6 +2667,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2706,6 +2700,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2736,6 +2731,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2770,6 +2766,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -2805,6 +2802,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -2837,6 +2835,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2870,6 +2869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2903,6 +2903,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2935,6 +2936,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2965,6 +2967,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2996,6 +2999,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3027,6 +3031,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3058,6 +3063,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3088,6 +3094,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3120,6 +3127,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3152,6 +3160,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3182,6 +3191,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3211,6 +3221,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3242,6 +3253,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3271,6 +3283,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3305,6 +3318,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3339,6 +3353,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3368,6 +3383,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3396,6 +3412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3429,6 +3446,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3460,6 +3478,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3491,6 +3510,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3521,6 +3541,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3529,7 +3550,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3538,10 +3559,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -3552,6 +3573,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3584,6 +3606,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3617,6 +3640,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3647,6 +3671,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3680,6 +3705,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3713,6 +3739,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3743,6 +3770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3775,6 +3803,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3790,8 +3819,8 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-03-13 15:35:02.234116",
- "modified_by": "Administrator",
+ "modified": "2018-04-30 15:35:02.234116",
+ "modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
"owner": "Administrator",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 9f609be..4f9f301 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -135,6 +138,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -168,6 +172,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -200,6 +205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -260,6 +267,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -295,6 +303,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -330,6 +339,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -362,6 +372,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -396,6 +407,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -427,6 +439,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -459,6 +472,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -489,6 +503,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -519,6 +534,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -549,6 +565,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -579,6 +596,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -608,6 +626,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -637,6 +656,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -666,6 +686,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -695,6 +716,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -727,6 +749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -757,6 +780,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -787,6 +811,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -819,6 +844,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -852,6 +878,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -882,6 +909,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -913,6 +941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -944,6 +973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -975,6 +1005,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1004,6 +1035,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1035,6 +1067,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1067,6 +1100,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1098,6 +1132,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1127,6 +1162,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1158,6 +1194,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1191,6 +1228,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1220,6 +1258,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1251,6 +1290,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1283,6 +1323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1313,6 +1354,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1345,6 +1387,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1378,6 +1421,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1407,6 +1451,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1438,6 +1483,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1499,6 +1546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1529,6 +1577,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1559,6 +1608,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1591,6 +1641,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1623,6 +1674,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1655,6 +1707,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1687,6 +1740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1716,6 +1770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1749,6 +1804,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1781,6 +1837,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1812,6 +1869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1843,6 +1901,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1875,6 +1934,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1906,6 +1966,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1935,6 +1996,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1965,6 +2027,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1996,6 +2059,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2025,6 +2089,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2057,6 +2122,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2088,6 +2154,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2120,6 +2187,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2152,6 +2220,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2181,6 +2250,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2213,6 +2283,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2244,6 +2315,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2275,6 +2347,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2307,6 +2380,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2339,6 +2413,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2370,6 +2445,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2403,6 +2479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2437,6 +2514,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2471,6 +2549,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50px"
},
@@ -2504,6 +2583,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2535,6 +2615,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2566,6 +2647,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2597,6 +2679,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2631,6 +2714,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2665,6 +2749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2698,6 +2783,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2730,6 +2816,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2760,6 +2847,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2791,6 +2879,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2808,7 +2897,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Detail",
+ "label": "Auto Repeat Detail",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2821,6 +2910,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2829,7 +2919,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2838,10 +2928,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2852,6 +2942,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2882,6 +2973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2912,6 +3004,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2944,6 +3037,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2974,6 +3068,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3006,6 +3101,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "30%"
},
@@ -3038,6 +3134,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3067,6 +3164,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3098,6 +3196,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3129,6 +3228,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3158,6 +3258,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3192,6 +3293,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3226,6 +3328,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
}
@@ -3242,7 +3345,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-01-11 14:40:58.353712",
+ "modified": "2018-03-10 07:36:31.378606",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/templates/emails/recurring_document_failed.html b/erpnext/templates/emails/recurring_document_failed.html
deleted file mode 100644
index f9e8c2d..0000000
--- a/erpnext/templates/emails/recurring_document_failed.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<h2>{{_("Recurring")}} {{ type }} {{ _("Failed")}}</h2>
-
-<p>{{_("An error occured while creating recurring")}} {{ type }} <b>{{ name }}</b> {{_("for")}} <b>{{ party }}</b>.</p>
-<p>{{_("This could be because of some invalid Email Addresses in the")}} {{ type }}.</p>
-<p>{{_("To stop sending repetitive error notifications from the system, we have checked Disabled field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.</p>
-<p><b>{{_("Please correct the")}} {{ type }} {{_('and unchcked Disabled in the')}} {{ subscription }} {{_("for making recurring again.")}}</b></p>
-<hr>
-<p><b>{{_("It is necessary to take this action today itself for the above mentioned recurring")}} {{ type }}
-{{_('to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field
-of this')}} {{ type }} {{_("for generating the recurring")}} {{ type }} {{_("in the subscription")}} {{ subscription }}.</b></p>
-<p>[{{_("This email is autogenerated")}}]</p>