We are needing the unit cost to show up next to the unit price on each invoice line item on both Entry and Tracker screens of AR Invoice at the time of invoice. Is there an easy way to add a field that displays that value?
My go-to on things like this is to set up a foreign key view in the customization data tools. Then I add a textbox and set the epiBinding to the desired foreign field. Though, we’re still running classic. I haven’t delved too much into Kinetic customization yet.
I was planning on going about it that way, but how would you recommend tying the field value to a specific value? For unit cost, what really needs to be used to derive the final value? Where does this value get pulled from?
Hmm…I just looked into the Data Dictionary and realized there isn’t a “TotalUnitCost” type of field. You’d have to write a custom routine. Maybe an AfterFieldChange on InvcDtl.PartNum, which calls the part adapter, which then sums the fields corresponding to your costing method, then pushes it to a textbox.
Something like this, though I have not actually tested this. I barely checked it for obvious typos.
private void InvcDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
// ** Argument Properties and Uses **
// args.Row["FieldName"]
// args.Column, args.ProposedValue, args.Row
// Add Event Handler Code
switch (args.Column.ColumnName)
{
case "PartNum":
using (var adapter = new PartCostSearchAdapter(oTrans))
{
adapter.BOConnect();
var partCost = adapter.PartCostSearch.PartCost;
adapter.GetByID((string)args.ProposedValue,1);
if (partCost.Rows.Count > 0)
{
var cost = partCost.Rows[0].["StdLaborCost"]
+ partCost.Rows[0].["StdBurdenCost"]
+ partCost.Rows[0].["StdMaterialCost"]
+ partCost.Rows[0].["StdSubConCost"]
yourTextBox.Text = cost;
}
else
{
yourTextBox.Text = "";
}
}
}
}
What would be the steps to link the Invoice Detail table to the Part Transaction table in a BAQ? Trying to verify the values for each invoice before setting up this field
I’m tying to the PartCost table, not PartTran. Depending on how you do things there won’t even be any PartTran records for an invoice, since the pieces will have been shipped out of inventory already.
Understood. So would you go from InvcDtl → Part → PartCost?
InvcDtl → PartCost where InvcDtl.PartNum = PartCost.PartNum
There’s no need to go through Part.
Do you have any recommendations how to setup a FKV in the invcdtl customization and link it to the partcost? Is it a direct link similar to the baq?
Look at the custom code block. It calls the PartCost adapter itself and passes InvcDtl.PartNum to it.
@ypgpatel
It will be ideal to use the cost fields available in the invcdtl table.
In the invoice tracker we can use the personalization to enable the unit cost.
If total needed then it can be calculated through customization.
Do these cost fields pull average or standard costs?
Also, is there a way to maybe add a calculated field from a BAQ to a customization field? So if I created a calc field that summed up the costs and I wanted to place that summation in the Unit Cost Total field, would there be a way to just call that calculated field?
@ypgpatel,
When the invoice is created it is referenced to a shipment, it will pick up the cost from the shipment (customer shipment entry).
Standard or avereage is depends on the costing method.
@ypgpatel
Add new field for the Total cost.
Calulcate the total cost through customization or BPM, when the new line is added / updated.
Total Cost = (MtlUnitCost + LbrUnitCost + BurUnitCost + MtlBurUnitCost) X ShippedQty
Do you have any recommendations how and where to enter the formula for Total Cost in the customization?
I agree. This is a much better solution than calling the external method. Not that my idea wouldn’t work, just that this better fits best practice.
As to why I even suggested my solution, 1) I didn’t dig into the hidden columns myself. Oops. 2) I had recently wrote some reporting for my company that compared historic invoices to current costs, which does require x-referencing PartCost. So my bad on the brain fart.
That’s a basic enough question that I suggest you review the ICE documentation on EpicWeb before you proceed.
Are there fields similar to these on the OrderDtl table for the costing at the time of order?
When the invoice is created it is referenced to a shipment, it will pick up the cost from the shipment (customer shipment entry).