From db21f86b260f7ef68a06adfa736eee522f734431 Mon Sep 17 00:00:00 2001 From: Pranav Nachanekar Date: Mon, 9 Sep 2019 17:01:40 +0530 Subject: [PATCH] Removed unneccessary doctype --- .../doctype/availabilty_of_slots/__init__.py | 0 .../availability_of_slots.json | 46 ------------------- .../availabilty_of_slots.py | 10 ---- erpnext/www/book-appointment/index.js | 9 ++-- erpnext/www/book-appointment/index.py | 2 +- 5 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 erpnext/crm/doctype/availabilty_of_slots/__init__.py delete mode 100644 erpnext/crm/doctype/availabilty_of_slots/availability_of_slots.json delete mode 100644 erpnext/crm/doctype/availabilty_of_slots/availabilty_of_slots.py diff --git a/erpnext/crm/doctype/availabilty_of_slots/__init__.py b/erpnext/crm/doctype/availabilty_of_slots/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/erpnext/crm/doctype/availabilty_of_slots/availability_of_slots.json b/erpnext/crm/doctype/availabilty_of_slots/availability_of_slots.json deleted file mode 100644 index d26f7ced35..0000000000 --- a/erpnext/crm/doctype/availabilty_of_slots/availability_of_slots.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "creation": "2019-08-27 10:52:54.204677", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "day_of_week", - "from_time", - "to_time" - ], - "fields": [ - { - "fieldname": "day_of_week", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Day Of Week", - "options": "Sunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday", - "reqd": 1 - }, - { - "fieldname": "from_time", - "fieldtype": "Time", - "in_list_view": 1, - "label": "From Time ", - "reqd": 1 - }, - { - "fieldname": "to_time", - "fieldtype": "Time", - "in_list_view": 1, - "label": "To Time", - "reqd": 1 - } - ], - "istable": 1, - "modified": "2019-08-27 10:52:54.204677", - "modified_by": "Administrator", - "module": "CRM", - "name": "Availabilty Of Slots", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1 -} \ No newline at end of file diff --git a/erpnext/crm/doctype/availabilty_of_slots/availabilty_of_slots.py b/erpnext/crm/doctype/availabilty_of_slots/availabilty_of_slots.py deleted file mode 100644 index 62436b8da7..0000000000 --- a/erpnext/crm/doctype/availabilty_of_slots/availabilty_of_slots.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2019, 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 AvailabiltyOfSlots(Document): - pass \ No newline at end of file diff --git a/erpnext/www/book-appointment/index.js b/erpnext/www/book-appointment/index.js index 5bc8af0bde..b2df3b4382 100644 --- a/erpnext/www/book-appointment/index.js +++ b/erpnext/www/book-appointment/index.js @@ -165,12 +165,13 @@ function setup_details_page(){ async function submit() { // form validation here form_validation(); + debugger; let appointment = (await frappe.call({ method: 'erpnext.www.book-appointment.index.create_appointment', args: { - 'date': date, - 'time': time, - 'contact': contact + 'date': window.selected_date, + 'time': window.selected_time, + 'contact': window.contact } })).message; frappe.msgprint(__('Appointment Created Successfully')); @@ -181,7 +182,7 @@ async function submit() { function form_validation(){ var date = window.selected_date; - var time = document.getElementsByClassName('selected')[0].id; + var time = window.selected_time; contact = {}; contact.name = document.getElementById('customer_name').value; contact.number = document.getElementById('customer_number').value; diff --git a/erpnext/www/book-appointment/index.py b/erpnext/www/book-appointment/index.py index e853a35fff..9c37fb0c99 100644 --- a/erpnext/www/book-appointment/index.py +++ b/erpnext/www/book-appointment/index.py @@ -76,7 +76,7 @@ def create_appointment(date,time,contact): appointment.scheduled_time = datetime.datetime.strptime(date+" "+time,format_string) contact = json.loads(contact) appointment.customer_name = contact['name'] - appointment.customer_phone_no = contact['number'] + appointment.customer_phone_number = contact['number'] appointment.customer_skype = contact['skype'] appointment.customer_details = contact['notes'] appointment.insert()