sales tax
This commit is contained in:
parent
4deff2a0a9
commit
f3ab99bc02
23 changed files with 607 additions and 111 deletions
|
|
@ -1,5 +1,6 @@
|
|||
7.2.0
|
||||
- Added server side spellchecker (Martin Kamerbeek / Procolix)
|
||||
- Added configurable sales tax. (Tiffany Patterson / Elite Marketing)
|
||||
- change: made Text::Aspell optional, nullifying spellchecker if not present
|
||||
|
||||
7.1.2
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
#PBtmpl0000000000000016
|
||||
<a href="<tmpl_var viewShoppingCart.url>"><tmpl_var viewShoppingCart.label></a> ·
|
||||
<a href="<tmpl_var changePayment.url>"><tmpl_var changePayment.label></a> ·
|
||||
<a href="<tmpl_var changeShipping.url>"><tmpl_var changeShipping.label></a><br />
|
||||
<br />
|
||||
|
||||
<tmpl_var title><br />
|
||||
<ul>
|
||||
<tmpl_loop errorLoop>
|
||||
<li><tmpl_var message></li>
|
||||
</tmpl_loop>
|
||||
</ul>
|
||||
|
||||
<table> <tr align="left">
|
||||
<th style="border-bottom: 2px solid black">Product</th>
|
||||
<th style="border-bottom: 2px solid black">Quantity</th>
|
||||
<th style="border-bottom: 2px solid black" align='center'>Price</th>
|
||||
<th style="border-bottom: 2px solid black">Amount</th>
|
||||
<th style="border-bottom: 2px solid black">Sales Tax</th>
|
||||
<th style="border-bottom: 2px solid black">Each</th>
|
||||
</tr>
|
||||
|
||||
<tmpl_if normalItems>
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_loop normalItemsLoop>
|
||||
<tr>
|
||||
<td align="left"><tmpl_var name></td>
|
||||
<td align="center"><tmpl_var quantity></td>
|
||||
<td align="right"><tmpl_var price></td>
|
||||
<td align="right"><tmpl_var totalPrice></td>
|
||||
<td align="right"><tmpl_var salesTax></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tmpl_loop>
|
||||
|
||||
<tmpl_loop recurringItemsLoop>
|
||||
<tr>
|
||||
<td align="left"><tmpl_var name></td>
|
||||
<td align="center"><tmpl_var quantity></td>
|
||||
<td align="left"><tmpl_var price></td>
|
||||
<td align="right"><tmpl_var totalPrice></td>
|
||||
<td align="right"><tmpl_var salesTax></td>
|
||||
<td align="left"><tmpl_var period></td>
|
||||
</tr>
|
||||
</tmpl_loop>
|
||||
<tr style="border-top: 1px solid black">
|
||||
<td colspan='2' style="border-top: 1px solid black"> </td>
|
||||
<td align="right" style="border-top: 1px solid black"><b>Subtotal</b></td>
|
||||
<td align="right" style="border-top: 1px solid black"><b><tmpl_var subtotal></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right">Shipping</td>
|
||||
<td align="right"><tmpl_var shippingCost></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right"><tmpl_var discountsApplied.label></td>
|
||||
<td align="right"><tmpl_var discountsApplied></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">Sales Tax Rate</td>
|
||||
<td align="right"><tmpl_var salesTaxRate></td>
|
||||
<td style="border-top: 1px solid black"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right">Total Sales Tax</td>
|
||||
<td style="border-top: 1px solid black"> </td>
|
||||
<td align="right"><tmpl_var totalSalesTax></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right" style="border-top: 1px solid black"><b>Total</b></td>
|
||||
<td align="right" style="border-top: 1px solid black"><b><tmpl_var total></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<tmpl_var form>
|
||||
|
|
@ -20,11 +20,32 @@ my $quiet; # this line required
|
|||
|
||||
my $session = start(); # this line required
|
||||
|
||||
commerceSalesTax($session);
|
||||
createDictionaryStorage($session);
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
||||
##-------------------------------------------------
|
||||
sub commerceSalesTax {
|
||||
my $session = shift;
|
||||
print "\tAdding tables and columns to support sales tax in the Commerce System.\n" unless ($quiet);
|
||||
$session->db->write(<<EOS1);
|
||||
CREATE TABLE commerceSalesTax (commerceSalesTaxId varchar(22) NOT NULL, regionIdentifier varchar(50) NOT NULL, salesTax float NOT NULL, PRIMARY KEY (commerceSalesTaxId) ) ENGINE MyISAM DEFAULT CHARSET=utf8;
|
||||
EOS1
|
||||
$session->db->write(<<EOS2);
|
||||
ALTER TABLE products
|
||||
ADD COLUMN useSalesTax INTEGER DEFAULT 0;
|
||||
EOS2
|
||||
$session->db->write(<<EOS3);
|
||||
ALTER TABLE subscription
|
||||
ADD COLUMN useSalesTax INTEGER DEFAULT 0;
|
||||
EOS3
|
||||
$session->db->write(<<EOS3);
|
||||
INSERT INTO settings (name,value) VALUES ('commerceEnableSalesTax','0');
|
||||
EOS3
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub createDictionaryStorage {
|
||||
my $session = shift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue