?> </td> <td align="right"><?php echo constant('ACT_' . strtoupper($type) . '_ACCOUNT_NUMBER'); ?> </td> <td><?php echo html_input_field('account_number', $cInfo->account_number, 'size="17" maxlength="16"'); ?> </td> <td align="right"><?php echo TEXT_DEFAULT_PRICE_SHEET; ?> </td> <td><?php echo html_pull_down_menu('price_sheet', get_price_sheet_data(), $cInfo->price_sheet); ?> </td> </tr> <tr> <td align="right"><?php echo constant('ACT_' . strtoupper($type) . '_ID_NUMBER'); ?> </td> <td><?php echo html_input_field('gov_id_number', $cInfo->gov_id_number, 'size="17" maxlength="16"'); ?> </td> <td align="right"><?php echo INV_ENTRY_ITEM_TAXABLE; ?>
} ?> newCell = newRow.insertCell(-1); newCell.innerHTML = cell; <?php if (isset($cInfo->purch_taxable)) { echo "cell ='" . str_replace("'", "\\'", html_pull_down_menu('purch_taxable_array[]', $purch_tax_rates, INVENTORY_DEFAULT_PURCH_TAX)) . "';" . chr(13); } else { echo "cell ='';" . chr(13); } ?> newCell = newRow.insertCell(-1); newCell.innerHTML = cell; <?php if (isset($cInfo->price_sheet_v)) { echo "cell ='" . str_replace("'", "\\'", html_pull_down_menu('price_sheet_v_array[]', get_price_sheet_data('v'), '')) . "';" . chr(13); } else { print 'onwaar'; echo "cell ='';" . chr(13); } ?> newCell = newRow.insertCell(-1); newCell.innerHTML = cell; } function removeVendorRow(index){ var row = document.getElementById('row_id_'+index); row.parentElement.removeChild(row); } $(document).ready(function(){
echo '<td>' . html_input_field('item_cost_array[]', $currencies->precise($purchaseRow['item_cost']), 'onchange="what_to_update();" size="15" maxlength="20" style="text-align:right"', false) . '</td>'; } else { echo '<td></td>'; } if (isset($cInfo->item_cost) || $error) { echo '<td>' . html_input_field('purch_package_quantity_array[]', $currencies->precise($purchaseRow['purch_package_quantity']), 'size="6" maxlength="5" style="text-align:right"') . '</td>'; } else { echo '<td></td>'; } if (isset($cInfo->purch_taxable) || $error) { echo '<td>' . html_pull_down_menu('purch_taxable_array[]', $purch_tax_rates, $purchaseRow['purch_taxable']) . '</td>'; } else { echo '<td></td>'; } if (isset($cInfo->price_sheet_v) || $error) { echo '<td>' . html_pull_down_menu('price_sheet_v_array[]', get_price_sheet_data('v'), $purchaseRow['price_sheet_v']); echo ' ' . html_icon('mimetypes/x-office-spreadsheet.png', BOX_SALES_PRICE_SHEETS, 'small', $params = 'onclick="priceMgr(' . $cInfo->id . ', 0, 0, \'v\', ' . $purchaseRow['id'] . ')"') . '</td>'; } else { echo '<td></td>'; } echo '</tr>'; $odd = !$odd; } } ?> </tbody> <tfoot> <tr> <td width="5%"><?php echo html_icon('actions/list-add.png', TEXT_ADD, 'medium', 'onclick="addVendorRow()"'); ?>
} /***************** prepare to display templates *************************/ // build the type filter list $type_select_list = array(array('id' => '0', 'text' => TEXT_ALL), array('id' => 'cog', 'text' => TEXT_INV_MANAGED)); if (in_array($_REQUEST['action'], array('create', 'edit', 'properties'))) { foreach ($inventory_types_plus as $key => $value) { $type_select_list[] = array('id' => $key, 'text' => $value); } // generate the vendors and fill js arrays for dynamic pull downs $vendors = gen_get_contact_array_by_type('v'); $js_vendor_array = 'var js_vendor_array = new Array();' . chr(10); for ($i = 0; $i < count($vendors); $i++) { $js_vendor_array .= 'js_vendor_array[' . $i . '] = new dropDownData("' . $vendors[$i]['id'] . '", "' . $vendors[$i]['text'] . '");' . chr(10); } // generate the pricesheets and fill js arrays for dynamic pull downs $pur_pricesheets = get_price_sheet_data('v'); $js_pricesheet_array = 'var js_pricesheet_array = new Array();' . chr(10); for ($i = 0; $i < count($pur_pricesheets); $i++) { $js_pricesheet_array .= 'js_pricesheet_array[' . $i . '] = new dropDownData("' . $pur_pricesheets[$i]['id'] . '", "' . $pur_pricesheets[$i]['text'] . '");' . chr(10); } // load the tax rates $tax_rates = ord_calculate_tax_drop_down('c'); $purch_tax_rates = inv_calculate_tax_drop_down('v', false); // generate a rate array parallel to the drop down for javascript $js_tax_rates = 'var tax_rates = new Array(' . count($tax_rates) . ');' . chr(10); for ($i = 0; $i < count($tax_rates); $i++) { $js_tax_rates .= 'tax_rates[' . $i . '] = new tax("' . $tax_rates[$i]['id'] . '", "' . $tax_rates[$i]['text'] . '", "' . $tax_rates[$i]['rate'] . '");' . chr(10); } // load gl accounts $gl_array_list = gen_coa_pull_down(); }