// auction price - tax $unitpriceincl = vat($paysubtotal); // auction price & tax $subtotal = $payvalue; // total invoice - tax $totalinc = vat($payvalue); // total invoice & tax } } $totalvat = $totalinc - $subtotal; $unitpriceincl = $totalinc / $data['qty']; $unitexcl = $subtotal / $data['qty']; // auction specific details $template->assign_vars(array('AUCTION_TITLE' => strtoupper($title), 'ITEM_QUANTITY' => $data['qty'], 'UNIT_PRICE' => $system->print_money($unitexcl, true, false), 'UNIT_PRICE_WITH_TAX' => $system->print_money($unitpriceincl, true, false), 'TOTAL' => $system->print_money($subtotal, true, false), 'TOTAL_WITH_TAX' => $system->print_money($totalinc, true, false))); } else { $seller = getSeller($user->user_data['id']); // used as user: ?? $vat = getTax(true, $seller['country']); $winner_address = ''; $data['shipping_terms'] = ''; $shipping_cost = 0; $title = $system->SETTINGS['sitename'] . ' - ' . $MSG['766'] . '#' . $data['id']; $payvalue = $data['total']; // create fee data ready for template & get totals $totals = setfeetemplate($data); // fee specific details $template->assign_vars(array('TOTAL' => $system->print_money($totals[1], true, false), 'TOTAL_WITH_TAX' => $system->print_money($totals[0], true, false))); } $template->assign_vars(array('DOCDIR' => $DOCDIR, 'LOGO' => $system->SETTINGS['siteurl'] . 'themes/' . $system->SETTINGS['theme'] . '/' . $system->SETTINGS['logo'], 'CHARSET' => $CHARSET, 'LANGUAGE' => $language, 'SENDER' => $seller['nick'], 'WINNER_NICK' => $winner['nick'], 'WINNER_ADDRESS' => $winner_address, 'AUCTION_ID' => $data['auc_id'], 'SHIPPING_METHOD' => empty($data['shipping_terms']) ? strtoupper($MSG['000']) : $data['shipping_terms'], 'INVOICE_DATE' => gmdate('d/m/Y', $data['date'] + $system->tdiff), 'SALE_ID' => ($auction ? 'AUC' : 'FEE') . $data['id'], 'TAX' => $vat . '%', 'SHIPPING_COST' => $system->print_money($shipping_cost, true, false), 'VAT_TOTAL' => $system->print_money($totalvat, true, false), 'TOTAL_SUM' => $system->print_money($payvalue, true, false), 'YELLOW_LINE' => $system->SETTINGS['invoice_yellow_line'], 'THANKYOU' => $system->SETTINGS['invoice_thankyou'], 'B_INVOICE' => true, 'B_IS_AUCTION' => $auction)); $template->set_filenames(array('body' => 'order_invoice.tpl')); $template->display('body');
// get fee data $query = "SELECT * FROM " . $DBPrefix . "useraccounts WHERE useracc_id = :user_id"; $params = array(); $params[] = array(':user_id', $_GET['id'], 'int'); $db->query($query, $params); // check its real if ($db->numrows() < 1) { invalidinvoice(); } $data = $db->result(); // do you have permission to view this? if (!$fromadmin && $data['user_id'] != $user->user_data['id']) { invalidinvoice(); } //$seller = getSeller($user->user_data['id']); // used as user: ?? $seller = getSeller($data['user_id']); $vat = getTax(true, $seller['country']); $winner['nick'] = ''; $winner_address = ''; $data['shipping_terms'] = ''; $data['id'] = $data['useracc_id']; $shipping_cost = 0; $title = $system->SETTINGS['sitename'] . ' - ' . $MSG['766'] . '#' . $data['id']; $payvalue = $data['total']; $totalvat = 0; // create fee data ready for template & get totals $totals = setfeetemplate($data); // fee specific details $template->assign_vars(array('TOTAL' => $system->print_money($totals[1], true, false), 'TOTAL_WITH_TAX' => $system->print_money($totals[0], true, false))); } $template->assign_vars(array('DOCDIR' => $DOCDIR, 'LOGO' => $system->SETTINGS['siteurl'] . 'themes/' . $system->SETTINGS['theme'] . '/' . $system->SETTINGS['logo'], 'CHARSET' => $CHARSET, 'LANGUAGE' => $language, 'SENDER' => $seller['nick'], 'WINNER_NICK' => $winner['nick'], 'WINNER_ADDRESS' => $winner_address, 'AUCTION_ID' => $data['auc_id'], 'SHIPPING_METHOD' => empty($data['shipping_terms']) ? strtoupper($MSG['000']) : $data['shipping_terms'], 'INVOICE_DATE' => date('d/m/Y', $data['date'] + $system->tdiff), 'SALE_ID' => ($auction ? 'AUC' : 'FEE') . $data['id'], 'TAX' => $vat . '%', 'SHIPPING_COST' => $system->print_money($shipping_cost, true, false), 'VAT_TOTAL' => $system->print_money($totalvat, true, false), 'TOTAL_SUM' => $system->print_money($payvalue, true, false), 'YELLOW_LINE' => $system->SETTINGS['invoice_yellow_line'], 'THANKYOU' => $system->SETTINGS['invoice_thankyou'], 'B_INVOICE' => true, 'B_IS_AUCTION' => $auction));