Пример #1
0
            /******      COUNTER END     ******/
            /*******    SECTION HEADER  *******/
                    $strSQL = "INSERT INTO 
                    purchase_order ( 
                    po_no, tgl_po, request_no,
                    id_supplier, flags, 
                    created_datetime, created_user,
                    updated_datetime, updated_user
                    )VALUES (
                    '$rallyPO', now(),'$noReq',
                    $suppID, 4, 
                    now(),'$userLoged',now(),'$userLoged'
                    )";
                    print ($strSQL . '<br />' . '<br />');
                    $exQueryHead  = mysql_query($strSQL) or die("FAILED INPHead!! \n Please contact PT. Priatman ");
                    updateNextNo('PO',$baseCountZero+1,$nextPONO,'action/generate_po');
            /*******     END HEADER     *******/
            /*******    START DETAIL    *******/
/*                $countFetch = getSingleData("SELECT COUNT(ID) FROM generate_po where supp_id=$suppID and request_no='$noReq'");
                print $countFetch ;
                for($i=1;$i<=$countFetch;$i++){
*/                    $strSQL = "SELECT * FROM generate_po where supp_id = '$suppID' and request_no='$noReq'";
                    $exQueryDet = mysql_query($strSQL);
                    print $strSQL . '<br />' . '<br />';
                    while ($fetchDetail = mysql_fetch_array($exQueryDet)){
                        $strSQL = "INSERT INTO 
                        purchase_orderdetail (
                        no_po, no_spb, barang_id, qty_po, harga_po, subtotal,
                        created_datetime, created_user,
                        updated_datetime, updated_user,
                        fld01
Пример #2
0
function resetNo($iType, $frmSource){
    if($iType = 'PO'){
            $head = 'PON' ; 
        }else{ 
            $head = $iType ;
        }
    $resetVal = ($head."/". date("dmy").'0001');
    updateNextNo($iType,1,$resetVal,$frmSource);
    $ret = getNo($iType);
    return ($ret);
}