Forum Discussion

DM83's avatar
DM83
Contributing User
5 months ago
Solved

Trying to generate Invoice for one customer and keep getting error

I have one customer that I have generated a quote for and now trying to convert to an invoice.  Every time I try to save it an error occurs. I have tried to create a whole new invoice and it still has an error and I am forced to quit. 

Error log is the divisible by zero.

 


System.DivideByZeroException


Message:
Attempted to divide by zero.


Stack Trace
----------------------------------------
1 : System.DivideByZeroException
----------------------------------------
System.DivideByZeroException: Attempted to divide by zero.
at mscorlib!0x06005862!System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +0x27
at mscorlib!0x0600586d!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +0x1b3
at Huxley.Service.Gateway!0x06001a2b!MYOB.Huxley.Service.Gateway.API.IGatewayService.Dispatch(String name, Object[] arguments)
at Huxley.Service.Proxy!0x060017ee!MYOB.Huxley.Service.Proxy.Services.ProxySaleContainerService.ProcessContainerWithNegativeInventoryCheckAndReset(ISaleContainer container, IEnumerable`1 objectSetVersions, Int32 saleEventId, Boolean isNew, List`1 saleItemLines, IEnumerable`1& results, Int32& savedSaleId, Guid& savedSaleUId, Int32& savedCardId, String& savedEventId, IEnumerable`1& backOrderList) +0x0
at Huxley.UI.Decorators!0x06002f29!MYOB.Huxley.UI.Decorators.Services.DecoratorServiceMYOBHuxleyApplicationServicesContainerAPIISaleContainerService.MYOB.Huxley.ApplicationServices.Container.API.ISaleContainerService.ProcessContainerWithNegativeInventoryCheckAndReset(ISaleContainer container, IEnumerable`1 objectSetVersions, Int32 saleEventId, Boolean isNew, List`1 saleItemLines, IEnumerable`1& results, Int32& savedSaleId, Guid& savedSaleUId, Int32& savedCardId, String& savedEventId, IEnumerable`1& backOrderList) +0x74
at Huxley.UI.Model!0x06003a0b!MYOB.Huxley.UI.Model.Context.EnterSaleContext.ProcessContainerWithNegativeInventoryCheckAndReset(ISaleContainer container, IEnumerable`1& results) +0x0
at Huxley.UI.Model!0x06003a07!MYOB.Huxley.UI.Model.Context.EnterSaleContext.ExecuteProcessContainerWithValidation(ISaleContainer container, List`1 validationResults) +0x0
at Huxley.UI.Model!0x06003aee!MYOB.Huxley.UI.Model.Context.Base.UIContextProcessContainer`2.InvokeContainerUpdate() +0x3a
at Huxley.UI.Model!0x06003aea!MYOB.Huxley.UI.Model.Context.Base.UIContextProcessContainer`2.ProcessContainerObject() +0x12
at Huxley.UI.Controllers!0x060011a5!MYOB.Huxley.UI.Controllers.Base.BaseControllerBusinessObject`5.SaveObjectContainer() +0x19
at Huxley.UI.Controllers!0x0600118c!MYOB.Huxley.UI.Controllers.Base.BaseControllerBusinessObject`5.SaveChanges(IEnumerable`1 entitiesToSave) +0x1a
at Huxley.UI.Forms!0x060022c7!MYOB.Huxley.UI.Forms.BaseForms.BaseViewBusinessObject.SaveChanges(IEnumerable`1 entitiesToSave) +0x52
at Huxley.UI.Forms!0x060022c5!MYOB.Huxley.UI.Forms.BaseForms.BaseViewBusinessObject.SaveChanges(IUIObject objectToSave) +0x10
at Huxley.UI.Forms!0x0600293b!MYOB.Huxley.UI.Forms.Sales.EnterSalesBase.OnCustomRight1Clicked(ButtonClickedArgs args) +0x208
at Huxley.UI.Forms!0x06002a0c!MYOB.Huxley.UI.Forms.Sales.EnterSales.OnCustomRight1Clicked(ButtonClickedArgs args) +0x33
at Huxley.UI.Forms!0x06002051!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.CallButtonClicked(Action`1 execute, ButtonClickedArgs args, String buttonText) +0x12
at Huxley.UI.Forms!0x06001fcd!MYOB.Huxley.UI.Forms.BaseForms.BaseViewForm.btnCustom1_Click(Object sender, EventArgs e) +0x30
at System.Windows.Forms!0x06001169!System.Windows.Forms.Control.OnClick(EventArgs e) +0x19
at DevExpress.XtraEditors.v17.1!0x06000d4f!DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e) +0x2e
at DevExpress.XtraEditors.v17.1!0x06000d48!DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e) +0x1d
at System.Windows.Forms!0x06001250!System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) +0x184
at System.Windows.Forms!0x06001260!System.Windows.Forms.Control.WndProc(Message& m) +0x49f
at DevExpress.Utils.v17.1!0x06002708!DevExpress.Utils.Controls.ControlBase.WndProc(Message& m) +0x2e
at DevExpress.XtraEditors.v17.1!0x06000256!DevExpress.XtraEditors.BaseControl.WndProc(Message& msg) +0x0
at System.Windows.Forms!0x060063eb!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) +0x0
at System.Windows.Forms!0x060063ee!System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) +0x8e
at System.Windows.Forms!0x0600314d!System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) +0x25
==========
MODULE: DevExpress.Utils.v17.1 => DevExpress.Utils.v17.1, Version=17.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a; G:b8c34c059b804930811d5f6d50999b6c; A:1
MODULE: DevExpress.XtraEditors.v17.1 => DevExpress.XtraEditors.v17.1, Version=17.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a; G:6df94e55f5bd4444b910d4b2a37076a4; A:1
MODULE: Huxley.Service.Gateway => Huxley.Service.Gateway, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:f9cbe21c20d3443d9d2babe4c6243f06; A:1
MODULE: Huxley.Service.Proxy => Huxley.Service.Proxy, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:46aa9df2cd034f5eb09168ce31464fc8; A:1
MODULE: Huxley.UI.Controllers => Huxley.UI.Controllers, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:46d10a09c5ee408e84c2651bc2b7b083; A:1
MODULE: Huxley.UI.Decorators => Huxley.UI.Decorators, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:8ac9e1a74ff54898866bbc424b8fb4a5; A:1
MODULE: Huxley.UI.Forms => Huxley.UI.Forms, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:93ca19cc5825453fbb5cafb9bacad1d7; A:1
MODULE: Huxley.UI.Model => Huxley.UI.Model, Version=2023.11.1.6, Culture=neutral, PublicKeyToken=947f70fecdd4159f; G:e7da28a935124333bc8e2e0b6911822d; A:1
MODULE: mscorlib => mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; G:6124afa4bc7342b581f1f084ae850486; A:2
MODULE: System.Windows.Forms => System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; G:4f38ceb21d204c87b3ee28d3e54c7dcb; A:1

----------------------------------------

  • Hi DM83,

     

    Thank you for your post.

     

    Typically, the error message you've encountered can arise from two scenarios. Firstly, it may occur if you've used an item multiple times on an order. In such cases, combining the amounts to have the item on a single line usually resolves this issue. The second scenario involves discounting an item by 100% on an order and attempting to convert it to a sale, resulting in a similar problem. To address this, you should convert the order to a sale and subsequently edit the sale to include the discount.

     

    Additionally, I've made some adjustments to your file that may assist in resolving the issue.

     

    If the error persists, please let me know, and I'd be happy to assist further.

     

    If my response has answered your question, please click on "Accept as Solution" to help other users find this information.

     

    Cheers,

    Princess

5 Replies

  • Hi DM83,

     

    Thank you for your post.

     

    Typically, the error message you've encountered can arise from two scenarios. Firstly, it may occur if you've used an item multiple times on an order. In such cases, combining the amounts to have the item on a single line usually resolves this issue. The second scenario involves discounting an item by 100% on an order and attempting to convert it to a sale, resulting in a similar problem. To address this, you should convert the order to a sale and subsequently edit the sale to include the discount.

     

    Additionally, I've made some adjustments to your file that may assist in resolving the issue.

     

    If the error persists, please let me know, and I'd be happy to assist further.

     

    If my response has answered your question, please click on "Accept as Solution" to help other users find this information.

     

    Cheers,

    Princess

    • DM83's avatar
      DM83
      Contributing User

      Thanks Princess,

       

      It all works now.

       

      I made sure my Invoices had none of those issues you described first.

       

      Since you have made the adjustments it is all good.

       

      Regards,


      Dom

       

      • Princess_R's avatar
        Princess_R
        MYOB Moderator

        Hi DM83,

         

        Thank you for your response.

         

        I'm delighted to hear that the adjustments worked and that the invoices are now in order. I will now close this post as resolved.

         

        If you ever encounter any similar issues or have any questions in the future, please don't hesitate to reach out again. I'm always happy to help!

         

        Cheers,

        Princess