573: --API start
574: --update the qty of the current row. If qty = 0, delete this row.
575: if (p_lot_quantity > 0) then
576: if (p_serial_transaction_temp_id is not null) then
577: update mtl_transaction_lots_temp
578: set primary_quantity = p_lot_quantity,
579: transaction_quantity = p_lot_quantity
580: where serial_transaction_temp_id = p_serial_transaction_temp_id
581: and transaction_temp_id = p_transaction_temp_id
581: and transaction_temp_id = p_transaction_temp_id
582: and lot_number = p_lot
583: and primary_quantity = p_old_lot_quantity;
584: else
585: update mtl_transaction_lots_temp
586: set primary_quantity = p_lot_quantity,
587: transaction_quantity = p_lot_quantity
588: where transaction_temp_id = p_transaction_temp_id
589: and lot_number = p_lot
620: x_ser_trx_id);
621: end if;
622: end if;
623: elsif (p_lot_quantity = 0) then
624: delete from mtl_transaction_lots_temp
625: where transaction_temp_id = p_transaction_temp_id
626: and lot_number = p_lot
627: and primary_quantity = p_old_lot_quantity
628: and rownum = 1;
686: end if;
687:
688: --API start
689: SELECT MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL into l_ser_trx_id from dual;
690: update mtl_transaction_lots_temp
691: set serial_transaction_temp_id = l_ser_trx_id
692: where transaction_temp_id = p_transaction_temp_id
693: and lot_number = p_lot
694: and primary_quantity = p_primary_quantity