Merge branch 'develop'
This commit is contained in:
commit
8c78a1abb7
@ -109,6 +109,7 @@ erpnext.POS = Class.extend({
|
|||||||
this.party = party;
|
this.party = party;
|
||||||
this.price_list = (party == "Customer" ?
|
this.price_list = (party == "Customer" ?
|
||||||
this.frm.doc.selling_price_list : this.frm.doc.buying_price_list);
|
this.frm.doc.selling_price_list : this.frm.doc.buying_price_list);
|
||||||
|
this.price_list_field = (party == "Customer" ? "selling_price_list" : "buying_price_list");
|
||||||
this.sales_or_purchase = (party == "Customer" ? "Sales" : "Purchase");
|
this.sales_or_purchase = (party == "Customer" ? "Sales" : "Purchase");
|
||||||
this.net_total = "net_total_" + export_or_import;
|
this.net_total = "net_total_" + export_or_import;
|
||||||
this.grand_total = "grand_total_" + export_or_import;
|
this.grand_total = "grand_total_" + export_or_import;
|
||||||
@ -269,22 +270,17 @@ erpnext.POS = Class.extend({
|
|||||||
this.frm.cscript.fname, this.frm.doctype), function(i, d) {
|
this.frm.cscript.fname, this.frm.doctype), function(i, d) {
|
||||||
if (d.item_code == item_code) {
|
if (d.item_code == item_code) {
|
||||||
caught = true;
|
caught = true;
|
||||||
if (serial_no) {
|
if (serial_no)
|
||||||
d.serial_no += '\n' + serial_no;
|
wn.model.set_value(d.doctype, d.name, "serial_no", d.serial_no + '\n' + serial_no);
|
||||||
me.frm.script_manager.trigger("serial_no", d.doctype, d.name);
|
else
|
||||||
}
|
wn.model.set_value(d.doctype, d.name, "qty", d.qty + 1);
|
||||||
else {
|
|
||||||
d.qty += 1;
|
|
||||||
me.frm.script_manager.trigger("qty", d.doctype, d.name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// if item not found then add new item
|
// if item not found then add new item
|
||||||
if (!caught) {
|
if (!caught)
|
||||||
this.add_new_item_to_grid(item_code, serial_no);
|
this.add_new_item_to_grid(item_code, serial_no);
|
||||||
}
|
|
||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.refresh_search_box();
|
this.refresh_search_box();
|
||||||
@ -319,15 +315,16 @@ erpnext.POS = Class.extend({
|
|||||||
wn.model.clear_doc(d.doctype, d.name);
|
wn.model.clear_doc(d.doctype, d.name);
|
||||||
me.refresh_grid();
|
me.refresh_grid();
|
||||||
} else {
|
} else {
|
||||||
d.qty = qty;
|
wn.model.set_value(d.doctype, d.name, "qty", qty);
|
||||||
me.frm.script_manager.trigger("qty", d.doctype, d.name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
me.refresh();
|
this.refresh();
|
||||||
},
|
},
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
this.refresh_item_list();
|
||||||
this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]);
|
this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]);
|
||||||
this.barcode.set_input("");
|
this.barcode.set_input("");
|
||||||
|
|
||||||
@ -350,6 +347,14 @@ erpnext.POS = Class.extend({
|
|||||||
this.make_party();
|
this.make_party();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
refresh_item_list: function() {
|
||||||
|
var me = this;
|
||||||
|
// refresh item list on change of price list
|
||||||
|
if (this.frm.doc[this.price_list_field] != this.price_list) {
|
||||||
|
this.price_list = this.frm.doc[this.price_list_field];
|
||||||
|
this.make_item_list();
|
||||||
|
}
|
||||||
|
},
|
||||||
show_items_in_item_cart: function() {
|
show_items_in_item_cart: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var $items = this.wrapper.find("#cart tbody").empty();
|
var $items = this.wrapper.find("#cart tbody").empty();
|
||||||
@ -383,9 +388,8 @@ erpnext.POS = Class.extend({
|
|||||||
)).appendTo($items);
|
)).appendTo($items);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.wrapper.find(".increase-qty, .decrease-qty").on("click", function() {
|
this.wrapper.find("input.qty").on("focus", function() {
|
||||||
var item_code = $(this).closest("tr").attr("id");
|
$(this).select();
|
||||||
me.selected_item_qty_operation(item_code, $(this).attr("class"));
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
show_taxes: function() {
|
show_taxes: function() {
|
||||||
@ -422,10 +426,16 @@ erpnext.POS = Class.extend({
|
|||||||
|
|
||||||
// append quantity to the respective item after change from input box
|
// append quantity to the respective item after change from input box
|
||||||
$(this.wrapper).find("input.qty").on("change", function() {
|
$(this.wrapper).find("input.qty").on("change", function() {
|
||||||
var item_code = $(this).closest("tr")[0].id;
|
var item_code = $(this).closest("tr").attr("id");
|
||||||
me.update_qty(item_code, $(this).val());
|
me.update_qty(item_code, $(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// increase/decrease qty on plus/minus button
|
||||||
|
$(this.wrapper).find(".increase-qty, .decrease-qty").on("click", function() {
|
||||||
|
var tr = $(this).closest("tr");
|
||||||
|
me.increase_decrease_qty(tr, $(this).attr("class"));
|
||||||
|
});
|
||||||
|
|
||||||
// on td click toggle the highlighting of row
|
// on td click toggle the highlighting of row
|
||||||
$(this.wrapper).find("#cart tbody tr td").on("click", function() {
|
$(this.wrapper).find("#cart tbody tr td").on("click", function() {
|
||||||
var row = $(this).closest("tr");
|
var row = $(this).closest("tr");
|
||||||
@ -443,6 +453,15 @@ erpnext.POS = Class.extend({
|
|||||||
me.refresh_delete_btn();
|
me.refresh_delete_btn();
|
||||||
this.barcode.$input.focus();
|
this.barcode.$input.focus();
|
||||||
},
|
},
|
||||||
|
increase_decrease_qty: function(tr, operation) {
|
||||||
|
var item_code = tr.attr("id");
|
||||||
|
var item_qty = cint(tr.find("input.qty").val());
|
||||||
|
|
||||||
|
if (operation == "increase-qty")
|
||||||
|
this.update_qty(item_code, item_qty + 1);
|
||||||
|
else if (operation == "decrease-qty" && item_qty != 1)
|
||||||
|
this.update_qty(item_code, item_qty - 1);
|
||||||
|
},
|
||||||
disable_text_box_and_button: function() {
|
disable_text_box_and_button: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
// if form is submitted & cancelled then disable all input box & buttons
|
// if form is submitted & cancelled then disable all input box & buttons
|
||||||
@ -514,27 +533,11 @@ erpnext.POS = Class.extend({
|
|||||||
this.refresh_grid();
|
this.refresh_grid();
|
||||||
},
|
},
|
||||||
refresh_grid: function() {
|
refresh_grid: function() {
|
||||||
|
this.frm.dirty();
|
||||||
this.frm.fields_dict[this.frm.cscript.fname].grid.refresh();
|
this.frm.fields_dict[this.frm.cscript.fname].grid.refresh();
|
||||||
this.frm.script_manager.trigger("calculate_taxes_and_totals");
|
this.frm.script_manager.trigger("calculate_taxes_and_totals");
|
||||||
this.refresh();
|
this.refresh();
|
||||||
},
|
},
|
||||||
selected_item_qty_operation: function(item_code, operation) {
|
|
||||||
var me = this;
|
|
||||||
var child = wn.model.get_children(this.frm.doctype + " Item", this.frm.doc.name,
|
|
||||||
this.frm.cscript.fname, this.frm.doctype);
|
|
||||||
|
|
||||||
$.each(child, function(i, d) {
|
|
||||||
if (d.item_code == item_code) {
|
|
||||||
if (operation == "increase-qty")
|
|
||||||
d.qty += 1;
|
|
||||||
else if (operation == "decrease-qty")
|
|
||||||
d.qty != 1 ? d.qty -= 1 : d.qty = 1;
|
|
||||||
|
|
||||||
me.frm.script_manager.trigger("qty", d.doctype, d.name);
|
|
||||||
me.refresh();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
make_payment: function() {
|
make_payment: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var no_of_items = $(this.wrapper).find("#cart tbody tr").length;
|
var no_of_items = $(this.wrapper).find("#cart tbody tr").length;
|
||||||
|
|||||||
@ -320,12 +320,9 @@ class DocType(SellingController):
|
|||||||
item = webnotes.conn.sql("select name,is_asset_item,is_sales_item from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())"% d.item_code)
|
item = webnotes.conn.sql("select name,is_asset_item,is_sales_item from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())"% d.item_code)
|
||||||
acc = webnotes.conn.sql("select account_type from `tabAccount` where name = '%s' and docstatus != 2" % d.income_account)
|
acc = webnotes.conn.sql("select account_type from `tabAccount` where name = '%s' and docstatus != 2" % d.income_account)
|
||||||
if not acc:
|
if not acc:
|
||||||
msgprint("Account: "+d.income_account+" does not exist in the system")
|
msgprint("Account: "+d.income_account+" does not exist in the system", raise_exception=True)
|
||||||
raise Exception
|
|
||||||
elif item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset Account':
|
elif item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset Account':
|
||||||
msgprint("Please select income head with account type 'Fixed Asset Account' as Item %s is an asset item" % d.item_code)
|
msgprint("Please select income head with account type 'Fixed Asset Account' as Item %s is an asset item" % d.item_code, raise_exception=True)
|
||||||
raise Exception
|
|
||||||
|
|
||||||
|
|
||||||
def validate_with_previous_doc(self):
|
def validate_with_previous_doc(self):
|
||||||
super(DocType, self).validate_with_previous_doc(self.tname, {
|
super(DocType, self).validate_with_previous_doc(self.tname, {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-05-13 16:10:02",
|
"creation": "2013-05-13 16:10:02",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-05-13 16:21:07",
|
"modified": "2014-01-24 18:19:11",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -11,7 +11,7 @@
|
|||||||
"doctype": "Report",
|
"doctype": "Report",
|
||||||
"is_standard": "Yes",
|
"is_standard": "Yes",
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Ordered Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc",
|
"query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tsum(ifnull(mr_item.qty, 0)) as \"Qty:Float:100\",\n\tsum(ifnull(mr_item.ordered_qty, 0)) as \"Ordered Qty:Float:100\", \n\t(sum(mr_item.qty) - sum(ifnull(mr_item.ordered_qty, 0))) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\ngroup by mr.name, mr_item.item_code\nhaving\n\tsum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.qty, 0))\norder by mr.transaction_date asc",
|
||||||
"ref_doctype": "Purchase Order",
|
"ref_doctype": "Purchase Order",
|
||||||
"report_name": "Requested Items To Be Ordered",
|
"report_name": "Requested Items To Be Ordered",
|
||||||
"report_type": "Query Report"
|
"report_type": "Query Report"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"app_name": "ERPNext",
|
"app_name": "ERPNext",
|
||||||
"app_version": "3.6.6",
|
"app_version": "3.7.0",
|
||||||
"base_template": "app/portal/templates/base.html",
|
"base_template": "app/portal/templates/base.html",
|
||||||
"modules": {
|
"modules": {
|
||||||
"Accounts": {
|
"Accounts": {
|
||||||
@ -74,5 +74,5 @@
|
|||||||
"type": "module"
|
"type": "module"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"requires_framework_version": "==3.7.5"
|
"requires_framework_version": "==3.8.0"
|
||||||
}
|
}
|
||||||
@ -243,10 +243,10 @@ class DocType:
|
|||||||
"item_code": [qty_required, description, stock_uom, min_order_qty]
|
"item_code": [qty_required, description, stock_uom, min_order_qty]
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
bom_wise_item_details = {}
|
|
||||||
item_list = []
|
item_list = []
|
||||||
|
|
||||||
for bom, so_wise_qty in bom_dict.items():
|
for bom, so_wise_qty in bom_dict.items():
|
||||||
|
bom_wise_item_details = {}
|
||||||
if self.doc.use_multi_level_bom:
|
if self.doc.use_multi_level_bom:
|
||||||
# get all raw materials with sub assembly childs
|
# get all raw materials with sub assembly childs
|
||||||
for d in webnotes.conn.sql("""select fb.item_code,
|
for d in webnotes.conn.sql("""select fb.item_code,
|
||||||
|
|||||||
10
patches/1401/fix_planned_qty.py
Normal file
10
patches/1401/fix_planned_qty.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
import webnotes
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
from utilities.repost_stock import repost_stock
|
||||||
|
for d in webnotes.conn.sql("""select distinct production_item, fg_warehouse
|
||||||
|
from `tabProduction Order` where docstatus>0""", as_dict=1):
|
||||||
|
repost_stock(d.production_item, d.fg_warehouse)
|
||||||
17
patches/1401/fix_serial_no_status_and_warehouse.py
Normal file
17
patches/1401/fix_serial_no_status_and_warehouse.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 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 webnotes
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0
|
||||||
|
and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""")
|
||||||
|
for sr in serial_nos:
|
||||||
|
try:
|
||||||
|
sr_bean = webnotes.bean("Serial No", sr[0])
|
||||||
|
sr_bean.make_controller().via_stock_ledger = True
|
||||||
|
sr_bean.save()
|
||||||
|
webnotes.conn.commit()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
@ -267,4 +267,6 @@ patch_list = [
|
|||||||
"patches.1401.p01_make_buying_selling_as_check_box_in_price_list",
|
"patches.1401.p01_make_buying_selling_as_check_box_in_price_list",
|
||||||
"patches.1401.update_billing_status_for_zero_value_order",
|
"patches.1401.update_billing_status_for_zero_value_order",
|
||||||
"patches.1401.enable_all_price_list",
|
"patches.1401.enable_all_price_list",
|
||||||
|
"patches.1401.fix_serial_no_status_and_warehouse",
|
||||||
|
"patches.1401.fix_planned_qty",
|
||||||
]
|
]
|
||||||
@ -10,9 +10,9 @@
|
|||||||
<li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
|
<li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
|
<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
|
||||||
{% if doc.name == "Not Allowed" -%}
|
{% if session_user == "Guest" -%}
|
||||||
<script>ask_to_login();</script>
|
<script>ask_to_login();</script>
|
||||||
{% else %}
|
{% elif doc.name != "Not Allowed"%}
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@ -41,21 +41,23 @@ def get_currency_context():
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_transaction_context(doctype, name):
|
def get_transaction_context(doctype, name):
|
||||||
|
context = {"session_user": webnotes.session.user}
|
||||||
|
|
||||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||||
"customer")
|
"customer")
|
||||||
|
|
||||||
bean = webnotes.bean(doctype, name)
|
bean = webnotes.bean(doctype, name)
|
||||||
if bean.doc.customer != customer:
|
if bean.doc.customer != customer:
|
||||||
return {
|
context.update({"doc": {"name": "Not Allowed"}})
|
||||||
"doc": {"name": "Not Allowed"}
|
|
||||||
}
|
|
||||||
else:
|
else:
|
||||||
return {
|
context.update({
|
||||||
"doc": bean.doc,
|
"doc": bean.doc,
|
||||||
"doclist": bean.doclist,
|
"doclist": bean.doclist,
|
||||||
"webnotes": webnotes,
|
"webnotes": webnotes,
|
||||||
"utils": webnotes.utils
|
"utils": webnotes.utils
|
||||||
}
|
})
|
||||||
|
|
||||||
|
return context
|
||||||
|
|
||||||
@webnotes.whitelist(allow_guest=True)
|
@webnotes.whitelist(allow_guest=True)
|
||||||
def send_message(subject="Website Query", message="", sender="", status="Open"):
|
def send_message(subject="Website Query", message="", sender="", status="Open"):
|
||||||
|
|||||||
@ -10,6 +10,7 @@ no_cache = True
|
|||||||
def get_context():
|
def get_context():
|
||||||
from portal.utils import get_transaction_context
|
from portal.utils import get_transaction_context
|
||||||
context = get_transaction_context("Sales Order", webnotes.form_dict.name)
|
context = get_transaction_context("Sales Order", webnotes.form_dict.name)
|
||||||
|
if context.get("doc").get("name") != "Not Allowed":
|
||||||
modify_status(context.get("doc"))
|
modify_status(context.get("doc"))
|
||||||
context.update({
|
context.update({
|
||||||
"parent_link": "orders",
|
"parent_link": "orders",
|
||||||
|
|||||||
@ -310,6 +310,7 @@ def set_price_list_and_rate(quotation, cart_settings, billing_territory):
|
|||||||
quotation.run_method("set_price_list_and_item_details")
|
quotation.run_method("set_price_list_and_item_details")
|
||||||
|
|
||||||
# set it in cookies for using in product page
|
# set it in cookies for using in product page
|
||||||
|
if quotation.doc.selling_price_list:
|
||||||
webnotes.local._response.set_cookie("selling_price_list", quotation.doc.selling_price_list)
|
webnotes.local._response.set_cookie("selling_price_list", quotation.doc.selling_price_list)
|
||||||
|
|
||||||
def set_taxes(quotation, cart_settings, billing_territory):
|
def set_taxes(quotation, cart_settings, billing_territory):
|
||||||
|
|||||||
@ -36,6 +36,7 @@ test_records = [
|
|||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC"
|
||||||
}, {
|
}, {
|
||||||
"doctype": "Item Reorder",
|
"doctype": "Item Reorder",
|
||||||
"parentfield": "item_reorder",
|
"parentfield": "item_reorder",
|
||||||
@ -64,6 +65,7 @@ test_records = [
|
|||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC"
|
||||||
}],
|
}],
|
||||||
[{
|
[{
|
||||||
"doctype": "Item",
|
"doctype": "Item",
|
||||||
@ -73,6 +75,7 @@ test_records = [
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_stock_item": "Yes",
|
"is_stock_item": "Yes",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
@ -99,6 +102,7 @@ test_records = [
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_stock_item": "Yes",
|
"is_stock_item": "Yes",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
@ -119,6 +123,7 @@ test_records = [
|
|||||||
"description": "_Test Sales BOM Item",
|
"description": "_Test Sales BOM Item",
|
||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_stock_item": "No",
|
"is_stock_item": "No",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
@ -140,6 +145,7 @@ test_records = [
|
|||||||
"is_stock_item": "Yes",
|
"is_stock_item": "Yes",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
"has_serial_no": "No",
|
"has_serial_no": "No",
|
||||||
@ -216,6 +222,7 @@ test_records = [
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_stock_item": "Yes",
|
"is_stock_item": "Yes",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
@ -238,6 +245,7 @@ test_records = [
|
|||||||
"is_stock_item": "Yes",
|
"is_stock_item": "Yes",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
"default_income_account": "Sales - _TC",
|
"default_income_account": "Sales - _TC",
|
||||||
|
"purchase_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
"is_asset_item": "No",
|
"is_asset_item": "No",
|
||||||
"has_batch_no": "No",
|
"has_batch_no": "No",
|
||||||
"has_serial_no": "No",
|
"has_serial_no": "No",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-25 11:35:09",
|
"creation": "2013-01-25 11:35:09",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2014-01-17 13:29:39",
|
"modified": "2014-01-27 11:11:08",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -11,6 +11,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_email": 1,
|
"allow_email": 1,
|
||||||
"allow_print": 1,
|
"allow_print": 1,
|
||||||
|
"allow_rename": 1,
|
||||||
"autoname": "field:price_list_name",
|
"autoname": "field:price_list_name",
|
||||||
"description": "Price List Master",
|
"description": "Price List Master",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
|
|||||||
@ -87,6 +87,8 @@ class DocType(StockController):
|
|||||||
self.doc.status = "Sales Returned"
|
self.doc.status = "Sales Returned"
|
||||||
else:
|
else:
|
||||||
self.doc.status = "Available"
|
self.doc.status = "Available"
|
||||||
|
if not self.doc.warehouse:
|
||||||
|
self.doc.warehouse = last_sle.warehouse
|
||||||
else:
|
else:
|
||||||
if document_type == "Purchase Return":
|
if document_type == "Purchase Return":
|
||||||
self.doc.status = "Purchase Returned"
|
self.doc.status = "Purchase Returned"
|
||||||
@ -94,6 +96,8 @@ class DocType(StockController):
|
|||||||
self.doc.status = "Delivered"
|
self.doc.status = "Delivered"
|
||||||
else:
|
else:
|
||||||
self.doc.status = "Not Available"
|
self.doc.status = "Not Available"
|
||||||
|
else:
|
||||||
|
self.doc.status = "Not Available"
|
||||||
|
|
||||||
def set_purchase_details(self, purchase_sle):
|
def set_purchase_details(self, purchase_sle):
|
||||||
if purchase_sle:
|
if purchase_sle:
|
||||||
@ -185,7 +189,6 @@ class DocType(StockController):
|
|||||||
def on_stock_ledger_entry(self):
|
def on_stock_ledger_entry(self):
|
||||||
if self.via_stock_ledger and not self.doc.fields.get("__islocal"):
|
if self.via_stock_ledger and not self.doc.fields.get("__islocal"):
|
||||||
last_sle = self.get_last_sle()
|
last_sle = self.get_last_sle()
|
||||||
if last_sle:
|
|
||||||
self.set_status(last_sle.get("last_sle"))
|
self.set_status(last_sle.get("last_sle"))
|
||||||
self.set_purchase_details(last_sle.get("purchase_sle"))
|
self.set_purchase_details(last_sle.get("purchase_sle"))
|
||||||
self.set_sales_details(last_sle.get("delivery_sle"))
|
self.set_sales_details(last_sle.get("delivery_sle"))
|
||||||
|
|||||||
@ -346,6 +346,7 @@ class DocType(StockController):
|
|||||||
pro_bean = webnotes.bean("Production Order", self.doc.production_order)
|
pro_bean = webnotes.bean("Production Order", self.doc.production_order)
|
||||||
_validate_production_order(pro_bean)
|
_validate_production_order(pro_bean)
|
||||||
self.update_produced_qty(pro_bean)
|
self.update_produced_qty(pro_bean)
|
||||||
|
if self.doc.purpose == "Manufacture/Repack":
|
||||||
self.update_planned_qty(pro_bean)
|
self.update_planned_qty(pro_bean)
|
||||||
|
|
||||||
def update_produced_qty(self, pro_bean):
|
def update_produced_qty(self, pro_bean):
|
||||||
|
|||||||
@ -21,3 +21,4 @@ Start entering data below this line,,,,
|
|||||||
,,2009,01-01-2009,31-12-2009,No
|
,,2009,01-01-2009,31-12-2009,No
|
||||||
,,2010,01-01-2010,31-12-2010,No
|
,,2010,01-01-2010,31-12-2010,No
|
||||||
,,2011,01-01-2011,31-12-2011,No
|
,,2011,01-01-2011,31-12-2011,No
|
||||||
|
,,2012,01-01-2012,31-12-2012,No
|
||||||
|
Can't render this file because it has a wrong number of fields in line 16.
|
@ -19,7 +19,7 @@ company_abbr = "WP"
|
|||||||
country = "United States"
|
country = "United States"
|
||||||
currency = "USD"
|
currency = "USD"
|
||||||
time_zone = "America/New_York"
|
time_zone = "America/New_York"
|
||||||
start_date = '2013-01-01'
|
start_date = '2014-01-01'
|
||||||
bank_name = "Citibank"
|
bank_name = "Citibank"
|
||||||
runs_for = None
|
runs_for = None
|
||||||
prob = {
|
prob = {
|
||||||
@ -105,6 +105,10 @@ def run_accounts(current_date):
|
|||||||
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Sales Invoice")]:
|
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Sales Invoice")]:
|
||||||
si = webnotes.bean(make_sales_invoice(so))
|
si = webnotes.bean(make_sales_invoice(so))
|
||||||
si.doc.posting_date = current_date
|
si.doc.posting_date = current_date
|
||||||
|
for d in si.doclist.get({"parentfield": "entries"}):
|
||||||
|
if not d.income_account:
|
||||||
|
d.income_account = "Sales - {}".format(company_abbr)
|
||||||
|
|
||||||
si.insert()
|
si.insert()
|
||||||
si.submit()
|
si.submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
@ -170,6 +174,9 @@ def run_stock(current_date):
|
|||||||
dn = webnotes.bean(make_delivery_note(so))
|
dn = webnotes.bean(make_delivery_note(so))
|
||||||
dn.doc.posting_date = current_date
|
dn.doc.posting_date = current_date
|
||||||
dn.doc.fiscal_year = current_date.year
|
dn.doc.fiscal_year = current_date.year
|
||||||
|
for d in dn.doclist.get({"parentfield": "delivery_note_details"}):
|
||||||
|
d.expense_account = "Cost of Goods Sold - {}".format(company_abbr)
|
||||||
|
|
||||||
dn.insert()
|
dn.insert()
|
||||||
try:
|
try:
|
||||||
dn.submit()
|
dn.submit()
|
||||||
@ -236,7 +243,7 @@ def run_manufacturing(current_date):
|
|||||||
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
||||||
ppt.doc.company = company
|
ppt.doc.company = company
|
||||||
ppt.doc.use_multi_level_bom = 1
|
ppt.doc.use_multi_level_bom = 1
|
||||||
ppt.doc.purchase_request_for_warehouse = "Stores - WP"
|
ppt.doc.purchase_request_for_warehouse = "Stores - {}".format(company_abbr)
|
||||||
ppt.run_method("get_open_sales_orders")
|
ppt.run_method("get_open_sales_orders")
|
||||||
ppt.run_method("get_items_from_so")
|
ppt.run_method("get_items_from_so")
|
||||||
ppt.run_method("raise_production_order")
|
ppt.run_method("raise_production_order")
|
||||||
@ -380,8 +387,8 @@ def complete_setup():
|
|||||||
setup_account({
|
setup_account({
|
||||||
"first_name": "Test",
|
"first_name": "Test",
|
||||||
"last_name": "User",
|
"last_name": "User",
|
||||||
"fy_start_date": "2013-01-01",
|
"fy_start_date": "2014-01-01",
|
||||||
"fy_end_date": "2013-12-31",
|
"fy_end_date": "2014-12-31",
|
||||||
"industry": "Manufacturing",
|
"industry": "Manufacturing",
|
||||||
"company_name": company,
|
"company_name": company,
|
||||||
"company_abbr": company_abbr,
|
"company_abbr": company_abbr,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user