-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
update add transaction module
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends 'layout.html' %} | ||
{% load static translater%} | ||
{% load i18n %} | ||
{% block content %} | ||
<div class="mt-3 mb-4 min-h-screen mx-5"> | ||
<div class="card max-w-full"> | ||
<div class="card-body p-[1rem]"> | ||
<div class=""> | ||
Laporan Toko <b>{{ user_toko }}</b> | ||
</div> | ||
<div> | ||
<table class="w-full"> | ||
<tr> | ||
<td class="w-[1rem]" >Pembeli</td> | ||
<td class="px-1 w-[.1rem]">:</td> | ||
<td>-</td> | ||
</tr> | ||
<tr> | ||
<td class="w-[1rem]">Catatan</td> | ||
<td class="px-1 w-[.1rem]">:</td> | ||
<td></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
{% block bottom_nav %} | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from django.shortcuts import redirect, render | ||
from django.utils.decorators import method_decorator | ||
from django.views.decorators.csrf import csrf_exempt | ||
|
||
from frontend.views.base_view import FrontPage | ||
from store.models import UserStore | ||
from transaction.models import Report, ReportImage | ||
Check failure on line 7 in frontend/views/toko/report.py GitHub Actions / buildRuff (F401)
Check failure on line 7 in frontend/views/toko/report.py GitHub Actions / buildRuff (F401)
Check failure on line 7 in frontend/views/toko/report.py GitHub Actions / buildRuff (F401)
Check failure on line 7 in frontend/views/toko/report.py GitHub Actions / buildRuff (F401)
Check failure on line 7 in frontend/views/toko/report.py GitHub Actions / buildRuff (F401)
|
||
|
||
|
||
@method_decorator(csrf_exempt, name="dispatch") | ||
class ReportToko(FrontPage): | ||
def get(self, request, id): | ||
user_setting = request.user.id | ||
Check failure on line 13 in frontend/views/toko/report.py GitHub Actions / buildRuff (F841)
Check failure on line 13 in frontend/views/toko/report.py GitHub Actions / buildRuff (F841)
|
||
user_toko = request.user.userstore_set.first() | ||
return render(request, "toko/report.html", {"user_toko": user_toko}) | ||
|
||
def post(self, request, id): | ||
user = UserStore.objects.filter(users_id=id).first() | ||
if user is None: | ||
user = UserStore.objects.create(users_id=id) | ||
if request.POST.get("setuju"): | ||
user.aggrement = True | ||
else: | ||
user.aggrement = False | ||
user.save() | ||
return redirect("/toko/" + str(id)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ class Meta: | |
|
||
class DistricAdmin(ImportExportModelAdmin): | ||
resource_classes = [DistricResource] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,3 @@ class Meta: | |
|
||
class ProvinsiAdmin(ImportExportModelAdmin): | ||
resource_classes = [ProvinsiResource] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ class Meta: | |
|
||
class RegencyAdmin(ImportExportModelAdmin): | ||
resource_classes = [RegencyResource] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
from django.db import models | ||
from master.utils import SOURCE_REQUEST | ||
|
||
|
||
class Expedisi(models.Model): | ||
SOURCE_REQUEST = [ | ||
(1, "Raja Ongkir"), | ||
(2, "Biteship"), | ||
] | ||
code = models.CharField(max_length=255, null=True, blank=True) | ||
nama = models.CharField(max_length=255) | ||
url_request = models.URLField(null=True, blank=True) | ||
source_request = models.IntegerField(choices=SOURCE_REQUEST, default=1) | ||
|
||
def __str__(self): | ||
return self.nama | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SOURCE_REQUEST = [ | ||
(1, "Raja Ongkir"), | ||
(2, "Biteship"), | ||
] |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.