[comment] ui_template: Yes ui_template_name: noleft [/comment] [tmp members_only]1[/tmp] [tmp page_title]__COMPANY__ -- [L]Order History[/L][/tmp] [control reset=1] [control reset=1] @_NOLEFT_TOP_@ [tmpn bounce_page]query/check_orders[/tmpn] [perl transactions] my $on = $Session->{arg}; my $un = $Tag->data('transactions', 'username', $on); if($un eq $Session->{username}) { delete $Scratch->{bounce_page}; } else { $Tag->warnings('Not your order!'); } return; [/perl] [bounce page="[scratch bounce_page]" if="[scratch bounce_page]"]
[perl tables=country]### pre-open database for calcs below[/perl] [loop list="[data session arg]"]

Order Number: [loop-data transactions order_number]

Order Status: [display table=transactions col=status type=display key="[loop-code]"] [if-loop-data transactions archived == 1] ([L]archived[/L]) [/if-loop-data] [if-loop-data transactions deleted == 1] ([L]deleted[/L]) [/if-loop-data]

Affiliate: [if-loop-data transactions affiliate] [loop-data transactions affiliate] [else] none [/else] [/if-loop-data]

Order Date: [convert-date fmt="%b %e, %Y %l:%M %P"][loop-data transactions order_date][/convert-date]

Billing Address

[if-loop-data transactions b_address1] [loop prefix=bill list="[loop-code]"]

[L]Name[/L]: | [loop-data transactions b_fname] [loop-data transactions b_lname]
[if-bill-data transactions b_company]
[L]Company[/L]: | [loop-data transactions b_company]
[/if-bill-data]
[L]Address[/L]: | [loop-data transactions b_address1] [if-bill-data transactions b_address2] [loop-data transactions b_address2] [/if-bill-data]
[if-bill-data transactions b_country =~ /^US|^CA/]
[L]City, State, Zip[/L]: | [loop-data transactions b_city], [loop-data transactions state] [loop-data transactions zip]
[else]
[L]City[/L]: | [loop-data transactions b_city]
[if-bill-data transactions b_state]
[L]State[/L]: | [loop-data transactions b_state]
[/if-bill-data] [if-bill-data transactions b_zip]
[L]Postal code[/L]: | [loop-data transactions b_zip]
[/if-bill-data] [/else] [/if-bill-data]
[L]Country[/L]: | [data table=country col=name key="[loop-data transactions b_country]"]

[/loop] [else] Same as shipping address [/else] [/if-loop-data]

Shipping Address

[L]Name[/L]: | [loop-data transactions fname] [loop-data transactions lname]
[if-loop-data transactions company]
[L]Company[/L]: | [loop-data transactions company]
[/if-loop-data]
[L]Address[/L]: | [loop-data transactions address1] [if-loop-data transactions address2] [loop-data transactions address2] [/if-loop-data]
[if-loop-data transactions country =~ /^US|^CA/]
[L]City, State, Zip[/L]: | [loop-data transactions city], [loop-data transactions state] [loop-data transactions zip]
[else]
[L]City[/L]: | [loop-data transactions city]
[if-loop-data transactions state]
[L]State[/L]: | [loop-data transactions state]
[/if-loop-data] [if-loop-data transactions zip]
[L]Postal code[/L]: | [loop-data transactions zip]
[/if-loop-data] [/else] [/if-loop-data]
[L]Country[/L]: | [data table=country col=name key="[loop-data transactions country]"]

[L]Status[/L] | [L]SKU[/L] | [L]Name[/L] | [L]Qty[/L] | [L]Unit Price[/L] | [L]Total[/L]
[query list=1 sql="select * from orderline where order_number = '[loop-code]'"]
[display table=transactions column=status key="[loop-code]" arbitrary=order_view ] [calc] $total_weight += ([field field=weight key="[sql-param sku]"] + 0 || 0) * [sql-data orderline quantity]; return; [/calc] | [sql-param sku] | [sql-filter 30.][sql-param description][/sql-filter] | [sql-param quantity] | [sql-param price] | [sql-param subtotal]
[/query]
[L]Item Total[/L]: | [currency][loop-data transactions subtotal][/currency]
[L]Tax:[/L] | [currency][loop-data transactions salestax][/currency]
[L]Total Weight:[/L] | [calc]$total_weight[/calc]
[if-loop-data transactions handling > 0]
[L]Shipping[/L] | [currency][loop-data transactions shipping][/currency]
[/if-loop-data]
[L]Shipping[/L] | [currency][loop-data transactions shipping][/currency]
[L]GRAND TOTAL:[/L] | [currency][loop-data transactions total_cost][/currency]

[/loop]
[page query/check_orders extra='style="font-size: larger"']Return
@_NOLEFT_BOTTOM_@