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 -N -r1.6 -r1.6.2.1 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 19 Sep 2002 17:12:45 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 9 May 2003 23:19:24 -0000 1.6.2.1 @@ -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 { Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql,v diff -u -N -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql 17 Oct 2002 04:38:00 -0000 1.4.2.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql 9 May 2003 23:21:20 -0000 1.4.2.2 @@ -78,6 +78,17 @@ + + + + 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 ", "]) + + + update ec_financial_transactions