Acumatica / Acumatica-LotSerialNbrAttribute-2023R1-ONWARD

Adding Attribute Support to Lot/Serial Number
GNU General Public License v3.0
8 stars 0 forks source link

Move Screen #5

Closed Atkinsa closed 8 months ago

Atkinsa commented 10 months ago

Apparently the Move screen does not create entries in the INItemLotSerial table when creating serial lots when the production ticket is linked to a sales order (all other times and other screens do). If this is not a bug and is intended behavior, how can this project workaround it? The attributes remain empty on the Line Details of the Move screen until it is released, but at the point they are not editable, so it's self-defeating.

DhirenChhapgar commented 8 months ago

I was able to replicate the issue you are reporting. Lot/Serial number not being generated in INItemLotSerial table during Move operation until release when this Move transaction is linked to Sales Order is core manufacturing module behavior and cannot be handled with in scope of this customization. I have reported this issue to relevant product team. I advise you create a support case for this issue.

As a workaround, you may want to create production order first and link to Sales Order until this is addressed in core product.

Atkinsa commented 8 months ago

Thank you for the confirmation! Please note that Acumatica did give me a work-around for this issue if you are interested, but it does require overriding a validation check on an accumulator, so it might not be desired for a universal project like this one.

RobertCSternberg commented 8 months ago

Hello @Atkinsa, do you have more details on the workaround? It would be helpful for us.

Thanks!

Atkinsa commented 8 months ago

Hi Robert,

What I did was basically to override the IsZero function on this Accumulator to always return false:

PX.Objects.IN.InventoryRelease.Accumulators.QtyAllocated.ItemLotSerial.AccumulatorAttribute

Unfortunately, the only way (that I found) to utilize that function is to copy/paste the entire class and change the IsZero method: public virtual bool IsZero(ItemLotSerial a) => false; // a.IsZero();

Once that’s done it’s simply a matter of forcing the ProdMaint screen to use it:

public class ProdMaintExt : PXGraphExtension { public override void Initialize() { Base.Caches().Interceptor = new MyNewAccumulatorAttribute(); base.Initialize(); }

Below is the functionality being addressed in this “fix” and why it’s by design so you can see if you should include it or not (direct quote from Acumatica support):

This is basically the designed behavior caused by 2 factors:

1) Item plans for finished goods attached to production orders created from SO have the MD/ME plan type (Production for SO [Prepared])

These plan types (unlike the Production Supply [Prepared] plan types for 'non-SO' production oders) are not supposed to affect available qty (because they are always supposed to be offset by demand plans), which is done by setting InclQtyProductionSupply to 0:

@.***

2) INItemLotSerial (like any other 'status accumulator') record is not inserted when all itq qties are zero. This is implemented in the PrepareInsert method of the ItemLotSerialAccumulatorAttribute :

protected override bool PrepareInsert(PXCache sender, object row, PXAccumulatorCollection columns)

    {

     ...

        }

                                if (sender.GetStatus(row) == PXEntryStatus.Inserted && IsZero((ItemLotSerial)row))

                                {

                                            sender.SetStatus(row, PXEntryStatus.InsertedDeleted);

                                            return false;

                                }

        return true;

    }

public virtual bool IsZero(ItemLotSerial a)

                    {

                                return a.IsZero();

                    }

        public static bool IsZero(this Overrides.INDocumentRelease.ItemLotSerial a)

                    {

                                return (a.QtyOnHand == 0m)

                                  && (a.QtyAvail == 0m)

                                  && (a.QtyHardAvail == 0m)

                                  && (a.QtyActual == 0m)

                                  && (a.QtyNotAvail == 0m)

                                  && (a.QtyInTransit == 0m)

                                  && (a.QtyOnReceipt == 0m)

                                  && (a.UpdateExpireDate != true);

                    }

Theoretically, you can create inherot from the ItemLotSerialAccumulatorAttribute and override the IsZero function (say, to always returning false). It might require some trick to re-attach the derived attribute to the ItemLotSerial DAC (instead of ItemLotSerialAccumulatorAttribute )

@.***

Hope that helps! Alan E Atkins @.**@.> Mobile: 610.312.4569 [mayer_logo]http://www.mayererp.com/ @.***

Mayer Group | 1255 Winter Garden Vineland Road | Winter Garden, FL 34787 | mayererp.comhttp://mayererp.com/ | @. https://www.linkedin.com/company/3783629 @. https://twitter.com/MayerERPGroup

From: Robert Sternberg @.> Sent: Wednesday, January 17, 2024 2:57 PM To: Acumatica/Acumatica-LotSerialNbrAttribute-2023R1-ONWARD @.> Cc: Alan Atkins @.>; Mention @.> Subject: Re: [Acumatica/Acumatica-LotSerialNbrAttribute-2023R1-ONWARD] Move Screen (Issue #5)

Hello @Atkinsahttps://github.com/Atkinsa, do you have more details on the workaround? It would be helpful for us.

Thanks!

— Reply to this email directly, view it on GitHubhttps://github.com/Acumatica/Acumatica-LotSerialNbrAttribute-2023R1-ONWARD/issues/5#issuecomment-1896590662, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQ57UITV33WASBBA4TDJ54DYPAUILAVCNFSM6AAAAAA7WRPDUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGU4TANRWGI. You are receiving this because you were mentioned.Message ID: @.**@.>>

RobertCSternberg commented 8 months ago

Thanks @Atkinsa for explaining the bug fix, we will try overriding the IsZero function to return false in our environment.

I appreciate the detail!

Regards, Robert.