update for wage
This commit is contained in:
@@ -19240,6 +19240,37 @@ def get_gate_way_payer_info(request):
|
||||
status=status.HTTP_200_OK
|
||||
|
||||
)
|
||||
# elif role == 'KillHouse':
|
||||
# total_unpaid_wage = 0
|
||||
# total_paid_wage = 0
|
||||
# real_free_sale_wage = 0
|
||||
# kill_house_kill_requests_wage = 0
|
||||
# # wage_type = WageType.objects.filter(en_name='province-kill-request').first()
|
||||
# # total_check_wage = wage_type.amount
|
||||
# kill_house = KillHouse.objects.filter(kill_house_operator__user=user, trash=False).first()
|
||||
# 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), status='completed',
|
||||
# trash=False)
|
||||
#
|
||||
# total_paid_wage += slaughter_transactions.aggregate(total=Sum('amount'))[
|
||||
# 'total'] or 0
|
||||
#
|
||||
# return Response(
|
||||
# {
|
||||
# "role": role,
|
||||
# "user_key": user.key,
|
||||
# "name": kill_house.name,
|
||||
# "fullname": user.fullname,
|
||||
# "mobile": user.mobile,
|
||||
# "city": user.city.name,
|
||||
# "province": user.province.name,
|
||||
# "total_amount": total_unpaid_wage - (total_paid_wage + kill_house.off)
|
||||
# },
|
||||
# status=status.HTTP_200_OK
|
||||
#
|
||||
# )
|
||||
elif role == 'KillHouse':
|
||||
total_unpaid_wage = 0
|
||||
total_paid_wage = 0
|
||||
@@ -19249,10 +19280,14 @@ def get_gate_way_payer_info(request):
|
||||
# total_check_wage = wage_type.amount
|
||||
kill_house = KillHouse.objects.filter(kill_house_operator__user=user, trash=False).first()
|
||||
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), status='completed',
|
||||
trash=False)
|
||||
if kill_house.killer and kill_house.type == 'public':
|
||||
slaughter_transactions = InternalTransaction.objects.filter(
|
||||
kill_house=kill_house,parent_kill_house=kill_house, 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'] or 0
|
||||
@@ -19271,6 +19306,7 @@ def get_gate_way_payer_info(request):
|
||||
status=status.HTTP_200_OK
|
||||
|
||||
)
|
||||
|
||||
else:
|
||||
total_unpaid_wage = 0
|
||||
total_paid_wage = 0
|
||||
|
||||
Reference in New Issue
Block a user