Commit 5b5fd7dd authored by Gladys Forte's avatar Gladys Forte

clean clean

parent ac916bcd
......@@ -5,7 +5,6 @@ from app.entities import models
from django.conf import settings
# def account_created(args, username, password, receiver) :
def account_created(args):
name = args[0]
username = args[1]
......@@ -51,20 +50,7 @@ def account_created(args):
def cronjob(args):
# name = args[0]
# username = args[1]
# password = args[2]
# recipient = args[3]
# admin = args[4]
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'RMS-NEWUSER.html'), 'r')
# FC = F.read()
# FC = FC.replace('{name}', name)
# FC = FC.replace('{username}', username)
# FC = FC.replace('{password}', password)
# FC = FC.replace('{url}', settings.FRONT_END_URL + '/cms/profile') #changed
try:
send_mail(
subject='Resource Management System: Welcome!',
......@@ -145,24 +131,6 @@ def forgot_password(args):
)
# def password_changed(username, date, receiver) :
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'password-changed.html'), 'r')
# FC = F.read()
# FC = FC.replace('[Username]', username)
# FC = FC.replace('[Datetime]', date)
# FC = FC.replace('[URL]', settings.FRONT_END_URL)
# send_mail(
# subject='OB RMS: Password Changed!',
# message='',
# from_email=settings.EMAIL_DEFAULT_SENDER,
# recipient_list=[receiver,],
# html_message=FC
# )
def admin_changepassword(args):
name = args[0]
username = args[1]
......@@ -188,342 +156,6 @@ def admin_changepassword(args):
)
# def account_created(username, password, receiver) :
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'account-created.html'), 'r')
# FC = F.read()
# FC = FC.replace('[Username]', username)
# FC = FC.replace('[Password]', password)
# FC = FC.replace('[URL]', settings.FRONT_END_URL)
# send_mail(
# subject='OB IMS: Welcome!',
# message='',
# from_email=settings.EMAIL_DEFAULT_SENDER,
# recipient_list=[receiver,],
# html_message=FC
# )
# def stock_requisition_new(sr_id,
# sr_no,
# requestor,
# requested_on,
# project,
# remarks,
# receiver,
# requested_items=[],
# purchase_items=[],
# required_date=None):
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'stock-requisition.html'), 'r')
# FC = F.read()
# FC = FC.replace('[SR No]', sr_no)
# FC = FC.replace('[Requestor]', requestor)
# FC = FC.replace('[Requested On]', requested_on)
# FC = FC.replace('[Project]', project)
# FC = FC.replace('[Remarks]', remarks)
# # PRINT SR ITEMS
# if requested_items and len(requested_items) > 0:
# appendedList = ''
# for item in requested_items :
# prodNo = str(item.product.product_no)
# prodName = str(item.product.name)
# brand = str(item.product.brand.name)
# qty = str(item.quantity)
# unit = str(item.product.unit_material.name)
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="sr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# # PRINT PR ITEMS
# if purchase_items and len(purchase_items) > 0 :
# FC = FC.replace('[Required Date]', required_date)
# appendedList = ''
# for item in purchase_items :
# prodNo = str(item.product.product_no)
# prodName = str(item.product.name)
# brand = str(item.product.brand.name)
# qty = str(item.quantity)
# unit = str(item.product.unit_material.name)
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="pr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# urlApprove = f"{settings.FRONT_END_URL}/{'transaction/requisition/approve'}/{sr_id}/basic"
# urlReject = f"{settings.FRONT_END_URL}/{'transaction/requisition/reject'}/{sr_id}/basic"
# FC = FC.replace('ApproveToken', urlApprove)
# FC = FC.replace('RejectToken', urlReject)
# send_mail(
# subject='OB IMS: '+ sr_no +' by ' + requestor,
# message='',
# from_email=settings.EMAIL_DEFAULT_SENDER,
# recipient_list=[receiver,],
# html_message=FC
# )
# def stock_requisition_approve(sr_no,
# requestor,
# requestor_email,
# requested_on,
# requestor_contact,
# project,
# remarks,
# approved_by,
# approved_date,
# requested_items=[],
# purchase_items=[],
# required_date=None):
# # requested_items
# # LIST OF "RequisitionApproveItem"
# # purchase_items
# # LIST OF "PurchaseRequestApproveItem"
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'stock-requisition-approved.html'), 'r')
# FC = F.read()
# FC = FC.replace('[SR No]', sr_no)
# FC = FC.replace('[Requestor]', requestor)
# FC = FC.replace('[Requested On]', requested_on)
# FC = FC.replace('[Project]', project)
# FC = FC.replace('[Remarks]', remarks)
# FC = FC.replace('[Approved By]', approved_by)
# FC = FC.replace('[Approved On]', approved_date)
# # PRINT SR ITEMS
# if len(requested_items) > 0 :
# appendedList = ''
# for item in requested_items :
# prodNo = item.requisition_product.product.product_no
# prodName = item.requisition_product.product.name
# brand = item.requisition_product.product.brand.name
# qty = str(item.quantity)
# unit = item.requisition_product.product.unit_material.name
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="sr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# # PRINT PR ITEMS
# if len(purchase_items) > 0 :
# FC = FC.replace('[Required Date]', required_date)
# appendedList = ''
# for item in purchase_items :
# prodNo = item.purchase_request_item.product.product_no
# prodName = item.purchase_request_item.product.name
# brand = item.purchase_request_item.product.brand.name
# qty = str(item.quantity)
# unit = item.purchase_request_item.product.unit_material.name
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="pr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# approver_emails = []
# # roles_receives = ['Receive Stock Requisition Authorization Email',
# # 'Allow Purchase Requests Authorisation',
# # 'Receive Stock Request Email',
# # 'Receive Purchase Request Email']
# # qry = models.User.objects.filter(user_roles__role__code__in=roles_receives).values('email').distinct()
# # for item in qry:
# # approver_emails.append(item['email'])
# approver_emails.append(requestor_email)
# if len(approver_emails) > 0:
# send_mail(
# subject='OB IMS Stock Request: '+ sr_no,
# message='',
# from_email=settings.EMAIL_DEFAULT_SENDER,
# recipient_list=approver_emails,
# html_message=FC
# )
# def stock_requisition_reject(sr_no,
# requestor,
# requestor_email,
# requested_on,
# project,
# remarks,
# rejected_reason,
# rejected_by,
# rejected_date,
# requested_items=[],
# purchase_items=[],
# required_date=None):
# # requested_items
# # LIST OF "RequisitionRejectItem"
# # purchase_items
# # LIST OF "PurchaseRequestRejectItem"
# F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'stock-requisition-rejected.html'), 'r')
# FC = F.read()
# FC = FC.replace('[SR No]', sr_no)
# FC = FC.replace('[Requestor]', requestor)
# FC = FC.replace('[Requested On]', requested_on)
# FC = FC.replace('[Project]', project)
# FC = FC.replace('[Remarks]', remarks)
# FC = FC.replace('[Rejected By]', rejected_by)
# FC = FC.replace('[Rejected On]', rejected_date)
# FC = FC.replace('[Rejected Reason]', rejected_reason)
# # PRINT SR ITEMS
# if len(requested_items) > 0 :
# appendedList = ''
# for item in requested_items :
# prodNo = item.requisition_product.product.product_no
# prodName = item.requisition_product.product.name
# brand = item.requisition_product.product.brand.name
# qty = str(item.quantity)
# unit = item.requisition_product.product.unit_material.name
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="sr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# # PRINT PR ITEMS
# if len(purchase_items) > 0 :
# FC = FC.replace('[Required Date]', required_date)
# appendedList = ''
# for item in purchase_items :
# prodNo = item.purchase_request_item.product.product_no
# prodName = item.purchase_request_item.product.name
# brand = item.purchase_request_item.product.brand.name
# qty = str(item.quantity)
# unit = item.purchase_request_item.product.unit_material.name
# appendedList += '\t\t\t\t \
# <tr bgcolor="#FFFFFF"> \
# <td>' + prodNo + '</td> \
# <td>' + prodName + '</td> \
# <td>' + brand + '</td> \
# <td>' + qty + '</td> \
# <td>' + unit + '</td> \
# </tr>'
# FC = FC.replace('<tr bgcolor="#FFFFFF" id="pr">\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n <td>&nbsp;</td>\n </tr>', appendedList)
# approver_emails = []
# # roles_receives = ['Receive Stock Requisition Authorization Email', 'Allow Purchase Requests Authorisation', 'Receive Stock Request Email', 'Receive Purchase Request Email']
# # qry = models.User.objects.filter(user_roles__role__code__in=roles_receives).values('email').distinct()
# # for item in qry :
# # approver_emails.append(item['email'])
# approver_emails.append(requestor_email)
# if len(approver_emails) > 0:
# send_mail(
# subject='OB IMS: '+ sr_no +' by ' + requestor,
# message='',
# from_email=settings.EMAIL_DEFAULT_SENDER,
# recipient_list=approver_emails,
# html_message=FC
# )
# # def account_password_reset(username, password, receiver, date_reset) :
# # F = open(os.path.join(EMAIL_TEMPLATES_ROOT, 'reset-password.html'), 'r')
# # FC = F.read()
# # FC = FC.replace('[Username]', username)
# # FC = FC.replace('[Password]', password)
# # FC = FC.replace('[Reset Datetime]', date_reset)
# # send_mail(
# # subject='OB IMS: Password Reset!',
# # message='',
# # from_email=EMAIL_DEFAULT_SENDER,
# # recipient_list=[receiver,],
# # html_message=FC
# # )
# RMS-CRAPPROVED ; RMS-CRACKNOWLEDGE ; RMS-CRCOMPLETED ; RMS-CRACCEPTED ;
# RMS-CRREJECTED ; RMS-CRREJECTED-VENDOR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment