123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- async function bindOrderDetails() {
- debugger
- // validatesession()
- const res = await getAPIServiceLocal(
- "apis/v4/Bizgaze/integrations/products/salesorderdetailsbyphonenumber"
- );
- debugger;
- console.log(res);
- const orderDetailsres = JSON.parse(res.data.result);
- console.log(orderDetailsres);
- let new_arrr = orderDetailsres;
- console.log(new_arrr);
- $(".user_order_details").html(``)
- console.log('hello')
- // $.each(new_arrr, function (key, value) {
- // console.log("a", value);
-
- // $(".user_order_details").append(user_order_details);
- // });
- let user_order_details =``;
- let order_itemTotal = '';
- let order_netTotal = '' ;
- let order_quantity = '' ;
- let order_taxAmount = '' ;
- for(let i=0;i<new_arrr.length;i++){
- let current=new_arrr[i]
- let updatedCurent_total= current.nettotal.toLocaleString()
- order_itemTotal = current.itemtotal;
- order_netTotal = current.nettotal;
- order_quantity =current.Quantity;
- order_taxAmount =current.taxamount;
- user_order_details+= `<div class=" border-3 mb-3"> <a href="#" class="text-dark order_details_main_container"><div class="d-none hi"><span class="order_itemTotal">${order_itemTotal}</span><span class="order_netTotal">${order_netTotal}</span><span class="order_tax">${order_taxAmount}</span> <span class="order_qty">${order_quantity}</span></div> <div class="bg-gray-4 p-2 row g-0"> <div class="col-md-6 "> <div class="d-flex justify-content-between align-items-center"> <div> <p class="mb-1">ORDER PLACED</p><p class="mb-1 order_date">${current.OrderDate}</p></div><div> <p class="mb-1"> TOTAL</p><p class="mb-1 Current_netTotal"> ₹${updatedCurent_total}</p></div><div> <p class="mb-1">Delivered TO </p><p class="mb-1">${current.OrganizationName}</p></div></div></div><div class="col-md-4 ms-auto"> <div> <p class="mb-1 text-end">ORDER NO: <span class="text-secondary fs-9 serial_no">${current.OrderNo}</span> </p></div><div class="d-flex justify-content-between"> <p class="mb-1 text-info"> View order details </p><p class="mb-0 text-info">Invoice</p></div></div></div><div class="border-0 card rounded-0 order-cards py-2"> <div class="row align-items-center"> <div class="col-md-3"> <img src="${current.imageurl}" class="img-fluid w-75"/> </div><div class="col-md-9"> <div class="row align-items-center"> <div class="col-md-8"> <div class="order_item_name">${current.itemname}</div></div><div class="col-md-4"> <button type="button" class="btn btn-sm btn-warning rounded order_details_btn py-0 mb-3" onClick="event.preventDefault();">Track Package</button> <button type="button" class="btn btn-sm btn-light rounded order_details_btn py-0 mb-3 shadow-sm" onClick="event.preventDefault();">Cancel Item</button> </div></div></div></div></div></div>`;
- }
- $(".user_order_details").append(user_order_details);
- // $('.order_details_main_container').click(function(){
- // window.localStorage.setItem("orderNumber", current.OrderNo);
- // window.localStorage.setItem("orderDate", current.OrderNo);
- // });
- $('.order_details_main_container').click(function(){
- let current_order_date= $(this).find('.order_date').text();
- let current_serial_no= $(this).find('.serial_no').text();
- let current_item_name= $(this).find('.order_item_name').text();
- let current_order_itemTotal =$(this).find('.order_itemTotal').text();
- let current_order_netTotal =$(this).find('.order_netTotal').text();
- let current_order_tax =$(this).find('.order_tax').text();
- let current_order_qty =$(this).find('.order_qty').text();
-
- window.localStorage.setItem('orderDate',current_order_date);
- window.localStorage.setItem('orderSerialno',current_serial_no);
- window.localStorage.setItem('orderItemname',current_item_name);
- window.localStorage.setItem('orderitemTotal',current_order_itemTotal);
- window.localStorage.setItem('netTotal',current_order_netTotal)
- window.localStorage.setItem('Qty',current_order_qty)
- window.localStorage.setItem('tax',current_order_tax)
- debugger;
- // console.log(get_local_orderDate,get_local_orderSerialno)
- $(this).attr('href','./orderdetails.html')
- })
- }
- function toasterOpts(){
- toastr.options = {
- "closeButton": true,
- "debug": false,
- "newestOnTop": true,
- "progressBar": true,
- "positionClass": "toast-top-center",
- "preventDuplicates": true,
- "onclick": null,
- "showDuration": "300",
- "hideDuration": "1000",
- "timeOut": "5000",
- "extendedTimeOut": "1000",
- "showEasing": "swing",
- "hideEasing": "linear",
- "showMethod": "fadeIn",
- "hideMethod": "fadeOut"
- }
- }
|