function edit_link($row)
{
    if (@$_GET['popup']) {
        return '';
    }
    return pager_link(_("Edit"), "/purchasing/po_entry_items.php?" . SID . "ModifyOrderNumber=" . $row["order_no"], ICON_EDIT);
}
function edit_link($row)
{
    //return $row["closed"] ?  '' :
    //	pager_link(_("Edit"),
    //		"/dimensions/dimension_entry.php?trans_no=" . $row["id"], ICON_EDIT);
    return pager_link(_("Edit"), "/dimensions/dimension_entry.php?trans_no=" . $row["id"], ICON_EDIT);
}
function alloc_link($row)
{
    if (($row["type"] == ST_BANKPAYMENT || $row["type"] == ST_SUPPCREDIT || $row["type"] == ST_SUPPAYMENT) && -$row["TotalAmount"] - $row["Allocated"] >= 0) {
        return pager_link(_("Allocations"), "/purchasing/allocations/supplier_allocate.php?trans_no=" . $row["trans_no"] . "&trans_type=" . $row["type"] . "&supplier_id=" . $row["supplier_id"], ICON_ALLOC);
    } elseif ($row["type"] == ST_SUPPINVOICE && $row["TotalAmount"] - $row["Allocated"] > 0) {
        return pager_link(_("Pay"), "/purchasing/supplier_payment.php?supplier_id=" . $row["supplier_id"] . "&PInvoice=" . $row["trans_no"], ICON_MONEY);
    } else {
        return '';
    }
}
function edit_link($row)
{
    global $editors;
    $ok = true;
    if ($row['type'] == ST_SALESINVOICE) {
        $myrow = get_customer_trans($row["type_no"], $row["type"]);
        if ($myrow['alloc'] != 0 || get_voided_entry(ST_SALESINVOICE, $row["type_no"]) !== false) {
            $ok = false;
        }
    }
    return isset($editors[$row["type"]]) && !is_closed_trans($row["type"], $row["type_no"]) && $ok ? pager_link(_("Edit"), sprintf($editors[$row["type"]], $row["type_no"], $row["type"]), ICON_EDIT) : '';
}
function alloc_link($row)
{
    $link = pager_link(_("Allocation"), "/sales/allocations/customer_allocate.php?trans_no=" . $row["trans_no"] . "&trans_type=" . $row["type"] . "&debtor_no=" . $row["debtor_no"], ICON_ALLOC);
    if ($row["type"] == ST_CUSTCREDIT && $row['TotalAmount'] > 0) {
        /*its a credit note which could have an allocation */
        return $link;
    } elseif (($row["type"] == ST_CUSTPAYMENT || $row["type"] == ST_BANKDEPOSIT) && floatcmp($row['TotalAmount'], $row['Allocated']) >= 0) {
        /*its a receipt  which could have an allocation*/
        return $link;
    } elseif ($row["type"] == ST_CUSTPAYMENT && $row['TotalAmount'] <= 0) {
        /*its a negative receipt */
        return '';
    } elseif ($row["type"] == ST_SALESINVOICE && $row['TotalAmount'] - $row['Allocated'] > 0) {
        return pager_link(_("Payment"), "/sales/customer_payments.php?customer_id=" . $row["debtor_no"] . "&SInvoice=" . $row["trans_no"], ICON_MONEY);
    }
}
/**
 * Creates a basic link bar for a given paginator.
 * 
 * Options :
 * - param_name : the routing name for the paginator (default : page)
 * - window_size : the number of pages to show around the current page (default : 2)
 * - show_anchors : whether or not the first and last pages should be shown (default : true)
 * - link_to_current_page : whether or not the current page should be linked to (default : false)
 * - params : any additional routing parameters for page URLs
 */
function pager($paginator, $options = array(), $html_options = array())
{
    $param_name = !isset($options['param_name']) ? 'page' : $options['param_name'];
    $window_size = !isset($options['window_size']) ? 2 : $options['window_size'];
    $show_anchors = !isset($options['show_anchors']) ? True : $options['show_anchors'];
    $params = !isset($options['params']) ? array() : $options['params'];
    $link_to_current_page = !isset($options['link_to_current_page']) ? array() : $options['link_to_current_page'];
    $current_page = $paginator->currentPage;
    $page_count = $paginator->pageCount();
    $window_pages = $paginator->windowPages($window_size);
    $wp_count = count($window_pages);
    $first = 1;
    $last = $page_count;
    $html = '';
    if ($show_anchors && ($wp_first = $window_pages[0]) != $first) {
        $html .= pager_link($first, $param_name, $params, $html_options);
        if ($wp_first - $first > 1) {
            $html .= '...';
        }
        $html .= ' ';
    }
    foreach ($window_pages as $page) {
        if ($current_page == $page && !$link_to_current_page) {
            $html .= $page;
        } else {
            $html .= pager_link($page, $param_name, $params, $html_options);
        }
        $html .= ' ';
    }
    if ($show_anchors && ($wp_last = $window_pages[$wp_count - 1]) != $last) {
        if ($last - $wp_last > 1) {
            $html .= '...';
        }
        $html .= pager_link($last, $param_name, $params, $html_options);
    }
    return $html;
}
function costs_link($row)
{
    /*
    	return $row["closed"] || !$row["released"] ? '' :
    		pager_link(_('Costs'),
    			"/gl/gl_bank.php?NewPayment=1&PayType=" 
    			.PT_WORKORDER. "&PayPerson=" .$row["id"]);
    */
    return $row["closed"] || !$row["released"] ? '' : pager_link(_('Costs'), "/manufacturing/work_order_costs.php?trans_no=" . $row["id"]);
}
function edit_link($row)
{
    if (@$_GET['popup'] || get_voided_entry($row['type'], $row["trans_no"]) || is_closed_trans($row['type'], $row["trans_no"])) {
        return '';
    }
    $str = '';
    switch ($row['type']) {
        case ST_SALESINVOICE:
            $str = "/sales/customer_invoice.php?ModifyInvoice=" . $row['trans_no'];
            break;
        case ST_CUSTCREDIT:
            if ($row['order_'] == 0) {
                // free-hand credit note
                $str = "/sales/credit_note_entry.php?ModifyCredit=" . $row['trans_no'];
            } else {
                // credit invoice
                $str = "/sales/customer_credit_invoice.php?ModifyCredit=" . $row['trans_no'];
            }
            break;
        case ST_CUSTDELIVERY:
            $str = "/sales/customer_delivery.php?ModifyDelivery=" . $row['trans_no'];
            break;
        case ST_CUSTPAYMENT:
            $str = "/sales/customer_payments.php?trans_no=" . $row['trans_no'];
            break;
    }
    return $str ? pager_link(_('Edit'), $str, ICON_EDIT) : '';
}
Exemple #9
0
function receive_link($row)
{
    return pager_link(_("Receive"), "/purchasing/po_receive_items.php?PONumber=" . $row["order_no"], ICON_RECEIVE);
}
Exemple #10
0
function credit_link($row)
{
    if (@$_GET['popup']) {
        return '';
    }
    return $row['type'] == ST_SUPPINVOICE && $row["TotalAmount"] - $row["Allocated"] > 0 ? pager_link(_("Credit This"), "/purchasing/supplier_credit.php?New=1&invoice_no=" . $row['trans_no'], ICON_CREDIT) : '';
}
function invoice_link($row)
{
    return $row["Outstanding"] == 0 ? '' : pager_link(_('Invoice'), "/sales/customer_invoice.php?DeliveryNumber=" . $row['trans_no'], ICON_DOC);
}
function select_link($row)
{
    return pager_link($row["parent"] . " - " . $row["description"], "/manufacturing/manage/bom_edit.php?stock_id=" . $row["parent"]);
}
function alloc_link($row)
{
    return pager_link(_("Allocate"), "/sales/allocations/customer_allocate.php?trans_no=" . $row["trans_no"] . "&trans_type=" . $row["type"] . "&debtor_no=" . $row["debtor_no"], ICON_ALLOC);
}
function order_link($row)
{
    return pager_link(_("Sales Order"), "/sales/sales_order_entry.php?NewQuoteToSalesOrder=" . $row['order_no'], ICON_DOC);
}
function edit_link($row)
{
    $str = '';
    if (@$_GET['popup']) {
        return '';
    }
    switch ($row['type']) {
        case ST_SALESINVOICE:
            if (get_voided_entry(ST_SALESINVOICE, $row["trans_no"]) === false && $row['Allocated'] == 0) {
                $str = "/sales/customer_invoice.php?ModifyInvoice=" . $row['trans_no'];
            }
            break;
        case ST_CUSTCREDIT:
            if (get_voided_entry(ST_CUSTCREDIT, $row["trans_no"]) === false && $row['Allocated'] == 0) {
                if ($row['order_'] == 0) {
                    // free-hand credit note
                    $str = "/sales/credit_note_entry.php?ModifyCredit=" . $row['trans_no'];
                } else {
                    // credit invoice
                    $str = "/sales/customer_credit_invoice.php?ModifyCredit=" . $row['trans_no'];
                }
            }
            break;
        case ST_CUSTDELIVERY:
            if (get_voided_entry(ST_CUSTDELIVERY, $row["trans_no"]) === false) {
                $str = "/sales/customer_delivery.php?ModifyDelivery=" . $row['trans_no'];
            }
            break;
        case ST_CUSTPAYMENT:
            if (get_voided_entry(ST_CUSTPAYMENT, $row["trans_no"]) === false) {
                $str = "/sales/customer_payments.php?trans_no=" . $row['trans_no'];
            }
            break;
    }
    if ($str != "" && !is_closed_trans($row['type'], $row["trans_no"])) {
        return pager_link(_('Edit'), $str, ICON_EDIT);
    }
    return '';
}
function alloc_link($row)
{
    return pager_link(_("Allocate"), "/purchasing/allocations/supplier_allocate.php?trans_no=" . $row["trans_no"] . "&trans_type=" . $row["type"], ICON_MONEY);
}