$nodesToKill[] = $trg;
        }
    }
    // This is the first tax id we're allowed to use.
    $taxId++;
    // Prepare new taxRulesGroup
    $taxRulesGroup = $file['pack']->taxes->addChild('taxRulesGroup');
    $taxRulesGroup->addAttribute('name', 'EU VAT For Virtual Products');
    $taxRulesGroup->addAttribute('auto-generated', '1');
    $taxRulesGroup->addAttribute('eu-tax-group', 'virtual');
    addTaxRule($taxRulesGroup, $file['virtualTax'], $file['iso_code_country']);
    foreach ($euLocalizationFiles as $foreignPath => $foreignFile) {
        if ($foreignPath === $path) {
            // We already added the tax that belongs to this pack
            continue;
        }
        $tax = addTax($file['pack']->taxes, $foreignFile['virtualTax'], array('id' => (string) $taxId, 'auto-generated' => '1', 'from-eu-tax-group' => 'virtual'), array('eu-tax-group'));
        addTaxRule($taxRulesGroup, $tax, $foreignFile['iso_code_country']);
        $taxId++;
    }
    foreach ($nodesToKill as $node) {
        unset($node[0]);
    }
    $dom = new DOMDocument("1.0");
    $dom->preserveWhiteSpace = false;
    $dom->formatOutput = true;
    $dom->loadXML($file['pack']->asXML());
    file_put_contents($path, $dom->saveXML());
}
$nUpdated = count($euLocalizationFiles);
echo "Updated the virtual tax groups for {$nUpdated} localization files.\n";
Example #2
0
<body bgcolor='#ffffff'>
<?php 
include_once "ini/ini.php";
include_once "session.php";
include_once "printLib.php";
include_once "printReceipt.php";
include_once "connect.php";
include_once "additem.php";
include_once "ccLib.php";
include_once "maindisplay.php";
if ($_SESSION["End"] == 1) {
    addtransDiscount();
    addTax();
}
/* acg 
if ($_SESSION["End"] == 1 && $_SESSION["isStaff"] == 3 && $_SESSION["volunteerDiscount"] != 0) {
	
	wmupdate($_SESSION["memID"], $_SESSION["volunteerDiscount"]);
}
*/
$receiptType = $_SESSION["receiptType"];
$_SESSION["receiptType"] = "";
if (strlen($receiptType) > 0) {
    printReceipt($receiptType);
    if ($_SESSION["End"] == 1 || $_SESSION["msg"] == 2) {
        if ($_SESSION["msg"] == 2) {
            $returnHome = 1;
        } else {
            $returnHome = 0;
        }
        $_SESSION["End"] = 0;