Esempio n. 1
0
 function Output($params)
 {
     global $db, $currencies;
     // Build control box form data
     $control = '<div class="row">';
     $control .= '<div style="white-space:nowrap">' . TEXT_SHOW . TEXT_SHOW_NO_LIMIT;
     $control .= '<select name="num_rows" onchange="">';
     for ($i = 0; $i < MAX_NUM_SO_LIST; $i++) {
         $control .= '<option value="' . $i . '"' . ($params['num_rows'] == $i ? ' selected="selected"' : '') . '>' . $i . '</option>';
     }
     $control .= '</select> ' . TEXT_ITEMS . '&nbsp;&nbsp;&nbsp;&nbsp;';
     $control .= '<input type="submit" value="' . TEXT_SAVE . '" />';
     $control .= '</div></div>';
     // Build content box
     $sql = "select id, post_date, purchase_invoice_id, bill_primary_name, total_amount, currencies_code, currencies_value \r\n\t\t\tfrom " . TABLE_JOURNAL_MAIN . " \r\n\t\t\twhere journal_id = 10 and closed = '0' order by post_date DESC";
     if ($params['num_rows']) {
         $sql .= " limit " . $params['num_rows'];
     }
     $result = $db->Execute($sql);
     if ($result->RecordCount() < 1) {
         $contents = CP_SO_STATUS_NO_RESULTS;
     } else {
         while (!$result->EOF) {
             $contents .= '<div style="float:right">' . $currencies->format_full($result->fields['total_amount'], true, $result->fields['currencies_code'], $result->fields['currencies_value']) . '</div>';
             $contents .= '<div>';
             $contents .= '<a href="' . html_href_link(FILENAME_DEFAULT, 'cat=orders&amp;module=orders&amp;oID=' . $result->fields['id'] . '&amp;jID=10&amp;action=edit', 'SSL') . '">';
             $contents .= $result->fields['purchase_invoice_id'] . ' - ';
             $contents .= gen_spiffycal_db_date_short($result->fields['post_date']);
             $name = strlen($result->fields['bill_primary_name']) > 20 ? substr($result->fields['bill_primary_name'], 0, 20) . '...' : $result->fields['bill_primary_name'];
             $contents .= ' ' . htmlspecialchars($name);
             $contents .= '</a></div>' . chr(10);
             $result->MoveNext();
         }
     }
     return $this->build_div($this->title, $contents, $control);
 }
            }
            $result->MoveNext();
            $last_fy->MoveNext();
        }
        break;
    default:
}
/*****************   prepare to display templates  *************************/
$result = $db->Execute("select period, start_date, end_date from " . TABLE_ACCOUNTING_PERIODS . " \r\n\twhere fiscal_year = '" . $fy . "' order by period");
$last_fy = $db->Execute("select period from " . TABLE_ACCOUNTING_PERIODS . " \r\n\twhere fiscal_year = '" . ($fy - 1) . "' order by period");
$next_fy = $db->Execute("select period from " . TABLE_ACCOUNTING_PERIODS . " \r\n\twhere fiscal_year = '" . ($fy + 1) . "' order by period");
$periods = array();
$lf_per = array();
$nf_per = array();
while (!$result->EOF) {
    $periods[$result->fields['period']] = $result->fields['period'] . ' - ' . gen_spiffycal_db_date_short($result->fields['start_date']) . ' - ' . gen_spiffycal_db_date_short($result->fields['end_date']);
    if (!$last_fy->EOF) {
        $lf_per[$last_fy->fields['period']] = 1;
    }
    if (!$next_fy->EOF) {
        $nf_per[$next_fy->fields['period']] = 1;
    }
    $result->MoveNext();
    $last_fy->MoveNext();
    $next_fy->MoveNext();
}
$result = $db->Execute("select id, period, budget from " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \r\n\twhere account_id = '" . $gl_acct . "' and period in (" . implode(',', array_keys($periods)) . ")");
if ($gl_acct && sizeof($lf_per) > 0) {
    $last_fy = $db->Execute("select budget from " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \r\n\twhere account_id = '" . $gl_acct . "' and period in (" . implode(',', array_keys($lf_per)) . ")");
} else {
    $next_fy = new objectInfo();
Esempio n. 3
0
<script type="text/javascript">
<!--
ajaxRH["skuDetails"] = "processSkuDetails";
ajaxRH["skuStock"]   = "processSkuStock";
ajaxRH["loadRecord"] = "processEditAdjustment";

// pass any php variables generated during pre-process that are used in the javascript functions.
// Include translations here as well.
var adj_qty = 0;
var unit_price_placeholder = false;
var unit_price_note = '<?php 
echo JS_COGS_AUTO_CALC;
?>
';
var dateReference = new ctlSpiffyCalendarBox("dateReference", "inv_adj", "post_date","btnDate1", "<?php 
echo isset($cInfo->post_date) ? gen_spiffycal_db_date_short($cInfo->post_date) : date(DATE_FORMAT, time());
?>
", scBTNMODE_CALBTN);

function init() {
  cssjsmenu('navbar');
  document.getElementById('sku_1').focus();
<?php 
if ($action == 'edit') {
    echo '  EditAdjustment(' . $oID . ')';
}
?>

}

function check_form() {
Esempio n. 4
0
    }
    // replace bID with ID from payment
} else {
    $bill = new objectInfo();
}
// select the customer and build the contact record
$contact = $db->Execute("select * from " . TABLE_CONTACTS . " where id = '" . $cID . "'");
$type = $contact->fields['type'];
define('ACCOUNT_TYPE', $type);
$bill_add = $db->Execute("select * from " . TABLE_ADDRESS_BOOK . " \r\n  where ref_id = '" . $cID . "' and type in ('" . $type . "m', '" . $type . "b')");
// fetch the line items
$invoices = fill_paid_invoice_array($bID, $cID, $type);
$item_list = $invoices['invoices'];
// some adjustments based on what we are doing
$bill->fields['payment_fields'] = $invoices['payment_fields'];
$bill->fields['post_date'] = gen_spiffycal_db_date_short($bill->fields['post_date']);
// build the form data
if ($contact->fields) {
    $xml .= "\t<contact>\n";
    foreach ($contact->fields as $key => $value) {
        $xml .= "\t\t" . xmlEntry($key, $value);
    }
    $xml .= "\t</contact>\n";
}
if ($bill_add->fields) {
    while (!$bill_add->EOF) {
        $xml .= "\t<billaddress>\n";
        foreach ($bill_add->fields as $key => $value) {
            $xml .= "\t\t" . xmlEntry($key, $value);
        }
        $xml .= "\t</billaddress>\n";
function ProcessData($strData, $Process)
{
    global $currencies, $posted_currencies, $rw_xtra_jrnl_defs;
    //echo 'process = ' . $Process . ' and posted cur = '; print_r($posted_currencies); echo '<br />';
    switch ($Process) {
        case "uc":
            return strtoupper_utf8($strData);
        case "lc":
            return strtolower_utf8($strData);
        case "neg":
            return -$strData;
        case "rnd2d":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return number_format(round($strData, 2), 2, '.', '');
            }
        case "rnd_dec":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return $currencies->format($strData);
            }
        case "rnd_pre":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return $currencies->precise($strData);
            }
        case "def_cur":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return $currencies->format_full($strData, true, DEFAULT_CURRENCY, 1, 'fpdf');
            }
        case "null_dcur":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return !$strData ? '' : $currencies->format_full($strData, true, DEFAULT_CURRENCY, 1, 'fpdf');
            }
        case "posted_cur":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return $currencies->format_full($strData, true, $posted_currencies['currencies_code'], $posted_currencies['currencies_value'], 'fpdf');
            }
        case "null_pcur":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return !$strData ? '' : $currencies->format_full($strData, true, $posted_currencies['currencies_code'], $posted_currencies['currencies_value'], 'fpdf');
            }
        case "dlr":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return '$ ' . number_format(round($strData, 2), 2);
            }
        case "euro":
            if (!is_numeric($strData)) {
                return $strData;
            } else {
                return chr(128) . ' ' . number_format(round($strData, 2), 2);
            }
            // assumes standard FPDF fonts
        // assumes standard FPDF fonts
        case "n2wrd":
            return value_to_words_en_us($strData);
            // for checks primarily
        // for checks primarily
        case "terms":
            return gen_terms_to_language($strData, $short = true, $type = 'ar');
        case "date":
            return gen_spiffycal_db_date_short($strData);
        case "null-dlr":
            return !$strData ? '' : '$ ' . number_format($strData, 2);
        case "ordr_qty":
            return pull_order_qty($strData);
        case "branch":
            return rw_get_branch_name($strData);
        case "rep_id":
            return rw_get_user_name($strData);
        case "ship_name":
            return rw_get_ship_name($strData);
        case 'j_desc':
            return isset($rw_xtra_jrnl_defs[$strData]) ? $rw_xtra_jrnl_defs[$strData] : $strData;
        case 'yesBno':
            return $strData ? TEXT_YES : '';
        case 'printed':
            return $strData ? '' : TEXT_DUPLICATE;
    }
    $processed_value = false;
    if (function_exists('rw_extra_processing')) {
        $processed_value = rw_extra_processing($strData, $Process);
    }
    return $processed_value === false ? $strData : $processed_value;
    // do nothing if Process not recognized
}
Esempio n. 6
0
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/services/shipping/label_mgr/item/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass any php variables generated during pre-process that are used in the javascript functions.
// Include translations here as well.
var dateShipped = new ctlSpiffyCalendarBox("dateShipped", "label_mgr", "ship_date","btnDate2", "<?php 
echo isset($sInfo->ship_date) ? gen_spiffycal_db_date_short($sInfo->ship_date) : date('m/d/Y', time());
?>
", scBTNMODE_CALBTN);
var dateExpected = new ctlSpiffyCalendarBox("dateExpected", "label_mgr", "deliver_date","btnDate2", "<?php 
echo isset($sInfo->deliver_date) ? gen_spiffycal_db_date_short($sInfo->deliver_date) : date('m/d/Y', time());
?>
", scBTNMODE_CALBTN);

function init() {
  <?php 
if (!$error && ($action == 'save' || $action == 'delete')) {
    echo '  window.opener.location.reload();' . chr(10);
    echo '  self.close();' . chr(10);
}
?>
}

function check_form() {
  return true;
}
    case '9':
    case '10':
    case '12':
        //  case  '19':
        // check for stock available for SO, Customer Quote and Sales
        if ($qty > $inventory->fields['branch_qty_in_stock'] && strpos(COG_ITEM_TYPES, $inventory->fields['inventory_type']) !== false) {
            $stock_note = array(ORD_INV_STOCK_LOW);
            $stock_note[] = ORD_INV_STOCK_BAL . $inventory->fields['branch_qty_in_stock'];
            // fetch open orders
            $sku_history = gather_history($inventory->fields['sku']);
            if (is_array($sku_history['open_po'])) {
                $stock_note[] = ORD_INV_OPEN_POS;
                foreach ($sku_history['open_po'] as $value) {
                    $store = $value['store_id'] ? gen_get_account_name($value['store_id']) : COMPANY_NAME;
                    // get name from id
                    $stock_note[] = sprintf(ORD_INV_STOCK_STATUS, $store, $value['purchase_invoice_id'], $value['qty'], gen_spiffycal_db_date_short($value['date_1']));
                }
            }
        }
        break;
    case '7':
    case '13':
    default:
}
//put it all together
// echo back some submitted values
$xml .= xmlEntry("qty", $qty);
if ($cID) {
    $xml .= xmlEntry("cID", $cID);
}
if ($jID) {
$template_options = array();
switch (JOURNAL_ID) {
    case 3:
        $req_date = gen_spiffycal_db_date_short(gen_specific_date('', 0, 1, 0));
        $template_options['terminal_date'] = array('title' => constant('ORD_TEXT_' . JOURNAL_ID . '_EXPIRES'), 'field' => '<script type="text/javascript">dateRequired.writeControl(); dateRequired.displayLeft=true; dateRequired.dateFormat="' . DATE_FORMAT_SPIFFYCAL . '";</script>');
        $template_options['terms'] = array('title' => ACT_TERMS_DUE, 'field' => html_input_field('terms_text', gen_terms_to_language('0', true, 'ap'), 'readonly="readonly" size="25"') . '&nbsp;' . html_icon('apps/accessories-text-editor.png', ACT_TERMS_DUE, 'small', 'align="top" style="cursor:pointer" onclick="TermsList()"'));
        $template_options['closed'] = array('title' => TEXT_CLOSE, 'field' => html_checkbox_field('closed', '1', $order->closed ? true : false, '', ''));
        break;
    case 4:
        $req_date = gen_spiffycal_db_date_short(gen_specific_date('', 0, 1, 0));
        $template_options['terminal_date'] = array('title' => constant('ORD_TEXT_' . JOURNAL_ID . '_EXPIRES'), 'field' => '<script type="text/javascript">dateRequired.writeControl(); dateRequired.displayLeft=true; dateRequired.dateFormat="' . DATE_FORMAT_SPIFFYCAL . '";</script>');
        $template_options['terms'] = array('title' => ACT_TERMS_DUE, 'field' => html_input_field('terms_text', gen_terms_to_language('0', true, 'ap'), 'readonly="readonly" size="25"') . '&nbsp;' . html_icon('apps/accessories-text-editor.png', ACT_TERMS_DUE, 'small', 'align="top" style="cursor:pointer" onclick="TermsList()"'));
        $template_options['closed'] = array('title' => TEXT_CLOSE, 'field' => html_checkbox_field('closed', '1', $order->closed ? true : false, '', ''));
        break;
    case 6:
        $req_date = gen_spiffycal_db_date_short(gen_specific_date('', 0, 1, 0));
        $template_options['terms'] = array('title' => ACT_TERMS_DUE, 'field' => html_input_field('terms_text', gen_terms_to_language('0', true, 'ap'), 'readonly="readonly" size="25"') . '&nbsp;' . html_icon('apps/accessories-text-editor.png', ACT_TERMS_DUE, 'small', 'align="top" style="cursor:pointer" onclick="TermsList()"'));
        $template_options['waiting'] = array('title' => ORD_WAITING_FOR_INVOICE, 'field' => html_checkbox_field('waiting', '1', $order->waiting ? true : false, '', ''));
        break;
    case 7:
        $req_date = date(DATE_FORMAT, time());
        $template_options['terms'] = array('title' => ACT_TERMS_DUE, 'field' => html_input_field('terms_text', gen_terms_to_language('0', true, 'ap'), 'readonly="readonly" size="25"') . '&nbsp;' . html_icon('apps/accessories-text-editor.png', ACT_TERMS_DUE, 'small', 'align="top" style="cursor:pointer" onclick="TermsList()"'));
        $template_options['waiting'] = array('title' => ORD_WAITING_FOR_INVOICE, 'field' => html_checkbox_field('waiting', '1', $order->waiting ? true : false, '', ''));
        break;
    case 9:
        $req_date = date(DATE_FORMAT, time());
        $template_options['terminal_date'] = array('title' => constant('ORD_TEXT_' . JOURNAL_ID . '_EXPIRES'), 'field' => '<script type="text/javascript">dateRequired.writeControl(); dateRequired.displayLeft=true; dateRequired.dateFormat="' . DATE_FORMAT_SPIFFYCAL . '";</script>');
        $template_options['terms'] = array('title' => ACT_TERMS_DUE, 'field' => html_input_field('terms_text', gen_terms_to_language('0', true, 'ap'), 'readonly="readonly" size="25"') . '&nbsp;' . html_icon('apps/accessories-text-editor.png', ACT_TERMS_DUE, 'small', 'align="top" style="cursor:pointer" onclick="TermsList()"'));
        $template_options['closed'] = array('title' => TEXT_CLOSE, 'field' => html_checkbox_field('closed', '1', $order->closed ? true : false, '', ''));
        break;
    case 10:
        case 7:
            $closed = $query_result->fields['waiting'];
            break;
    }
    $purch_order_id = $query_result->fields['so_po_ref_id'] ? ord_get_so_po_num($query_result->fields['so_po_ref_id']) : '';
    $total_amount = $currencies->format_full($query_result->fields['total_amount'], true, $query_result->fields['currencies_code'], $query_result->fields['currencies_value']);
    if (ENABLE_MULTI_CURRENCY) {
        $total_amount .= ' (' . $query_result->fields['currencies_code'] . ')';
    }
    ?>
  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="setReturnOrdr(<?php 
    echo $query_result->fields['id'];
    ?>
, false)">
	<td class="dataTableContent"><?php 
    echo gen_spiffycal_db_date_short($query_result->fields['post_date']);
    ?>
</td>
	<td class="dataTableContent"><?php 
    echo $query_result->fields['purchase_invoice_id'];
    ?>
</td>
	<?php 
    switch (JOURNAL_ID) {
        case 6:
        case 12:
            echo '<td class="dataTableContent">' . $purch_order_id . '</td>';
            break;
        case 7:
        case 13:
            echo '<td class="dataTableContent">' . $query_result->fields['purch_order_id'] . '</td>';
Esempio n. 10
0
//  Path: /modules/assets/pages/main/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass some php variables
var date1=new ctlSpiffyCalendarBox("date1", "assets", "acquisition_date","btnDate1", "<?php 
echo isset($cInfo->acquisition_date) ? gen_spiffycal_db_date_short($cInfo->acquisition_date) : '';
?>
", scBTNMODE_CALBTN);
var date2=new ctlSpiffyCalendarBox("date2", "assets", "maintenance_date","btnDate1", "<?php 
echo isset($cInfo->maintenance_date) ? gen_spiffycal_db_date_short($cInfo->maintenance_date) : '';
?>
", scBTNMODE_CALBTN);
var date3=new ctlSpiffyCalendarBox("date3", "assets", "terminal_date",   "btnDate1", "<?php 
echo isset($cInfo->terminal_date) ? gen_spiffycal_db_date_short($cInfo->terminal_date) : '';
?>
", scBTNMODE_CALBTN);

// required function called with every page load
function init() {
	cssjsmenu('navbar');

  <?php 
if ($action != 'new' && $action != 'edit') {
    // set focus for main window
    echo "  document.getElementById('search_text').focus();";
}
?>
  <?php 
if ($action == 'new') {
Esempio n. 11
0
// | 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   |
// | GNU General Public License for more details.                    |
// |                                                                 |
// | The license that is bundled with this package is located in the |
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/zencart/pages/main/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass some php variables
var shipDate = new ctlSpiffyCalendarBox("shipDate", "zencart", "ship_date","btnDate1", "<?php 
echo gen_spiffycal_db_date_short($ship_date);
?>
", scBTNMODE_CALBTN);

// required function called with every page load
function init() {
  cssjsmenu('navbar');
}

function check_form() {
  return true;
}

// -->
</script>
echo html_hidden_field('ship_acct_id', $order->ship_acct_id) . chr(10);
// id of the account in the ship to
echo html_hidden_field('ship_address_id', $order->ship_address_id) . chr(10);
echo html_hidden_field('terms', $order->terms) . chr(10);
echo html_hidden_field('item_count', $order->item_count) . chr(10);
echo html_hidden_field('weight', $order->weight) . chr(10);
echo html_hidden_field('currencies_code', $order->currencies_code) . chr(10);
echo html_hidden_field('printed', $order->printed);
if (!isset($template_options['closed'])) {
    echo html_hidden_field('closed', $order->closed);
}
if (!isset($template_options['waiting'])) {
    echo html_hidden_field('waiting', $order->waiting);
}
if (!isset($template_options['terminal_date'])) {
    echo html_hidden_field('terminal_date', gen_spiffycal_db_date_short($order->terminal_date));
}
if (!isset($template_options['terms'])) {
    echo html_hidden_field('terms_text', $order->terms_text);
}
// placeholder when not used
if (!ENABLE_MULTI_CURRENCY) {
    echo html_hidden_field('display_currency', DEFAULT_CURRENCY) . chr(10);
    echo html_hidden_field('currencies_value', '1') . chr(10);
}
if (!ENABLE_MULTI_BRANCH) {
    echo html_hidden_field('store_id', '0') . chr(10);
}
// customize the toolbar actions
$toolbar->icon_list['cancel']['params'] = 'onclick="location.href = \'' . html_href_link(FILENAME_DEFAULT, '', 'SSL') . '\'"';
$toolbar->icon_list['open']['params'] = 'onclick="OpenOrdrList(this)"';
Esempio n. 13
0
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/general/pages/admin_tools/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass any php variables generated during pre-process that are used in the javascript functions.
// Include translations here as well.
var startDate = new ctlSpiffyCalendarBox("startDate", "admin_tools", "start_date", "btnDate2", "<?php 
echo isset($start_date) ? gen_spiffycal_db_date_short($start_date) : date(DATE_FORMAT, time());
?>
", scBTNMODE_CALBTN);
var endDate = new ctlSpiffyCalendarBox("endDate", "admin_tools", "end_date", "btnDate2", "<?php 
echo isset($end_date) ? gen_spiffycal_db_date_short($end_date) : date(DATE_FORMAT, time());
?>
", scBTNMODE_CALBTN);

function init() {
  cssjsmenu('navbar');
}

function check_form() {
  return true;
}

// Insert other page specific functions here.

// -->
</script>
Esempio n. 14
0
	var nextDay = new Date(thisYear, thisMonth, thisDay);
	var oneDay = 1000 * 60 * 60 * 24;
	var dateInMs = nextDay.getTime();
	dateInMs += oneDay;
	nextDay.setTime(dateInMs);
	thisDay = nextDay.getDate();
	if (thisDay < 10) thisDay = '0' + thisDay;
	thisMonth = nextDay.getMonth() + 1;
	if (thisMonth < 10) thisMonth = '0' + thisMonth;
	thisYear = nextDay.getFullYear();
	temp = thisYear + '-' + thisMonth + '-' + thisDay;
	document.getElementById('start_'+(index+1)).value = formatDate(temp);
  }
}

// -->
</script>
<?php 
// set up a calendar variable for each possible calendar
echo '<script type="text/javascript">' . chr(10);
$i = 0;
foreach ($fy_array as $key => $value) {
    if ($key > $max_period) {
        // only allow changes if nothing has bee posted above this period
        $ctl_end = 'P' . $i . 'End';
        echo 'var ' . $ctl_end . '=new ctlSpiffyCalendarBox("' . $ctl_end . '", "gl_utils", "end_' . $i . '", "btnDate2", "' . gen_spiffycal_db_date_short($value['end']) . '", scBTNMODE_CALBTN);' . chr(10);
        echo $ctl_end . '.readonly=true; ' . $ctl_end . '.displayLeft=true; ';
    }
    $i++;
}
echo '</script>' . chr(10);
Esempio n. 15
0
// Include translations here as well.
var journalID    = '<?php 
echo JOURNAL_ID;
?>
';
var datePosted   = new ctlSpiffyCalendarBox("datePosted", "bulk_bills", "post_date", "btnDate2", "<?php 
echo gen_spiffycal_db_date_short($post_date);
?>
", scBTNMODE_CALBTN);
datePosted.JStoRunOnSelect="loadNewBalance();";
var dateInvoice  = new ctlSpiffyCalendarBox("dateInvoice", "bulk_bills", "invoice_date", "btnDate2", "<?php 
echo gen_spiffycal_db_date_short($invoice_date);
?>
", scBTNMODE_CALBTN);
var dateDiscount = new ctlSpiffyCalendarBox("dateDiscount", "bulk_bills", "discount_date", "btnDate2", "<?php 
echo gen_spiffycal_db_date_short($discount_date);
?>
", scBTNMODE_CALBTN);

function init() {
  cssjsmenu('navbar');
  checkShipAll();

<?php 
if ($post_success && $action == 'print') {
    echo '  var printWin = window.open("index.php?cat=reportwriter&module=popup_form&gn=' . POPUP_FORM_TYPE . '&cr0=' . TABLE_JOURNAL_MAIN . '.purchase_invoice_id:' . $check_range . '","forms","width=700px,height=550px,resizable=1,scrollbars=1,top=150px,left=200px");';
    echo '  printWin.focus();';
}
?>
}
</td>
		</tr>
<?php 
        if (sizeof($values['detail']) > 1) {
            $j = 0;
            $ref = $i;
            echo '<tr id="detail_' . $i . '" style="display:none"><td colspan="7"><table width="100%">' . chr(10);
            foreach ($values['detail'] as $detail) {
                ?>
		    <tr onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
			  <td width="16%" class="dataTableContent"><?php 
                echo '&nbsp;';
                ?>
</td>
			  <td width="10%" class="dataTableContent"><?php 
                echo gen_spiffycal_db_date_short($detail['post_date']);
                ?>
</td>
			  <td width="15%" class="dataTableContent" align="right"><?php 
                echo $detail['dep_amount'] ? $currencies->format($detail['dep_amount']) : '&nbsp;';
                ?>
</td>
			  <td width="15%" class="dataTableContent" align="right"><?php 
                echo $detail['pmt_amount'] ? $currencies->format($detail['pmt_amount']) : '&nbsp;';
                ?>
</td>
			  <td width="30%" class="dataTableContent"><?php 
                echo htmlspecialchars($detail['name']);
                ?>
</td>
			  <td width="7%" class="dataTableContent" align="center">
Esempio n. 17
0
//  Path: /modules/rma/pages/main/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass some php variables
var createDate = new ctlSpiffyCalendarBox("createDate", "rma", "creation_date","btnDate1", "<?php 
echo isset($cInfo->creation_date) ? gen_spiffycal_db_date_short($cInfo->creation_date) : '';
?>
", scBTNMODE_CALBTN);
var receiveDate = new ctlSpiffyCalendarBox("receiveDate", "rma", "receive_date", "btnDate1", "<?php 
echo isset($cInfo->receive_date) ? gen_spiffycal_db_date_short($cInfo->receive_date) : '';
?>
", scBTNMODE_CALBTN);
var closedDate = new ctlSpiffyCalendarBox("closedDate", "rma", "closed_date", "btnDate1", "<?php 
echo isset($cInfo->closed_date) ? gen_spiffycal_db_date_short($cInfo->closed_date) : '';
?>
", scBTNMODE_CALBTN);
var image_path = '<?php 
echo DIR_WS_ICONS;
?>
';
var image_delete_text = '<?php 
echo TEXT_DELETE;
?>
';
var image_delete_msg = '<?php 
echo RMA_ROW_DELETE_ALERT;
?>
';
var delete_icon_HTML = '<?php 
, 'edit')"><?php 
    echo $query_result->fields['default_sheet'] == '1' ? TEXT_YES : '';
    ?>
</td>
	<td class="dataTableContent" onclick="submitSeq(<?php 
    echo $query_result->fields['id'];
    ?>
, 'edit')"><?php 
    echo gen_spiffycal_db_date_short($query_result->fields['effective_date']);
    ?>
</td>
	<td class="dataTableContent" onclick="submitSeq(<?php 
    echo $query_result->fields['id'];
    ?>
, 'edit')"><?php 
    echo gen_spiffycal_db_date_short($query_result->fields['expiration_date']);
    ?>
</td>
	<td class="dataTableContent" align="center" onclick="submitSeq(<?php 
    echo $query_result->fields['id'];
    ?>
, 'edit')"><?php 
    echo $special_price;
    ?>
</td>
	<td class="dataTableContent" align="right">
<?php 
    // build the action toolbar
    // first pull in any extra buttons, this is dynamic since each row can have different buttons
    if (function_exists('add_extra_action_bar_buttons')) {
        echo add_extra_action_bar_buttons($query_result->fields);
<div id="cat_history" class="tabset_content">
  <h2 class="tabset_label"><?php 
echo TEXT_HISTORY;
?>
</h2>

<?php 
// ***********************  History Section  ******************************
?>
  <fieldset class="formAreaTitle">
    <legend><?php 
echo ACT_CONTACT_HISTORY;
?>
</legend>
    <table border="0" width="100%" cellspacing="6" cellpadding="0">
	  <tr>
	    <td width="50%"><?php 
echo ACT_FIRST_DATE . ' ' . gen_spiffycal_db_date_short($cInfo->first_date);
?>
</td>
	  </tr>
	  <tr>
	    <td width="50%"><?php 
echo ACT_LAST_DATE1 . ' ' . gen_spiffycal_db_date_short($cInfo->last_update);
?>
</td>
	  </tr>
	</table>
  </fieldset>

</div>
Esempio n. 20
0
// |                                                                 |
// | The license that is bundled with this package is located in the |
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/inventory/pages/transfer/js_include.php
//
?>
<script type="text/javascript">
<!--
ajaxRH["skuDetails"]   = "processSkuDetails";

// pass any php variables generated during pre-process that are used in the javascript functions.
// Include translations here as well.
var dateReference = new ctlSpiffyCalendarBox("dateReference", "inv_xfer", "post_date", "btnDate1", "<?php 
echo gen_spiffycal_db_date_short($post_date);
?>
", scBTNMODE_CALBTN);

function init() {
  cssjsmenu('navbar');
  document.getElementById('sku_1').focus();
}

function check_form() {
  var error = 0;
  var error_message = '<?php 
echo JS_ERROR;
?>
';
Esempio n. 21
0
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/services/pages/popup_tracking/js_include.php
//
?>
<script type="text/javascript">
<!--
// pass any php variables generated during pre-process that are used in the javascript functions.
// Include translations here as well.
var ship_cal = new ctlSpiffyCalendarBox("ship_cal", "popup_tracking", "ship_date", "btnDate2", "<?php 
echo gen_spiffycal_db_date_short($cInfo->ship_date);
?>
", scBTNMODE_CALBTN);
var cal = new ctlSpiffyCalendarBox("cal", "popup_tracking", "deliver_date", "btnDate2", "<?php 
echo gen_spiffycal_db_date_short($cInfo->deliver_date);
?>
", scBTNMODE_CALBTN);

// list the freight options
<?php 
echo $shipping_methods;
?>

function init() {
  <?php 
if ($close_popup) {
    echo '  window.opener.location.reload();' . chr(10);
    echo '  self.close();' . chr(10);
}
?>
Esempio n. 22
0
function fill_paid_invoice_array($id, $account_id, $type = 'c')
{
    // to build this data array, all current open invoices need to be gathered and then the paid part needs
    // to be applied along with discounts taken by row.
    global $db, $currencies;
    $negate = JOURNAL_ID == 20 && $type == 'c' || JOURNAL_ID == 18 && $type == 'v' ? true : false;
    // first read all currently open invoices and the payments of interest and put into an array
    $sql = "select distinct so_po_item_ref_id from " . TABLE_JOURNAL_ITEM . " where ref_id = " . $id;
    $result = $db->Execute($sql);
    $paid_indeces = array();
    while (!$result->EOF) {
        if ($result->fields['so_po_item_ref_id']) {
            $paid_indeces[] = $result->fields['so_po_item_ref_id'];
        }
        $result->MoveNext();
    }
    switch ($type) {
        case 'c':
            $search_journal = '(12, 13)';
            break;
        case 'v':
            $search_journal = '(6, 7)';
            break;
        default:
            return false;
    }
    $sql = "select id, journal_id, post_date, terms, purch_order_id, purchase_invoice_id, total_amount, gl_acct_id \r\n\t\tfrom " . TABLE_JOURNAL_MAIN . " \r\n\t\twhere (journal_id in " . $search_journal . " and closed = '0' and bill_acct_id = " . $account_id . ")";
    if (sizeof($paid_indeces) > 0) {
        $sql .= " or (id in (" . implode(',', $paid_indeces) . ") and closed = '0')";
    }
    $sql .= " order by post_date";
    $result = $db->Execute($sql);
    $open_invoices = array();
    while (!$result->EOF) {
        if ($result->fields['journal_id'] == 7 || $result->fields['journal_id'] == 13) {
            $result->fields['total_amount'] = -$result->fields['total_amount'];
        }
        $result->fields['total_amount'] -= fetch_partially_paid($result->fields['id']);
        $result->fields['description'] = $result->fields['purch_order_id'];
        $result->fields['discount'] = '';
        $result->fields['amount_paid'] = '';
        $open_invoices[$result->fields['id']] = $result->fields;
        $result->MoveNext();
    }
    // next read the record of interest and add/adjust open invoice array with amounts
    $sql = "select id, ref_id, so_po_item_ref_id, gl_type, description, debit_amount, credit_amount, gl_account \r\n\t\tfrom " . TABLE_JOURNAL_ITEM . " where ref_id = " . $id;
    $result = $db->Execute($sql);
    while (!$result->EOF) {
        $amount = $result->fields['debit_amount'] ? $result->fields['debit_amount'] : $result->fields['credit_amount'];
        if ($negate) {
            $amount = -$amount;
        }
        $index = $result->fields['so_po_item_ref_id'];
        switch ($result->fields['gl_type']) {
            case 'dsc':
                // it's the discount field
                $open_invoices[$index]['discount'] = $amount;
                $open_invoices[$index]['amount_paid'] -= $amount;
                break;
            case 'chk':
            case 'pmt':
                // it's the payment field
                $open_invoices[$index]['total_amount'] += $amount;
                $open_invoices[$index]['description'] = $result->fields['description'];
                $open_invoices[$index]['amount_paid'] = $amount;
                break;
            case 'ttl':
                $payment_fields = $result->fields['description'];
                // payment details
            // payment details
            default:
        }
        $result->MoveNext();
    }
    ksort($open_invoices);
    $balance = 0;
    $index = 0;
    $item_list = array();
    foreach ($open_invoices as $key => $line_item) {
        // fetch some information about the invoice
        $sql = "select id, post_date, terms, purchase_invoice_id, purch_order_id, gl_acct_id, waiting  \r\n\t\t\tfrom " . TABLE_JOURNAL_MAIN . " where id = " . $key;
        $result = $db->Execute($sql);
        $due_dates = calculate_terms_due_dates($result->fields['post_date'], $result->fields['terms'], $type == 'v' ? 'AP' : 'AR');
        if ($negate) {
            $line_item['total_amount'] = -$line_item['total_amount'];
            $line_item['discount'] = -$line_item['discount'];
            $line_item['amount_paid'] = -$line_item['amount_paid'];
        }
        $balance += $line_item['total_amount'];
        $item_list[] = array('id' => $result->fields['id'], 'waiting' => $result->fields['waiting'], 'purchase_invoice_id' => $result->fields['purchase_invoice_id'], 'purch_order_id' => $result->fields['purch_order_id'], 'percent' => $due_dates['discount'], 'early_date' => gen_spiffycal_db_date_short($due_dates['early_date']), 'net_date' => gen_spiffycal_db_date_short($due_dates['net_date']), 'total_amount' => $currencies->format($line_item['total_amount']), 'gl_acct_id' => $result->fields['gl_acct_id'], 'description' => $line_item['description'], 'discount' => $line_item['discount'] ? $currencies->format($line_item['discount']) : '', 'amount_paid' => $line_item['amount_paid'] ? $currencies->format($line_item['amount_paid']) : '');
        $index++;
    }
    return array('balance' => $balance, 'payment_fields' => $payment_fields, 'invoices' => $item_list);
}
    // past the early date
    $extra_params = $query_result->fields['waiting'] == '1' ? 'readonly="readonly" ' : '';
    echo '<tr' . ($extra_params ? ' class="rowInactive"' : '') . '>' . chr(10);
    echo '<td class="dataTableContent" align="center">' . chr(10);
    echo gen_spiffycal_db_date_short($query_result->fields['post_date']) . chr(10);
    // Hidden fields
    echo html_hidden_field('id_' . $idx, $query_result->fields['id']) . chr(10);
    echo html_hidden_field('bill_acct_id_' . $idx, $query_result->fields['bill_acct_id']) . chr(10);
    echo html_hidden_field('amt_' . $idx, $amount_due) . chr(10);
    echo html_hidden_field('inv_' . $idx, $query_result->fields['purchase_invoice_id']) . chr(10);
    echo html_hidden_field('origdisc_' . $idx, $currencies->clean_value($discount)) . chr(10);
    echo html_hidden_field('discdate_' . $idx, gen_spiffycal_db_date_short($due_dates['early_date'])) . chr(10);
    echo html_hidden_field('acct_' . $idx, $query_result->fields['gl_acct_id']) . chr(10);
    // End hidden fields
    echo '</td>' . chr(10);
    echo '<td class="main">' . htmlspecialchars($query_result->fields['bill_primary_name']) . '</td>' . chr(10);
    echo '<td class="main" align="center">' . $query_result->fields['purchase_invoice_id'] . '</td>' . chr(10);
    echo '<td class="main" align="center" style="text-align:right">' . $currencies->format($amount_due) . '</td>' . chr(10);
    echo '<td class="main" align="center">' . html_input_field('desc_' . $idx, $query_result->fields['purch_order_id'], $extra_params . 'size="32"') . '</td>' . chr(10);
    echo '<td class="main" align="center">' . gen_spiffycal_db_date_short($due_dates['net_date']) . '</td>' . chr(10);
    echo '<td class="main" align="center">' . html_input_field('dscnt_' . $idx, $discount, $extra_params . 'size="11" maxlength="20" onchange="updateDiscTotal(' . $idx . ')" style="text-align:right"') . '</td>' . chr(10);
    echo '<td class="main" align="center">' . html_input_field('total_' . $idx, '', $extra_params . 'size="11" maxlength="20" onchange="updateLineTotal(' . $idx . ')" style="text-align:right"') . '</td>' . chr(10);
    echo '<td class="main" align="center">' . html_checkbox_field('pay_' . $idx, '1', false, '', ($extra_params ? 'disabled="disabled" ' : '') . 'onclick="updatePayValues(' . $idx . ')"') . '</td>' . chr(10);
    echo '</tr>' . chr(10);
    $idx++;
    $query_result->MoveNext();
}
?>
  </table>
</div>
</form>
, 'edit')"><?php 
    echo $query_result->fields['purchase_invoice_id'];
    ?>
</td>
	<td class="dataTableContent" onclick="submitSeq(<?php 
    echo $query_result->fields['id'];
    ?>
, 'edit')"><?php 
    echo $status_codes[$query_result->fields['status']];
    ?>
</td>
	<td class="dataTableContent" onclick="submitSeq(<?php 
    echo $query_result->fields['id'];
    ?>
, 'edit')"><?php 
    echo $query_result->fields['closed_date'] == '0000-00-00' ? '&nbsp;' : gen_spiffycal_db_date_short($query_result->fields['closed_date']);
    ?>
</td>
	<td class="dataTableContent" align="right">
<?php 
    // build the action toolbar
    // first pull in any extra buttons, this is dynamic since each row can have different buttons
    if (function_exists('add_extra_action_bar_buttons')) {
        echo add_extra_action_bar_buttons($query_result->fields);
    }
    if ($security_level > 1) {
        echo html_icon('actions/edit-find-replace.png', TEXT_EDIT, 'small', 'onclick="submitSeq(' . $query_result->fields['id'] . ', \'edit\')"') . chr(10);
    }
    if ($security_level > 3) {
        echo html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . RMA_MSG_DELETE_RMA . '\')) deleteItem(' . $query_result->fields['id'] . ')"') . chr(10);
    }
Esempio n. 25
0
     $sheet_id = db_insert_id();
     // Copy special pricing information to new sheet
     $levels = $db->Execute("select inventory_id, price_levels from " . TABLE_INVENTORY_SPECIAL_PRICES . " \r\n\t\t\twhere price_sheet_id = " . $id);
     while (!$levels->EOF) {
         $db->Execute("insert into " . TABLE_INVENTORY_SPECIAL_PRICES . " set \r\n\t\t\tinventory_id = " . $levels->fields['inventory_id'] . ", \r\n\t\t\tprice_sheet_id = " . $sheet_id . ", \r\n\t\t\tprice_levels = '" . $levels->fields['price_levels'] . "'");
         $levels->MoveNext();
     }
     gen_add_audit_log(PRICE_SHEETS_LOG . TEXT_REVISE, $result->fields['sheet_name'] . ' Rev. ' . $old_rev . ' => ' . ($old_rev + 1));
     $action = '';
     break;
 case 'edit':
     $id = db_prepare_input($_POST['rowSeq']);
     $result = $db->Execute("select * from " . TABLE_PRICE_SHEETS . " where id = " . $id);
     $sheet_name = $result->fields['sheet_name'];
     $revision = $result->fields['revision'];
     $effective_date = gen_spiffycal_db_date_short($result->fields['effective_date']);
     $default_sheet = $result->fields['default_sheet'] ? '1' : '0';
     $default_levels = $result->fields['default_levels'];
     break;
 case 'go_first':
     $_GET['page'] = 1;
     break;
 case 'go_previous':
     $_GET['page']--;
     break;
 case 'go_next':
     $_GET['page']++;
     break;
 case 'go_last':
     $_GET['page'] = 99999;
     break;
if (is_array($combined_list)) {
    foreach ($combined_list as $values) {
        ?>
		<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
			<td class="dataTableContent" id="td_<?php 
        echo $i;
        ?>
_0"><?php 
        echo $values['reference'];
        ?>
</td>
			<td class="dataTableContent" id="td_<?php 
        echo $i;
        ?>
_1"><?php 
        echo gen_spiffycal_db_date_short($values['post_date']);
        ?>
</td>
			<td class="dataTableContent" id="td_<?php 
        echo $i;
        ?>
_2" align="right"><?php 
        echo $values['dep_amount'] ? $currencies->format($values['dep_amount']) : '&nbsp;';
        ?>
</td>
			<td class="dataTableContent" id="td_<?php 
        echo $i;
        ?>
_3" align="right"><?php 
        echo $values['pmt_amount'] ? $currencies->format($values['pmt_amount']) : '&nbsp;';
        ?>
Esempio n. 27
0
';
var tax_freight          = '<?php 
echo $account_type == "c" ? AR_ADD_SALES_TAX_TO_SHIPPING : AP_ADD_SALES_TAX_TO_SHIPPING;
?>
';
var tax_before_discount  = '<?php 
echo $account_type == "c" ? AR_TAX_BEFORE_DISCOUNT : AP_TAX_BEFORE_DISCOUNT;
?>
';
var dateOrdered          = new ctlSpiffyCalendarBox("dateOrdered", "orders", "post_date", "btnDate2", "<?php 
echo isset($order->post_date) ? gen_spiffycal_db_date_short($order->post_date) : date(DATE_FORMAT, time());
?>
", scBTNMODE_CALBTN);
<?php 
if (isset($template_options['terminal_date'])) {
    echo 'var dateRequired = new ctlSpiffyCalendarBox("dateRequired", "orders", "terminal_date", "btnDate2", "' . (isset($order->terminal_date) ? gen_spiffycal_db_date_short($order->terminal_date) : $req_date) . '", scBTNMODE_CALBTN);';
}
?>

// List the currency codes and exchange rates
<?php 
if (ENABLE_MULTI_CURRENCY) {
    echo $currencies->build_js_currency_arrays();
}
?>

// List the gl accounts for line item pull downs
<?php 
echo $js_gl_array;
?>
		    <th><?php 
echo TEXT_MONTH;
?>
</th>
		    <th><?php 
echo INV_ADJ_QUANTITY;
?>
</th>
		  </tr>
      <?php 
if ($sku_history['adjustments']) {
    $adjustments = 0;
    foreach ($sku_history['adjustments'] as $key => $value) {
        $adjustments += $value['qty'];
        echo '<tr>' . chr(10);
        echo '  <td align="center">' . gen_spiffycal_db_date_short($value['post_date']) . '</td>' . chr(10);
        echo '  <td align="center">' . ($value['qty'] ? $value['qty'] : '&nbsp;') . '</td>' . chr(10);
        echo '</tr>' . chr(10);
    }
    echo "<tr> <td align='center'>Total:</td><td align='center'>" . $adjustments . "</td></tr>";
} else {
    echo '<tr><td align="center" colspan="4">' . INV_NO_RESULTS . '</td></tr>' . chr(10);
}
?>
		</table>
	  </td>
	  </tr>
    </table>
  </fieldset>
</div>
Esempio n. 29
0
</th>
	<th><?php 
echo TEXT_ACTION;
?>
</th>
  </tr>
	<?php 
$result = $db->Execute("select id, shipment_id, ref_id, method, deliver_date, tracking_id, cost \r\n\t\tfrom " . TABLE_SHIPPING_LOG . " \r\n\t\twhere carrier = 'freeshipper' and ship_date = '" . $date . "'");
if ($result->RecordCount() > 0) {
    while (!$result->EOF) {
        echo '  <tr>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . $result->fields['shipment_id'] . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . $result->fields['ref_id'] . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="center">' . constant('freeshipper_' . $result->fields['method']) . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . ($result->fields['deliver_date'] ? gen_spiffycal_db_date_short($result->fields['deliver_date']) : '&nbsp;') . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . ($result->fields['actual_date'] ? gen_spiffycal_db_date_short($result->fields['actual_date']) : '&nbsp;') . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . $result->fields['tracking_id'] . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">' . $currencies->format_full($result->fields['cost']) . '</td>' . chr(10);
        echo '    <td class="dataTableContent" align="right">';
        echo html_icon('phreebooks/stock_id.png', TEXT_VIEW_SHIP_LOG, 'small', 'onclick="loadPopUp(\'freeshipper\', \'edit\', ' . $result->fields['id'] . ')"') . chr(10);
        //	  		echo html_icon('actions/document-print.png', TEXT_PRINT, 'small', 'onclick="window.open(\'' . html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('carrier', 'labels', 'date')) . 'carrier=freeshipper&date=' . $date . '&labels=' . $result->fields['tracking_id'], 'SSL') . '\',\'label_mgr\',\'width=800,height=700,resizable=1,scrollbars=1,top=50,left=50\')"') . chr(10);
        echo html_icon('emblems/emblem-unreadable.png', TEXT_DELETE, 'small', 'onclick="if (confirm(\'' . SHIPPING_DELETE_CONFIRM . '\')) window.open(\'index.php?cat=services&module=popup_label_mgr&subject=freeshipper&sID=' . $result->fields['shipment_id'] . '&action=delete\',\'ship_mgr\',\'width=800,height=700,resizable=1,scrollbars=1,top=50,left=50\')"') . chr(10);
        echo '    </td>';
        echo '  </tr>' . chr(10);
        $result->MoveNext();
    }
} else {
    echo '  <tr><td align="center" colspan="8">' . SHIPPING_NO_SHIPMENTS . '</td></tr>';
}
?>
</table>
        $pay_num = 'pay_' . $i;
        if (!isset($order->{$id_num})) {
            break;
        }
        // no more rows to build, exit loop
        $extra_params = $order->{$inv_num} ? '' : 'readonly="readonly" ';
        echo '<tr' . ($extra_params ? ' class="rowInactive"' : '') . '>' . chr(10);
        echo '<td class="main" align="center">' . chr(10);
        echo html_input_field($inv_num, $order->{$inv_num}, 'readonly="readonly" size="15"') . chr(10);
        // Hidden fields
        echo html_hidden_field($id_num, $order->{$id_num}) . chr(10);
        echo html_hidden_field($prcnt_num, $order->{$prcnt_num}) . chr(10);
        echo html_hidden_field($early_num, $order->{$early_num}) . chr(10);
        echo html_hidden_field($acct_num, $order->{$acct_num}) . chr(10);
        // End hidden fields
        echo '</td>' . chr(10);
        echo '<td class="main" align="center">' . html_input_field($due_num, gen_spiffycal_db_date_short($order->{$due_num}), 'readonly="readonly" size="15"') . '</td>' . chr(10);
        echo '<td class="main" align="center">' . html_input_field($amt_num, $currencies->format($currencies->clean_value($order->{$amt_num})), 'readonly="readonly" size="12" style="text-align:right"') . '</td>' . chr(10);
        echo '<td class="main" align="center">' . html_input_field($desc_num, $order->{$desc_num}, $extra_params . 'size="64" maxlength="64"') . '</td>' . chr(10);
        echo '<td class="main" align="center">' . html_input_field($dscnt_num, $currencies->format($currencies->clean_value($order->{$dscnt_num})), $extra_params . 'size="15" maxlength="20" onchange="updateRowTotal(' . $i . ')" style="text-align:right"') . '</td>' . chr(10);
        echo '<td class="main" align="center">' . html_input_field($total_num, $currencies->format($currencies->clean_value($order->{$total_num})), $extra_params . 'size="15" maxlength="20" onchange="updateUnitPrice(' . $i . ')" style="text-align:right"') . '</td>' . chr(10);
        echo '<td class="main" align="center">' . ($extra_params ? '&nbsp;' : html_checkbox_field($pay_num, '1', $order->{$pay_num} ? true : false, '', 'onclick="updatePayValues(' . $i . ')"')) . '</td>' . chr(10);
        echo '</tr>' . chr(10);
        $i++;
    }
}
?>
  </table>
</div>
</form>