Mailing List Archive

Still seeking solution to bug in interchange reports
To facilitate the handling of orders, we needed a menu type system that
helped us track orders, sort of like McDonalds, etc.

So, I have modified the order detail reports so that we can separate the
shipped and cancelled orders from the pending order reports and they
seem to work fine.

First, we need at least the user's last name in the reports so we added
to Detail.html :
    <TD VALIGN=top>
    [L]Order[/L]
    </TD>
    <TD VALIGN=top>
        [L]Affiliate[/L]
    </TD>
    <TD VALIGN=top>
        [L]Campaign[/L]
    </TD>
    <TD VALIGN=top>
        [L]Name[/L]
    </TD>
_____________AND________________

[.query    hashref=main
    st=db
    ml=100000
    table=transactions
    sql="
    select order_number, affiliate, campaign, total_cost,
payment_method, state, city, status, order_date, lname
        from  transactions
        WHERE deleted <> '1'

_____________AND________________

    <TR class=rnorm>
    <TD VALIGN=top>
    <A HREF="$url">$line->{order_number}</A>
    </TD>
    <TD VALIGN=top>
    $line->{affiliate}&nbsp;
    </TD>
    <TD VALIGN=top>
    $line->{campaign}&nbsp;
    </TD>
    <TD VALIGN=top>
    $line->{lname}&nbsp;
    </TD>

_____________________________

We also need the invoice number but could not find it saved anywhere in
the orderline or transaction files. That is the only information that
the customers get and they call up asking for a status on invoice number.

To get the pending, shipped, and cancelled order reports, we copied and
modified the Detail.html

_____________pending orders________________ >>Pending.html

    foreach $line (@$mary) {
        if ( $line->{status} eq 'pending') {  ### pending orders only

        $total_sales    += $line->{total_cost};
        $amount = $Tag->currency({}, $line->{total_cost});
            $line->{status} = $Tag->loc('', $line->{status});

        $url = $Tag->area({     href => '__UI_BASE__/order_view',
                    form => "order=$line->{order_number}", });


        $out .= <<EOF;

....

}

_____________shipped orders________________  Shipped.html

    foreach $line (@$mary) {
        if ( $line->{status} eq 'shipped') {  ### shipped orders only

        $total_sales    += $line->{total_cost};
        $amount = $Tag->currency({}, $line->{total_cost});
            $line->{status} = $Tag->loc('', $line->{status});

        $url = $Tag->area({     href => '__UI_BASE__/order_view',
                    form => "order=$line->{order_number}", });


        $out .= <<EOF;

______________cancelled orders_______________ Cancelled.html

For canceled orders, we modified:

    foreach $line (@$mary) {
        if ( $line->{status} eq 'canceled') {  ### canceled orders only

        $total_sales    += $line->{total_cost};
        $amount = $Tag->currency({}, $line->{total_cost});
            $line->{status} = $Tag->loc('', $line->{status});

        $url = $Tag->area({     href => '__UI_BASE__/order_view',
                    form => "order=$line->{order_number}", });


        $out .= <<EOF;
_____________________________


Also modified interchange/lib/UI/pages/include/menus/OrderStats.txt

code    mgroup    msort    next_line    indicator    exclude_on
depends_on    page    form    name    super    inactive description   
help_name    img_dn    img_up    img_sel img_icon    url
001    OrderReports    x001                    admin/orderstats    
Order Reports Menu        0
002    OrderReports    x002 admin/reports/order/ByAffiliate       
Overall by month 0
003    OrderReports    x003 admin/reports/order/Monthly        This
month        0     For this month
004    OrderReports    x004 admin/reports/order/Detail        Individual
orders        0  For this month
005    OrderReports    x005 admin/reports/order/BySKU        By SKU   
    0     For this month
006    OrderReports    x006 admin/reports/order/Pending        Pending
orders        0     For this month
007    OrderReports    x007 admin/reports/order/Shipped        Shipped
orders        0     For this month
008    OrderReports    x008 admin/reports/order/Canceled        Canceled
orders        0  For this month

_____________________________

And modified interchange/lib/UI/pages/admin/orderstats.html

<TD COLSPAN=2 class=rnorm>
    [set [L]List individual orders[/L]]
    mv_nextpage=__UI_BASE__/reports/order/Detail
    [/set]
    [set [L]List pending orders[/L]]
    mv_nextpage=__UI_BASE__/reports/order/Pending
    [/set]
    [set [L]List shipped orders[/L]]
    mv_nextpage=__UI_BASE__/reports/order/Shipped
    [/set]
    [set [L]List canceled orders[/L]]
    mv_nextpage=__UI_BASE__/reports/order/Canceled
    [/set]
    [set [L]By day[/L]]
    mv_nextpage=__UI_BASE__/reports/order/Monthly
    [/set]
    <BLOCKQUOTE>
    <INPUT TYPE=submit VALUE="[L]By
month[/L]">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=submit NAME=mv_click
VALUE="[L]By day[/L]">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=submit
NAME=mv_click VALUE="[L]List individual
orders[/L]">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=submit NAME=mv_click
VALUE="[L]List pending orders[/L]">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT
TYPE=submit NAME=mv_click VALUE="[L]List shipped
orders[/L]">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=submit NAME=mv_click
VALUE="[L]List canceled orders[/L]">
    </BLOCKQUOTE>
</TD>


_____________________________

I am happy to contribute and will be glad to upload the full files if
anyone requests so.


Also, My greatest appreciation to those who helped with suggestions.

David Etheredge


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users