[interchange-cvs] interchange - edl modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Nov 21 19:55:18 EST 2003


User:      edl
Date:      2003-11-22 00:55:17 GMT
Modified:  dist/foundation/pages process_return.html
Modified:  dist/foundation/pages/query order_return.html
Log:
Fixed bugaboos which would allow return of 0 items. Also added code so qty of
items returnable is automatically <= qty ordered, and added detail lines to
return receipt and email.

Revision  Changes    Path
2.2       +104 -9    interchange/dist/foundation/pages/process_return.html


rev 2.2, prev_rev 2.1
Index: process_return.html
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/pages/process_return.html,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- process_return.html	8 Feb 2003 16:42:15 -0000	2.1
+++ process_return.html	22 Nov 2003 00:55:17 -0000	2.2
@@ -36,7 +36,7 @@
 
 <!-- BEGIN CONTENT -->
 
-[if !value return_items]
+[if !cgi return_items]
 
 [L]No items were selected for return.[/L]
 <br><br>
@@ -50,22 +50,26 @@
 
 [perl tables="orderline"]
 
-my @items = split /\0/, $Values->{return_items};
+my @items = split /\0/, $CGI->{return_items};
 my $num_items = @items;
 $Scratch->{ret_num_items} = $num_items;
 
 my $count = 0;
 my $amount3 = 0;
 my $total_qty = 0;
+my $detail;
 
 foreach (@items) {
 
 my $code = @items[$count];
+$detail .= $Tag->data('orderline', 'sku', $code) . "\t";
 my $qty1 = $Tag->data('orderline', 'quantity', $code);
 my $amount1 = $Tag->data('orderline', 'price', $code);
 my $code = "qty-$code";
 my $qty2 = $Values->{$code};
+$detail .= "$qty2\t";
 my $amount2 = $amount1 * $qty2;
+$detail .= $Tag->currency( {}, $amount2 ) . "\n";
 $amount3 = $amount2 + $amount3;
 $total_qty = $qty2 + $total_qty;
 
@@ -80,17 +84,21 @@
 	
 $count ++;
 }
-
+$Tag->tmp( { name => 'return_detail' }, $detail );
 
 [/perl]
 
 [if scratch qty_over]
-
-[L]You may not return more items than you originally purchased.[/L]
-<br><br>
-[L]Please use your browser's back to enter a more appropriate value.[/L]
-<br><br>
-
+	[L]You may not return more items than you originally purchased.[/L]
+	<br><br>
+	[L]Please use your browser's back to enter a more appropriate value.[/L]
+	<br><br>
+[elsif scratch total_qty == 0]
+	[L]You need to indicated the quantity of items you wish to return.[/L]
+	<br><br>
+	[L]Please use your browser's back to enter a more appropriate value.[/L]
+	<br><br>
+[/elsif]
 [else]					  
 
 [seti rma_number][counter etc/rma.number][/seti]
@@ -141,8 +149,28 @@
 </tr>
 </table>
 
+
+<table border="1" cellspacing="0" cellpadding="3">
+<tr>
+	<th colspan=4>[L]Returned Items Detail[/L]</th>
+<tr>
+	<td>[L]SKU[/L]</td>
+	<td align=right>[L]Quantity[/L]</td>
+	<td align=right>[L]Extension[/L]</td>
+</tr>
+[loop delimiter="\n" arg="[scratch return_detail]"]
+	<tr>
+	[loop prefix=line delimiter="\t" arg="[loop-code]"]
+		<td>[line-code]</td>
+	[/loop]
+	</tr>
+[/loop]
+</table>
+
 <p>&nbsp; </p>
 
+
+
 [set name=return1 interpolate=1]
 
 [comment] SEND REPORT OF NEW RETURN TO SHOP OWNER [/comment]
@@ -168,10 +196,44 @@
 [L]Item Quantity[/L]: [scratch total_qty]
 [L]Credit Amount[/L]: [currency][scratch return_credit][/currency]
 					
+[row 80]
+[column width=25][/column]
+[column width=30]
+	[L]Returned Items Detail[/L]
+[/column]
+[column width=25][/column]
+[/row]
+[row 80]
+[column width=18][/column]
+[column width=15 align=left]
+	[L]SKU[/L]
+[/column]
+[column width=15 align=left]
+	[L]Quantity[/L]
+[/column]
+[column width=15 align=left]
+	[L]Extension[/L]
+[/column]
+[/column width=17][/column]
+[/row]
+[loop delimiter="\n" arg="[scratch return_detail]"]
+[row 80]
+[column width=18][/column]
+	[loop prefix=line delimiter="\t" arg="[loop-code]"]
+	[column width=15 align=left]
+		[line-code]
+	[/column]
+	[/loop]
+[/column width=17][/column]
+[/row]
+[/loop]
+
 [/email]
 
+
 [/set]
 
+
 [set name=return1 interpolate=1]
 
 [comment] SEND RETURN SUMMARY TO CUSTOMER [/comment]
@@ -203,7 +265,40 @@
 [L]Item Quantity[/L]: [scratch total_qty]
 [L]Credit Amount[/L]: [currency][scratch return_credit][/currency]
 					
+[row 80]
+[column width=25][/column]
+[column width=30]
+	[L]Returned Items Detail[/L]
+[/column]
+[column width=25][/column]
+[/row]
+[row 80]
+[column width=18][/column]
+[column width=15 align=left]
+	[L]SKU[/L]
+[/column]
+[column width=15 align=left]
+	[L]Quantity[/L]
+[/column]
+[column width=15 align=left]
+	[L]Extension[/L]
+[/column]
+[/column width=17][/column]
+[/row]
+[loop delimiter="\n" arg="[scratch return_detail]"]
+[row 80]
+[column width=18][/column]
+	[loop prefix=line delimiter="\t" arg="[loop-code]"]
+	[column width=15 align=left]
+		[line-code]
+	[/column]
+	[/loop]
+[/column width=17][/column]
+[/row]
+[/loop]
+
 [/email]
+
 
 [/set]
 



2.3       +10 -1     interchange/dist/foundation/pages/query/order_return.html


rev 2.3, prev_rev 2.2
Index: order_return.html
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/pages/query/order_return.html,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- order_return.html	14 Feb 2003 12:26:01 -0000	2.2
+++ order_return.html	22 Nov 2003 00:55:17 -0000	2.3
@@ -104,7 +104,16 @@
 		WHERE order_number = '[scratch arg]'
 		ORDER BY code
 	|
-]<input type="checkbox" name="return_items" value="[sql-param code]">	<input type="text" name="qty-[sql-param code]" size="3" value="[sql-param quantity]">	[sql-param sku]	[description [sql-param sku]]<BR>[if-sql-data orderline size][L]SIZE[/L]-->[sql-param size][/if-sql-data][if-sql-data orderline color] [L]COLOR[/L]-->[sql-param color][/if-sql-data][calc]
+][calc]
+	my ($out, $i);
+	$out = qq{<select name="qty-[sql-param code]">};
+	for ($i = 0; $i <= [sql-param quantity]; $i++) {
+		$out .= qq{<option value="$i">$i};
+	}
+	$out .= q{</select>};
+	$Tag->tmp( { name => 'return_qty' }, $out );
+	return;
+[/calc]<input type="checkbox" name="return_items" value="[sql-param code]">	[scratch return_qty]	[sql-param sku]	[description [sql-param sku]]<BR>[if-sql-data orderline size][L]SIZE[/L]-->[sql-param size][/if-sql-data][if-sql-data orderline color] [L]COLOR[/L]-->[sql-param color][/if-sql-data][calc]
 return unless
 	q{[userdb function=check_file_acl mode=expire location="[sql-param sku]"]};
 	return get_download(q{[sql-param sku]});








More information about the interchange-cvs mailing list