update for wage
This commit is contained in:
@@ -19747,9 +19747,15 @@ class KillHouseLock(APIView):
|
|||||||
kill_house = KillHouse.objects.filter(kill_house_operator__user=user, trash=False).first()
|
kill_house = KillHouse.objects.filter(kill_house_operator__user=user, trash=False).first()
|
||||||
kill_house_purchase = KillHousePurchaseRequest.objects.filter(kill_house=kill_house).first()
|
kill_house_purchase = KillHousePurchaseRequest.objects.filter(kill_house=kill_house).first()
|
||||||
total_unpaid_wage = get_finance_info(kill_house)['total_price']
|
total_unpaid_wage = get_finance_info(kill_house)['total_price']
|
||||||
slaughter_transactions = InternalTransaction.objects.filter(Q(kill_house=kill_house) | Q(parent_kill_house=kill_house),
|
if kill_house.killer and kill_house.type=='public':
|
||||||
status='completed',
|
slaughter_transactions = InternalTransaction.objects.filter(kill_house=kill_house,parent_kill_house=kill_house,
|
||||||
trash=False)
|
status='completed',
|
||||||
|
trash=False)
|
||||||
|
else:
|
||||||
|
slaughter_transactions = InternalTransaction.objects.filter(
|
||||||
|
Q(kill_house=kill_house) | Q(parent_kill_house=kill_house),
|
||||||
|
status='completed',
|
||||||
|
trash=False)
|
||||||
|
|
||||||
total_paid_wage = slaughter_transactions.aggregate(total=Sum('amount'))[
|
total_paid_wage = slaughter_transactions.aggregate(total=Sum('amount'))[
|
||||||
'total'] or 0
|
'total'] or 0
|
||||||
|
|||||||
Reference in New Issue
Block a user