<?php
/**********************************************************************
***********************************************************************/


function process_jobq_stock_count($jqr){
    global $path_to_root;
    
    $parameters_json = $jqr['parameters'];
    $parameters_json = str_replace("&quot;", '"', $parameters_json);
    $stock_count_parameters = json_decode($parameters_json,true);
    
    $stock_count_no = $stock_count_parameters[0]['stock_count_no'];
    $stock_count_processing_type = $stock_count_parameters[0]['stock_count_processing_type'];

    start_processing_jobq_request($jqr['id']);
    
    if($stock_count_processing_type == "PROCESS"){
            
            include_once($path_to_root."/inventory/includes/process_stock_count.inc");
            include_once($path_to_root."/inventory/includes/db/complete_stock_count_db.inc");
            include_once($path_to_root."/inventory/includes/db/stock_count_db.inc");

            $msg = process_stock_count_job($stock_count_no);
    }
    elseif(stock_count_processing_type == "COMPLETE"){
        
    }
    else{
            $msg = array("success" => false, "message" => _("Unknown stock_count_processing_type [".$stock_count_processing_type."]"));
    }

    $msg["trans_no"] = $stock_count_no;
    complete_jobq_request($jqr, $msg);
    
}


?>
