Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I've killed the Invoice generator!


newmeat

Recommended Posts

Posted

Ok so I wanted to change the invoice abit. I had a look at the admin/invoice.php and saw that the log top right was store_logo.png. This wasn't in images so I created a store_logo.gif and added it. I bracketed out a few rows that I didn't need.

 

I then changed admin/includes/languages/english/invoice.php to remove the tax bit as I am not VAT registered.

 

I uploaded all 3 files to the right place but when I click invoice i get:

 

A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.

 

admin/invoice.php is set to 777

admin/includes/languages/english/invoice.php is set to 777

 

Even if I put the original admin/invoice.php back it says the same.

 

Anyone any ideas......its driving me insane!

Posted

The new code is:

<?php
/*
 $Id: invoice.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- body_text //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<!--
	<td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
	//-->
	<td class="pageHeading" align="left"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . 'store_logo.gif', STORE_NAME); ?></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
	<td colspan="2"><?php echo tep_draw_separator(); ?></td>
  </tr>
  <tr>
	<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->billing, 1, '', '<br>'); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
	  </tr>

	  <tr>
		<td class="main"><?php echo $order->customer['telephone']; ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
	  </tr>

	</table></td>
	<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
<td><table border="0" cellspacing="0" cellpadding="2">
  <tr>
	<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
	<td class="main"><?php echo $order->info['payment_method']; ?></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="dataTableHeadingRow">
	<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
	<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
	<!--<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>//-->
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
	<!--<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>//-->
	<!--<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>//-->
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
  </tr>
<?php
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
  echo '	  <tr class="dataTableRow">' . "\n" .
	   '		<td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	   '		<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

  if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
	for ($j = 0; $j < $k; $j++) {
	  echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	  if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
	  echo '</i></small></nobr>';
	}
  }

  echo '		</td>' . "\n" .
	   '		<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
  echo '		<td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
  echo '	  </tr>' . "\n";
}
?>
  <tr>
	<td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
echo '		  <tr>' . "\n" .
	 '			<td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
	 '			<td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
	 '		  </tr>' . "\n";
 }
?>
	</table></td>
  </tr>
</table></td>
 </tr>
</table>
<!-- body_text_eof //-->

<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Posted

Anyone know what sets the width of the invoice. When I print mine I only get half on a piece of A4!!! Do I need to change all the 100%'s to 2400px's???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...