query($sql); $_GET["emp_id"] = ""; $_GET["department"] = ""; if($result->num_rows > 0){ while($row = $result->fetch_assoc()){ $string = decrypt('decrypt',$_GET["token"],$row["key1"],$row["key2"]); $string = explode("$",$string); $_GET["emp_id"] = $string[0]; $_GET["department"] = $string[1]; break; } $txt = '{"process": "FRONTEND", "token": "'.$token.'", "action": "'.$_GET["type"].'", "actiontime": "'.$entry_date.'", "department": "'.$_GET["department"].'", "emp_id": "'.$_GET["emp_id"].'", "method": "'.$_SERVER['REQUEST_METHOD'].'", "REMOTE_ADDR": "'.$_SERVER['REMOTE_ADDR'].'"}'; $myfile = file_put_contents('../../logs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX); if ($_GET["type"] == "saveDirectPO") { $total_value = round($input["total"]); $round_value = round(round($input["total"])-$input["total"],2); $total_value = floatval($input["total"])+floatval($round_value); $sql = "INSERT INTO purchaseorder (user_no, po_type, vendor_no,broker_name,broker_per, gross_total, gst_total, other_charges, net_total, terms_conditions, entry_by, entry_date, discount, requirement_days, delivery_schedule_date, delivery_address, delivery_type, booking_location, disc_amt, final_total,billcompany_code, shipcompany_code,rounding) VALUES ('".$_GET["user_no"]."', 'Finish Goods', '".$input["vendor_no"]."','".$input["agent_name"]."','".$input["broker_per"]."', '".$input["gross_total"]."', '".$input["gst_total"]."', '".$input["other_charges"]."', '".$input["net_total"]."', '".json_encode($input["terms_conditions"])."', '".$_GET["emp_id"]."', '$entry_date', '".$input["discount"]."', '".$input["requirement_days"]."', '".$input["delivery_schedule_date"]."', '".$input["delivery_address"]."', '".$input["delivery_type"]."', '".$input["booking_location"]."', '".$input["dis_amt"]."', '".$total_value."','".$input["billcompany_code"]."','".$input["shipcompany_code"]."','".$round_value."')"; if ($conn->query($sql)) { $last_id = $conn->insert_id; echo "{\"status\":\"success\"}"; $materials = $input["materials"]; for ($i = 0; $i < count($materials); $i++) { $material = $materials[$i]; if ($material["required_for"] == "Own") { $material["client_code"] = ""; } $sql1 = "INSERT INTO po_material (user_no, po_no, po_type, material_code, qty, unit, requirement, quotation_amt, gst, gross_total, tax_total, net_total, required_for, client_code) VALUES ('".$_GET["user_no"]."', '".$last_id."','Finish Goods', '".$material["material_code"]."', '".$material["qty"]."', '".$material["unit"]."', '".$material["requirement"]."', '".$material["rate"]."', '".$material["gst"]."', '".$material["gross_total"]."', '".$material["tax_total"]."', '".$material["net_total"]."', '".$material["required_for"]."', '".$material["client_code"]."')"; $conn->query($sql1); } } else { echo "{\"status\":\"".$conn->error."\"}"; } } else if ($_GET["type"] == "saveIndendPO") { $sql = "INSERT INTO purchaseorder (user_no, po_type, vendor_no, gross_total, gst_total, net_total, terms_conditions, entry_by, entry_date, discount, requirement_days, delivery_schedule_date, delivery_address) VALUES ('".$_GET["user_no"]."', 'Finish Goods', '".$input["vendor_no"]."', '".$input["gross_total"]."', '".$input["gst_total"]."', '".$input["net_total"]."', '".json_encode($input["terms_conditions"])."', '".$_GET["emp_id"]."', '$entry_date', '".$input["discount"]."', '".$input["requirement_days"]."', '".$input["delivery_schedule_date"]."', '".$input["delivery_address"]."')"; if ($conn->query($sql)) { $last_id = $conn->insert_id; echo "{\"status\":\"success\"}"; $materials = $input["materials"]; for ($i = 0; $i < count($materials); $i++) { $material = $materials[$i]; if ($material["required_for"] == "Own") { $material["client_code"] = ""; } $sql1 = "INSERT INTO po_material (user_no, po_no,po_type, material_code, qty, unit, requirement,quotation_no, quotation_amt, gst, gross_total, tax_total, net_total, required_for, client_code, indend_no,po_indend) VALUES ('".$_GET["user_no"]."', '".$last_id."','Finish Goods','".$material["material_code"]."', '".$material["qty"]."', '".$material["unit"]."', '".$material["requirement"]."','".$material["quotation_no"]."', '".$material["quotation_amt"]."', '".$material["gst"]."', '".$material["gross_total"]."', '".$material["gst_total"]."', '".$material["net_total"]."', '".$material["required_for"]."', '".$material["client_code"]."', '".$material["indend_no"]."','Approve')"; $conn->query($sql1); $sql2 = "UPDATE finish_indend SET po_indend='Approve' WHERE material_code='".$material["material_code"]."'"; $conn->query($sql2); } } else { echo "{\"status\":\"".$conn->error."\"}"; } } else if ($_GET["type"] == "saveIndendPONew") {//Modified by devaraj $datas = $input["data"]; $pos = json_decode(json_encode($datas)); $Po_Group ="FG"; $last_id=0; foreach ($pos as $po) { $sql = "Select count(*) as count from purchaseorder where Po_Group = '".$Po_Group."' "; $result = $conn->query($sql); while($row = $result->fetch_assoc()){ $last_id = $row['count']; } if($last_id==0){ $last_id=1; } $length = 4; $total_value = round($po->net_total); $round_value = round(round($po->net_total)-$po->net_total,2); $total_value = floatval($po->net_total)+floatval($round_value); $number = substr(str_repeat(0, $length).$last_id, - $length); $PO_NO = $Po_Group."/PURHO/05".$last_id."/2022-23"; $sql = "INSERT INTO purchaseorder (user_no, po_no, po_type, vendor_no, gross_total, gst_total, net_total, terms_conditions, entry_by, entry_date, discount, requirement_days, delivery_schedule_date, delivery_address,department,billcompany_code,shipcompany_code, transport, local_transport,purchase_type,currancy,currancy_rate,term_local_transport,Po_Group,Fin_Year,indent_no,rounding,final_total) VALUES ('".$_GET["user_no"]."','".$PO_NO."', 'Raw Material', '".$po->vendor_no."', '".$po->gross_total."', '".$po->gst_total."', '".$po->net_total."', '".json_encode($po->terms_conditions)."', '".$_GET["emp_id"]."', '$entry_date', '".$po->discount."', '".$po->requirement_days."', '".$po->delivery_schedule_date."', '".$po->delivery_address."','".$po->department."', '".$po->billcompany_code."','".$po->shipcompany_code."','".$po->transport."','".$po->local_transport."','".$po->purchase_type."', '".$po->currancy."','".$po->currancy_rate."','".$po->term_local_transport."','".$Po_Group."','2002-23','".$po->indent_no."' ,'".$round_value."','".$total_value."')"; //echo $sql; // echo $po->materials; if ($conn->query($sql)) { $last_id = $conn->insert_id; $materials = json_decode(json_encode($po->materials)); foreach ($materials as $mat) { //echo $mat->material_code." ".$mat->required_for, "\n"; if ($mat->required_for == "Own") { $mat->client_code = ""; } $sql1 = "INSERT INTO po_material (user_no, po_no,po_type, material_code, qty, unit, requirement,quotation_no, quotation_amt, gst, gross_total, tax_total, net_total, required_for, client_code, indend_no,po_indend) VALUES ('".$_GET["user_no"]."', '".$last_id."','Raw Material', '".$mat->material_code."', '".$mat->order_qty."', '".$mat->unit."', '".$mat->requirement."','".$mat->quotation_no."', '".$mat->quotation_amt."', '".$mat->gst."', '".$mat->gross_total."', '".$mat->gst_total."', '".$mat->net_total."', '".$mat->required_for."', '".$mat->client_code."', '".$mat->indend_no."','Approve')"; $conn->query($sql1); $sql2 = "UPDATE finish_indend SET po_indend='Approve' WHERE id='".$mat->id."'"; $conn->query($sql2); } } } echo "{\"status\":\"success\"}"; } /*else if ($_GET["type"] == "getPendingIndend") { $output = Array(); $sql = "SELECT i.*, v.vendor_name, v.email, v.gst_no, v.address_corporate, a.agent_name FROM finish_indend i LEFT JOIN vendor v ON i.vendor_no=v.vendor_no LEFT JOIN agent a ON p.broker_name=a.agent_no WHERE i.user_no='".$_GET["user_no"]."' AND i.status='pending' AND i.indend_no NOT IN (SELECT indend_no FROM po_material WHERE user_no='".$_GET["user_no"]."' AND indend_no !='') GROUP BY i.vendor_no"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $gross_total = 0; $gst_total = 0; $net_total = 0; $output1 = Array(); $sql1 = "SELECT i.*, m.material_type, m.material_subtype, m.material_name, m.grade FROM finish_indend i LEFT JOIN material m ON i.material_code=m.material_code WHERE i.user_no='".$_GET["user_no"]."' AND i.status='pending' AND i.vendor_no='".$row["vendor_no"]."'"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $gross_total += +$row1["gross_total"]; $gst_total += +$row1["gst_total"]; $net_total += +$row1["net_total"]; if ($row["required_for"] !== 'Own') { $sql2 = "SELECT * FROM client WHERE user_no='".$_GET["user_no"]."' AND client_code='".$row1["client_code"]."'"; $result2 = $conn->query($sql2); if ($result2->num_rows > 0) { while ($row2 = $result2->fetch_assoc()) { $row1["client_name"] = $row2["company"]; } } } else { $row1["client_code"] = "NA"; } $output1[] = $row1; } } $row["gross_total"] = $gross_total; $row["gst_total"] = $gst_total; $row["net_total"] = $net_total; $row["indends"] = $output1; $output[] = $row; } } echo json_encode($output); } */ else if ($_GET["type"] == "getPendingIndend") { $output = Array(); $sql = "SELECT i.*, v.vendor_name, v.email, v.gst_no, v.address FROM finish_indend i LEFT JOIN vendor v ON i.vendor_no=v.vendor_no WHERE i.status='approve' AND i.indend_no NOT IN (SELECT indend_no FROM po_material WHERE user_no='".$_GET["user_no"]."' AND indend_no !='') "; //echo $sql; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $gross_total = 0; $gst_total = 0; $net_total = 0; $output1 = Array(); $sql1 = "SELECT i.*,m.material_type, m.material_subtype, m.material_name, m.grade FROM finish_indend i LEFT JOIN material m ON i.material_code=m.material_code LEFT JOIN po_material p ON p.indend_no=i.indend_no WHERE i.status='approve' AND i.po_indend='pending' AND i.vendor_no='".$row["vendor_no"]."'"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $gross_total += +$row1["gross_total"]; $gst_total += +$row1["gst_total"]; $net_total += +$row1["net_total"]; if ($row["required_for"] !== 'Own') { $sql2 = "SELECT * FROM client WHERE user_no='".$_GET["user_no"]."' AND client_code='".$row1["client_code"]."'"; $result2 = $conn->query($sql2); if ($result2->num_rows > 0) { while ($row2 = $result2->fetch_assoc()) { $row1["client_name"] = $row2["company"]; } } } else { $row1["client_code"] = "NA"; } $output1[] = $row1; } } $row["gross_total"] = $gross_total; $row["gst_total"] = $gst_total; $row["net_total"] = $net_total; $row["indends"] = $output1; $output[] = $row; } } echo json_encode($output); } else if ($_GET["type"] == "getPendingPO") { $output = array(); $sql = "SELECT p.*, v.vendor_name, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode, a.agent_name FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN agent a ON p.broker_name=a.agent_no WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Finish Goods' AND p.status='Pending'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $output1 = array(); $sql1 = "SELECT p.*, m.material_name, m.grade, m.material_subtype FROM po_material p LEFT JOIN material m ON p.material_code=m.material_code WHERE p.po_no='".$row["id"]."'AND p.po_type='Finish Goods' AND (p.po_indend='Approve' OR p.material_status='pending') GROUP BY p.id"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $output1[] = $row1; } } $row["materials"] = $output1; $output[] = $row; } } echo json_encode($output); } else if ($_GET["type"] == "checkPO") { $sql = "UPDATE purchaseorder SET status='".$_GET["status"]."', approve_by='".$_GET["emp_id"]."', approve_date='".$entry_date."' WHERE id='".$_GET["id"]."'"; if ($conn->query($sql)) { echo "{\"status\":\"success\"}"; } else { echo "{\"status\":\"".$conn->error."\"}"; } } else if ($_GET["type"] == "getPOLog") { $output = array(); $sql = "SELECT p.*, v.vendor_name, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode, a.agent_name FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN agent a ON p.broker_name=a.agent_no WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Finish Goods' AND p.vendor_no LIKE '%".$_GET["vendor_no"]."' AND DATE(p.entry_date) BETWEEN '".$_GET["from_date"]."' AND '".$_GET["to_date"]."' AND p.status LIKE '%".$_GET["status"]."%'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $output1 = array(); $sql1 = "SELECT p.*, m.material_name, m.grade, m.material_subtype FROM po_material p LEFT JOIN material m ON p.material_code=m.material_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_no='".$row["id"]."' GROUP BY p.id"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $output1[] = $row1; } } $row["materials"] = $output1; $output[] = $row; } } echo json_encode($output); } else if ($_GET["type"] == "getRejectedPO") { $output = array(); $sql = "SLELECT * FROM purchaseorder WHERE user_no='".$_GET["user_no"]."' AND po_type='Finish Goods' AND status='Rejected'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $output1 = array(); $sql1 = "SELECT p.*, m.material_name, m.grade, m.material_subtype FROM po_material p LEFT JOIN material m ON p.material_code=m.material_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_no='".$_GET["id"]."' GROUP BY p.id"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $output1[] = $row1; } } $row["materials"] = $output1; $output[] = $row; } } echo json_encode($output); } else if ($_GET["type"] == "ammendPO") { $sql = "INSERT INTO purchaseorder (user_no, po_type, vendor_no, requirement_days, gross_total, gst_total, net_total, terms_conditions, entry_by, entry_date, discount, delivery_schedule_date, delivery_address) VALUES ('".$_GET["user_no"]."', 'Finish Goods', '".$input["vendor_no"]."', '".$input["requirement_days"]."', '".$input["gross_total"]."', '".$input["gst_total"]."', '".$input["net_total"]."', '".json_encode($input["terms_conditions"])."', '".$_GET["emp_id"]."', '$entry_date', '".$input["discount"]."', '".$input["delivery_schedule_date"]."', '".$input["delivery_address"]."')"; if ($conn->query($sql)) { $last_id = $conn->insert_id; echo "{\"status\":\"success\"}"; $sql = "UPDATE purchaseorder SET status='ammendment' WHERE id='".$input["id"]."'"; $conn->query($sql); $materials = $input["materials"]; for ($i = 0; $i < count($materials); $i++) { $material = $materials[$i]; $sql1 = "INSERT INTO po_material (user_no, po_no, material_code, qty, unit, requirement, quotation_amt, gst, gross_total, tax_total, net_total, required_for, client_code) VALUES ('".$_GET["user_no"]."', '".$last_id."', '".$material["material_code"]."', '".$material["qty"]."', '".$material["unit"]."', '".$material["requirement"]."', '".$material["quotation_amt"]."', '".$material["gst"]."', '".$material["gross_total"]."', '".$material["tax_total"]."', '".$material["net_total"]."', '".$material["required_for"]."', '".$material["client_code"]."')"; $conn->query($sql1); } } else { echo "{\"status\":\"".$conn->error."\"}"; } } else if ($_GET["type"] == "getPODetails") { $sql = "SELECT p.*, v.vendor_name, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Finish Goods' AND p.status='approve' AND p.id='".$_GET["id"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $output1 = array(); $sql1 = "SELECT p.*, m.material_name, m.grade, m.material_subtype FROM po_material p LEFT JOIN material m ON p.material_code=m.material_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_no='".$_GET["id"]."' GROUP BY p.id"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $output1[] = $row1; } } $row["materials"] = $output1; $row["terms_conditions"] = json_decode($row["terms_conditions"]); echo json_encode($row); } } else { echo "{}"; } }else if($_GET['type'] == 'downloadPOLog'){ $_GET['filename'] = 'PURCHASE ORDER LOG'; $_GET['pdftype'] = 'landscape'; include("../../pdfimp.php"); $html.=' '; $i=1; $sql = "SELECT p.*, v.vendor_name, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode, a.agent_name FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN agent a ON p.broker_name=a.agent_no WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Finish Goods' AND p.vendor_no LIKE '%".$_GET["vendor_no"]."' AND DATE(p.entry_date) BETWEEN '".$_GET["from_date"]."' AND '".$_GET["to_date"]."' AND p.status LIKE '%".$_GET["status"]."%'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $output1 = array(); $sql1 = "SELECT p.*, m.material_name, m.grade, m.material_subtype FROM po_material p LEFT JOIN material m ON p.material_code=m.material_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_no='".$row["id"]."' GROUP BY p.id"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $output1[] = $row1; $row["materials"] = $output1; $html.=' '; $i++; } } } } $html.='
Sr. Date PO No. Vendor Name Broker Name Broker Percentage Discount Gross Total Tax Total Net Total status
'.$i.' '.date('d-m-Y',strtotime($row['entry_date'])).' '.$row["po_no"].' '.$row["vendor_name"].' '.$row['agent_name'].' '.$row['broker_per'].' '.$row['discount'].' '.$row["gross_total"].' '.$row["gst_total"].' '.$row['net_total'].' '.$row['status'].'
'; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Output('PurchaseOrder.pdf', 'I'); } else if ($_GET["type"] == "download") { $_GET['filename'] = ''; $_GET['pdftype'] = 'onlyheader'; include("../../pdfimp.php"); $html= ""; //$sql = "SELECT p.*,q.quotation_no,q.approve_date FROM purchaseorder p LEFT JOIN quotation q ON p.vendor_no=q.vendor_no WHERE p.po_type='Raw Material' AND p.id='".$_GET["id"]."'"; $sql = "SELECT p.*, DATE_FORMAT(DATE(p.entry_date),'%d-%m-%Y') as entry_date, v.vendor_name,v.tel_no1,v.email,v.mobile_no, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode, s.state_name ,q.quotation_no,q.approve_date FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN quotation q ON p.vendor_no=q.vendor_no LEFT JOIN state s ON v.state_code=s.state_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Finish Goods' AND p.id='".$_GET["id"]."'"; $result = $conn->query($sql); $j=1; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $html.='

PurchaseOrder

'; $html.="
TO
'.$row['vendor_name'].'
'.$row['address_factory'].'
Phone No:'.$row['tel_no1'].'
Email:'.$row['email'].'
Mobile:'.$row['mobile_no'].'
GST No:'.$row['gst_no'].'
Purchase Ord. No.:'.$row['po_no'].'
Purchase Ord. Date:'.$row['entry_date'].'
Quotation Ref. No.:'.$row['quotation_no'].'
Quotation Date:'.$row['approve_date'].'
IMPORTANT : PLS. MENTION OUR G.S.T. & C.S.T. NO. IN YOUR INVOICE/CHALLANS. MATERIAL SH\'D BE DELIVERED TO OUR GOTA-FACTORY BEFORE 4.00 P.M.
Dear Sir,
Please supply the following item(s) as per your quotation reffered to above and as per terms and condition stated overleaf
Item Name HSN No Design No Delivery Date Qty Rate IGST Total
SubTotal
Discount '.$row['discount'].'
Total
Order Place By : Advance amount : Credit Days :
Booking At : Bill In Favour of : Dispatch By :
Range : Payment Terms : Delivery At :
Division : Mode of Trans. : Remarks :
Drug Lic No : CST No: : E.C.C. No. :
  1. Our TIN No.:24075200479 Dt. 14.09.2005 , C.S.T.No. 24575200479: Dt. 14.09.2005, GST No: 24AAACW7013Q1Z2 Dt. Pan No: AAACW7013Q
  2. Drug License No: 20B-GJ-AD2-76997 (Dt.03/07/2018), New E.C.C.No.: AAACW7013QXM001
  3. Don’t supply if our PO is not signed by authorized signatory.
  4. Please confirm above order & mention our P.O. No. in all Correspondence & documents.
  5. You are responsible for goods delivery to our Godown in proper packing.
  6. We will not pay any charge for extra packing, postage or Forwarding.
  7. Material should be delivered to our GOTA-FACTORY before 4.00 P.M.
  8. Supply of Raw Material should be of latest Mfg Batch with Less No. Of Batches.
  9. Deliver the goods along with Delivery Challans, Gate Pass and Invoice..
  10. If Delivery of goods from outside state the Octroi limit, enclose the Octroi Receipts with the Invoice.
  11. The test report, COA, other valid documents of the batches supplied will be required with the invoice.
  12. Send MTR & other documents only to our factory address.
  13. Kindly mention Manufacturing Date, Expiry Date, Name of Manufacturer in Invoice.
  14. Kindly mentioned our G.S.T & C.S.T No in your invoices/challans.
  15. Kindly update on the minimum available packing for future purchase.
  16. If Quantity of goods supplied will be more than 10% to the PO then we will raise Debit Note.
  17. Supplier is responsible up to the complete testing done in laboratory.
  18. We will raise Debit Note if rates are higher as per mutually confirmed rate.
  19. Supply of Raw Material should be of latest Mfg. Batch, 3 Month old Mfg.Material not Accepted.
  20. Any Raw Material Self Life Minimum 4 Years.
Purchase For
Thanking You
Yours Faithfully,
WEST-COAST PHRMACEUTICAL WORKS LTD
Purchase Department
Mobile
Email
For any further inquiry please contact on above stated no.
"; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Output('Po Report.pdf', 'I'); break; } } }else if ($_GET["type"] == "downloadPOReport") { $_GET['filename'] = ''; $_GET['pdftype'] = 'onlyheader'; include("../../pdfimp.php"); $html= ""; $sql = "SELECT p.*, v.vendor_name, v.address_corporate, v.address_factory, v.gst_no, v.location, v.state_code, v.pincode, a.agent_name FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN agent a ON p.broker_name=a.agent_no WHERE p.id='".$_GET["id"]."'"; //$sql = "SELECT p.*,q.quotation_no,q.approve_date FROM purchaseorder p LEFT JOIN quotation q ON p.vendor_no=q.vendor_no WHERE p.po_type='Raw Material' AND p.id='".$_GET["id"]."'"; //$sql = "SELECT p.*, DATE_FORMAT(DATE(p.entry_date),'%d-%m-%Y') as entry_date, v.vendor_name,v.tel_no1,v.email,v.mobile_no, v.address_corporate, v.address, v.gst_no, v.location, v.state_code, v.pincode, s.state_name ,q.quotation_no,q.approve_date FROM purchaseorder p LEFT JOIN vendor v ON p.vendor_no=v.vendor_no LEFT JOIN quotation q ON p.vendor_no=q.vendor_no LEFT JOIN state s ON v.state_code=s.state_code WHERE p.user_no='".$_GET["user_no"]."' AND p.po_type='Raw Material' AND p.id='".$_GET["id"]."'"; $result = $conn->query($sql); $j=1; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $html.='

PurchaseOrder

Bill To SHIP TO P.O NUMBER
West Coast Pharmaceuticals
Location:Opp Sola Bhagwat, Near Prasang Party Plot,,Near Meldi Mata Temple, Meldi Estate,,GOTA,AHMEDABAD INDIA-382481
'.$row['vendor_name'].'
Location:'.$row['address'].''.$row['address_factory'].'
Email:'.$row['email'].'
Mobile No:'.$row['mobile_no'].'
PO No :'.$row['po_no'].'
PO Type :'.$row['po_type'].'
PO Date :'.date('d-m-Y',strtotime($row['entry_date'])).'
P.O Date Requisitioner Shipped Via F.O.B Point Terms
'.date('d-m-Y',strtotime($row['entry_date'])).' West Coast Pharmaceuticals
'; $sql1 = "SELECT * FROM po_material WHERE id='".$_GET["id"]."'"; $result1 = $conn->query($sql1); if ($result1->num_rows > 0) { while ($row1 = $result1->fetch_assoc()) { $html.=' '; } } $sql2 = "SELECT * FROM po_material WHERE id='".$_GET["id"]."'"; $result2 = $conn->query($sql1); if ($result2->num_rows > 0) { while ($row2 = $result2->fetch_assoc()) { $html.=' '; } } $html.='
Qty Unit Description Unit Price Total
'.$row1['qty'].' '.$row1['unit'].' '.$row1['quotation_amt'].' '.$row1['gross_total'].'
  • Please send two copies of your invoice.
  • Enter this order in accordance with the prices, terms, delivery method, and specifications listed above
  • Please notify us immediately if you are unable to ship as specified.
  • Send all correspondence to:
Sub Total '.$row2['gross_total'].'
Sub Total Sales Tax '.$row2['tax_total'].'
Shipping & Handling
Other
Total '.$row2['net_total'].'
'; $html.='
Checked By & Digital Signed By Approved By & Digital Signed By
Name :'.$row['entry_by'].'
ID :
Department :
Date :'.date('d-m-Y',strtotime($row['entry_date'])).' Time :'.date('H:i:s',strtotime($row['entry_date'])).'
Name :'.$row['approve_by'].'
ID :
Department :
Date :'.date('d-m-Y',strtotime($row['approve_date'])).' Time :'.date('H:i:s',strtotime($row['approve_date'])).'
'; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Output('Po Report.pdf', 'I'); break; } } } } else { echo "{\"status\":\"invalid\"}"; } $conn->close(); ?>