-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
724f22e
commit bb47cb0
Showing
7 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import frappe | ||
from frappe import _ | ||
from frappe.model.document import Document | ||
|
||
def send_welcome_email(doc,method): | ||
msg = " ".join([ | ||
'Welcome to Membership Management System <b>',doc.full_name, | ||
'<br>Plan:</b> ', doc.plan, | ||
'<br><b>Start Date:</b> ',doc.joining_date, | ||
'<br><b>End Date:</b> ',doc.end_date, | ||
'<br><b>Balance:</b> ',str(doc.balance) | ||
]) | ||
frappe.sendmail( | ||
recipients=[doc.member], | ||
sender=frappe.session.user, | ||
subject="New Membership", | ||
message=msg, | ||
now=True | ||
) | ||
frappe.msgprint(_("Welcome Email Sent!")) | ||
|
||
def add_balance_log(doc,method): | ||
# doc = frappe.get_doc('Member', doc.member) | ||
doc.append('balance_log', { | ||
'date': doc.joining_date, | ||
'description': ' ' . join(['Membership - ',doc.plan, ' - ', doc.duration, ' month/s']), | ||
'amount': doc.total, | ||
'balance': (doc.balance - doc.total) | ||
}) | ||
doc.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
52 changes: 52 additions & 0 deletions
52
membershipmanagement/members/doctype/balance_log/balance_log.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"creation": "2019-12-05 14:46:36.632538", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"date", | ||
"description", | ||
"amount", | ||
"balance" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "date", | ||
"fieldtype": "Read Only", | ||
"in_list_view": 1, | ||
"label": "Date", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "description", | ||
"fieldtype": "Read Only", | ||
"in_list_view": 1, | ||
"label": "Description", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "amount", | ||
"fieldtype": "Read Only", | ||
"in_list_view": 1, | ||
"label": "Amount", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "balance", | ||
"fieldtype": "Read Only", | ||
"in_list_view": 1, | ||
"label": "Balance", | ||
"reqd": 1 | ||
} | ||
], | ||
"istable": 1, | ||
"modified": "2019-12-05 15:02:08.757375", | ||
"modified_by": "Administrator", | ||
"module": "Members", | ||
"name": "Balance Log", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"quick_entry": 1, | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"track_changes": 1 | ||
} |
10 changes: 10 additions & 0 deletions
10
membershipmanagement/members/doctype/balance_log/balance_log.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2019, Parth - M20Zero and contributors | ||
# For license information, please see license.txt | ||
|
||
from __future__ import unicode_literals | ||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
class BalanceLog(Document): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters