Skip to content

[Bug]: Item_id integer validation faild on sales item add #4188

@mrkzshawon

Description

@mrkzshawon

Bug Description?

Image

Steps to Reproduce?

In sales Find or Scan Item search box, type some string and hit enter.

Expected Behavior?

In sales controller postAdd function can be an integer validation rules like bellow
$rules = [ 'item' => 'trim|required|integer' ];

if($this->validate($rules)) { if($item_id_or_number_or_item_kit_or_receipt == '' || !$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $item_location, $quantity, $discount, $discount_type, PRICE_MODE_STANDARD, null, null, $price)) { $data['error'] = lang('Sales.unable_to_add_item'); } else { $data['warning'] = $this->sale_lib->out_of_stock($item_id_or_number_or_item_kit_or_receipt, $item_location); } } else { $data['error'] = lang('Sales.unable_to_add_item'); }

OpensourcePOS Version

development (unreleased)

Php version

Php 8.3

What browsers are you seeing the problem on?

Firefox

Server Operating System and version

Wamp Server

Database Management System and version

MySQL 9.1.0

Web Server and version

Apache 2.4.62

System Information Report (optional)

System Information Report

Unmodified copy of OpensourcePOS

  • I agree this copy has not been modified

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions