function createPO($postatus, $potanggal, $lyidsupp, $pocreated){ if(empty($poNo)){ $poNo = reserveNo("PO","content/po_man.php"); $poStatus = $postatus; $poReqNo = "POM/" . date("dmy") ; $poDate = $potanggal; $poSupplier = $lyidsupp; $poCreator = $pocreated; $strSQLPoMan = "Insert into purchase_order (`po_no`, `tgl_po`, `request_no`, `id_supplier`, `flags`, `total_price`, `percent_discount`, `discount_amount`, `after_discount`, `ppn_amount`, `grand_total` , `total_items`, `created_datetime`, `created_user`, `updated_datetime`, `updated_user`) VALUES ('$poNo', '$poDate', '$poReqNo', '$poSupplier', 2, '0', '0', '0', '0', '0','0','0', now(), '$poCreator', now(),'$poCreator')"; //$execGo = execSQL($strSQLPoMan); $retCreate = array("$poNo", "$poReqNo", "$poDate", "$poSupplier", "$poCreator"); return($retCreate); } else{ } }
</script> </head> <body> <?php $tahun = date("y"); $qp = mysql_query("SELECT * FROM mr WHERE type='SPB'"); $rp = mysql_fetch_array($qp); $lastNO = $rp['full_no']; $tgl = substr($lastNO,8,2); if ($tgl == $tahun) { $count = $rp['next_no']; $no_req = reserveNo('SPB', 'content/mr_auto'); } else { $count = 1; $no_req = resetNo('SPB','content/mr_auto'); } /* if ($tgl == $tahun) { $temp = $rp['param_no']; $count = $temp + 1; } else { $temp = 1;