emile 1 year ago
parent a944ac1e20
commit 25128fcc53

@ -58,9 +58,16 @@ class Order(models.Model):
return None return None
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if not self.order_id: if not self.order_id:
order_count = Order.objects.filter(customer=self.customer).count() current_year_last_two_digits = timezone.now().strftime('%y')
order_count_str = str(order_count).zfill(4) last_order = Order.objects.filter(order_id__startswith=f'O{current_year_last_two_digits}').order_by('-order_id').first()
self.order_id = f"{self.customer.customer_id}-{order_count_str}" if last_order:
last_order_number = int(last_order.order_id[4:])
new_order_number = last_order_number + 1
else:
new_order_number = 0
new_order_number_str = str(new_order_number).zfill(4)
self.order_id = f'O{current_year_last_two_digits}{new_order_number_str}'
super(Order, self).save(*args, **kwargs) super(Order, self).save(*args, **kwargs)

@ -17,7 +17,7 @@ def items(request, *args, **kwargs):
def orders(request, *args, **kwargs): def orders(request, *args, **kwargs):
orders = Order.objects.all().order_by('-id') orders = Order.objects.all().filter(orderstatus__isnull=False).order_by('-id')
context = { context = {
'orders': orders, 'orders': orders,
} }

@ -126,9 +126,9 @@ def buy_now(request, item_id):
@customer_login_required @customer_login_required
def buy_now_checkout(request): def buy_now_checkout(request):
api_username = 'merchant.TEST06127800' api_username = 'merchant.06127800'
api_password = '37846250a67c70e7fe9f82cf6ca81f93' api_password = '549c33e1bc4aea6fcf96f9943e6c0256'
merchant_id = 'TEST06127800' merchant_id = '06127800'
merchant_name = 'Ositcom Sal' merchant_name = 'Ositcom Sal'
customer = request.user.customerprofile customer = request.user.customerprofile

@ -39,12 +39,19 @@
<h1 class="text-gray-500 text-[17px] font-light">Features:</h1> <h1 class="text-gray-500 text-[17px] font-light">Features:</h1>
<div class="w-full flex flex-col"> <div class="w-full flex flex-col">
<div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 text-red-500">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
</svg>
<p class="font-light text-secondosiblue">One business</p>
</div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 text-yellow-500"> stroke="currentColor" class="w-6 h-6 text-yellow-500">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg> </svg>
<p class="font-light text-secondosiblue">One user</p> <p class="font-light text-secondosiblue">One profile</p>
</div> </div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
@ -131,19 +138,26 @@
<h1 class="text-gray-500 text-[17px] font-light">Features:</h1> <h1 class="text-gray-500 text-[17px] font-light">Features:</h1>
<div class="w-full flex flex-col"> <div class="w-full flex flex-col">
<div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-green-600">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg>
<p class="font-light text-secondosiblue">One business</p>
</div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-yellow-500"> stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-yellow-500">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg> </svg>
<p class="font-light text-secondosiblue">One user</p> <p class="font-light text-secondosiblue">10 profiles</p>
</div> </div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-yellow-500"> stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-yellow-500">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg> </svg>
<p class="font-light text-secondosiblue">One digital business card</p> <p class="font-light text-secondosiblue">10 digital business cards</p>
</div> </div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
@ -223,14 +237,21 @@
stroke="currentColor" class="w-6 h-6 text-green-600"> stroke="currentColor" class="w-6 h-6 text-green-600">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg> </svg>
<p class="font-light text-secondosiblue">Unlimited user</p> <p class="font-light text-secondosiblue">One business</p>
</div>
<div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 text-green-600">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg>
<p class="font-light text-secondosiblue">Unlimited profiles</p>
</div> </div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 text-green-600"> stroke="currentColor" class="w-6 h-6 text-green-600">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
</svg> </svg>
<p class="font-light text-secondosiblue">Unlimited digital business card</p> <p class="font-light text-secondosiblue">Unlimited digital business cards</p>
</div> </div>
<div class="flex justify-start items-center gap-2 py-1"> <div class="flex justify-start items-center gap-2 py-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"

Binary file not shown.
Loading…
Cancel
Save