Exemplo n.º 1
0
	if($saved =='true') {
		$display_block =  $LANG['save_payment_success'];
        $paid_to[$SI_PAYMENTS->getLastInsertId()] = $payment_data['ac_amount'];
        $inv_info .= sprintf($inv_info_format,$payment_data['ac_inv_id'],$payment_data['ac_amount']);
	} elseif ($saved == 'false' && $_POST['distribute'] == '1') {
        $display_block = sprintf('%s %f %s %f %s<br />%s',$LANG['something_went_wrong'],$payment_data['ac_amount'],$LANG['of'],$orig_amt,$LANG['save_payment_failure_distribute'],$sql);
    } else {
	    $display_block =  $LANG['save_payment_failure']."<br />".$sql;
	}

    $inv_info .= "</ul>";

    //Append distribution information to pmt notes
    foreach ($paid_to as $sub_pmt_id => $sub_amt) {
        $paid_formatted = sprintf("<br /><br />%s %f %s %f %s",$LANG['payment_of'],$sub_amt,$LANG['payment_larger'],$orig_amt,$LANG['payment_split_over']);
        $paid_formatted .= $inv_info;

        $update_data = array(
            'ac_notes' => new Zend_Db_Expr($SI_PAYMENTS->getAdapter()->quoteInto('CONCAT(ac_notes, ?)', $paid_formatted))
        );
        $SI_PAYMENTS->update($update_data, $sub_pmt_id);
    }

	$refresh_total = "<meta http-equiv='refresh' content='27;url=index.php?module=payments&view=manage' />";
}

$smarty->assign('display_block', $display_block);

$smarty -> assign('pageActive', 'payment');
$smarty -> assign('active_tab', '#money');
?>