Compare commits

...

32 Commits

Author SHA1 Message Date
Anand Doshi
00c5875ff7 Merge branch 'develop' 2015-08-24 16:53:51 +05:30
Anand Doshi
5c9bd5e650 bumped to version 5.7.7 2015-08-24 17:23:51 +06:00
Anand Doshi
96773bdc0e Merge pull request #3926 from neilLasrado/prod-order
Production Order - Validation Added
2015-08-24 14:44:44 +05:30
Anand Doshi
d092fd918a Merge pull request #3937 from rmehta/purchase-order-fix
[hot] make_stock_entry button in purchase order
2015-08-24 14:41:40 +05:30
Anand Doshi
50e2e1d9af Merge pull request #3936 from rmehta/customer-report-fix
[fix] Customer Address and Contact report
2015-08-24 14:35:42 +05:30
Rushabh Mehta
da24698cf7 [minor] in ap, ar renamed label for date as 'as on date' as it was confusing 2015-08-24 14:31:07 +05:30
Rushabh Mehta
d999dd1bb9 [minor] fix setup wizard buying_items query 2015-08-24 14:23:55 +05:30
Rushabh Mehta
c8a5a2cc4a [hot] make_stock_entry button in purchase order 2015-08-24 13:12:45 +05:30
Rushabh Mehta
12fb0d998f [fix] Customer Address and Contact report 2015-08-24 12:21:04 +05:30
Neil Trini Lasrado
17231e39cc Added validation in Production Order. Operations Time made mandatory 2015-08-21 16:52:04 +05:30
Anand Doshi
4451db2db4 Merge branch 'develop' 2015-08-21 14:57:19 +05:30
Anand Doshi
d7a6c11a92 bumped to version 5.7.6 2015-08-21 15:27:19 +06:00
Anand Doshi
bcb386fb64 Merge pull request #3922 from nabinhait/fraction_gle
Divisonal loss adjustment in purchase receipt
2015-08-21 14:55:44 +05:30
Anand Doshi
3709668464 Merge pull request #3925 from nabinhait/uom_replace
[fix]Stock UOM Replace Utility: Multiply Qty after Transaction by conversion factor as well, as there is no qty mentioned for stock reconciliation
2015-08-21 14:47:27 +05:30
Nabin Hait
7c2901fb56 [fix]Stock UOM Replace Utility: Multiply Qty after Transaction by conversion factor as well, as there is no qty mentioned for stock reconciliation 2015-08-21 14:45:59 +05:30
Anand Doshi
b5d9ab24ec Merge pull request #3921 from nabinhait/uom_replace
[fix]Stock UOM Replace Utility: Multiply Qty after Transaction by conversion factor as well, as there is no qty mentioned for stock reconciliation
2015-08-21 14:39:25 +05:30
Nabin Hait
597a402dff Divisonal loss adjustment in purchase receipt 2015-08-21 14:13:55 +05:30
Nabin Hait
1b6fd1ba5b [fix]Stock UOM Replace Utility: Multiply Qty after Transaction by conversion factor as well, as there is no qty mentioned for stock reconciliation 2015-08-21 13:05:19 +05:30
Anand Doshi
ac35b8af55 Merge pull request #3912 from nabinhait/jv1
[fix] payment amt against invoice outstanding
2015-08-21 13:01:53 +05:30
Anand Doshi
9b02aa722c Merge pull request #3920 from nabinhait/advances
[fix] Fetch advances in Sales/Purchase Invoice
2015-08-21 13:01:39 +05:30
Anand Doshi
32f3426007 Merge pull request #3919 from nabinhait/conv_factor
[fix] UOM Conversion factor mandatory in stock entry
2015-08-21 12:59:19 +05:30
Nabin Hait
046db626a2 [fix] Fetch advances in Sales/Purchase Invoice 2015-08-21 12:34:41 +05:30
Nabin Hait
d7ed197131 [fix] UOM Conversion factor mandatory in stock entry 2015-08-21 12:00:32 +05:30
Anand Doshi
f37884472d Merge branch 'develop' 2015-08-20 18:47:19 +05:30
Anand Doshi
e9cebd4de3 bumped to version 5.7.5 2015-08-20 19:17:19 +06:00
Anand Doshi
db1a9edbdf [minor] removed test case of template cannot have stock 2015-08-20 18:20:06 +05:30
Anand Doshi
5c85740aab [minor] don't validate stock for template item 2015-08-20 17:43:35 +05:30
Anand Doshi
8554cbf001 [minor] fixed patch item template attributes 2015-08-20 17:43:35 +05:30
Anand Doshi
0e90e8e8dc Merge branch 'develop' 2015-08-20 15:45:07 +05:30
Anand Doshi
30d3eb3d4b bumped to version 5.7.4 2015-08-20 16:15:07 +06:00
Anand Doshi
cf7adb5c02 [patch] re-run repost_reserved_qty 2015-08-20 15:42:58 +05:30
Nabin Hait
efc89f4395 [fix] payment amt against invoice outstanding 2015-08-20 11:30:44 +05:30
19 changed files with 83 additions and 61 deletions

View File

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.7.3'
__version__ = '5.7.7'

View File

@@ -236,7 +236,7 @@ class JournalEntry(AccountsController):
if voucher_properties[0] != 1:
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
if flt(voucher_properties[1]) < total:
if total and flt(voucher_properties[1]) < total:
frappe.throw(_("Payment against {0} {1} cannot be greater \
than Outstanding Amount {2}").format(reference_type, reference_name, voucher_properties[1]))

View File

@@ -18,7 +18,7 @@ frappe.query_reports["Accounts Payable"] = {
},
{
"fieldname":"report_date",
"label": __("Date"),
"label": __("As on Date"),
"fieldtype": "Date",
"default": get_today()
},

View File

@@ -18,7 +18,7 @@ frappe.query_reports["Accounts Receivable"] = {
},
{
"fieldname":"report_date",
"label": __("Date"),
"label": __("As on Date"),
"fieldtype": "Date",
"default": get_today()
},

View File

@@ -32,7 +32,8 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt).addClass("btn-primary");
if(doc.is_subcontracted==="Yes") {
cur_frm.add_custom_button(__('Transfer Material to Supplier'), this.make_stock_entry);
cur_frm.add_custom_button(__('Transfer Material to Supplier'),
function() { me.make_stock_entry(); });
}
}

View File

@@ -215,14 +215,15 @@ class AccountsController(TransactionBase):
"""Returns list of advances against Account, Party, Reference"""
order_list = list(set([d.get(against_order_field) for d in self.get("items") if d.get(against_order_field)]))
if not order_list:
return
in_placeholder = ', '.join(['%s'] * len(order_list))
# conver sales_order to "Sales Order"
reference_type = against_order_field.replace("_", " ").title()
condition = ""
if order_list:
in_placeholder = ', '.join(['%s'] * len(order_list))
condition = "or (t2.reference_type = '{0}' and ifnull(t2.reference_name, '') in ({1}))"\
.format(reference_type, in_placeholder)
res = frappe.db.sql("""
select
t1.name as jv_no, t1.remark, t2.{0} as amount, t2.name as jv_detail_no,
@@ -233,11 +234,9 @@ class AccountsController(TransactionBase):
t1.name = t2.parent and t2.account = %s
and t2.party_type = %s and t2.party = %s
and t2.is_advance = 'Yes' and t1.docstatus = 1
and (
ifnull(t2.reference_type, '')=''
or (t2.reference_type = %s and ifnull(t2.reference_name, '') in ({1})))
order by t1.posting_date""".format(dr_or_cr, in_placeholder),
[account_head, party_type, party, reference_type] + order_list, as_dict=1)
and (ifnull(t2.reference_type, '')='' {1})
order by t1.posting_date""".format(dr_or_cr, condition),
[account_head, party_type, party] + order_list, as_dict=1)
self.set(parentfield, [])
for d in res:

View File

@@ -27,7 +27,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "5.7.3"
app_version = "5.7.7"
github_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"

View File

@@ -42,6 +42,8 @@ class ProductionOrder(Document):
self.validate_warehouse()
self.calculate_operating_cost()
self.validate_delivery_date()
self.validate_qty()
self.validate_operation_time()
from erpnext.utilities.transaction_base import validate_uom_is_integer
validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"])
@@ -327,6 +329,15 @@ class ProductionOrder(Document):
frappe.throw(_("Production Order cannot be raised against a Item Template"), ItemHasVariantError)
validate_end_of_life(self.production_item)
def validate_qty(self):
if not self.qty > 0:
frappe.throw(_("Quantity to Manufacture must be greater than 0."))
def validate_operation_time(self):
for d in self.operations:
if not d.time_in_mins > 0:
frappe.throw(_("Operation Time must be greater than 0 for Operation {0}".format(d.operation)))
@frappe.whitelist()
def get_item_details(item):

View File

@@ -276,7 +276,7 @@
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -476,7 +476,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:45:53.834920",
"modified": "2015-08-21 07:17:18.185276",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order Operation",

View File

@@ -191,5 +191,5 @@ erpnext.patches.v5_4.stock_entry_additional_costs
erpnext.patches.v5_4.cleanup_journal_entry #2015-08-14
execute:frappe.db.sql("update `tabProduction Order` pro set description = (select description from tabItem where name=pro.production_item) where ifnull(description, '') = ''")
erpnext.patches.v5_7.item_template_attributes
erpnext.patches.v4_2.repost_reserved_qty #2015-08-17
erpnext.patches.v4_2.repost_reserved_qty #2015-08-20
erpnext.patches.v5_4.update_purchase_cost_against_project

View File

@@ -65,6 +65,12 @@ def migrate_item_variants():
item_attributes = frappe.db.sql("""select distinct item_attribute, item_attribute_value
from `tabItem Variant` where parent=%s""", item.name)
if not item_attributes and not all_variants:
item = frappe.get_doc("Item", item.name)
item.has_variants = 0
item.save()
continue
attribute_value_options = {}
for attribute, value in item_attributes:
attribute_value_options.setdefault(attribute, []).append(value)

View File

@@ -1,17 +1,19 @@
{
"apply_user_permissions": 1,
"creation": "2012-10-04 18:45:27",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-07-14 07:18:17.006732",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer Addresses and Contacts",
"owner": "Administrator",
"query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc",
"ref_doctype": "Customer",
"report_name": "Customer Addresses And Contacts",
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2012-10-04 18:45:27",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2015-08-24 11:44:00.711112",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer Addresses And Contacts",
"owner": "Administrator",
"query": "SELECT\n\t`tabCustomer`.name as \"Customer ID:Link/Customer\",\n\t`tabCustomer`.customer_name as \"Customer Name\",\n\t`tabCustomer`.customer_group as \"Customer Group:Link/Customer Group\",\n\t`tabAddress`.address_line1 as \"Address Line 1\",\n\t`tabAddress`.address_line2 as \"Address Line 2\",\n\t`tabAddress`.city as \"City\",\n\t`tabAddress`.state as \"State\",\n\t`tabAddress`.pincode as \"Postal Code\",\n\t`tabAddress`.country as \"Country\",\n\t`tabAddress`.is_primary_address as \"Is Primary Address:Check\", \n\t`tabContact`.first_name as \"First Name\",\n\t`tabContact`.last_name as \"Last Name\",\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact:Check\"\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc",
"ref_doctype": "Customer",
"report_name": "Customer Addresses And Contacts",
"report_type": "Query Report"
}
}

View File

@@ -12,7 +12,7 @@ def make_sample_data():
to help the user get started"""
selling_items = frappe.get_all("Item", filters = {"is_sales_item": 1})
buying_items = frappe.get_all("Item", filters = {"is_sales_item": 0})
buying_items = frappe.get_all("Item", filters = {"is_purchase_item": 1})
if selling_items:
for i in range(3):

View File

@@ -64,7 +64,7 @@ class Item(WebsiteGenerator):
self.update_item_desc()
self.synced_with_hub = 0
self.validate_has_variants()
self.validate_stock_for_template_must_be_zero()
# self.validate_stock_for_template_must_be_zero()
self.validate_attributes()
self.validate_variant_attributes()

View File

@@ -46,11 +46,11 @@ class TestItem(unittest.TestCase):
item = frappe.get_doc("Item", item_code)
return item
def test_template_cannot_have_stock(self):
item = self.get_item(10)
make_stock_entry(item_code=item.name, target="Stores - _TC", qty=1, basic_rate=1)
item.has_variants = 1
self.assertRaises(ItemTemplateCannotHaveStock, item.save)
# def test_template_cannot_have_stock(self):
# item = self.get_item(10)
# make_stock_entry(item_code=item.name, target="Stores - _TC", qty=1, basic_rate=1)
# item.has_variants = 1
# self.assertRaises(ItemTemplateCannotHaveStock, item.save)
def test_default_warehouse(self):
item = frappe.copy_doc(test_records[0])

View File

@@ -291,7 +291,7 @@ class PurchaseReceipt(BuyingController):
if warehouse_account.get(d.warehouse):
val_rate_db_precision = 6 if cint(d.precision("valuation_rate")) <= 6 else 9
# warehouse account
gl_entries.append(self.get_gl_dict({
"account": warehouse_account[d.warehouse],
@@ -334,22 +334,21 @@ class PurchaseReceipt(BuyingController):
}))
# divisional loss adjustment
if not self.get("taxes"):
sle_valuation_amount = flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
self.precision("base_net_amount", d))
sle_valuation_amount = flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
self.precision("base_net_amount", d))
distributed_amount = flt(flt(d.base_net_amount, self.precision("base_net_amount", d))) + \
flt(d.landed_cost_voucher_amount) + flt(d.rm_supp_cost)
distributed_amount = flt(flt(d.base_net_amount, self.precision("base_net_amount", d))) + \
flt(d.landed_cost_voucher_amount) + flt(d.rm_supp_cost) + flt(d.item_tax_amount)
divisional_loss = flt(distributed_amount - sle_valuation_amount, self.precision("base_net_amount", d))
if divisional_loss:
gl_entries.append(self.get_gl_dict({
"account": stock_rbnb,
"against": warehouse_account[d.warehouse],
"cost_center": d.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": divisional_loss
}))
divisional_loss = flt(distributed_amount - sle_valuation_amount, self.precision("base_net_amount", d))
if divisional_loss:
gl_entries.append(self.get_gl_dict({
"account": stock_rbnb,
"against": warehouse_account[d.warehouse],
"cost_center": d.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": divisional_loss
}))
elif d.warehouse not in warehouse_with_no_account or \
d.rejected_warehouse not in warehouse_with_no_account:

View File

@@ -80,7 +80,8 @@ class StockEntry(StockController):
for item in self.get("items"):
if not flt(item.qty):
frappe.throw(_("Row {0}: Qty is mandatory").format(item.idx))
if not flt(item.conversion_factor):
frappe.throw(_("Row {0}: UOM Conversion Factor is mandatory").format(item.idx))
item.transfer_qty = flt(item.qty * item.conversion_factor, self.precision("transfer_qty", item))
def validate_item(self):

View File

@@ -88,9 +88,12 @@ def update_stock_ledger_entry(item_code, new_stock_uom, conversion_factor):
if flt(conversion_factor) != flt(1):
frappe.db.sql("""update `tabStock Ledger Entry`
set stock_uom = %s, actual_qty = ifnull(actual_qty,0) * %s
set
stock_uom = %s,
actual_qty = ifnull(actual_qty,0) * %s,
qty_after_transaction = ifnull(qty_after_transaction, 0) * %s
where item_code = %s""",
(new_stock_uom, conversion_factor, item_code))
(new_stock_uom, conversion_factor, conversion_factor, item_code))
else:
frappe.db.sql("""update `tabStock Ledger Entry` set stock_uom=%s
where item_code=%s""", (new_stock_uom, item_code))

View File

@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "5.7.3"
version = "5.7.7"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()