I have two tables. The first is inventory_control and the second is stock.
table
inventory_controlis recorded stock opname a warehouse and every receiving or dispatching event, data is always updated.table
stockis related to accounting.
Every day at 00:00 o'clock, all data in the inventory_control table needs to be inserted into table stock automatically.
I have no idea about that. I have searched in google and I didn't find something useful. I learned about trigger and I didn't think trigger can help.
These are my tables:
CREATE TABLE 'inventory_control' (
'warehouse', varchar(100) unsigned NOT NULL,
'idItem', int(8) unsigned NOT NULL,
'Quantity' int(8) unsigned);
CREATE TABLE 'stock'(
'warehouse', varchar(100) unsigned NOT NULL,
'idItem', int(8) unsigned NOT NULL,
'Quantity' int(8) unsigned,
'value', int(11) unsigned);