function echoProdLine($lino, $drug_id, $del = FALSE, $units = NULL, $fee = NULL, $sale_id = 0, $billed = FALSE) { global $code_types, $ndc_applies, $pid, $usbillstyle, $hasCharges; $drow = sqlQuery("SELECT name FROM drugs WHERE drug_id = ?", array($drug_id)); $code_text = $drow['name']; $fee = sprintf('%01.2f', $fee); if (empty($units)) { $units = 1; } $units = max(1, intval($units)); // We put unit price on the screen, not the total line item fee. $price = $fee / $units; $strike1 = $sale_id && $del ? "<strike>" : ""; $strike2 = $sale_id && $del ? "</strike>" : ""; echo " <tr>\n"; echo " <td class='billcell'>{$strike1}" . xlt("Product") . "{$strike2}"; echo "<input type='hidden' name='prod[" . attr($lino) . "][sale_id]' value='" . attr($sale_id) . "'>"; echo "<input type='hidden' name='prod[" . attr($lino) . "][drug_id]' value='" . attr($drug_id) . "'>"; echo "<input type='hidden' name='prod[" . attr($lino) . "][billed]' value='" . attr($billed) . "'>"; echo "</td>\n"; echo " <td class='billcell'>{$strike1}" . text($drug_id) . "{$strike2}</td>\n"; if (modifiers_are_used(true)) { echo " <td class='billcell'> </td>\n"; } if ($billed) { if (fees_are_used()) { echo " <td class='billcell' align='right'>" . text(oeFormatMoney($price)) . "</td>\n"; echo " <td class='billcell' align='center'>" . text($units) . "</td>\n"; } if (justifiers_are_used()) { echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // justify } echo " <td class='billcell' align='center'> </td>\n"; // provider echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // note codes echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // auth echo " <td class='billcell' align='center'><input type='checkbox'" . " disabled /></td>\n"; } else { if (fees_are_used()) { echo " <td class='billcell' align='right'>" . "<input type='text' name='prod[" . attr($lino) . "][price]' " . "value='" . attr($price) . "' size='6'"; if (acl_check('acct', 'disc')) { echo " style='text-align:right'"; } else { echo " style='text-align:right;background-color:transparent' readonly"; } echo "></td>\n"; echo " <td class='billcell' align='center'>"; echo "<input type='text' name='prod[" . attr($lino) . "][units]' " . "value='" . attr($units) . "' size='2' style='text-align:right'>"; echo "</td>\n"; } if (justifiers_are_used()) { echo " <td class='billcell'{$usbillstyle}> </td>\n"; // justify } echo " <td class='billcell' align='center'> </td>\n"; // provider echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // note codes echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // auth echo " <td class='billcell' align='center'><input type='checkbox' name='prod[" . attr($lino) . "][del]' " . "value='1'" . ($del ? " checked" : "") . " /></td>\n"; } echo " <td class='billcell'>{$strike1}" . text($code_text) . "{$strike2}</td>\n"; echo " </tr>\n"; if ($fee != 0) { $hasCharges = true; } }
function echoLine($lino, $codetype, $code, $modifier, $auth = TRUE, $del = FALSE, $fee = NULL, $id = NULL, $billed = FALSE, $code_text = NULL) { global $code_types; if (!$code_text) { $query = "select fee, code_text from codes where code_type = '" . $code_types[$codetype]['id'] . "' and " . "code = '{$code}' and "; if ($modifier) { $query .= "modifier = '{$modifier}'"; } else { $query .= "(modifier is null or modifier = '')"; } $result = sqlQuery($query); $code_text = $result['code_text']; if (!isset($fee)) { $fee = $result['fee']; } } $strike1 = $id && $del ? "<strike>" : ""; $strike2 = $id && $del ? "</strike>" : ""; echo " <tr>\n"; echo " <td class='billcell'>{$strike1}{$codetype}{$strike2}"; if ($id) { echo "<input type='hidden' name='bill[{$lino}][id]' value='{$id}'>"; } echo "<input type='hidden' name='bill[{$lino}][code_type]' value='{$codetype}'>"; echo "<input type='hidden' name='bill[{$lino}][code]' value='{$code}'>"; echo "<input type='hidden' name='bill[{$lino}][billed]' value='{$billed}'>"; echo "</td>\n"; echo " <td class='billcell'>{$strike1}{$code}{$strike2}</td>\n"; if ($billed) { if (modifiers_are_used()) { echo " <td class='billcell'>{$strike1}{$modifier}{$strike2}" . "<input type='hidden' name='bill[{$lino}][mod]' value='{$modifier}'></td>\n"; } if (fees_are_used()) { echo " <td class='billcell' align='right'>{$fee}</td>\n"; } echo " <td class='billcell' align='center'><input type='checkbox'" . ($auth ? " checked" : "") . " disabled /></td>\n"; echo " <td class='billcell' align='center'><input type='checkbox'" . " disabled /></td>\n"; } else { if (modifiers_are_used()) { if ($code_types[$codetype]['mod'] || $modifier) { echo " <td class='billcell'><input type='text' name='bill[{$lino}][mod]' " . "value='{$modifier}' size='" . $code_types[$codetype]['mod'] . "'></td>\n"; } else { echo " <td class='billcell'> </td>\n"; } } if (fees_are_used()) { if ($code_types[$codetype]['fee'] || $fee != 0) { echo " <td class='billcell' align='right'><input type='text' name='bill[{$lino}][fee]' " . "value='{$fee}' size='6' style='text-align:right'></td>\n"; } else { echo " <td class='billcell'> </td>\n"; } } echo " <td class='billcell' align='center'><input type='checkbox' name='bill[{$lino}][auth]' " . "value='1'" . ($auth ? " checked" : "") . " /></td>\n"; echo " <td class='billcell' align='center'><input type='checkbox' name='bill[{$lino}][del]' " . "value='1'" . ($del ? " checked" : "") . " /></td>\n"; } echo " <td class='billcell'>{$strike1}" . ucfirst(strtolower($code_text)) . "{$strike2}</td>\n"; echo " </tr>\n"; }
<?php } else { ?> <input type='text' size='6' name='code' value='<?php echo attr($code); ?> ' onkeyup='maskkeyup(this,getCTMask())' onblur='maskblur(this,getCTMask())' /> <?php } ?> <?php if (modifiers_are_used()) { ?> <?php echo xlt('Modifier'); ?> : <?php if ($mode == "modify") { ?> <input type='text' size='3' name='modifier' readonly='readonly' value='<?php echo attr($modifier); ?> '> <?php } else { ?>
function echoProductLines() { global $code_types, $usbillstyle, $liprovstyle, $justifystyle, $fs, $price_levels_are_used; foreach ($fs->productitems as $lino => $li) { $drug_id = $li['hidden']['drug_id']; $selector = $li['hidden']['selector']; $sale_id = $li['hidden']['sale_id']; $billed = $li['hidden']['billed']; $fee = $li['fee']; $price = $li['price']; $pricelevel = $li['pricelevel']; $units = $li['units']; $del = $li['del']; $warehouse_id = $li['warehouse']; $rx = $li['rx']; $strike1 = $sale_id && $del ? "<strike>" : ""; $strike2 = $sale_id && $del ? "</strike>" : ""; echo " <tr>\n"; echo " <td class='billcell'>{$strike1}" . xlt("Product") . "{$strike2}"; echo "<input type='hidden' name='prod[" . attr($lino) . "][sale_id]' value='" . attr($sale_id) . "'>"; echo "<input type='hidden' name='prod[" . attr($lino) . "][drug_id]' value='" . attr($drug_id) . "'>"; echo "<input type='hidden' name='prod[" . attr($lino) . "][selector]' value='" . attr($selector) . "'>"; echo "<input type='hidden' name='prod[" . attr($lino) . "][billed]' value='" . attr($billed) . "'>"; if (isset($li['hidden']['method'])) { echo "<input type='hidden' name='prod[{$lino}][method]' value='" . attr($li['hidden']['method']) . "' />"; echo "<input type='hidden' name='prod[{$lino}][methtype]' value='" . attr($li['hidden']['methtype']) . "' />"; } echo "</td>\n"; echo " <td class='billcell'>{$strike1}" . text($drug_id) . "{$strike2}</td>\n"; echo " <td class='billcell'>{$strike1}" . text($li['code_text']) . "{$strike2}</td>\n"; if (modifiers_are_used(true)) { echo " <td class='billcell'> </td>\n"; } if ($billed) { if (fees_are_used()) { if ($price_levels_are_used) { echo " <td class='billcell' align='center'>"; echo $fs->genPriceLevelSelect('', ' ', $drug_id, $selector, $pricelevel, true); echo "</td>\n"; } echo " <td class='billcell' align='right'>" . text(oeFormatMoney($price)) . "</td>\n"; echo " <td class='billcell' align='center'>" . text($units) . "</td>\n"; } if (justifiers_are_used()) { // KHY Evaluate proper position/usage of if justifiers echo " <td class='billcell' align='center'{$justifystyle}> </td>\n"; // justify } // Show warehouse for this line. echo " <td class='billcell' align='center' {$liprovstyle}>"; echo $fs->genWarehouseSelect('', ' ', $warehouse_id, true, $drug_id, $sale_id > 0); echo "</td>\n"; // echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // note codes echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // auth if ($GLOBALS['gbl_auto_create_rx']) { echo " <td class='billcell' align='center'><input type='checkbox'" . " disabled /></td>\n"; } echo " <td class='billcell' align='center'><input type='checkbox'" . " disabled /></td>\n"; } else { // not billed if (fees_are_used()) { if ($price_levels_are_used) { echo " <td class='billcell' align='center'>"; echo $fs->genPriceLevelSelect("prod[{$lino}][pricelevel]", ' ', $drug_id, $selector, $pricelevel); echo "</td>\n"; } echo " <td class='billcell' align='right'>" . "<input type='text' name='prod[" . attr($lino) . "][price]' " . "value='" . attr($price) . "' size='6' onchange='setSaveAndClose()'"; if (acl_check('acct', 'disc')) { echo " style='text-align:right'"; } else { echo " style='text-align:right;background-color:transparent' readonly"; } echo "></td>\n"; echo " <td class='billcell' align='center'>"; echo "<input type='text' name='prod[" . attr($lino) . "][units]' " . "value='" . attr($units) . "' size='2' style='text-align:right'>"; echo "</td>\n"; } if (justifiers_are_used()) { echo " <td class='billcell'{$justifystyle}> </td>\n"; // justify } // Generate warehouse selector if there is a choice of warehouses. echo " <td class='billcell' align='center' {$liprovstyle}>"; echo $fs->genWarehouseSelect("prod[{$lino}][warehouse]", ' ', $warehouse_id, false, $drug_id, $sale_id > 0); echo "</td>\n"; // echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // note codes echo " <td class='billcell' align='center'{$usbillstyle}> </td>\n"; // auth if ($GLOBALS['gbl_auto_create_rx']) { echo " <td class='billcell' align='center'>" . "<input type='checkbox' name='prod[{$lino}][rx]' value='1'" . ($rx ? " checked" : "") . " /></td>\n"; } echo " <td class='billcell' align='center'><input type='checkbox' name='prod[" . attr($lino) . "][del]' " . "value='1'" . ($del ? " checked" : "") . " /></td>\n"; } echo " </tr>\n"; } }