[minor] fixed conflict while merging with master

This commit is contained in:
Nabin Hait
2013-08-21 17:49:26 +05:30
19 changed files with 340 additions and 112 deletions

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, cint
from webnotes.utils import cstr, flt, cint, add_days
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint, _
@@ -232,7 +232,7 @@ class DocType(SellingController):
sr.doc.customer = self.doc.customer
sr.doc.customer_name = self.doc.customer_name
if sr.doc.warranty_period:
sr.doc.warranty_expiry_date = add_days(cstr(self.doc.delivery_date),
sr.doc.warranty_expiry_date = add_days(cstr(self.doc.posting_date),
cint(sr.doc.warranty_period))
sr.doc.status = 'Delivered'

View File

@@ -51,10 +51,9 @@ class DocType(BuyingController):
msgprint("You can raise indent of maximum qty: %s for item: %s against sales order: %s\n Anyway, you can add more qty in new row for the same item." % (actual_so_qty - already_indented, item, so_no), raise_exception=1)
def validate_schedule_date(self):
#:::::::: validate schedule date v/s indent date ::::::::::::
for d in getlist(self.doclist, 'indent_details'):
if d.schedule_date < self.doc.transaction_date:
msgprint("Expected Schedule Date cannot be before Material Request Date")
msgprint("Expected Date cannot be before Material Request Date")
raise Exception
# Validate

View File

@@ -23,24 +23,23 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
this.show_stock_ledger();
this.show_general_ledger();
} else {
cur_frm.add_custom_button(wn._('From Purchase Order'),
function() {
wn.model.map_current_doc({
method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
source_doctype: "Purchase Order",
get_query_filters: {
supplier: cur_frm.doc.supplier || undefined,
docstatus: 1,
status: ["!=", "Stopped"],
per_received: ["<", 99.99],
company: cur_frm.doc.company
}
})
});
}
cur_frm.add_custom_button(wn._('From Purchase Order'),
function() {
wn.model.map_current_doc({
method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
source_doctype: "Purchase Order",
get_query_filters: {
supplier: cur_frm.doc.supplier || undefined,
docstatus: 1,
status: ["!=", "Stopped"],
per_received: ["<", 99.99],
company: cur_frm.doc.company
}
})
});
if(wn.boot.control_panel.country == 'India') {
unhide_field(['challan_no', 'challan_date']);
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-16 10:59:15",
"docstatus": 0,
"modified": "2013-08-20 11:52:13",
"modified": "2013-08-21 11:22:50",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -442,17 +442,6 @@
"reqd": 1,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "fiscal_year",
"fieldtype": "Select",
"in_filter": 1,
"label": "Fiscal Year",
"options": "link:Fiscal Year",
"read_only": 0,
"reqd": 1,
"search_index": 1
},
{
"cancel": 1,
"create": 1,

View File

@@ -103,12 +103,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
},
callback: function(r) {
if (!r.exc) me.frm.set_value("expense_adjustment_account", r.message);
me.get_items();
}
});
} else {
me.get_items();
}
},

View File

@@ -20,6 +20,7 @@ sql = webnotes.conn.sql
class NotUpdateStockError(webnotes.ValidationError): pass
class StockOverReturnError(webnotes.ValidationError): pass
class IncorrectValuationRateError(webnotes.ValidationError): pass
class DuplicateEntryForProductionOrderError(webnotes.ValidationError): pass
from controllers.stock_controller import StockController
@@ -146,21 +147,33 @@ class DocType(StockController):
return
if self.doc.purpose == "Manufacture/Repack":
if not flt(self.doc.fg_completed_qty):
msgprint(_("Manufacturing Quantity") + _(" is mandatory"), raise_exception=1)
if flt(pro_obj.doc.qty) < (flt(pro_obj.doc.produced_qty)
+ flt(self.doc.fg_completed_qty)):
# do not allow manufacture of qty > production order qty
msgprint(_("For Item ") + pro_obj.doc.production_item
+ _("Quantity already manufactured")
+ " = %s." % flt(pro_obj.doc.produced_qty)
+ _("Hence, maximum allowed Manufacturing Quantity")
+ " = %s." % (flt(pro_obj.doc.qty) - flt(pro_obj.doc.produced_qty)),
raise_exception=1)
# check for double entry
self.check_duplicate_entry_for_production_order()
elif self.doc.purpose != "Material Transfer":
self.doc.production_order = None
def check_duplicate_entry_for_production_order(self):
other_ste = [t[0] for t in webnotes.conn.get_values("Stock Entry", {
"production_order": self.doc.production_order,
"purpose": self.doc.purpose,
"docstatus": ["!=", 2],
"name": ["!=", self.doc.name]
}, "name")]
if other_ste:
production_item, qty = webnotes.conn.get_value("Production Order",
self.doc.production_order, ["production_item", "qty"])
args = other_ste + [production_item]
fg_qty_already_entered = webnotes.conn.sql("""select sum(actual_qty)
from `tabStock Entry Detail`
where parent in (%s)
and item_code = %s
and ifnull(s_warehouse,'')='' """ % (", ".join(["%s" * len(other_ste)]), "%s"), args)[0][0]
if fg_qty_already_entered >= qty:
webnotes.throw(_("Stock Entries already created for Production Order ")
+ self.doc.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
def set_total_amount(self):
self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})])

View File

@@ -180,6 +180,11 @@ wn.module_page["Stock"] = [
route: "query-report/Purchase Order Items To Be Received",
doctype: "Purchase Receipt"
},
{
"label":wn._("Item Shortage Report"),
route: "Report/Bin/Item Shortage Report",
doctype: "Purchase Receipt"
},
{
"label":wn._("Serial No Service Contract Expiry"),
route: "Report/Serial No/Serial No Service Contract Expiry",

View File

@@ -0,0 +1,22 @@
[
{
"creation": "2013-08-20 13:43:30",
"docstatus": 0,
"modified": "2013-08-20 13:46:15",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
"name": "__common__",
"ref_doctype": "Bin",
"report_name": "Item Shortage Report",
"report_type": "Report Builder"
},
{
"doctype": "Report",
"name": "Item Shortage Report"
}
]

View File

@@ -0,0 +1,22 @@
[
{
"creation": "2013-08-20 15:08:10",
"docstatus": 0,
"modified": "2013-08-20 15:10:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"name": "__common__",
"query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Item:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
"ref_doctype": "Item",
"report_name": "Items To Be Requested",
"report_type": "Query Report"
},
{
"doctype": "Report",
"name": "Items To Be Requested"
}
]