Skip to content

Instantly share code, notes, and snippets.

employee_list = frappe.get_all("Employee", fields=["employee_name"])
qualification_entry_list = frappe.get_all("Qualification Entry", fields=["employee_name", "qualification_name", "level"], as_dict=1)
qualification_dict = {}
for d in qualification_entry_list:
qualification_dict.setdefault(d.employee_name, {}).setdefault(d.qualification_name, d.level)
frappe.ui.form.on("Journal Entry Account", "reference_no", function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.reference_type == "Purchase Invoice" && row.reference_no) {
me.frm.call({
method: "frappe.client.get_value",
args: {
doctype: "Purchase Invoice",
fieldname: "bill_no",
filters: { name: row.reference_no },
},
frappe.ui.form.on("Salary Structure Earning", "modified_value", function(frm, cdt, cdn) {
console.log(frm.doc.doctype);
console.log("we are here");
var c = frm.add_child('deductions');
c.d_type = 'Employee CPF';
c.modified_value = 20;
refresh_field("deductions");
// frm.layout.refresh_sections();
});
@nabinhait
nabinhait / is_chart_of_accounts.json
Created January 19, 2015 07:13
Iceland Chart of Accounts
{
"country_code": "is",
"name": "Íslenskur bókhaldslykill fyrir ERPNext - útgáfa 1",
"is_active": "Yes",
"tree": {
"Eignir": {
"Veltufjármunir": {
"Viðskiptakröfur": {
"Viðskiptamenn": {
"account_type": "Receivable"
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import nowdate
class LibraryTransaction(Document):
def validate(self):
last_transaction = frappe.get_list("Library Transaction",
fields=["transaction_type", "transaction_date"],
frappe.ui.form.on("Quotation Item", "disc", function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.disc) {
// var final_discount = get_final_discount(row.disc);
frappe.model.set_value(cdt, cdn, "discount_percentage", 49);
}
})
//
// get_final_discount = function(disc) {
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
def execute(filters=None):
if not filters: filters = {}
@nabinhait
nabinhait / 2013_07.css
Last active December 20, 2015 12:19
ERPNext Open Day - July 2013
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@nabinhait
nabinhait / 2013_06.css
Created July 1, 2013 09:19
ERPNext Open Day - June 2013
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@nabinhait
nabinhait / impress-demo.css
Created June 3, 2013 12:11
ERPNext Open Day - May 2013
/*
So you like the style of impress.js demo?
Or maybe you are just curious how it was done?
You couldn't find a better place to find out!
Welcome to the stylesheet impress.js demo presentation.
Please remember that it is not meant to be a part of impress.js and is
not required by impress.js.