This commit is contained in:
Rushabh Mehta
2013-01-23 19:44:35 +05:30
28 changed files with 93 additions and 319 deletions

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,30 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
cur_frm.fields_dict.landed_cost.grid.get_field('account_head').get_query = function(doc, cdt, cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"';
}

View File

@@ -1,22 +0,0 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl

View File

@@ -1,86 +0,0 @@
[
{
"creation": "2013-01-10 16:34:27",
"docstatus": 0,
"modified": "2013-01-22 14:56:03",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"autoname": "field:title",
"doctype": "DocType",
"document_type": "Master",
"module": "Stock",
"name": "__common__"
},
{
"doctype": "DocField",
"name": "__common__",
"parent": "Landed Cost Master",
"parentfield": "fields",
"parenttype": "DocType",
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Landed Cost Master",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"submit": 0,
"write": 1
},
{
"doctype": "DocType",
"name": "Landed Cost Master"
},
{
"doctype": "DocField",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "title",
"fieldtype": "Data",
"label": "Title",
"oldfieldname": "title",
"oldfieldtype": "Data"
},
{
"doctype": "DocField",
"fieldname": "landed_cost_details",
"fieldtype": "Section Break",
"label": "Landed Cost Items",
"oldfieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "landed_cost",
"fieldtype": "Table",
"label": "Landed Cost",
"oldfieldname": "landed_cost",
"oldfieldtype": "Table",
"options": "Landed Cost Master Detail"
},
{
"doctype": "DocPerm",
"role": "Purchase Manager"
},
{
"doctype": "DocPerm",
"role": "System Manager"
},
{
"doctype": "DocPerm",
"role": "Purchase User"
}
]

View File

@@ -1,8 +0,0 @@
[
"Trash Reason",
"Title",
"Landed Cost Master",
"Landed Cost",
"Landed Cost Items",
"Stock"
]

View File

@@ -1,8 +0,0 @@
{
"Landed Cost": "\u0906\u092f\u093e\u0924\u093f\u0924 \u092e\u093e\u0932 \u0915\u0940 \u0932\u093e\u0917\u0924",
"Landed Cost Items": "\u0906\u092f\u093e\u0924\u093f\u0924 \u092e\u093e\u0932 \u0915\u0940 \u0932\u093e\u0917\u0924 \u0906\u0907\u091f\u092e",
"Landed Cost Master": "\u0906\u092f\u093e\u0924\u093f\u0924 \u092e\u093e\u0932 \u0915\u0940 \u0932\u093e\u0917\u0924 \u092e\u093e\u0938\u094d\u091f\u0930",
"Stock": "\u0938\u094d\u091f\u0949\u0915",
"Title": "\u0936\u0940\u0930\u094d\u0937\u0915",
"Trash Reason": "\u091f\u094d\u0930\u0948\u0936 \u0915\u093e\u0930\u0923"
}

View File

@@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@@ -1,22 +0,0 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl

View File

@@ -1,48 +0,0 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-05-03 11:00:55",
"modified_by": "Administrator",
"modified": "2012-05-04 13:02:35"
},
{
"section_style": "Simple",
"istable": 1,
"name": "__common__",
"colour": "White:FFF",
"module": "Stock",
"doctype": "DocType",
"version": 1,
"server_code_error": " "
},
{
"name": "__common__",
"parent": "Landed Cost Master Detail",
"oldfieldtype": "Data",
"doctype": "DocField",
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "fields"
},
{
"name": "Landed Cost Master Detail",
"doctype": "DocType"
},
{
"doctype": "DocField",
"label": "Account Head",
"oldfieldname": "account_head",
"fieldname": "account_head",
"fieldtype": "Link",
"options": "Account"
},
{
"doctype": "DocField",
"label": "Description",
"oldfieldname": "description",
"width": "300px",
"fieldname": "description",
"fieldtype": "Data"
}
]

View File

@@ -1,6 +0,0 @@
[
"Description",
"Landed Cost Master Detail",
"Account Head",
"Stock"
]

View File

@@ -1,6 +0,0 @@
{
"Account Head": "\u0932\u0947\u0916\u093e\u0936\u0940\u0930\u094d\u0937",
"Description": "\u0935\u093f\u0935\u0930\u0923",
"Landed Cost Master Detail": "\u0909\u0924\u0930\u093e \u0932\u093e\u0917\u0924 \u092e\u093e\u0938\u094d\u091f\u0930 \u0935\u093f\u0938\u094d\u0924\u093e\u0930",
"Stock": "\u0938\u094d\u091f\u0949\u0915"
}

View File

@@ -56,19 +56,6 @@ class DocType:
ch.purchase_receipt = i and i['name'] or ''
ch.save()
def get_landed_cost_master_details(self):
""" pull details from landed cost master"""
self.doclist = self.doc.clear_table(self.doclist, 'landed_cost_details')
idx = 0
landed_cost = sql("select account_head, description from `tabLanded Cost Master Detail` where parent=%s", (self.doc.landed_cost), as_dict = 1)
for cost in landed_cost:
lct = addchild(self.doc, 'landed_cost_details', 'Landed Cost Item',
self.doclist)
lct.account_head = cost['account_head']
lct.description = cost['description']
def get_selected_pr(self):
""" Get selected purchase receipt no """
self.selected_pr = [d.purchase_receipt for d in getlist(self.doclist, 'lc_pr_details') if d.select_pr]
@@ -199,9 +186,6 @@ class DocType:
ocd[oc].total_tax_amount = flt(prev_total)
ocd[oc].tax_amount += flt(tax_amount)
total_amount = flt(ocd[oc].tax_amount)
total_tax_amount = flt(ocd[oc].total_tax_amount) + (add_ded * flt(total_amount))
if ocd[oc].category != "Valuation":
prev_total += add_ded * flt(ocd[oc].total_amount)
total += add_ded * flt(ocd[oc].tax_amount)

View File

@@ -1,6 +1,6 @@
[
{
"creation": "2013-01-10 16:34:28",
"creation": "2013-01-22 16:50:39",
"docstatus": 0,
"modified": "2013-01-22 16:54:49",
"modified_by": "Administrator",
@@ -29,7 +29,7 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"report": 0,
"submit": 0,
"write": 1
},
@@ -92,20 +92,6 @@
"fieldtype": "Section Break",
"options": "Simple"
},
{
"doctype": "DocField",
"fieldname": "landed_cost",
"fieldtype": "Link",
"label": "Select Landed Cost Items Master",
"options": "Landed Cost Master"
},
{
"doctype": "DocField",
"fieldname": "get_details",
"fieldtype": "Button",
"label": "Get Details",
"options": "get_landed_cost_master_details"
},
{
"doctype": "DocField",
"fieldname": "landed_cost_details",

View File

@@ -141,11 +141,18 @@ class DocType(DocListController):
"posting_time": self.doc.posting_time
})
# check valuation rate mandatory
if row.qty != "" and not row.valuation_rate and \
flt(previous_sle.get("qty_after_transaction")) <= 0:
webnotes.msgprint(_("As existing qty for item: ") + row.item_code +
_(" is less than equals to zero in the system, \
valuation rate is mandatory for this item"), raise_exception=1)
change_in_qty = row.qty != "" and \
(flt(row.qty) - flt(previous_sle.get("qty_after_transaction")))
change_in_rate = row.valuation_rate != "" and \
(flt(row.valuation_rate) != flt(previous_sle.get("valuation_rate")))
(flt(row.valuation_rate) - flt(previous_sle.get("valuation_rate")))
if get_valuation_method(row.item_code) == "Moving Average":
self.sle_for_moving_avg(row, previous_sle, change_in_qty, change_in_rate)
@@ -162,7 +169,6 @@ class DocType(DocListController):
else:
if valuation_rate == "":
valuation_rate = previous_valuation_rate
return (qty * valuation_rate - previous_qty * previous_valuation_rate) \
/ flt(qty - previous_qty)
@@ -175,7 +181,7 @@ class DocType(DocListController):
self.insert_entries({"actual_qty": change_in_qty,
"incoming_rate": incoming_rate}, row)
elif change_in_rate and flt(previous_sle.get("qty_after_transaction")) >= 0:
elif change_in_rate and flt(previous_sle.get("qty_after_transaction")) > 0:
# if no change in qty, but change in rate
# and positive actual stock before this reconciliation
incoming_rate = _get_incoming_rate(
@@ -241,7 +247,6 @@ class DocType(DocListController):
"is_cancelled": "No",
}
args.update(opts)
# create stock ledger entry
sle_wrapper = webnotes.model_wrapper([args])
sle_wrapper.ignore_permissions = 1

View File

@@ -21,7 +21,6 @@ import webnotes
from webnotes.tests import insert_test_data
from webnotes.utils import flt
import json
from pprint import pprint
company = webnotes.conn.get_default("company")

View File

@@ -48,13 +48,14 @@ erpnext.StockAgeing = erpnext.StockGridReport.extend({
open_btn: true,
doctype: '"Item"'
}},
{id: "brand", name: "Brand", field: "brand", width: 100},
{id: "average_age", name: "Average Age", field: "average_age",
formatter: this.currency_formatter},
{id: "earliest", name: "Earliest", field: "earliest",
formatter: this.currency_formatter},
{id: "latest", name: "Latest", field: "latest",
formatter: this.currency_formatter},
{id: "stock_uom", name: "UOM", field: "stock_uom", width: 100},
{id: "brand", name: "Brand", field: "brand", width: 100},
{id: "item_name", name: "Item Name", field: "item_name",
width: 100, formatter: this.text_formatter},
{id: "description", name: "Description", field: "description",

View File

@@ -60,7 +60,7 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({
formatter: this.currency_formatter},
{id: "closing_value", name: "Closing Value", field: "closing_value", width: 100,
formatter: this.currency_formatter},
{id: "stock_uom", name: "UOM", field: "stock_uom", width: 100},
{id: "brand", name: "Brand", field: "brand", width: 100},
{id: "item_name", name: "Item Name", field: "item_name", width: 100},
{id: "description", name: "Description", field: "description", width: 200,

View File

@@ -78,11 +78,6 @@ wn.module_page["Stock"] = [
"label": wn._("Quality Inspection"),
description: wn._("Incoming quality inspection.")
},
{
"doctype":"Landed Cost Master",
"label":"Landed Cost Master",
description: wn._("Transportatoin cost distribution template.")
},
{
"route":"Form/Landed Cost Wizard/Landed Cost Wizard",
"label": wn._("Landed Cost Wizard"),