Merge branch 'responsive' of github.com:webnotes/erpnext into responsive

Conflicts:
	selling/doctype/lead/lead.txt
This commit is contained in:
Anand Doshi
2013-07-04 17:18:45 +05:30
44 changed files with 1061 additions and 622 deletions

View File

@@ -1,122 +1,122 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2010-08-08 17:09:35",
"docstatus": 0,
"modified": "2013-07-03 18:00:40",
"modified_by": "Administrator",
"modified": "2012-04-03 12:49:50"
"owner": "Administrator"
},
{
"name": "__common__",
"parent": "Purchase Order-Purchase Invoice",
"doctype": "Table Mapper Detail",
"parenttype": "DocType Mapper",
"parentfield": "table_mapper_details"
},
{
"name": "__common__",
"parent": "Purchase Order-Purchase Invoice",
"doctype": "Field Mapper Detail",
"parenttype": "DocType Mapper",
"parentfield": "field_mapper_details"
"parentfield": "table_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "Field Mapper Detail",
"name": "__common__",
"to_doctype": "Purchase Invoice",
"module": "Accounts",
"parent": "Purchase Order-Purchase Invoice",
"parentfield": "field_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "DocType Mapper",
"from_doctype": "Purchase Order",
"module": "Accounts",
"name": "__common__",
"ref_doc_submitted": 1,
"from_doctype": "Purchase Order"
"to_doctype": "Purchase Invoice"
},
{
"name": "Purchase Order-Purchase Invoice",
"doctype": "DocType Mapper"
"doctype": "DocType Mapper",
"name": "Purchase Order-Purchase Invoice"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / obj.purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "qty",
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.qty) - flt(obj.billed_qty)"
"to_field": "qty"
},
{
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "rate",
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate"
"to_field": "rate"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.amount) - flt(obj.billed_amt)",
"map": "Yes",
"match_id": 1,
"to_field": "amount",
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.purchase_rate)"
"to_field": "amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.conversion_rate)",
"map": "Yes",
"match_id": 1,
"to_field": "import_amount",
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.import_rate)"
"to_field": "import_amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "parent",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_order",
"doctype": "Field Mapper Detail",
"from_field": "parent"
"to_field": "purchase_order"
},
{
"doctype": "Field Mapper Detail",
"from_field": "name",
"map": "Yes",
"match_id": 1,
"to_field": "po_detail",
"doctype": "Field Mapper Detail",
"from_field": "name"
"to_field": "po_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "naming_series",
"map": "No",
"match_id": 0,
"to_field": "naming_series",
"doctype": "Field Mapper Detail",
"from_field": "naming_series"
"to_field": "naming_series"
},
{
"doctype": "Field Mapper Detail",
"from_field": "total_tax",
"map": "Yes",
"match_id": 0,
"to_field": "total_tax",
"doctype": "Field Mapper Detail",
"from_field": "total_tax"
"to_field": "total_tax"
},
{
"doctype": "Field Mapper Detail",
"from_field": "conversion_rate",
"map": "Yes",
"match_id": 0,
"to_field": "conversion_rate",
"doctype": "Field Mapper Detail",
"from_field": "conversion_rate"
"to_field": "conversion_rate"
},
{
"match_id": 0,
"doctype": "Table Mapper Detail",
"from_table": "Purchase Order",
"match_id": 0,
"to_table": "Purchase Invoice",
"validation_logic": "docstatus =1"
},
{
"match_id": 1,
"to_field": "entries",
"doctype": "Table Mapper Detail",
"from_field": "po_details",
"from_table": "Purchase Order Item",
"match_id": 1,
"to_field": "entries",
"to_table": "Purchase Invoice Item",
"validation_logic": "ifnull(billed_qty,0) < qty and docstatus = 1"
"validation_logic": "ifnull(billed_amt,0) < amount and docstatus = 1"
},
{
"match_id": 2,
"to_field": "purchase_tax_details",
"doctype": "Table Mapper Detail",
"from_field": "purchase_tax_details",
"from_table": "Purchase Taxes and Charges",
"match_id": 2,
"to_field": "purchase_tax_details",
"to_table": "Purchase Taxes and Charges",
"validation_logic": "docstatus =1"
}

View File

@@ -1,143 +1,143 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2010-08-08 17:09:35",
"docstatus": 0,
"modified": "2013-07-03 17:56:30",
"modified_by": "Administrator",
"modified": "2012-04-03 12:49:50"
"owner": "Administrator"
},
{
"name": "__common__",
"parent": "Purchase Receipt-Purchase Invoice",
"doctype": "Table Mapper Detail",
"parenttype": "DocType Mapper",
"parentfield": "table_mapper_details"
},
{
"name": "__common__",
"parent": "Purchase Receipt-Purchase Invoice",
"doctype": "Field Mapper Detail",
"parenttype": "DocType Mapper",
"parentfield": "field_mapper_details"
"parentfield": "table_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "Field Mapper Detail",
"name": "__common__",
"to_doctype": "Purchase Invoice",
"module": "Accounts",
"parent": "Purchase Receipt-Purchase Invoice",
"parentfield": "field_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "DocType Mapper",
"from_doctype": "Purchase Receipt",
"module": "Accounts",
"name": "__common__",
"ref_doc_submitted": 1,
"from_doctype": "Purchase Receipt"
"to_doctype": "Purchase Invoice"
},
{
"name": "Purchase Receipt-Purchase Invoice",
"doctype": "DocType Mapper"
"doctype": "DocType Mapper",
"name": "Purchase Receipt-Purchase Invoice"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / obj.purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "qty",
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.qty) - flt(obj.billed_qty)"
"to_field": "qty"
},
{
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "rate",
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate"
"to_field": "rate"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.amount) - flt(obj.billed_amt)",
"map": "Yes",
"match_id": 1,
"to_field": "amount",
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.purchase_rate)"
"to_field": "amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.conversion_rate)",
"map": "Yes",
"match_id": 1,
"to_field": "import_amount",
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.import_rate)"
"to_field": "import_amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "parent",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_receipt",
"doctype": "Field Mapper Detail",
"from_field": "parent"
"to_field": "purchase_receipt"
},
{
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_docname",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_order",
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_docname"
"to_field": "purchase_order"
},
{
"doctype": "Field Mapper Detail",
"from_field": "name",
"map": "Yes",
"match_id": 1,
"to_field": "pr_detail",
"doctype": "Field Mapper Detail",
"from_field": "name"
"to_field": "pr_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_detail_docname",
"map": "Yes",
"match_id": 1,
"to_field": "po_detail",
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_detail_docname"
"to_field": "po_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "naming_series",
"map": "No",
"match_id": 0,
"to_field": "naming_series",
"doctype": "Field Mapper Detail",
"from_field": "naming_series"
"to_field": "naming_series"
},
{
"doctype": "Field Mapper Detail",
"from_field": "net_total",
"map": "Yes",
"match_id": 0,
"to_field": "net_total",
"doctype": "Field Mapper Detail",
"from_field": "net_total"
"to_field": "net_total"
},
{
"doctype": "Field Mapper Detail",
"from_field": "grand_total",
"map": "Yes",
"match_id": 0,
"to_field": "grand_total",
"doctype": "Field Mapper Detail",
"from_field": "grand_total"
"to_field": "grand_total"
},
{
"doctype": "Field Mapper Detail",
"from_field": "total_tax",
"map": "Yes",
"match_id": 0,
"to_field": "total_tax",
"doctype": "Field Mapper Detail",
"from_field": "total_tax"
"to_field": "total_tax"
},
{
"match_id": 1,
"to_field": "entries",
"doctype": "Table Mapper Detail",
"from_field": "purchase_receipt_details",
"from_table": "Purchase Receipt Item",
"match_id": 1,
"to_field": "entries",
"to_table": "Purchase Invoice Item",
"validation_logic": "ifnull(billed_qty,0) < qty"
"validation_logic": "ifnull(billed_amt,0) < amount"
},
{
"match_id": 0,
"doctype": "Table Mapper Detail",
"from_table": "Purchase Receipt",
"match_id": 0,
"to_table": "Purchase Invoice",
"validation_logic": "docstatus=1"
},
{
"match_id": 2,
"to_field": "purchase_tax_details",
"doctype": "Table Mapper Detail",
"from_field": "purchase_tax_details",
"from_table": "Purchase Taxes and Charges",
"match_id": 2,
"to_field": "purchase_tax_details",
"to_table": "Purchase Taxes and Charges",
"validation_logic": "docstatus=1"
}

View File

@@ -1,8 +0,0 @@
<div class="appframe col col-lg-12">
<div id="fs_header"></div>
<div id="print_html">
<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>
<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>
<div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto; display: none; width: 100%;"></div>
</div>
</div>

View File

@@ -14,66 +14,60 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pscript['onload_Financial Statements'] = function() {
// header and toolbar
var h = new PageHeader('fs_header','Financial Statements','Profit & Loss and Balance Sheet Builder across multiple years');
//$y(h.toolbar_area,{padding:'8px'});
var dv = $a(h.toolbar_area,'div','',{margin:'4px 0px'});
var t = make_table(dv,1,4,'640px', [], {padding:'4px', width:'160px'});
var sel = $a($td(t,0,0),'select','',{width:'160px'});
sel.id = 'stmt_type';
var sel = $a($td(t,0,1),'select','',{width:'160px'});
sel.id = 'stmt_company';
var sel = $a($td(t,0,2),'select','',{width:'160px'});
sel.id = 'stmt_period';
erpnext.fs = {}
var sel = $a($td(t,0,3),'select','',{width:'160px'});
sel.id = 'stmt_fiscal_year';
h.add_button('Create',function(){ pscript.stmt_new(); },0,'ui-icon-document');
h.add_button('Print', function(){ _p.go($i('print_html').innerHTML); }, 0, 'ui-icon-print');
/*
var btn = $a($td(t,1,0),'button');
btn.onclick = function(){ pscript.stmt_new(); }
btn.innerHTML = 'Create';
pscript['onload_Financial Statements'] = function(wrapper) {
wn.ui.make_app_page({
parent: wrapper,
"title": "Financial Statements",
"single_column": true,
});
var btn = $a($td(t,1,1),'button');
btn.onclick = function(){ alert('print'); }
btn.innerHTML = 'Print';
erpnext.fs.stmt_type = wrapper.appframe.add_field({
fieldtype:"Select",
fieldname:"stmt_type",
options: ['Select Statement...','Balance Sheet','Profit & Loss']
})
//Button to create new
var btn = $a('stmt_new', 'button');
btn.onclick = function() { pscript.stmt_new(); }
btn.innerHTML = 'Create';*/
erpnext.fs.stmt_company = wrapper.appframe.add_field({
fieldtype:"Select",
fieldname:"stmt_company",
options: ['Loading Companies...']
})
// select for statement
add_sel_options($i('stmt_type'), ['Select Statement...','Balance Sheet','Profit & Loss']);
erpnext.fs.stmt_period = wrapper.appframe.add_field({
fieldtype:"Select",
fieldname:"stmt_period",
options: ['Select Period...', 'Annual', 'Quarterly', 'Monthly']
})
// select for companies
add_sel_options($i('stmt_company'), ['Loading Companies...']);
erpnext.fs.stmt_fiscal_year = wrapper.appframe.add_field({
fieldtype:"Select",
fieldname:"stmt_fiscal_year",
options: ['Loading...']
})
wrapper.appframe.add_button("Create", function() {
pscript.stmt_new();
}, "icon-refresh")
wrapper.appframe.add_button("Print", function() {
_p.go($i('print_html').innerHTML);
}, "icon-print")
$(wrapper).find(".layout-main").html('<div id="print_html">\
<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>\
<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>\
<div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto;">Please select options and click on Create</div>\
</div>').css({"min-height": "400px"});
// load companies
$c_obj('MIS Control','get_comp','', function(r,rt) {
// company
empty_select($i('stmt_company'));
add_sel_options($i('stmt_company'), add_lists(['Select Company...'], r.message.company), 'Select Company...');
// period
empty_select($i('stmt_period'));
//add_sel_options($i('stmt_period'), add_lists(['Select Period...'], r.message.period), 'Select period...');
add_sel_options($i('stmt_period'), add_lists(['Select Period...'], ['Annual', 'Quarterly', 'Monthly']), 'Select period...');
// fiscal-year
empty_select($i('stmt_fiscal_year'));
add_sel_options($i('stmt_fiscal_year'), add_lists(['Select Year...'], r.message.fiscal_year), 'Select fiscal year...');
erpnext.fs.stmt_company.$input.empty()
.add_options(['Select Company...'].concat(r.message.company));
erpnext.fs.stmt_fiscal_year.$input.empty()
.add_options(['Select Year...'].concat(r.message.fiscal_year));
});
}
@@ -83,26 +77,27 @@ pscript.stmt_new = function(stmt,company_name,level,period,year) {
$i('stmt_tree').innerHTML = 'Refreshing....';
$i('stmt_tree').style.display = 'block';
var company = sel_val($i('stmt_company'))
var company =erpnext.fs.stmt_company.get_value();
var arg = {
statement:sel_val($i('stmt_type')),
company:company,
period:sel_val($i('stmt_period')),
year:sel_val($i('stmt_fiscal_year'))
statement: erpnext.fs.stmt_type.get_value(),
company: company,
period: erpnext.fs.stmt_period.get_value(),
year: erpnext.fs.stmt_fiscal_year.get_value()
}
$c_obj('MIS Control', 'get_statement', docstring(arg), function(r,rt) {
var nl = r.message;
var t = $i('stmt_tree');
var stmt_type = sel_val($i('stmt_type'));
var stmt_type = erpnext.fs.stmt_type.get_value();
t.innerHTML = '';
var tab = $a($a(t, 'div'),'table','stmt_table');
tab.style.tableLayout = 'fixed';
tab.style.width = '100%';
$i('stmt_title1').innerHTML = sel_val($i('stmt_company'));
$i('stmt_title2').innerHTML = sel_val($i('stmt_type')) + ' - ' + sel_val($i('stmt_fiscal_year'));
$i('stmt_title1').innerHTML = erpnext.fs.stmt_company.get_value()
$i('stmt_title2').innerHTML = erpnext.fs.stmt_type.get_value()
+ ' - ' + erpnext.fs.stmt_fiscal_year.get_value();
for(i=0;i<nl.length;i++) {
tab.insertRow(i);
@@ -110,8 +105,6 @@ pscript.stmt_new = function(stmt,company_name,level,period,year) {
// heads
var per = tab.rows[i].insertCell(0);
// var acc_width = (sel_val($i('stmt_period'))=='Monthly')? 12 : 20;
// per.style.width = acc_width+'%';
per.style.width = '150px';
per.innerHTML = pscript.space_reqd(nl[i][0])+cstr(nl[i][1]);
per.className = 'stmt_level' + nl[i][0];