='".$date_paid1."' and DATE(order_date_time) <='".$date_paid12."' "; } if($_REQUEST['from']!="" && $_REQUEST['to']=="" ) { $cond9.="and DATE(order_date_time) ='".$date_paid1."'"; } if($_REQUEST['from']!="" && $_REQUEST['to']=="" ) { $cond9.="and DATE(order_date_time) ='".$date_paid12."'"; } if($_REQUEST['from']!="" && $_REQUEST['to']!="" ) { $cond9.="and DATE(order_date_time) >='".$date_paid1."' and DATE(order_date_time) <='".$date_paid12."' "; } if($_REQUEST['type']==1) { $cond9.="and userid IN (SELECT user_id from shop_user where new_status=0) "; } if($_REQUEST['type']==2) { $cond9.="and userid IN (SELECT user_id from shop_user where new_status=1) "; } $table_name="tbl_confirmorder"; //$Query = "SELECT * from tbl_confirmorder where orderstatus!='4' and refid not like '%CO%'and company_name='Energy Foods' and orderid IN(SELECT orderid from tbl_order) $cond9 order by orid asc"; $Query = "SELECT * from tbl_confirmorder where orderstatus!='4' and orderstatus!=15 and company_name='Energy Foods' and refid not like '%CO%' and orderid IN(SELECT orderid from tbl_order where totprice!=0) $cond9 order by orid asc"; $namesss=$DB->query($Query); $nsssss=mysql_num_rows($namesss); $manssss='0'; $kjjj=0; while ($rowsss = mysql_fetch_array($namesss)) { $pundai_order_id=$rowsss['orid']; if($pundai_order_id>495) { $kudhi=0; } else { $kudhi=10; } $new_orid =$rowsss['orid']; $userid =$rowsss['userid']; $paypalamount =$rowsss['paypalamount']; $varstatus =$rowsss['varstatus']; $varstatus =$rowsss['varstatus']; $orderid=$rowsss['orderid']; $contry=$rowsss['contry']; $state=$rowsss['state']; $order_tc_id =$rowsss['order_tc_id']; $orderstatus =$rowsss['orderstatus']; if($contry=="India") { $sss="Rs"; } else { $sss="$"; } $Query = "SELECT * from `shop_user` where user_id='$userid' "; $name=$DB->query($Query); $no=mysql_num_rows($name); $row = mysql_fetch_array($name); $new_status=$row['new_status']; /*weight calculation*/ $Query_new = "SELECT * from tbl_order where orderid='$orderid'"; $namesss_new=$DB->query($Query_new); $nsssss_new=mysql_num_rows($namesss_new); $x=0; $qty_new=0; $qty_new1=0; $new_qty_1_1=0; $sg=0; $sg1=0; $tot_price_new_1_mal=0; $tot_price_new_1_mal_1=0; while ($rowsss_new = mysql_fetch_array($namesss_new)) { $product_id_new=$rowsss_new['productid']; $qty_new=$rowsss_new['qty']; $unit_pr_new=$rowsss_new['price']; $tot_price_new=$rowsss_new['totprice']; $Query_12_new = "SELECT * from `shop_product` where product_id='$product_id_new' "; $name_12_new=$DB->query($Query_12_new); $no_new=mysql_num_rows($name_12_new); $row_12_new = mysql_fetch_array($name_12_new); $vstatus=$row_12_new['vstatus']; $Query_12_company = "SELECT * from `tbl_company` where id='$vstatus' "; $name_12_company=$DB->query($Query_12_company); $no_company=mysql_num_rows($name_12_company); $row_12_company = mysql_fetch_array($name_12_company); $new_comp_name=$row_12_company['name']; if($new_comp_name=="Siddhayoga Pharma") { $new_price=(($tot_price_new*100)/(100+12)); $sg=number_format((float)$new_price, 2, '.', ''); $n_g="12"; //GST Inclusive Price * GST Rate /(100 + GST Rate Percentage) // Outputs -> 105.00 //GST Inclusive Price * GST Rate /(100 + GST Rate Percentage) } if($new_comp_name=="Energy Foods") { $n_g="18"; //$new_price=(($tot_price*18)/100); $new_price=(($tot_price_new*100)/(100+18)); $sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00 } if($new_comp_name=="Siddha Sastric") { $n_g="5"; //$new_price=(($tot_price*18)/100); $new_price=(($tot_price_new*100)/(100+5)); $sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00 } if($new_comp_name=="Adv. Siddhayoga Research") { $n_g="12"; //$new_price=(($tot_price*18)/100); $new_price=(($tot_price_new*100)/(100+12)); $sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00 } $vstatus=$row_12_new['vstatus']; if($new_status==1) { if($vstatus==1) { $v_qty=($qty_new/2); } if($vstatus==7) { $v_qty=($qty_new/2); } if($vstatus==6) { $v_qty=($qty_new/2); } if($vstatus==2) { $v_qty=($qty_new/4); } $x = (int)$v_qty; } else { $x=0; } $weight=$row_12_new['stock_status_id']; if($weight=='' || $weight==0) { $weight=100; } $qty_new_1=($qty_new+$x); $new_qty=($weight*$qty_new_1); $new_qty_1_1 +=$new_qty; $tot_price_new_1_mal=(($tot_price_new-$sg)/2); $sg1 +=$sg; $tot_price_new_1_mal_1 +=$tot_price_new_1_mal; } $sg1; $tot_price_new_1_mal_1; /*weight calculation*/ $new_qty_1_1; $new_kilo_41=($new_qty_1_1/1000); $new_kilo_5 = explode('.',$new_kilo_41); $new_kilo_6=($new_kilo_5[0]+1); $Query_oo = "SELECT * from `tbl_order` where orderid='$orderid' "; $name_oo=$DB->query($Query_oo); $no_oo=mysql_num_rows($name_oo); $objqrynewsubee = "SELECT SUM(totprice) AS amtTotal FROM tbl_order where orderid='$orderid'"; $name_12_123=$DB->query($objqrynewsubee); $Fetchnewww = mysql_fetch_array($name_12_123); $subtotal_123=$Fetchnewww['amtTotal']; /*shipping*/ $contry; $state; $new_sta=1; if($state=="Tamilnadu") { $new_sta=0; } if($contry=="India") { $packing_charges=round((($subtotal_123*$kudhi)/100)); if($state=="Puducherry") { $packing_charges=0; } if($state=="Tamilnadu") { $packing_charges=0; } $packing_charges; $new_date_mal =$rowsss['order_date_time']; $new_date_mal_1 = date("Y-m-d",strtotime($new_date_mal)); date_default_timezone_set('Asia/Kolkata'); $date_mal_1 = date('2020-09-20', time()); $curdate_mal_1 = strtotime($new_date_mal_1); $curdate_mal_2 = strtotime($date_mal_1); $Query_job_move_courier= "SELECT * from tbl_courier_charges where state='$state' "; $name_12=$DB->query($Query_job_move_courier); $row_job_move_courier= mysql_fetch_array($name_12); //$courier_fees=$row_job_move_courier['amount']; //$courier_fees_para_1=$row_job_move_courier['amount']; if($pundai_order_id>495) { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; } else { if($curdate_mal_1<$curdate_mal_2) { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; if($state=="Puducherry") { $courier_fees=60; $courier_fees_para_1=60; } if($state=="Tamilnadu") { $courier_fees=40; $courier_fees_para_1=40; } if($state=="Andhra Pradesh") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Karnataka") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Kerala") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Telangana") { $courier_fees=150; $courier_fees_para_1=150; } } else { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; if($state=="Puducherry") { $courier_fees=60; $courier_fees_para_1=60; } if($state=="Tamilnadu") { $courier_fees=40; $courier_fees_para_1=40; } if($state=="Andhra Pradesh") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Karnataka") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Kerala") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Telangana") { $courier_fees=100; $courier_fees_para_1=100; } } } if($courier_fees=='') { $Query_job_move_courier_1= "SELECT * from tbl_courier_charges where state='Others' "; $name_12_w=$DB->query($Query_job_move_courier_1); $row_job_move_courier_1= mysql_fetch_array($name_12_w); $courier_fees=$row_job_move_courier_1['amount']; $subtotal_123; $packing_charges123=round((($subtotal_123*$kudhi)/100)); $packing_charges=round((($subtotal_123*$kudhi)/100)); $courier_fees=($courier_fees); } } else { $tot_weight_2_int=$new_qty_1_1; $Query_q= "SELECT * from tbl_courier_charges_country where state='$contry' "; $Query_job_move_courier_country=$DB->query($Query_q); $row_job_move_courier_country= mysql_fetch_array($Query_job_move_courier_country); $num_max_ship_int=mysql_num_rows($Query_job_move_courier_country); if($num_max_ship_int>0) { $courier_fees_country=$row_job_move_courier_country['amount']; $courier_fees_country_extra=$row_job_move_courier_country['additional_amount']; } else { $Query_jo= "SELECT * from tbl_courier_charges_country where state='Others' "; $Query_job_move_courier_country=$DB->query($Query_jo); $row_job_move_courier_country= mysql_fetch_array($Query_job_move_courier_country); $courier_fees_country=$row_job_move_courier_country['amount']; $courier_fees_country_extra=$row_job_move_courier_country['additional_amount']; } if($tot_weight_2_int<=500) { $courier_fees_country_1=$courier_fees_country; $new_kilo_4=$courier_fees_country_1; } else { $tot_weight_2_int_1=($tot_weight_2_int-500); $tot_weight_2_int_1_2=($tot_weight_2_int_1/250); $new_kilo_5_int = explode('.',$tot_weight_2_int_1_2); $new_kilo_6_int=$new_kilo_5_int[0]; $new_kilo_6_int_7=($new_kilo_6_int+1); $new_kilo_6_int_7_8=($courier_fees_country_extra*$new_kilo_6_int_7); $courier_fees_country_1=($courier_fees_country+$new_kilo_6_int_7_8); $new_kilo_4=$courier_fees_country_1; } } $new_courier=(($courier_fees*$new_kilo_6)+$packing_charges); /*shipping*/ if($no_oo>0) { if($orderstatus==0) { $par_status="Placed"; } if($orderstatus==1) { $par_status="Confirmed"; } if($orderstatus==2) { $par_status="Dispatched"; } if($orderstatus==3) { $par_status="Delivered"; } if($orderstatus==4) { $par_status="Refund"; } if($orderstatus==5) { $par_status="Packed"; } //sprintf("%02d", $to_hour); ?>
S.No. Invoice No Date and Time Name State Courier Company Courier Company Courier No Courier No Taxable Value CGST SGST GST Amount Amount Amount Amount Qty Time
Rs
                Patient Rs
                Dealer Rs
                Total Rs