$orderno = $result1->order_no; $supplierno = $result1->supplier_id; $datecreated = $result1->order_date; $orderedby = $result1->ordered_by; } $supplier = $purchaseorder->get_supplier($supplierno); echo $purchaseorder->generate_order($orderno, $supplier, $orderedby, $datecreated); } else { if ($_POST['add'] && $_REQUEST['mode'] == "order_items") { $order_id = $_REQUEST['orderid']; $product_Id = $_POST['product_id']; $quantity = $_POST['quantity']; $unitcost = $_POST['unitprice']; $amount = $quantity * $unitcost; $purchaseorder->add_order_items($order_id, $product_Id, $quantity, $unitcost, $amount); $stat = new grn_goods(); $stat->update_purchase_order_status($orderno); $order1 = $purchaseorder->get_order($order_id); while ($result1 = $purchaseorder->fetch_object($order1)) { $orderno = $result1->order_no; $supplierno = $result1->supplier_id; $datecreated = $result1->order_date; $orderedby = $result1->ordered_by; } $supplier = $purchaseorder->get_supplier($supplierno); echo $purchaseorder->generate_order($orderno, $supplier, $orderedby, $datecreated); } else { if ($_REQUEST['mode'] == "show") { $order_id = $_REQUEST['order_id']; $order1 = $purchaseorder->get_order($order_id); while ($result1 = $purchaseorder->fetch_object($order1)) {
</form> <?php } else { if (isset($_POST['receiveitem'])) { $no = $_POST['itemno']; $grno = $_REQUEST['grno']; $orderno = $_REQUEST['orderno']; $itemid = $_POST['itemid']; $oquantity = $_POST['oquantity']; $rquantity = $_POST['rquantity']; $invototal = $rquantity * $_POST['uprice']; $status = $_POST['cash_credit']; $batch = $_POST['batchno']; $expdate = $_POST['expdate']; $process = new grn_goods(); $process->dbconnect(); $process->dbselect(); if ($process->add_grn_detail($no, $grno, $orderno, $itemid, $oquantity, $rquantity, $invototal, $status, $batch, $expdate)) { $process->update_invoice_grn_master($grno, $orderno, $invototal); $process->update_purchase_detail($no, $orderno, $rquantity); $process->update_purchase_order_status($orderno); $additem->insert_item($itemid, 1, $batch, $expdate, $rquantity); echo "The Item is succesful received. "; $data = $process->get_grn_details($orderno); echo "\n<table padding='2' cellspacing='2' border='1'>\n<tr bgcolor='#CCCCCC'>\n<th>Item name</th><th>Oder number</th><th>Ordered quntity</th><th>Received quanity</th><th>Unit price</th><th>Order Amount</th><th>Invoice Amount</th><th>Receive</th>\n</tr>"; while ($row = $process->fetch_object($data)) { $trans_no = $row->no; $order_no = $row->order_no; $item_id = $row->itid; $orderedquantity = $row->quantity;