@@ -1570,7 +1570,7 @@ def get_previous_sle_of_current_voucher(args, operator="<", exclude_current_vouc
1570
1570
and (
1571
1571
posting_datetime { operator } %(posting_datetime)s
1572
1572
)
1573
- order by posting_date desc, posting_time desc, creation desc
1573
+ order by posting_datetime desc, creation desc
1574
1574
limit 1
1575
1575
for update""" ,
1576
1576
{
@@ -1664,7 +1664,7 @@ def get_stock_ledger_entries(
1664
1664
where item_code = %(item_code)s
1665
1665
and is_cancelled = 0
1666
1666
{conditions}
1667
- order by posting_date {order}, posting_time {order}, creation {order}
1667
+ order by posting_datetime {order}, creation {order}
1668
1668
{limit} {for_update}""" .format (
1669
1669
conditions = conditions ,
1670
1670
limit = limit or "" ,
@@ -1786,7 +1786,7 @@ def get_valuation_rate(
1786
1786
AND valuation_rate >= 0
1787
1787
AND is_cancelled = 0
1788
1788
AND NOT (voucher_no = %s AND voucher_type = %s)
1789
- order by posting_date desc, posting_time desc, name desc limit 1""" ,
1789
+ order by posting_datetime desc, creation desc limit 1""" ,
1790
1790
(item_code , warehouse , voucher_no , voucher_type ),
1791
1791
):
1792
1792
return flt (last_valuation_rate [0 ][0 ])
@@ -2037,7 +2037,7 @@ def get_future_sle_with_negative_qty(sle_args):
2037
2037
and posting_datetime >= %(posting_datetime)s
2038
2038
and is_cancelled = 0
2039
2039
and qty_after_transaction < 0
2040
- order by posting_date asc, posting_time asc
2040
+ order by posting_datetime asc, creation asc
2041
2041
limit 1
2042
2042
""" ,
2043
2043
sle_args ,
@@ -2051,14 +2051,14 @@ def get_future_sle_with_negative_batch_qty(sle_args):
2051
2051
with batch_ledger as (
2052
2052
select
2053
2053
posting_date, posting_time, posting_datetime, voucher_type, voucher_no,
2054
- sum(actual_qty) over (order by posting_date, posting_time , creation) as cumulative_total
2054
+ sum(actual_qty) over (order by posting_datetime , creation) as cumulative_total
2055
2055
from `tabStock Ledger Entry`
2056
2056
where
2057
2057
item_code = %(item_code)s
2058
2058
and warehouse = %(warehouse)s
2059
2059
and batch_no=%(batch_no)s
2060
2060
and is_cancelled = 0
2061
- order by posting_date, posting_time , creation
2061
+ order by posting_datetime , creation
2062
2062
)
2063
2063
select * from batch_ledger
2064
2064
where
0 commit comments