<?php

function RevisiData(){
    global $objAxpDB;
    //$objAxpDB->Allow_Revisi(false);
    $strSQL=array();
    switch($_REQUEST[mode]) {
        case "simpan_revisi":
          // Data lama penonomoran ditambah format '-'
          $ssql1="SELECT IFNULL(MAX(ftjournal_no),'')  AS M
                    FROM txgeneral_journal_hdr
                    WHERE ftjournal_no LIKE '{$_REQUEST['ftjournal_no']}-%'";
          $no=RetRstField($ssql1);
          if($no!="") {
              $no1=explode("-",$no);
              $no=(int)$no1[1]+1;
              $str1="-{$no}";
          }
          else {
              $str1="-1";
          }

          $ftjournal_no_new="{$_REQUEST['ftjournal_no']}{$str1}";

          $strSQL["Revisi"][]="update txgeneral_journal_hdr
                  set fdrevisi_date=now(), ftrevisi_user='{$_SESSION['username']}',
                  fnstatus=3, ftjournal_no='{$ftjournal_no_new}'
                  where ftjournal_no='{$_REQUEST['ftjournal_no']}'";

          $strSQL["Revisi"][]="update txgeneral_journal_det
                  set ftjournal_no='{$ftjournal_no_new}'
                  where ftjournal_no='{$_REQUEST['ftjournal_no']}'";

          break;
    }

    return $strSQL;
}

    