Man, you can use
stored procedure instead of
trigger for this operation.
Inside the stored procedure, write Insert query for the Transaction Table & then for Stock table.
example looks like
CREATE PROCEDURE UspSALES
(...arguments...)
BEGIN
INSERT INTO SALES_TABLE(...fields...) VALUES(...values...)
UPDATE STOCK_TABLE SET (...fields...)=(...values...)
END
CREATE PROCEDURE UspPURCHASE
(...arguments...)
BEGIN
INSERT INTO PURCHASE_TABLE(...fields...) VALUES(...values...)
UPDATE STOCK_TABLE SET (...fields...)=(...values...)
END
please let me know if you have any doubt