We need to be able to process returns and exchanges through admin for a qtpro ajax order editor osc heavily customized shop.
On admin/[login to view URL] in three places, we need a new button called "return/exchange" (attachments 1 & 2). This button will create a new order with all the same customer ship to/bill to/products as the original BUT all products in this order will be negative quantity - restocking the products quantity to current stock --- remember we are running qt pro stock by attributes. The shipping will NOT be carried over, nor will other order totals unless specified below. By clicking this return/exchange button you will then be taken to the new orders edit page (attach 3).
This new order will contain all items that were on the previous order (in negative quantities). This new order will also contain any discounts (current in the database as: ot_discount_coupon) but in a positive amount that were in the previous order. This order will also contain the dollar amount of the original order for reference purposes (again attachment).
This order when created will be given a new status entry and comments in the database which display on both edit screens. The status entry will be "completed in store" and the comments will contain the previous order number with a link to it (attach 3) this needs to be written to the products table called return_exchange (entry already is referenced elsewhere). If the original order was paid for by credit card through [login to view URL], enough payment information will be captured from the original order to allow for [login to view URL] processing in the new order but not posted in the comments section (security). If the order were paid for by paypal a notice will appear across the top of the screen saying "This payment was processed through paypal. To refund please visit PAYPAL." w/ link to direct the operator to refund.
This order will be editable as was the previous order with ajax order editor (by clicking on the edit button on the top or bottom of the page) (attach 3).
In this edit orders page (attach 4) new products in positive quantities may be added, some products may be deleted (alerts across the top of the page will be preserved). The stock again needs to be added/subtracted (it currently does decrement inventory when an item is added to the order through this editor) when changed through the ajax editor.
Currently there is a section to add/remove shipping and order totals. These need to be maintained AND a new section called restocking fee needs to be added (attach 4) with options of dollar amount or percentage to add to the order as an order total (currently in database as ot_restock).
When an order is finished being edited by the operator they will be able to click the new "Process Payment/Credit" button. This will popup a new window (attach 5) (either credit or charge transaction through [login to view URL] based on the calculation of the new order total and the original transaction amount that has been reference on the new order) and will populate the card information from the original order obtained from the customer AND will calculate the charge/credit amount. The operator then must be able to see that amount to verify and click the process order button. An email with then be sent to the customer with a new invoice (the same html email they get when they complete an order online) and the order will be status updated to "order processed" status if it contains ANY items with a positive quantity or remain in "completed in store" if it does not.
*** If an item in an order does not exist in the database any more, a new order will be created but a note in red will appear across the top of the screen that says "one or more item from the original order no longer exists in your database, please add this item as a non inventory item."
*** Suggestions for 2nd or 3rd returns need to be made- if a customer does an exchange but then wants to return that new item.