This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.ui.form.on('Project', { | |
refresh(frm) { | |
if (frm.doc.expected_end_date < frappe.datetime.get_today()) | |
{ | |
document.querySelectorAll("[data-fieldname='expected_end_date']")[1].style.color = 'red' | |
document.querySelectorAll("[data-fieldname='expected_end_date']")[1].style.fontWeight = 'bold' | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.ui.form.on("Timesheet", "validate", function(frm) { | |
if (frappe.user_roles.indexOf("Projects Manager") == -1) { | |
const t = new Date().getDate() + (6 - new Date().getDay() - 1) - 7; | |
const lastFriday = new Date(); | |
lastFriday.setDate(t); | |
let dd = lastFriday.getDate(); | |
let mm = lastFriday.getMonth() + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "templates/web.html" %} | |
{% block title %} ERPNext Certification {% endblock %} | |
{% block page_content %} | |
{% if frappe.session.user=='Guest' %} | |
<div class='with-border'> | |
<p>You must first sign up and login to apply for certification.</p> | |
<p><a href="/login#signup" class=''>Sign Up</a></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//payment_setup_certification.html | |
<script> | |
frappe.ready(function() { | |
$('.next').on('click', function() { | |
if($("input[type=radio]:checked").val() == 'INR'){ | |
window.location = '/certification-application?new=1¤cy=INR' | |
} | |
else{ | |
window.location = '/certification-application?new=1¤cy=USD' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.ui.form.on("Purchase Invoice", "refresh", function(frm) { | |
cur_frm.fields_dict['items'].grid.get_field('batch_no').new_doc = quick_entry_batch; | |
}); | |
quick_entry_batch = function(doc, cdt, cdn){ | |
console.log("Triggered"); | |
quick_entry("Batch", | |
function(){}, | |
{ | |
"item":"testtes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013, Selco and contributors | |
# For license information, please see license.txt | |
from __future__ import unicode_literals | |
import frappe | |
from frappe import _ | |
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details | |
from frappe import msgprint | |
import datetime | |
from datetime import timedelta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.ui.form.on("Sales Order", "refresh", function(frm) { | |
{ | |
cur_frm.add_custom_button(__("Get Items from Stock Entry"), | |
cur_frm.cscript.get_items_from_so); | |
} | |
cur_frm.cscript.get_items_from_so = function() { | |
if (!cur_frm.doc.items[0].item_code) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). | |
var colorbrewer = {YlGn: { | |
3: ["#f7fcb9","#addd8e","#31a354"], | |
4: ["#ffffcc","#c2e699","#78c679","#238443"], | |
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"], | |
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"], | |
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"], | |
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"], | |
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"] | |
},YlGnBu: { |