Skip to content

Instantly share code, notes, and snippets.

View anandpdoshi's full-sized avatar

Anand Doshi anandpdoshi

View GitHub Profile
@anandpdoshi
anandpdoshi / 2013_04.css
Last active December 16, 2015 17:08
ERPNext Open Day - April 2013 by Anand Doshi
/*
fallback-message display / hide
*/
.fallback-message {
line-height: 1.3;
width: 780px;
padding: 10px 10px 0;
margin: 20px auto;
@anandpdoshi
anandpdoshi / 2013_03.css
Last active December 15, 2015 12:29
ERPNext Open Day - March 2013 Presentation
/*
fallback-message display / hide
*/
.fallback-message {
line-height: 1.3;
width: 780px;
padding: 10px 10px 0;
margin: 20px auto;
@anandpdoshi
anandpdoshi / colorbrewer.js
Last active March 8, 2024 04:23
Relationships between DocTypes in ERPNext
// 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: {
@anandpdoshi
anandpdoshi / 2013-02.css
Last active December 14, 2015 07:39
ERPNext Open Day Presentation - February 2013 - by Anand Doshi
/*
We start with a good ol' reset.
That's the one by Eric Meyer http://meyerweb.com/eric/tools/css/reset/
You can probably argue if it is needed here, or not, but for sure it
doesn't do any harm and gives us a fresh start.
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
select
so.name as "SO No:Link/Sales Order:100",
so.transaction_date as "SO Date::80",
so_item.item_code as "Item Code:Link/Item:160",
so_item.description as "Description::300",
(so_item.qty - ifnull(so_item.delivered_qty, 0)) as "PEND QTY:Decimal:70",
so_item.reserved_warehouse as "WH::80",
bin.actual_qty as "ACT:Decimal:40",
bin.reserved_qty as "RSVD:Decimal:40",
so.customer as "Customer:Link/Customer:150"
cur_frm.cscript.custom_purpose = function(doc) {
if(doc.purpose==="Sales Return") {
cur_frm.toggle_reqd("sales_invoice_no", true);
} else {
cur_frm.toggle_reqd("sales_invoice_no", false);
}
}
@anandpdoshi
anandpdoshi / total_in_query_report.sql
Created January 4, 2013 06:55
Example: How to add a Total row in Query Report of ERPNext
select
item.name as "ID:Link/Item:120",
item.item_name as "Item Name::120",
item_price.price_list_name as "Price List::80",
item_price.ref_currency as "Currency::40",
item_price.ref_rate as "Rate:Currency:80",
item.description as "Description::160",
item.item_group as "Item Group:Link/Item Group:100",
item.brand as "Brand::100"
from `tabItem` item, `tabItem Price` item_price
@anandpdoshi
anandpdoshi / install_erpnext.py
Last active October 11, 2015 06:37
ERPNext Installer
#!/usr/bin/python
from __future__ import unicode_literals
import os, commands, sys
def install():
# get required details
root_pwd = get_root_password()
db_name, db_pwd = get_new_db_details()
# install path