Skip to content

Instantly share code, notes, and snippets.

View jvfiel's full-sized avatar

John Vincent Fiel jvfiel

View GitHub Profile
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Clinic",
"color": "#A6E4FF",
"reverse": 1,
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import json
import frappe, erpnext
from frappe import _, scrub
from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction
from erpnext.controllers.accounts_controller import validate_conversion_rate, \
validate_taxes_and_charges, validate_inclusive_tax
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
erpnext.taxes_and_totals = erpnext.payments.extend({
setup: function() {},
apply_pricing_rule_on_item: function(item){
if(item.margin_type == "Percentage"){
item.rate_with_margin = flt(item.price_list_rate)
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
} else {
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import json
import frappe, erpnext
from frappe import _, scrub
from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction
from erpnext.controllers.accounts_controller import validate_conversion_rate, \
validate_taxes_and_charges, validate_inclusive_tax
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
erpnext.taxes_and_totals = erpnext.payments.extend({
setup: function() {},
apply_pricing_rule_on_item: function(item){
if(item.margin_type == "Percentage"){
item.rate_with_margin = flt(item.price_list_rate)
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
} else {
def send_notification():
# Send to single device.
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="AIzaSyCgw3CjkdzXxGdhvEW8IYh-dIf5jYvPJQs")
# OR initialize with proxies
# proxy_dict = {
/**
* Created by jvfiel on 11/6/16.
*/
frappe.listview_settings['Enrollees'] = {
onload: function(listview) {
var method = "wela.school_setup.doctype.school_year.school_year";
// from wela.school_setup.doctype.school_year.school_year import current_school_year
frappe.call({
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
import pyexcel as pe
from frappe.model.document import Document
from wela.school_setup.doctype.school_year.school_year import current_school_year
from wela.school_setup.doctype.quarter.quarter import current_quarter
from wela.grading.doctype.master_grade.master_grade import remove_from_master
from wela.school_setup.doctype.subject_teacher.subject_teacher import get_subject_teacher, get_adviser_teacher
def match_number_enrollees(number):
contact_person_number = ""
number = number[-10:]
print """((((((((((((((((((((((((( Match Number Enrollee ))))))))))))))))))))))))"""
print number
# if len(number) < 10:
# print "Invalid Mobile Number"
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
erpnext.taxes_and_totals = erpnext.payments.extend({
setup: function() {},
apply_pricing_rule_on_item: function(item){
if(item.margin_type == "Percentage"){
item.total_margin = flt(item.price_list_rate)
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
}else{