Bug Report: Cant Make A Purchase

Cant Make A Purchase

I cant make a purchase, it gives me ksort error something.

EH

Einnlleinhatt Ha

Reported

I cant make a purchase, it gives me ksort error something.

  • EH

    Einnlleinhatt Ha

    Answered

    Tested on your demo site but different warning.

  • MS

    Mian Saleem

    Answered

    Hello,

    Let me check this tomorrow.

    Thank you

  • MS

    Mian Saleem

    Answered

    Hello,

    I have checked. The issue is caused due to item serials. You have enabled serials on item and didn’t provide any on add purchase. I will add the validation for this to stop the process at validation with proper error message and not to escalate. If you get this again that mean you need to provide serial numbers.

    Thank you

  • EH

    Einnlleinhatt Ha

    Answered

    Mian Saleem I dont have the serial item enabled and in my purchase i dont see where can i put my serial number on

  • MS

    Mian Saleem

    Answered

    That’s strange. Let me check it again.

  • MS

    Mian Saleem

    Answered

    Hello,

    Please edit modules/MPS/Models/PurchaseItem.php and change line no 37 from if ($pId && $serials) { to

    if ($pId && $serials && $serials[0]['number']) {
    

    I hope that will fix the issue.

    Thank you

  • EH

    Einnlleinhatt Ha

    Answered

    Mian Saleem It give me different error now. I tried to add item with supplier and without supplier is giving me the same error.

  • EH

    Einnlleinhatt Ha

    Answered

    Well, with that error i can make a purchase but my product quantity is not increasing.

  • MS

    Mian Saleem

    Answered

    Hello,

    I will correct the test. As I know there is no option for default supplier.

    Can you please edit modules/MPS/Listeners/PurchaseEventListener.php and change the link no 51 if (safe_email($this->purchase->supplier->email) && !default_supplier($this->purchase->supplier_id)) { to

    if (safe_email($this->purchase->supplier->email)) {
    

    I am not sure if that’s the reason for quantity job failing. You can try after change and let me know the result.

    Thank you

  • EH

    Einnlleinhatt Ha

    Answered

    Mian Saleem New error 500 and the quantity still not increasing.

  • Login to Reply