changes
This commit is contained in:
Binary file not shown.
@@ -99,4 +99,31 @@ def account_entry(request):
|
||||
if 'error' in data:
|
||||
return Response(data, status=400)
|
||||
|
||||
return Response(data)
|
||||
return Response(data)
|
||||
|
||||
|
||||
#==========================================================================================
|
||||
@api_view(['POST'])
|
||||
def account_multi_entry(request):
|
||||
try:
|
||||
result = []
|
||||
data = request.data.get('data')
|
||||
for obj in data:
|
||||
row = account_entry_api(
|
||||
code=obj['Tài khoản'],
|
||||
amount=obj['amount'],
|
||||
content=obj['content'],
|
||||
type='CR',
|
||||
category=obj['category'],
|
||||
userid=request.data.get('user'),
|
||||
ref=obj['ref'],
|
||||
product=obj['product'],
|
||||
customer=obj['customer']
|
||||
)
|
||||
result.append(row)
|
||||
|
||||
return Response(result)
|
||||
|
||||
except Exception as e:
|
||||
print({'error': f"Đã xảy ra lỗi không mong muốn: {str(e)}"})
|
||||
return Response(data, status=400)
|
||||
Reference in New Issue
Block a user