Exemplo n.º 1
0
        $search_journal = 4;
        break;
    case 7:
        $search_journal = 6;
        break;
    case 12:
        $search_journal = 10;
        break;
    case 13:
        $search_journal = 12;
        break;
    default:
        $search_journal = false;
}
if ($search_journal) {
    if ($open_order_array = load_open_orders($cID, $search_journal)) {
        echo createXmlHeader($function_name) . xmlEntry('result', 'fail') . createXmlFooter();
        die;
    }
}
$contact = $db->Execute("select * from " . TABLE_CONTACTS . " where id = '" . $cID . "'");
$terms_type = $type == 'v' ? 'AP' : 'AR';
$contact->fields['terms_text'] = gen_terms_to_language($contact->fields['special_terms'], true, $terms_type);
$contact->fields['ship_gl_acct_id'] = $type == 'v' ? AP_DEF_FREIGHT_ACCT : AR_DEF_FREIGHT_ACCT;
$bill_add = $db->Execute("select * from " . TABLE_ADDRESS_BOOK . " \r\n  where ref_id = '" . $cID . "' and type in ('" . $type . "m', '" . $type . "b')");
//fix some special fields
if (!$contact->fields['dept_rep_id']) {
    unset($contact->fields['dept_rep_id']);
}
// clear the rep field if not set to a contact
$ship_add = $db->Execute("select * from " . TABLE_ADDRESS_BOOK . " \r\n  where ref_id = '" . $cID . "' and type in ('" . $type . "m', '" . $type . "s')");
</th>
		  <th><?php 
echo TEXT_DATE;
?>
</th>
		  <th><?php 
echo TEXT_PAID;
?>
</th>
		  <th><?php 
echo TEXT_AMOUNT;
?>
</th></tr>
      <?php 
// then Sales/Purchases
$result = load_open_orders($cInfo->id, '6, 7, 21', false, LIMIT_HISTORY_RESULTS);
if ($result) {
    array_shift($result);
    // the first entry is for new stuff, don't display
    foreach ($result as $value) {
        echo '<tr><td><a href="' . html_href_link(FILENAME_DEFAULT, 'cat=orders&amp;module=orders&amp;action=edit&amp;jID=' . ($type == 'v' ? 6 : 12) . '&amp;oID=' . $value['id'], 'SSL') . '">' . $value['purchase_invoice_id'] . ACT_ACTION_OPEN . '</a></td>';
        echo '<td>' . ($value['purch_order_id'] ? $value['purch_order_id'] : '&nbsp;') . '</td>';
        echo '<td align="center">' . gen_spiffycal_db_date_short($value['post_date']) . '</td>';
        echo '<td align="center">' . ($value['closed'] ? TEXT_YES : '&nbsp;') . '</td>';
        echo '<td align="right">' . $currencies->format($value['total_amount']) . '</td></tr>';
    }
} else {
    echo '<tr><td align="center" colspan="5">' . ACT_NO_RESULTS . '</td></tr>';
}
?>
		</table>
Exemplo n.º 3
0
        case 13:
            switch (JOURNAL_ID) {
                case 6:
                    $search_journal = 4;
                    break;
                case 7:
                    $search_journal = 6;
                    break;
                case 12:
                    $search_journal = 10;
                    break;
                case 13:
                    $search_journal = 12;
                    break;
            }
            $open_order_array = load_open_orders($acct_id, $search_journal);
            if ($open_order_array) {
                $selection = html_pull_down_menu('open_order_' . $pointer, $open_order_array, '', 'onchange="setReturnOrder(' . $pointer . ')"');
                $cancel_single_result_exit = true;
            } else {
                $selection = html_hidden_field('open_order_' . $pointer, '');
            }
            break;
        default:
            $selection = html_hidden_field('open_order_' . $pointer, '') . '&nbsp;';
    }
    if ($cancel_single_result_exit) {
        ?>
	  <td class="dataTableContent" ><?php 
        echo $selection;
        ?>
</th>
		  <th><?php 
echo TEXT_DATE;
?>
</th>
		  <th><?php 
echo TEXT_PAID;
?>
</th>
		  <th><?php 
echo TEXT_AMOUNT;
?>
</th></tr>
      <?php 
// then Sales/Purchases
$result = load_open_orders($cInfo->id, '12, 13, 19', false, LIMIT_HISTORY_RESULTS);
if ($result) {
    array_shift($result);
    // the first entry is for new stuff, don't display
    foreach ($result as $value) {
        echo '<tr><td><a href="' . html_href_link(FILENAME_DEFAULT, 'cat=orders&amp;module=orders&amp;action=edit&amp;jID=' . $value['journal_id'] . '&amp;oID=' . $value['id'], 'SSL') . '">' . $value['purchase_invoice_id'] . ACT_ACTION_OPEN . '</a></td>';
        echo '<td>' . ($value['purch_order_id'] ? $value['purch_order_id'] : '&nbsp;') . '</td>';
        echo '<td align="center">' . gen_spiffycal_db_date_short($value['post_date']) . '</td>';
        echo '<td align="center">' . ($value['closed'] ? TEXT_YES : '&nbsp;') . '</td>';
        echo '<td align="right">' . $currencies->format($value['total_amount']) . '</td></tr>';
    }
} else {
    echo '<tr><td align="center" colspan="5">' . ACT_NO_RESULTS . '</td></tr>';
}
?>
		</table>