Ignore:
Timestamp:
Mar 16, 2010, 12:00:04 PM (15 years ago)
Author:
gav
Message:

Add CostCode and InventoryItemPurchase domain classes with import features.
Includes some fixes to inventory imports, where manufacturer and supplier were crossed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r435 r441  
    3434
    3535    /**
    36     * Disaply the import view.
     36    * Display the import view.
    3737    */
    3838    def importInventory = {
     
    9090        def s = inventoryCsvService.buildInventory(inventoryItemList)
    9191        render s
     92    }
     93
     94    /**
     95    * Display the import view for purchases.
     96    */
     97    def importInventoryItemPurchases = {
     98    }
     99
     100    /**
     101    * Handle the inventory purchases import save.
     102    */
     103    def importInventoryItemPurchasesSave = {
     104        def result = inventoryCsvService.importInventoryItemPurchases(request)
     105
     106        if(!result.error) {
     107            flash.message = g.message(code: "inventory.import.success")
     108            redirect(action:search)
     109            return
     110        }
     111
     112        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
     113        redirect(action: importInventoryItemPurchases)
    92114    }
    93115
     
    194216                                    inventoryMovementListTotal: result.inventoryMovementListTotal,
    195217                                    inventoryMovementListMax: result.inventoryMovementListMax,
     218                                    inventoryItemPurchases: result.inventoryItemPurchases,
     219                                    inventoryItemPurchasesTotal: result.inventoryItemPurchasesTotal,
    196220                                    showTab: result.showTab]
    197221
Note: See TracChangeset for help on using the changeset viewer.