NEW!

Landed costs and other inventory operations, such as changing an item’s standard cost, can affect the cost of goods sold (COGS) in closed periods. Consider the following examples:

  • You add/modify landed costs for an item and want the changes to apply for purchase orders in closed periods.
  • You change the standard cost of an item and use the Maintain Inventory Valuation tool to adjust the unit cost in the inventory subledger for closed periods.

In both scenarios, the inventory subledger is correctly updated, but the general ledger is not. You can balance out such discrepancies using COGSCLOSEDJE to apply adjustments to the general ledger in an open period.

You must define the journal to use for closed period COGS adjustments in your Inventory Control configuration. It is considered a best practice to use a separate journal for adjustments for audit purposes. You also need to create the necessary permissions for posting closed period COGS adjustments.


List Cost of Goods Sold Adjustments

readByQuery

<readByQuery>
    <object>COGSCLOSEDJE</object>
    <fields>*</fields>
    <query>NEEDSADJUSTMENT = 'true'</query>
    <pagesize>100</pagesize>
</readByQuery>

Parameters

Name Required Type Description
object Required string Use COGSCLOSEDJE
fields Optional string Comma-separated list of fields on the object to list. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide * for the value.
query Required string SQL-like query based on fields on the object. Illegal XML characters must be properly encoded. The following SQL operators are supported: <, >, >=, <=, =, like, not like, in, not in. When doing NULL comparisons: IS NOT NULL, IS NULL. Multiple fields may be matched using the AND and OR operators. Joins are not supported. Single quotes in any operands must be escaped with a backslash - For example, the value Erik's Deli would become 'Erik\'s Deli'.
pagesize Optional integer Custom page size between 1 and 1000 items (Default: 100)

query

Name Required Type Description
NEEDSADJUSTMENT Optional string Needs adjustment. Use true to list all potential adjusting journal entries, or use false to list adjustments that have already been applied. Adjustments already applied have a FIXUNIQUEID value that can be used to reverse the adjustment. (Default: true)

Response

cogsclosedje

The above function returns data structured like this:

<cogsclosedje>
    <RECORDNO>299</RECORDNO>
    <ASOFDATE>5/20/2018</ASOFDATE>
    <ITEMID>computer-87</ITEMID>
    <WAREHOUSE>1</WAREHOUSE>
    <LOCATION>1</LOCATION>
    <DOCUMENTNAME>Sales Invoice-SUBINV#0105#doc</DOCUMENTNAME>
    <CUSTOMER>FP--Future Products Inc</CUSTOMER>
    <CURRENTCOST>515</CURRENTCOST>
    <CURRENTGLCOGS>500</CURRENTGLCOGS>
    <DIFFERENCE>15</DIFFERENCE>
</cogsclosedje>

The same function returns data structured like this if NEEDSADJUSTMENT is set to false:

<cogsclosedje>
    <RECORDNO>302</RECORDNO>
    <ASOFDATE>12/18/2017</ASOFDATE>
    <ITEMID>HH Avg Inv</ITEMID>
    <WAREHOUSE>1</WAREHOUSE>
    <LOCATION>1</LOCATION>
    <DOCUMENTNAME>Sales Invoice-SUBINV#0106#doc</DOCUMENTNAME>
    <CUSTOMER>CG--Catalyst Gaming</CUSTOMER>
    <CREATEDON>2018-09-21</CREATEDON>
    <COST>2000</COST>
    <FIXUNIQUEID>302--1537558720</FIXUNIQUEID>
</cogsclosedje>

Parameters

Name Type Description
RECORDNO string Record number of the sales line item
ASOFDATE string As of date for the sales transaction
ITEMID string Item Id
WAREHOUSE string Warehouse ID
LOCATION string Location ID of warehouse (for multi-entity/multi-currency company)
DOCUMENTNAME string Sales order full document name
CUSTOMER string Customer name
CURRENTCOST number Current cost of the line
CURRENTGLCOGS number Current GL journal post amount
DIFFERENCE number Difference between current cost of the line and current GL journal post
CREATEDON string GL post date of a previously applied COGS adjustment
COST number Amount of the previously applied adjustment
FIXUNIQUEID string Unique ID of the adjustment

Get Cost of Goods Sold Adjustment

read

<read>
    <object>COGSCLOSEDJE</object>
    <keys>1</keys>
    <fields>*</fields>
</read>

Parameters

Name Required Type Description
object Required string Use COGSCLOSEDJE
keys Required string Object RECORDNO to get
fields Optional string Comma-separated list of fields on the object to get. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide * for the value.

Create Cost of Goods Sold Adjustment

Applies the specified adjustments to the configured GL journal for closed period COGS adjustments. The generated GL journal entries cannot be adjusted, but they can be rolled back by deleting the cost of goods sold adjustment.

create

<create>
    <COGSClosedJE>
        <RECORDNO>6</RECORDNO>
        <POSTINGDATE>09/18/2018</POSTINGDATE>
    </COGSClosedJE>
</create>

Parameters

Name Required Type Description
COGSClosedJE Required object Object to create

COGSCLOSEDJE

Name Required Type Description
RECORDNO Required string Record number of the cost of goods sold adjustment to apply
POSTINGDATE Optional string Posting date in format mm/dd/yyyy (Default: first date in first available open period)

Delete Cost of Goods Sold Adjustment

When you delete a cost of goods sold adjustment, the adjusting GL journal entry is rolled back and the COGSCLOSEDJE entry with the given key becomes available as a potential adjustment again.

delete

Deletes the adjustment with the given unique identifier:

<delete>
    <object>COGSCLOSEDJE</object>
    <keys>302--1537558720</keys>
</delete>

Parameters

Name Required Type Description
object Required string Use COGSCLOSEDJE
keys Required string Unique identifier for the fix (FIXUNIQUEID) for the COGSCLOSEDJE to delete. You can only delete one at a time.

Provide feedback