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

Binary file not shown.

View File

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

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)

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.