Merge branch 'develop'

This commit is contained in:
Nabin Hait 2017-04-17 15:12:18 +05:30
commit d12a4f5e8c
56 changed files with 890 additions and 251 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '8.0.11'
__version__ = '8.0.12'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -1426,7 +1426,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_sample_item",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@ -1435,7 +1435,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sample Item",
"label": "Allow Zero Valuation Rate",
"length": 0,
"no_copy": 1,
"permlevel": 0,

View File

@ -1552,7 +1552,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_sample_item",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@ -1561,7 +1561,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sample Item",
"label": "Allow Zero Valuation Rate",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@ -2094,7 +2094,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-03-30 16:26:36.507924",
"modified": "2017-04-05 23:28:13.520429",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@ -1356,7 +1356,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
discount_percentage: d.discount_percentage || 0.0,
actual_qty: me.actual_qty_dict[d.item_code] || 0.0,
projected_qty: d.projected_qty,
rate: format_number(d.rate, me.frm.doc.currency),
rate: format_currency(d.rate, me.frm.doc.currency),
enabled: me.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
amount: format_currency(d.amount, me.frm.doc.currency),
selected_class: (me.item_code == d.item_code) ? "active" : ""

View File

@ -7,10 +7,10 @@
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
"idx": 0,
"line_breaks": 0,
"modified": "2017-01-12 14:56:12.571032",
"modified": "2017-04-17 12:12:00.153763",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Point of Sale",

View File

@ -32,6 +32,12 @@ def get_data():
"label": _("Reports"),
"icon": "fa fa-list",
"items": [
{
"type": "report",
"is_query_report": True,
"name": "Lead Details",
"doctype": "Lead"
},
{
"type": "page",
"name": "sales-funnel",
@ -40,15 +46,15 @@ def get_data():
},
{
"type": "report",
"name": "Minutes to First Response for Opportunity",
"doctype": "Opportunity",
"name": "Prospects Engaged But Not Converted",
"doctype": "Lead",
"is_query_report": True
},
{
"type": "report",
"is_query_report": True,
"name": "Lead Details",
"doctype": "Lead"
"name": "Minutes to First Response for Opportunity",
"doctype": "Opportunity",
"is_query_report": True
},
{
"type": "report",

View File

@ -106,7 +106,7 @@ def get_data():
{
"type": "doctype",
"name": "Course Schedule",
"route": "Calendar/Course Schedule"
"route": "List/Course Schedule/Calendar"
},
{
"type": "doctype",
@ -205,6 +205,10 @@ def get_data():
{
"type": "doctype",
"name": "Academic Year"
},
{
"type": "doctype",
"name": "School Settings"
}
]
},

View File

@ -54,14 +54,14 @@ class StockController(AccountsController):
self.check_expense_account(item_row)
# If item is not a sample item
# If the item does not have the allow zero valuation rate flag set
# and ( valuation rate not mentioned in an incoming entry
# or incoming entry not found while delivering the item),
# try to pick valuation rate from previous sle or Item master and update in SLE
# Otherwise, throw an exception
if not sle.stock_value_difference and self.doctype != "Stock Reconciliation" \
and not item_row.get("is_sample_item"):
and not item_row.get("allow_zero_valuation_rate"):
sle = self.update_stock_ledger_entries(sle)

View File

@ -0,0 +1,25 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Prospects Engaged But Not Converted"] = {
"filters": [
{
"fieldname": "lead",
"label": __("Lead"),
"fieldtype": "Link",
"options": "Lead"
},
{
"fieldname": "no_of_interaction",
"label": __("Number of Interaction"),
"fieldtype": "Int",
"default": 1
},
{
"fieldname": "lead_age",
"label": __("Minimum Lead Age (Days)"),
"fieldtype": "Int",
"default": 60
},
]
}

View File

@ -0,0 +1,29 @@
{
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2017-04-04 08:25:40.491063",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"modified": "2017-04-04 10:00:10.253224",
"modified_by": "Administrator",
"module": "CRM",
"name": "Prospects Engaged But Not Converted",
"owner": "Administrator",
"ref_doctype": "Lead",
"report_name": "Prospects Engaged But Not Converted",
"report_type": "Script Report",
"roles": [
{
"role": "Sales User"
},
{
"role": "Sales Manager"
},
{
"role": "System Manager"
}
]
}

View File

@ -0,0 +1,74 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import add_days, now
def execute(filters=None):
columns, data = [], []
set_defaut_value_for_filters(filters)
columns = get_columns()
data = get_data(filters)
return columns, data
def set_defaut_value_for_filters(filters):
if not filters.get('no_of_interaction'): filters["no_of_interaction"] = 1
if not filters.get('lead_age'): filters["lead_age"] = 60
def get_columns():
return [
_("Lead") + ":Link/Lead:100",
_("Name") + "::100",
_("Organization") + "::100",
_("Reference Document") + "::150",
_("Reference Name") + ":Dynamic Link/"+_("Reference Document")+":120",
_("Last Communication") + ":Data:200",
_("Last Communication Date") + ":Date:180"
]
def get_data(filters):
lead_details = []
lead_filters = get_lead_filters(filters)
for lead in frappe.get_all('Lead', fields = ['name', 'lead_name', 'company_name'], filters=lead_filters):
data = frappe.db.sql("""
select
`tabCommunication`.reference_doctype, `tabCommunication`.reference_name,
`tabCommunication`.content, `tabCommunication`.communication_date
from
(
(select name, lead from `tabOpportunity` where lead = %(lead)s)
union
(select name, lead from `tabQuotation` where lead = %(lead)s)
union
(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
union
(select %(lead)s, %(lead)s)
)
as ref_document, `tabCommunication`
where
`tabCommunication`.reference_name = ref_document.name and
`tabCommunication`.sent_or_received = 'Received'
order by
ref_document.lead, `tabCommunication`.creation desc limit %(limit)s""",
{'lead': lead.name, 'limit': filters.get('no_of_interaction')})
for lead_info in data:
lead_data = [lead.name, lead.lead_name, lead.company_name] + list(lead_info)
lead_details.append(lead_data)
return lead_details
def get_lead_filters(filters):
lead_creation_date = get_creation_date_based_on_lead_age(filters)
lead_filters = [["status", "!=", "Converted"], ["creation", ">", lead_creation_date]]
if filters.get('lead'):
lead_filters.append(["name", "=", filters.get('lead')])
return lead_filters
def get_creation_date_based_on_lead_age(filters):
return add_days(now(), (filters.get('lead_age') * -1))

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,40 @@
CRM module's reports helps users to get the information about the prospects. Using Following reports, user can analyze the data about prospect's history with a company and will helps user to build strong relationships with them.
###Lead Details
It has data about the leads and their contact and address details.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/lead.png">
###Sales Funnel
By using the sales funnel report, and by quantifying the number of prospects at each stage of the process, you can get an idea of your potential customers.
More than this, by looking at the way these numbers change over time, you can identify problems in the sales pipeline and take any corrective action at the early stage.
For example, if you notice that very few communications with the prospects has taken place in a month which might indicate a decrease in the sales. From the next month, organization should make sure that more communications has to take place with the prospects.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/sales_funnel.png">
###Prospects Engaged But Not Converted
Using this report, user gets the information about the leads who has shown interest in the business with you but due to some reason they were not converted into the customers.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/prospects_engaged_but_not_converted.png">
###Minutes to First Response for Opportunity
Immediacy is so important and so valued
In this internet area, we all expect a quicker response time to any of our query. This report gives you the information about the first response time given to an opportunities or issues. Using this report, the organization can improve their first response time to the prospects which can help to the better sales in the future.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/minutes_to_first_response.png">
###Customer Addresses And Contacts
It has data about the customers and their contact and address details.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/customer_address_and_contact.png">
###Inactive Customers
This report shows the list of customers who has not purchased since long time.
<img alt="Lead Details" class="screenshot"
src="{{docs_base_url}}/assets/img/crm/report/inactive_customers.png">

View File

@ -3,4 +3,5 @@ customer
opportunity
contact
newsletter
crm_reports
setup

View File

@ -1,7 +1,7 @@
<img class="screenshot" alt="Production Order" src="{{docs_base_url}}/assets/img/manufacturing/manufacturing-flow.png">
Production Order (also called as Work Order) is a document that is given to
A Production Order (also known as a Work Order) is a document that is given to
the manufacturing shop floor by the Production Planner as a signal to produce
a certain quantity of a certain Item. Production Order also helps to generate
a certain quantity of a certain Item. The Production Order also helps to generate
the material requirements (Stock Entry) for the Item to be produced from its
**Bill of Materials**.
@ -66,8 +66,8 @@ by:
* Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html)
* Timesheet's time slots are created against Production Order Operations.
* Drafts of Timesheet is created based on the scheduled operations when an Production Order is Submitted.
* To create more Timesheet against an operation click 'Make Timesheet' button.
* Drafts of Timesheet are created based on the scheduled operations when an Production Order is Submitted.
* To create more Timesheets against an operation click 'Make Timesheet' button.
<img class="screenshot" alt="Make timesheet against PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-operations-make-ts.png">
@ -88,7 +88,7 @@ by:
### Stopping a Production Order
* When you stop a Production Order its status is changed to Stop indicating that all production process against that Production Order is to be ceased.
* To stop the Production Order click on the 'stop' Button
* To stop the Production Order click on the 'Stop' Button
1. On Submitting the Production Order, the system will reserve a slot for each of the Production Order Operations serially after the planned start date based on the workstation availability. The Workstation availability depends on the Workstation timings, holiday list and if some other Production Order Operation was scheduled in that slot. You can mention the number of days for the system to try scheduling the operations in the Manufacturing Settings. This is set to 30 Days by default. If the operation requires time exceeding the available slot, system shall ask you to break the operations. Once the scheduling is done system shall create Time Logs and save them. You can Modify them and submit them later.
2. You can also create additional time logs against an Operation. For doing so select the respective operation and click on 'Make Time Log'
@ -98,7 +98,7 @@ by:
<img class="screenshot" alt="PO - stop" src="{{docs_base_url}}/assets/img/manufacturing/PO-stop.png">
* You can Also re-start a stopped Production Order.
* You can also re-start a stopped Production Order.
> Note : In order to make a Production Order against an Item you must specify 'Yes' to "Allow Production Order" on the Item form.

View File

@ -157,7 +157,7 @@ class Employee(Document):
delete_events(self.doctype, self.name)
def validate_prefered_email(self):
if not self.get(scrub(self.prefered_contact_email)):
if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)):
frappe.msgprint(_("Please enter " + self.prefered_contact_email))

View File

@ -384,4 +384,5 @@ erpnext.patches.v8_0.repost_reserved_qty_for_multiple_sales_uom
erpnext.patches.v8_0.addresses_linked_to_lead
execute:frappe.delete_doc('DocType', 'Purchase Common')
erpnext.patches.v8_0.update_stock_qty_value_in_purchase_invoice
erpnext.patches.v8_0.update_supplier_address_in_stock_entry
erpnext.patches.v8_0.update_supplier_address_in_stock_entry
erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate

View File

@ -0,0 +1,12 @@
from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
doc_list = ["Purchase Invoice Item", "Stock Entry Detail", "Delivery Note Item",
"Purchase Receipt Item", "Sales Invoice Item"]
for doctype in doc_list:
frappe.reload_doctype(doctype)
rename_field(doctype, "is_sample_item", "allow_zero_valuation_rate")

View File

@ -26,8 +26,6 @@
background-size: cover;
background-repeat: no-repeat;
background-position: center top;
border-radius-top: 4px;
border-radius-right: 4px;
}
.product-image.missing-image {
width: 100%;
@ -36,8 +34,6 @@
background-size: cover;
background-repeat: no-repeat;
background-position: center top;
border-radius-top: 4px;
border-radius-right: 4px;
position: relative;
background-color: #EBEFF2;
}
@ -45,9 +41,6 @@
font-size: 32px;
color: #d1d8dd;
}
.product-text {
padding: 15px 0px;
}
.product-search {
margin-bottom: 15px;
}
@ -246,6 +239,15 @@
padding: 15px;
word-wrap: break-word;
height: 75px;
display: block;
/* Fallback for non-webkit */
display: -webkit-box;
max-width: 100%;
margin: 0 auto;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.product-image-wrapper {
padding-bottom: 40px;

View File

@ -10,11 +10,11 @@
<p class="amount-label"> Outstanding <h3 class="outstanding_amount">{%= format_currency(outstanding_amount, currency) %} </h3></p>
</div>
<div class="col-xs-6 col-sm-3 text-center">
<p class="amount-label"> Change <input class="form-control text-right change_amount bold" type="text" idx="change_amount" value="{{format_number(change_amount, 2)}}">
<p class="amount-label"> Change <input class="form-control text-right change_amount bold" type="text" idx="change_amount" value="{{format_number(change_amount, null, 2)}}">
</p>
</div>
<div class="col-xs-6 col-sm-3 text-center">
<p class="amount-label"> Write off <input class="form-control text-right write_off_amount bold" type="text" idx="write_off_amount" value="{{format_number(write_off_amount, 2)}}">
<p class="amount-label"> Write off <input class="form-control text-right write_off_amount bold" type="text" idx="write_off_amount" value="{{format_number(write_off_amount, null, 2)}}">
</p>
</div>
</div>

View File

@ -90,7 +90,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field,
}
})
} else {
frm.set_value(display_field, null);
frm.set_value(display_field, '');
}
};

View File

@ -36,8 +36,6 @@
background-size: cover;
background-repeat: no-repeat;
background-position: center top;
border-radius-top: 4px;
border-radius-right: 4px;
}
.product-image.missing-image {
@ -51,10 +49,6 @@
color: @border-color;
}
.product-text {
padding: 15px 0px;
}
.product-search {
margin-bottom: 15px;
}
@ -316,6 +310,14 @@
padding: 15px;
word-wrap: break-word;
height: 75px;
display: block; /* Fallback for non-webkit */
display: -webkit-box;
max-width: 100%;
margin: 0 auto;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.product-image-wrapper {

View File

@ -1,30 +1,18 @@
frappe.ui.form.on("Course", "refresh", function(frm) {
if(!cur_frm.doc.__islocal) {
frm.add_custom_button(__("Program"), function() {
frappe.route_options = {
"Program Course.course": frm.doc.name
}
frappe.set_route("List", "Program");
});
frm.add_custom_button(__("Student Group"), function() {
frappe.route_options = {
course: frm.doc.name
}
frappe.set_route("List", "Student Group");
});
frm.add_custom_button(__("Course Schedule"), function() {
frappe.route_options = {
course: frm.doc.name
}
frappe.set_route("List", "Course Schedule");
});
frm.add_custom_button(__("Assessment Plan"), function() {
frappe.route_options = {
course: frm.doc.name
}
frappe.set_route("List", "Assessment Plan");
});
}

View File

@ -1,8 +1,9 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:course_name",
"autoname": "field:course_code",
"beta": 0,
"creation": "2015-09-07 12:39:55.181893",
"custom": 0,
@ -24,7 +25,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Course Name",
"length": 0,
@ -46,16 +47,46 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course_code",
"fieldtype": "Data",
"fieldname": "department",
"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": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
"options": "Department",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parent_course",
"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": "Course Code",
"label": "Parent Course (Leave blank, if this isn't part of Parent Course)",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -103,7 +134,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course_abbreviation",
"fieldname": "course_code",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
@ -112,7 +143,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Course Abbreviation",
"label": "Course Code",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -122,7 +153,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@ -132,19 +163,18 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "department",
"fieldtype": "Link",
"fieldname": "course_abbreviation",
"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": 1,
"label": "Department",
"in_standard_filter": 0,
"label": "Course Abbreviation",
"length": 0,
"no_copy": 0,
"options": "Department",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -304,18 +334,18 @@
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-02-17 17:22:36.450073",
"modified": "2017-04-12 20:44:42.048564",
"modified_by": "Administrator",
"module": "Schools",
"name": "Course",
@ -366,7 +396,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "department",
"search_fields": "course_name",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",

View File

@ -24,28 +24,28 @@ class TestCourseSchedule(unittest.TestCase):
cs1 = make_course_schedule_test_record(simulate= True)
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
self.assertRaises(OverlapError, cs2.save)
def test_room_conflict(self):
cs1 = make_course_schedule_test_record(simulate= True)
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
self.assertRaises(OverlapError, cs2.save)
def test_no_conflict(self):
cs1 = make_course_schedule_test_record(simulate= True)
make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
student_group="TC1-TP2-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
def make_course_schedule_test_record(**args):
args = frappe._dict(args)
course_schedule = frappe.new_doc("Course Schedule")
course_schedule.student_group = args.student_group or "TC-TP-2014-2015-2014-2015 (_Test Academic Term)"
course_schedule.course = args.course or "_Test Course"
course_schedule.student_group = args.student_group or "TC-TP1-2014-2015-2014-2015 (_Test Academic Term)"
course_schedule.course = args.course or "TC100"
course_schedule.instructor = args.instructor or "_T-Instructor-00001"
course_schedule.room = args.room or "RM0001"

View File

@ -1,43 +1,27 @@
// Copyright (c) 2015, Frappe Technologies and contributors
// For license information, please see license.txt
cur_frm.add_fetch("course", "course_code", "course_code");
cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
frappe.ui.form.on("Program", "refresh", function(frm) {
if(!frm.doc.__islocal) {
frm.add_custom_button(__("Student Applicant"), function() {
frappe.route_options = {
program: frm.doc.name
}
frappe.set_route("List", "Student Applicant");
});
frm.add_custom_button(__("Program Enrollment"), function() {
frappe.route_options = {
program: frm.doc.name
}
frappe.set_route("List", "Program Enrollment");
});
frm.add_custom_button(__("Student Group"), function() {
frappe.route_options = {
program: frm.doc.name
}
frappe.set_route("List", "Student Group");
});
frm.add_custom_button(__("Fee Structure"), function() {
frappe.route_options = {
program: frm.doc.name
}
frappe.set_route("List", "Fee Structure");
});
frm.add_custom_button(__("Fees"), function() {
frappe.route_options = {
program: frm.doc.name
}
frappe.set_route("List", "Fees");
});
}

View File

@ -1,8 +1,9 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:program_name",
"autoname": "field:program_code",
"beta": 0,
"creation": "2015-09-07 12:54:03.609282",
"custom": 0,
@ -24,7 +25,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Program Name",
"length": 0,
@ -46,47 +47,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "program_code",
"fieldtype": "Data",
"fieldname": "department",
"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": "Program Code",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "program_abbreviation",
"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": "Program Abbreviation",
"in_standard_filter": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
"options": "Department",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -132,19 +105,47 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "department",
"fieldtype": "Link",
"fieldname": "program_code",
"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": "Program Code",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "program_abbreviation",
"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": 1,
"label": "Department",
"in_standard_filter": 0,
"label": "Program Abbreviation",
"length": 0,
"no_copy": 0,
"options": "Department",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -276,18 +277,18 @@
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-02-17 17:22:14.107052",
"modified": "2017-04-12 20:40:53.542488",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program",
@ -318,7 +319,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "department",
"search_fields": "program_name",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",

View File

@ -7,10 +7,4 @@ import frappe
from frappe.model.document import Document
class Program(Document):
def validate(self):
self.validate_course()
def validate_course(self):
for d in self.courses:
if not d.course_code:
d.course_code = frappe.db.get_value("Course", d.course, "course_code")
pass

View File

@ -1,10 +1,12 @@
[
{
"program_name": "_Test Program",
"program_abbreviation": "TP"
"program_code": "_TP1",
"program_abbreviation": "TP1"
},
{
"program_name": "_Test Program 2",
"program_code": "_TP2",
"program_abbreviation": "TP2"
}
]

View File

@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@ -41,36 +42,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "academic_term",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Academic Term",
"length": 0,
"no_copy": 0,
"options": "Academic Term",
"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_on_submit": 0,
"bold": 0,
@ -104,7 +75,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course_code",
"fieldname": "course_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
@ -113,9 +84,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Course Code",
"label": "Course Name",
"length": 0,
"no_copy": 0,
"options": "course.course_name",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -140,7 +112,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Required",
"length": 0,
@ -158,18 +130,18 @@
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-02-17 17:16:10.315691",
"modified": "2017-04-07 17:59:12.504949",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program Course",

View File

@ -3,7 +3,35 @@
cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
frappe.ui.form.on("Program Enrollment", {
frappe.ui.form.on("Program Enrollment", {
onload: function(frm, cdt, cdn){
frm.set_query("academic_term", "fees", function(){
return{
"filters":{
"academic_year": (frm.doc.academic_year)
}
};
});
frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
filters: {'academic_term': d.academic_term}
}
};
if (frm.doc.program) {
frm.set_query("course", "courses", function(doc, cdt, cdn) {
return{
query: "erpnext.schools.doctype.program_enrollment.program_enrollment.get_program_courses",
filters: {
'program': frm.doc.program
}
}
});
}
},
program: function(frm) {
if (frm.doc.program) {
frappe.call({
@ -18,28 +46,32 @@ frappe.ui.form.on("Program Enrollment", {
}
}
});
frm.trigger.onload()
}
},
student_category: function() {
frappe.ui.form.trigger("Program Enrollment", "program");
},
onload: function(frm, cdt, cdn){
cur_frm.set_query("academic_term", "fees", function(){
return{
"filters":{
"academic_year": (frm.doc.academic_year)
get_courses: function(frm) {
if (frm.doc.program) {
frm.set_value("courses",[]);
frappe.call({
method: "get_courses",
doc:frm.doc,
callback: function(r) {
if(r.message) {
frm.set_value("courses", r.message);
}
else {
frappe.msgprint(__("There is no mandatory course for the program {0}",[frm.doc.program]));
}
}
};
});
cur_frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
filters: {'academic_term': d.academic_term}
}
};
})
}
else {
frappe.throw(__("Select the Program to fetch mandatory courses."))
}
}
});

View File

@ -78,7 +78,37 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "student_category",
"fieldname": "academic_year",
"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": 1,
"label": "Academic Year",
"length": 0,
"no_copy": 0,
"options": "Academic Year",
"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_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "academic_term",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@ -87,10 +117,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Student Category",
"label": "Academic Term",
"length": 0,
"no_copy": 0,
"options": "Student Category",
"options": "Academic Term",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -108,8 +138,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "school_house",
"fieldtype": "Link",
"default": "Today",
"fieldname": "enrollment_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@ -117,10 +148,9 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "School House",
"label": "Enrollment Date",
"length": 0,
"no_copy": 0,
"options": "School House",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -128,7 +158,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@ -192,7 +222,7 @@
"unique": 0
},
{
"allow_on_submit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@ -205,7 +235,7 @@
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Batch Name",
"label": "Batch",
"length": 0,
"no_copy": 0,
"options": "Student Batch Name",
@ -226,19 +256,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "academic_year",
"fieldname": "student_category",
"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": 1,
"label": "Academic Year",
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Student Category",
"length": 0,
"no_copy": 0,
"options": "Academic Year",
"options": "Student Category",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -246,7 +276,37 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "school_house",
"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": "School House",
"length": 0,
"no_copy": 0,
"options": "School House",
"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
@ -256,9 +316,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "enrollment_date",
"fieldtype": "Date",
"fieldname": "enrolled_courses",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@ -266,7 +325,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enrollment Date",
"label": "Enrolled courses",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -276,7 +335,66 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_courses",
"fieldtype": "Button",
"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": "Get Courses",
"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_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "courses",
"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": "Courses",
"length": 0,
"no_copy": 0,
"options": "Program Enrollment Course",
"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
@ -295,7 +413,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"label": "Fees",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -412,7 +530,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-03-29 15:30:03.359985",
"modified": "2017-04-12 12:12:10.148274",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program Enrollment",

View File

@ -6,6 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.model.document import Document
from frappe.desk.reportview import get_match_cond, get_filters_cond
from frappe.utils import comma_and
class ProgramEnrollment(Document):
@ -53,4 +54,26 @@ class ProgramEnrollment(Document):
if fee_list:
fee_list = ["""<a href="#Form/Fees/%s" target="_blank">%s</a>""" % \
(fee, fee) for fee in fee_list]
msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list)))
msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list)))
def get_courses(self):
return frappe.db.sql('''select course, course_name from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1)
@frappe.whitelist()
def get_program_courses(doctype, txt, searchfield, start, page_len, filters):
if filters.get('program'):
return frappe.db.sql("""select course, course_name from `tabProgram Course`
where parent = %(program)s and course like %(txt)s {match_cond}
order by
if(locate(%(_txt)s, course), locate(%(_txt)s, course), 99999),
idx desc,
`tabProgram Course`.course asc
limit {start}, {page_len}""".format(
match_cond=get_match_cond(doctype),
start=start,
page_len=page_len), {
"txt": "%{0}%".format(txt),
"_txt": txt.replace('%', ''),
"program": filters['program']
})

View File

@ -0,0 +1,101 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2017-04-10 19:28:19.616308",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course",
"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": "Course",
"length": 0,
"no_copy": 0,
"options": "Course",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course_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": "Course Name",
"length": 0,
"no_copy": 0,
"options": "course.course_name",
"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,
"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": "2017-04-12 11:49:50.433280",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program Enrollment Course",
"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
}

View File

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, 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 ProgramEnrollmentCourse(Document):
pass

View File

@ -11,11 +11,11 @@ from erpnext.schools.api import enroll_student
class ProgramEnrollmentTool(Document):
def get_students(self):
if not self.get_students_from:
frappe.throw(_("Mandatory feild - Get Students From"))
frappe.throw(_("Mandatory field - Get Students From"))
elif not self.program:
frappe.throw(_("Mandatory feild - Program"))
frappe.throw(_("Mandatory field - Program"))
elif not self.academic_year:
frappe.throw(_("Mandatory feild - Academic Year"))
frappe.throw(_("Mandatory field - Academic Year"))
else:
if self.get_students_from == "Student Applicants":
students = frappe.db.sql("select name as student_applicant, title as student_name from \

View File

@ -0,0 +1,8 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('School Settings', {
refresh: function(frm) {
}
});

View File

@ -0,0 +1,151 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2017-04-05 13:33:04.519313",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "current_academic_year",
"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": "Current Academic Year",
"length": 0,
"no_copy": 0,
"options": "Academic Year",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "current_academic_term",
"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": "Current Academic Term",
"length": 0,
"no_copy": 0,
"options": "Academic Term",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "attendance_freeze_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": "Attendance Freeze 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
}
],
"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": "2017-04-05 13:34:57.493516",
"modified_by": "Administrator",
"module": "Schools",
"name": "School 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
}
],
"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
}

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.model.document import Document
school_keydict = {
# "key in defaults": "key in Global Defaults"
"academic_year": "current_academic_year",
"academic_term": "current_academic_term",
}
class SchoolSettings(Document):
def on_update(self):
"""update defaults"""
for key in school_keydict:
frappe.db.set_default(key, self.get(school_keydict[key], ''))
# clear cache
frappe.clear_cache()
def get_defaults(self):
return frappe.defaults.get_defaults()

View File

@ -3,7 +3,7 @@
"first_name": "_Test",
"middle_name": "Student",
"last_name": "Name",
"program": "_Test Program",
"program": "TC101",
"date_of_birth": "2000-01-01",
"gender": "Male",
"blood_group": "A+"
@ -13,7 +13,7 @@
"first_name": "_Test",
"middle_name": "Student",
"last_name": "Name 1",
"program": "_Test Program",
"program": "TC101",
"date_of_birth": "2000-01-01",
"gender": "Male",
"blood_group": "A+"
@ -23,7 +23,7 @@
"first_name": "_Test",
"middle_name": "Student",
"last_name": "Name 2",
"program": "_Test Program",
"program": "TC101",
"date_of_birth": "2000-01-01",
"gender": "Male",
"blood_group": "A+"

View File

@ -1,13 +1,13 @@
[
{
"program": "_Test Program",
"course": "_Test Course",
"program": "_TP1",
"course": "TC100",
"academic_year": "2014-2015",
"academic_term": "2014-2015 (_Test Academic Term)"
},
{
"program": "_Test Program",
"course": "_Test Course 2",
"program": "_TP2",
"course": "TC101",
"academic_year": "2014-2015",
"academic_term": "2014-2015 (_Test Academic Term)"
}

View File

@ -9,9 +9,9 @@ from frappe import _
class OverlapError(frappe.ValidationError): pass
def validate_overlap_for(doc, doctype, fieldname, value=None):
"""Checks overlap for specified feild.
"""Checks overlap for specified field.
:param fieldname: Checks Overlap for this feild
:param fieldname: Checks Overlap for this field
"""
existing = get_overlap_for(doc, doctype, fieldname, value)
@ -20,9 +20,9 @@ def validate_overlap_for(doc, doctype, fieldname, value=None):
doc.meta.get_label(fieldname) if not value else fieldname , value or doc.get(fieldname)), OverlapError)
def get_overlap_for(doc, doctype, fieldname, value=None):
"""Returns overlaping document for specified feild.
"""Returns overlaping document for specified field.
:param fieldname: Checks Overlap for this feild
:param fieldname: Checks Overlap for this field
"""
existing = frappe.db.sql("""select name, from_time, to_time from `tab{0}`

View File

@ -1648,7 +1648,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_sample_item",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@ -1657,7 +1657,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sample Item",
"label": "Allow Zero Valuation Rate",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@ -1894,7 +1894,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-03-30 19:34:42.305637",
"modified": "2017-04-05 23:26:03.390869",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",

View File

@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "hash",
@ -1633,7 +1634,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_sample_item",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@ -1642,7 +1643,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sample Item",
"label": "Allow Zero Valuation Rate",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@ -1968,17 +1969,17 @@
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-02-20 13:31:59.778417",
"modified": "2017-04-05 23:27:10.785444",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",

View File

@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "hash",
@ -1043,7 +1044,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_sample_item",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@ -1052,7 +1053,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Sample Item",
"label": "Allow Zero Valuation Rate",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@ -1214,17 +1215,17 @@
"unique": 0
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-02-20 13:31:25.233622",
"modified": "2017-04-05 23:25:26.885642",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry Detail",

View File

@ -259,10 +259,11 @@ class update_entries_after(object):
if not self.valuation_rate and actual_qty > 0:
self.valuation_rate = sle.incoming_rate
# Get valuation rate from previous SLE or Item master, if item is not a sample item
# Get valuation rate from previous SLE or Item master, if item does not have the
# allow zero valuration rate flag set
if not self.valuation_rate and sle.voucher_detail_no:
is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
if not is_sample_item:
allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no)
if not allow_zero_valuation_rate:
self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
sle.voucher_type, sle.voucher_no, self.allow_zero_rate,
currency=erpnext.get_company_currency(sle.company))
@ -290,8 +291,8 @@ class update_entries_after(object):
while qty_to_pop:
if not self.stock_queue:
# Get valuation rate from last sle if exists or from valuation rate field in item master
is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
if not is_sample_item:
allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no)
if not allow_zero_valuation_rate:
_rate = get_valuation_rate(sle.item_code, sle.warehouse,
sle.voucher_type, sle.voucher_no, self.allow_zero_rate,
currency=erpnext.get_company_currency(sle.company))
@ -344,9 +345,9 @@ class update_entries_after(object):
if not self.stock_queue:
self.stock_queue.append([0, sle.incoming_rate or sle.outgoing_rate or self.valuation_rate])
def check_if_sample_item(self, voucher_type, voucher_detail_no):
def check_if_allow_zero_valuation_rate(self, voucher_type, voucher_detail_no):
ref_item_dt = voucher_type + (" Detail" if voucher_type == "Stock Entry" else " Item")
return frappe.db.get_value(ref_item_dt, voucher_detail_no, "is_sample_item")
return frappe.db.get_value(ref_item_dt, voucher_detail_no, "allow_zero_valuation_rate")
def get_sle_before_datetime(self):
"""get previous stock ledger entry before current time-bucket"""

View File

@ -34,7 +34,7 @@ rfq = Class.extend({
me.qty = parseFloat($(this).val()) || 0;
me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val());
me.update_qty_rate();
$(this).val(format_number(me.qty, 2));
$(this).val(format_number(me.qty, doc.number_format, 2));
})
},
@ -45,7 +45,7 @@ rfq = Class.extend({
me.rate = parseFloat($(this).val()) || 0;
me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val());
me.update_qty_rate();
$(this).val(format_number(me.rate, 2));
$(this).val(format_number(me.rate, doc.number_format, 2));
})
},