Skip to content

No such property: comments for class: org.pih.warehouse.inventory.BinLocationItem #5392

@NatipongSupatsorn

Description

@NatipongSupatsorn

URI
/openboxes/product/createProductSnapshot/2c938084975398ce01975751713a00ee
Class
groovy.lang.MissingPropertyException
Message
No such property: comments for class: org.pih.warehouse.inventory.BinLocationItem

def recordStock(Location location, List lineItems) {

    if (!location || !location.inventory) {
        throw new IllegalArgumentException("Record stock transactions require a location")
    }

    Transaction transaction = new Transaction()
    transaction.transactionDate = new Date()
    transaction.inventory = location.inventory
    transaction.transactionNumber = generateTransactionNumber(transaction)
    transaction.transactionType = TransactionType.get(Constants.PRODUCT_INVENTORY_TRANSACTION_TYPE_ID)

    lineItems.each { lineItem ->
        // Add transaction entry to transaction
        TransactionEntry transactionEntry = new TransactionEntry()
        transactionEntry.binLocation = lineItem.binLocation
        transactionEntry.inventoryItem = lineItem.inventoryItem
        transactionEntry.quantity = lineItem.quantity
        transactionEntry.comments = lineItem.comments <----------------------------- Please consider this line. Thank you.
        transaction.addToTransactionEntries(transactionEntry)
    }

    if (!transaction.hasErrors() && transaction.save()) {
        log.info("Transaction saved: " + transaction)
    }

    return transaction
}

Metadata

Metadata

Assignees

Labels

domain: backendChanges or discussions relating to the backend serverstatus: needs investigationAn issue that needs to be investigated. Typically involves identifying the source of a bugtype: bugAddresses unintended behaviours of the app

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions