Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 10 Dec 2002 20:05:50 -0000 1.7 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 17 May 2003 10:30:21 -0000 1.8 @@ -231,10 +231,22 @@ where transaction_id = :pgw_transaction_id" } - # Flag that no new transactions need to be - # created for this shipment. + # The shipment is a partial shipment but the shipment + # cost equals the order cost. This could be due to + # voiding of items. A new transaction is required if + # there are no more items awaiting shipment and this + # shipment thus completes the order. - set create_new_transaction false + if {[string equal 0 [db_string count_remaining_items " + select count(*) + from ec_items + where order_id = :order_id + and item_state = 'to_be_shipped' + and item_id not in ([join $item_id_list ", "])" -default 0]]} { + set create_new_transaction true + } else { + set create_new_transaction false + } } } else {