Merge branch 'develop'
This commit is contained in:
commit
4f9fe9c856
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '6.12.0'
|
__version__ = '6.12.1'
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import cint, flt, getdate, formatdate, cstr
|
from frappe.utils import cint, flt, getdate, formatdate, cstr
|
||||||
from erpnext.accounts.report.financial_statements import filter_accounts, get_gl_entries
|
from erpnext.accounts.report.financial_statements import filter_accounts, set_gl_entries_by_account
|
||||||
|
|
||||||
value_fields = ("opening_debit", "opening_credit", "debit", "credit", "closing_debit", "closing_credit")
|
value_fields = ("opening_debit", "opening_credit", "debit", "credit", "closing_debit", "closing_credit")
|
||||||
|
|
||||||
@ -56,8 +56,10 @@ def get_data(filters):
|
|||||||
min_lft, max_rgt = frappe.db.sql("""select min(lft), max(rgt) from `tabAccount`
|
min_lft, max_rgt = frappe.db.sql("""select min(lft), max(rgt) from `tabAccount`
|
||||||
where company=%s""", (filters.company,))[0]
|
where company=%s""", (filters.company,))[0]
|
||||||
|
|
||||||
gl_entries_by_account = get_gl_entries(filters.company, filters.from_date, filters.to_date, min_lft, max_rgt,
|
gl_entries_by_account = {}
|
||||||
ignore_closing_entries=not flt(filters.with_period_closing_entry))
|
|
||||||
|
set_gl_entries_by_account(filters.company, filters.from_date,
|
||||||
|
filters.to_date, min_lft, max_rgt, gl_entries_by_account, ignore_closing_entries=not flt(filters.with_period_closing_entry))
|
||||||
|
|
||||||
opening_balances = get_opening_balances(filters)
|
opening_balances = get_opening_balances(filters)
|
||||||
|
|
||||||
|
@ -85,12 +85,9 @@ def make_new_document(ref_wrapper, date_field, posting_date):
|
|||||||
|
|
||||||
# get last day of the month to maintain period if the from date is first day of its own month
|
# get last day of the month to maintain period if the from date is first day of its own month
|
||||||
# and to date is the last day of its own month
|
# and to date is the last day of its own month
|
||||||
if (cstr(get_first_day(ref_wrapper.from_date)) == \
|
if (cstr(get_first_day(ref_wrapper.from_date)) == cstr(ref_wrapper.from_date)) and \
|
||||||
cstr(ref_wrapper.from_date)) and \
|
(cstr(get_last_day(ref_wrapper.to_date)) == cstr(ref_wrapper.to_date)):
|
||||||
(cstr(get_last_day(ref_wrapper.to_date)) == \
|
to_date = get_last_day(get_next_date(ref_wrapper.to_date, mcount))
|
||||||
cstr(ref_wrapper.to_date)):
|
|
||||||
to_date = get_last_day(get_next_date(ref_wrapper.to_date,
|
|
||||||
mcount))
|
|
||||||
else:
|
else:
|
||||||
to_date = get_next_date(ref_wrapper.to_date, mcount)
|
to_date = get_next_date(ref_wrapper.to_date, mcount)
|
||||||
|
|
||||||
|
@ -5,11 +5,10 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
import frappe.permissions
|
import frappe.permissions
|
||||||
from erpnext.controllers.recurring_document import date_field_map
|
from erpnext.controllers.recurring_document import date_field_map
|
||||||
from frappe.utils import getdate
|
from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days
|
||||||
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
|
|
||||||
def test_recurring_document(obj, test_records):
|
def test_recurring_document(obj, test_records):
|
||||||
from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days
|
|
||||||
from erpnext.accounts.utils import get_fiscal_year
|
|
||||||
frappe.db.set_value("Print Settings", "Print Settings", "send_print_as_pdf", 1)
|
frappe.db.set_value("Print Settings", "Print Settings", "send_print_as_pdf", 1)
|
||||||
today = nowdate()
|
today = nowdate()
|
||||||
base_doc = frappe.copy_doc(test_records[0])
|
base_doc = frappe.copy_doc(test_records[0])
|
||||||
@ -38,14 +37,15 @@ def test_recurring_document(obj, test_records):
|
|||||||
_test_recurring_document(obj, doc1, date_field, True)
|
_test_recurring_document(obj, doc1, date_field, True)
|
||||||
|
|
||||||
# monthly without a first and last day period
|
# monthly without a first and last day period
|
||||||
doc2 = frappe.copy_doc(base_doc)
|
if getdate(today).day != 1:
|
||||||
doc2.update({
|
doc2 = frappe.copy_doc(base_doc)
|
||||||
"from_date": today,
|
doc2.update({
|
||||||
"to_date": add_to_date(today, days=30)
|
"from_date": today,
|
||||||
})
|
"to_date": add_to_date(today, days=30)
|
||||||
doc2.insert()
|
})
|
||||||
doc2.submit()
|
doc2.insert()
|
||||||
_test_recurring_document(obj, doc2, date_field, False)
|
doc2.submit()
|
||||||
|
_test_recurring_document(obj, doc2, date_field, False)
|
||||||
|
|
||||||
# quarterly
|
# quarterly
|
||||||
doc3 = frappe.copy_doc(base_doc)
|
doc3 = frappe.copy_doc(base_doc)
|
||||||
|
@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd."
|
|||||||
app_description = """ERP made simple"""
|
app_description = """ERP made simple"""
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "6.12.0"
|
app_version = "6.12.1"
|
||||||
app_email = "info@erpnext.com"
|
app_email = "info@erpnext.com"
|
||||||
app_license = "GNU General Public License (v3)"
|
app_license = "GNU General Public License (v3)"
|
||||||
source_link = "https://github.com/frappe/erpnext"
|
source_link = "https://github.com/frappe/erpnext"
|
||||||
|
@ -249,18 +249,26 @@ class StockReconciliation(StockController):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_items(warehouse, posting_date, posting_time):
|
def get_items(warehouse, posting_date, posting_time):
|
||||||
items = frappe.get_list("Item", fields=["name"], filters=
|
items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
|
||||||
{"is_stock_item": 1, "has_serial_no": 0, "has_batch_no": 0, "has_variants": 0})
|
|
||||||
for item in items:
|
|
||||||
item.item_code = item.name
|
|
||||||
item.warehouse = warehouse
|
|
||||||
item.qty, item.valuation_rate = get_stock_balance(item.name, warehouse,
|
|
||||||
posting_date, posting_time, with_valuation_rate=True)
|
|
||||||
item.current_qty = item.qty
|
|
||||||
item.current_valuation_rate = item.valuation_rate
|
|
||||||
del item["name"]
|
|
||||||
|
|
||||||
return items
|
items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
|
||||||
|
"has_batch_no": 0, "has_variants": 0, "default_warehouse": warehouse}, as_list=1)
|
||||||
|
|
||||||
|
res = []
|
||||||
|
for item in set(items):
|
||||||
|
stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time,
|
||||||
|
with_valuation_rate=True)
|
||||||
|
|
||||||
|
res.append({
|
||||||
|
"item_code": item[0],
|
||||||
|
"warehouse": warehouse,
|
||||||
|
"qty": stock_bal[0],
|
||||||
|
"valuation_rate": stock_bal[1],
|
||||||
|
"current_qty": stock_bal[0],
|
||||||
|
"current_valuation_rate": stock_bal[1]
|
||||||
|
})
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_stock_balance_for(item_code, warehouse, posting_date, posting_time):
|
def get_stock_balance_for(item_code, warehouse, posting_date, posting_time):
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "6.12.0"
|
version = "6.12.1"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user