<?php
/**********************************************************************
    Copyright (C) FrontAccounting, LLC.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
include_once($path_to_root . "/admin/db/voiding_db.inc");
include_once($path_to_root . "/includes/types.inc");

//--------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------

function collection_get_customer_trans_view_str($type, $trans_no, $label="", $icon=false, 
	$class='', $id='')
{
	$viewer = "modules/CollectionPayment/";

	if ($type == ST_SALESINVOICE)
		$viewer .= "defer.php";
	else
		return null;

  if(!is_array($trans_no)) $trans_no = array($trans_no);

  $lbl = $label;
  $preview_str = '';

  foreach($trans_no as $trans) {
	if ($label == "")
		$lbl = $trans;
	if($preview_str!='') $preview_str .= ',';

	$preview_str .= viewer_link($lbl, $viewer."?trans_no=$trans&trans_type=$type", 
		$class, $id, $icon);

  }
  return $preview_str;
}

//--------------------------------------------------------------------------------------

function collection_get_trans_view_str($type, $trans_no, $label="", $icon=false, 
	$class='', $id='')
{
	$view_str = collection_get_customer_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
	if ($view_str != null)
		return $view_str;

	return null;
}


