I was looking at /interface/patient_file/pos_checkout.php and found that the file has two tags with different contents (one is for checkout, one is for receipt).
I thought that browser will only read the first available and ignore the following tags. Is that true? How does pos_checkout.php make browser to parse one tag at some times, and another tag at some other times?
It’s all built into that script (pos_checkout.php). Look for the function generate_receipt and for references to it. Note that the HTML for the receipt is generated entirely within that function.