Example #1
0
BreadCrumb::setCrumb($title);
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'page', 'sort_column', 'sort_order', 'hide_employer_rows', 'id', 'ids')));
switch ($action) {
    default:
        if (isset($id) and !isset($ids)) {
            $ids = array($id);
        }
        if (count($ids) > 0) {
            $pslf = new PayStubListFactory();
            if ($permission->Check('pay_stub', 'view')) {
                $pslf->getByCompanyIdAndId($current_company->getId(), $ids);
            } else {
                $pslf->getByUserIdAndId($current_user->getId(), $ids);
            }
            //foreach ($ids as $id) {
            $i = 0;
            foreach ($pslf as $pay_stub_obj) {
                $psealf = new PayStubEntryAccountListFactory();
                //Get pay stub entries.
                $pself = new PayStubEntryListFactory();
                $pself->getByPayStubId($pay_stub_obj->getId());
                Debug::text('Pay Stub Entries: ' . $pself->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
                $prev_type = NULL;
                $description_subscript_counter = 1;
                foreach ($pself as $pay_stub_entry) {
                    Debug::text('Pay Stub Entry Account ID: ' . $pay_stub_entry->getPayStubEntryNameId(), __FILE__, __LINE__, __METHOD__, 10);
                    $description_subscript = NULL;
                    //$pay_stub_entry_name_obj = $psenlf->getById( $pay_stub_entry->getPayStubEntryNameId() ) ->getCurrent();