<?php
/**********************Helper Preference*********************/

/*******************Preference Featured**********************/
function format_txt_no_invoice($edit_invoice_set){   
    if($edit_invoice_set == '0'){
        $action_txt_incoive = 'onclick="cek_invoice_txt();" readonly';
    } 
    else {
        $action_txt_incoive ='';
    }
	
    return $action_txt_incoive;
}

function format_cmb_salesman($use_salesmasn_set){
    if($use_salesmasn_set == '0'){
        $action_cmb_salesman = 'style="display:none;"';
    } 
    else {
        $action_cmb_salesman ='';
    }
	
    return $action_cmb_salesman;
}

/****************Preference Sales************/
function format_show_warning_under_cogs($price){
    if($price < 10000){
        $action_under_cogs = 'onclick="show_warning_under_cogs();"';
    } 
    else {
        $action_under_cogs ='';
    }
	
    return $action_under_cogs;
}

/****************Preference Purchases************/

/****************Preference Cost And Profit Center************/

/****************Preference Job Costing************/

/****************Misceleneous************************/
function format_numbering($number){	
    //$CI->load->model('m_preference');
    $rounding   = 100;
    $mod        = $number%$rounding;

    if($mod == 0){
        $result = $number;
    }
    elseif($mod >= 50){
        $result = $number - $mod + 100;
    }
    else{
        $result = $number - $mod - 100;
    }
    
    return $result;
}

?>