<?php
    function save_log_stock_err() {
        switch($_REQUEST['form']) {
            case "pembelian_stock_masuk":
                $fttrans_no=$_REQUEST['ftstock_in_no'];
                switch($_REQUEST['mode']) {
                    case "simpan":                        
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "batal":
                         SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "revisi":
                         SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                }
                  break;
            case "inventorybb_stock_mutasi":
                 $fttrans_no=$_REQUEST['ftstock_mutation_no'];
                 switch($_REQUEST['mode']) {
                    case "simpan":
                          SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "batal":
                          SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                }
                break;

            case "inventorybb_stock_penyesuaian":
                 $fttrans_no= $_REQUEST['ftstock_adjustment_no'];
                 switch($_REQUEST['mode']) {
                    case "final": 
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "batal":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                }
                break;

            case "inventorybb_surat_jalan_return0":
                $fttrans_no=$_REQUEST['fttrans_no'];
                 switch($_REQUEST['mode']) {
                    case "simpan":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                        break;
                    case "batal":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                        break;
                    case "revisi": 
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                        break;
                }
                break;

            case "inventorybb_stock_masuk_return0":
                 $fttrans_no=$_REQUEST['ftstock_in_return_no'];
                 switch($_REQUEST['mode']) {
                    case "simpan": 
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "batal":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "revisi":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                        break;

                }

                break;

            case "inventorybb_surat_jalan":
                $fttrans_no=$_REQUEST['ftdo_no'];
                    if($_REQUEST['fnitem_type']==2) {
                            switch($_REQUEST['mode']) {
                            case "simpan":
                                  SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                                  break;
                            case "batal":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                                break;
                            case "revisi":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                                break;
                            }
                    }
                break;
            case "inventorybb_surat_jalan_return":
                $fttrans_no=$_REQUEST['fttrans_no'];
                 if($_REQUEST['fnpo_type3']!=1) {
                            switch($_REQUEST['mode']) {
                            case "simpan":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                                 break;
                            case "batal":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                                break;
                            case "revisi":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                                break;

                            }
                    }



                break;
            case "inventorybb_stock_masuk_return":
                $fttrans_no=$_REQUEST['ftstock_in_return_no'];
                 if($_REQUEST['fnpo_type3']!=1) {
                         switch($_REQUEST['mode']) {
                            case "simpan":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                                break;
                            case "batal":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                                break;
                            case "revisi":
                                 SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                                break;
                    }
                 }
                break;
            case "inventorybb_surat_jalan_free":
                 $fttrans_no=$_REQUEST['ftdo_no'];
                if($_REQUEST['fnitem_type']==2) {
                    switch($_REQUEST['mode']) {
                    case "simpan":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);  
                        break;
                    case "batal":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "revisi":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                        break;
                    }
                }
                break;

            case "inventorybb_surat_jalan_sample":
                 $fttrans_no=$_REQUEST['ftdo_no'];
                 if($_REQUEST['fnitem_type']==2) {
                    switch($_REQUEST['mode']) {
                    case "simpan":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);  
                        break;
                    case "batal":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                        break;
                    case "revisi":
                        SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);   
                        break;
                    }
                }
                break;
            case "inventorybb_surat_jalan_jual":
                  $fttrans_no=$_REQUEST['ftdo_no'];
                  if($_REQUEST['fnitem_type']==2) {
                        switch($_REQUEST['mode']) {
                        case "simpan":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "batal":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "revisi":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']); 
                            break;
                        }
                }
                break;
            case "inventorybb_surat_jalan_pinjaman":
                $fttrans_no=$_REQUEST['ftdo_no'];
                 if($_REQUEST['fnitem_type']==2) {
                        switch($_REQUEST['mode']) {
                        case "simpan":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "batal":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "revisi":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        }
                }
                break;
            case "inventorybb_surat_jalan_alat":
                 $fttrans_no=$_REQUEST['ftdo_no'];
                if($_REQUEST['fnitem_type']==2) {
                        switch($_REQUEST['mode']) {
                        case "simpan":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "batal":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "revisi":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        }
                }
                break;

             case "inventorybb_surat_jalan_internal":
                $fttrans_no=$_REQUEST['ftdo_no'];
                if($_REQUEST['fnitem_type']==2) {
                        switch($_REQUEST['mode']) {
                        case "simpan":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "batal":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        case "revisi":
                            SaveLogStock($fttrans_no,$_REQUEST['form']."------".$_REQUEST['mode']);
                            break;
                        }
                }
                break;

        }
    }
?>
