Merge branch 'develop' into patch-fix
This commit is contained in:
commit
dd719ea151
@ -58,18 +58,16 @@ class TestLoanDisbursement(unittest.TestCase):
|
|||||||
|
|
||||||
process_loan_interest_accrual_for_demand_loans(posting_date=add_days(last_date, 1))
|
process_loan_interest_accrual_for_demand_loans(posting_date=add_days(last_date, 1))
|
||||||
|
|
||||||
# Paid 511095.89 amount includes 5,00,000 principal amount and 11095.89 interest amount
|
# Should not be able to create loan disbursement entry before repayment
|
||||||
|
self.assertRaises(frappe.ValidationError, make_loan_disbursement_entry, loan.name,
|
||||||
|
500000, first_date)
|
||||||
|
|
||||||
repayment_entry = create_repayment_entry(loan.name, self.applicant, add_days(get_last_day(nowdate()), 5),
|
repayment_entry = create_repayment_entry(loan.name, self.applicant, add_days(get_last_day(nowdate()), 5),
|
||||||
"Regular Payment", 611095.89)
|
"Regular Payment", 611095.89)
|
||||||
repayment_entry.submit()
|
|
||||||
|
|
||||||
|
repayment_entry.submit()
|
||||||
loan.reload()
|
loan.reload()
|
||||||
|
|
||||||
|
# After repayment loan disbursement entry should go through
|
||||||
make_loan_disbursement_entry(loan.name, 500000, disbursement_date=add_days(last_date, 16))
|
make_loan_disbursement_entry(loan.name, 500000, disbursement_date=add_days(last_date, 16))
|
||||||
|
|
||||||
total_principal_paid = loan.total_principal_paid
|
|
||||||
|
|
||||||
loan.reload()
|
|
||||||
|
|
||||||
# Loan Topup will result in decreasing the Total Principal Paid
|
|
||||||
self.assertEqual(flt(loan.total_principal_paid, 2), flt(total_principal_paid - 500000, 2))
|
|
||||||
|
|||||||
@ -119,6 +119,7 @@
|
|||||||
"label": "Penalty Interest Rate (%) Per Day"
|
"label": "Penalty Interest Rate (%) Per Day"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment",
|
||||||
"fieldname": "grace_period_in_days",
|
"fieldname": "grace_period_in_days",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "Grace Period in Days"
|
"label": "Grace Period in Days"
|
||||||
@ -142,7 +143,7 @@
|
|||||||
],
|
],
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-02-03 05:03:00.334813",
|
"modified": "2020-04-15 00:24:43.259963",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Loan Management",
|
"module": "Loan Management",
|
||||||
"name": "Loan Type",
|
"name": "Loan Type",
|
||||||
|
|||||||
@ -1176,7 +1176,7 @@ class POSCart {
|
|||||||
|
|
||||||
return `
|
return `
|
||||||
<div class="list-item indicator ${indicator_class}" data-item-code="${escape(item.item_code)}"
|
<div class="list-item indicator ${indicator_class}" data-item-code="${escape(item.item_code)}"
|
||||||
data-batch-no="${batch_no}" title="Item: ${item.item_name} Available Qty: ${item.actual_qty}">
|
data-batch-no="${batch_no}" title="Item: ${item.item_name} Available Qty: ${item.actual_qty} ${item.stock_uom}">
|
||||||
<div class="item-name list-item__content list-item__content--flex-1.5 ellipsis">
|
<div class="item-name list-item__content list-item__content--flex-1.5 ellipsis">
|
||||||
${item.item_name}
|
${item.item_name}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,20 +37,33 @@ def get_items(start, page_length, price_list, item_group, search_value="", pos_p
|
|||||||
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
|
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
|
||||||
# locate function is used to sort by closest match from the beginning of the value
|
# locate function is used to sort by closest match from the beginning of the value
|
||||||
|
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
items_data = frappe.db.sql(""" SELECT name as item_code,
|
items_data = frappe.db.sql("""
|
||||||
item_name, image as item_image, idx as idx,is_stock_item
|
SELECT
|
||||||
|
name AS item_code,
|
||||||
|
item_name,
|
||||||
|
stock_uom,
|
||||||
|
image AS item_image,
|
||||||
|
idx AS idx,
|
||||||
|
is_stock_item
|
||||||
FROM
|
FROM
|
||||||
`tabItem`
|
`tabItem`
|
||||||
WHERE
|
WHERE
|
||||||
disabled = 0 and has_variants = 0 and is_sales_item = 1
|
disabled = 0
|
||||||
and item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
AND has_variants = 0
|
||||||
and {condition} order by idx desc limit {start}, {page_length}"""
|
AND is_sales_item = 1
|
||||||
|
AND item_group in (SELECT name FROM `tabItem Group` WHERE lft >= {lft} AND rgt <= {rgt})
|
||||||
|
AND {condition}
|
||||||
|
ORDER BY
|
||||||
|
idx desc
|
||||||
|
LIMIT
|
||||||
|
{start}, {page_length}"""
|
||||||
.format(
|
.format(
|
||||||
start=start, page_length=page_length,
|
start=start,
|
||||||
lft=lft, rgt=rgt,
|
page_length=page_length,
|
||||||
|
lft=lft,
|
||||||
|
rgt=rgt,
|
||||||
condition=condition
|
condition=condition
|
||||||
), as_dict=1)
|
), as_dict=1)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user