[Fix] Incorrect assignment of Serial No in POS Invoice (#14772)

* Fix incorrect assignment of serial no in Sales Invoice through POS

* Add conversion factor to quantity check
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index cfc630a..98cf8fc 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -239,8 +239,9 @@
 								item.set(fieldname, value)
 
 							elif fieldname == "serial_no":
-								stock_qty = item.get("stock_qty") * -1 if item.get("stock_qty") < 0 else item.get("stock_qty")
-								if stock_qty != len(get_serial_nos(item.get('serial_no'))):
+								item_qty = abs(item.get("qty")) * item.get("conversion_factor")
+
+								if item_qty != len(get_serial_nos(item.get('serial_no'))):
 									item.set(fieldname, value)
 
 					if ret.get("pricing_rule"):