This commit is contained in:
Xuan Loi
2026-01-04 09:36:20 +07:00
parent 4537064cb6
commit 7416b0e6ee
26 changed files with 29 additions and 1 deletions

View File

@@ -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)