예제 #1
0
파일: bill_review.php 프로젝트: caseyi/BLIS
			}
			function print_bill(id, lab_id)
			{
				var url = "reports_billing_specific.php?bill_id=" + id + "&lab_config_id=" + lab_id;
				window.open(url, '_blank');
				window.focus();
			}
		</script>
		<?php 
include "../includes/styles.php";
?>
	</head>
	
	<body>
		<?php 
$bill = Bill::loadFromId($billId, $lab_config_id);
$patient = Patient::getById($bill->getPatientId());
$associations = $bill->getAllAssociationsForBill($lab_config_id);
?>
		<div class='patient_bill_title'>
			Bill <?php 
echo $bill->getId();
?>
 for <?php 
echo $patient->getName();
?>
		</div>
		<form id='payments_form' name='payments_form' action=''>
			<table class='tablesorter' id='bill_table' style="border-collapse: separate;">
				<tr valign='top'>
					<th style="width: 75px;">Test Date</th>
<?php

#
# Updates the discount for an test-bill association
#
include "../includes/db_lib.php";
$lab_config_id = $_SESSION['lab_config_id'];
$discount_type = $_REQUEST['sel'];
$discount_amount = $_REQUEST['amt'];
$discount_id = $_REQUEST['id'];
$assoc = BillsTestsAssociationObject::loadFromId($discount_id, $lab_config_id);
$assoc->setDiscountType($discount_type);
$assoc->setDiscountAmount($discount_amount);
$assoc->save($lab_config_id);
$bill = Bill::loadFromId($assoc->getBillId(), $lab_config_id);
echo json_encode(array("a" => format_number_to_money($assoc->getDiscountedTotal()), "b" => format_number_to_money($bill->getBillTotal($lab_config_id))));