When you post a customer invoice to GL, what initiates the Customer Invoice COGS entry?

I’m debugging an issue where a Customer Invoice in the process of being posted to the GL has problems with the Customer Invoice COGS entry that gets written in parallel.

Where in logic does this CICOGS GL posting get initiated from?

Hey Ian, the COGS customer invoice posting is initiated in the sales-backed invoice branch of posting logic called “WriteSalesReceivablesGL”. There is a variable used in this logic called SellCostCreated, that when true, will insert a GeneralLedgerHeader record for CICOGS. This variable is set from an output of a call to “WriteSalesOrderDetailGL“ and is set to true when the SellCost field on the SO is populated and not empty.

1 Like

Thanks Ben! I looked at WriteSalesReceivableGL and everything you said makes sense. Can you let me know where the GeneralLedgerDetailSellCostTT records are getting populated? I can’t see that happening in that logic block and the problem I’m investigating involves those particular detail records.

GeneralLedgerDetailSellCostTT is getting populated in WriteSalesOrderDetailGL. This LB is in the same call stack, called by WriteSalesReceivablesGL.

1 Like