changes
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -42,6 +42,7 @@ urlpatterns = [
|
||||
re_path('password/(?P<text>.+)/$', views.get_password),
|
||||
re_path('exportcsv/(?P<name>.+)/$', views.export_csv),
|
||||
re_path('account-entry/$', payment.account_entry),
|
||||
re_path('account-multi-entry/$', payment.account_multi_entry),
|
||||
re_path('close-of-business/$', cob.close_of_business),
|
||||
re_path('create-contract/', contract.create_contract),
|
||||
re_path('data-deletion/', cleardata.data_deletion),
|
||||
|
||||
Binary file not shown.
@@ -100,3 +100,30 @@ def account_entry(request):
|
||||
return Response(data, status=400)
|
||||
|
||||
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)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user