2024-03-15 13:46:43 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`buy_clone`(vEntryFk INT)
|
2024-03-15 13:46:43 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Clone buys to an entry
|
|
|
|
*
|
|
|
|
* @param vEntryFk The entry id
|
|
|
|
* @table tmp.buy(id)
|
|
|
|
*/
|
|
|
|
INSERT INTO buy(
|
|
|
|
entryFk,
|
|
|
|
itemFk,
|
|
|
|
quantity,
|
|
|
|
buyingValue,
|
|
|
|
freightValue,
|
|
|
|
isIgnored,
|
|
|
|
stickers,
|
|
|
|
packagingFk,
|
|
|
|
packing,
|
|
|
|
`grouping`,
|
|
|
|
groupingMode,
|
|
|
|
comissionValue,
|
|
|
|
packageValue,
|
|
|
|
price1,
|
|
|
|
price2,
|
|
|
|
price3,
|
|
|
|
minPrice,
|
|
|
|
isChecked,
|
|
|
|
location,
|
|
|
|
weight,
|
|
|
|
itemOriginalFk)
|
|
|
|
SELECT vEntryFk,
|
|
|
|
b.itemFk,
|
|
|
|
b.quantity,
|
|
|
|
b.buyingValue,
|
|
|
|
b.freightValue,
|
|
|
|
b.isIgnored,
|
|
|
|
b.stickers,
|
|
|
|
b.packagingFk,
|
|
|
|
b.packing,
|
|
|
|
b.`grouping`,
|
|
|
|
b.groupingMode,
|
|
|
|
b.comissionValue,
|
|
|
|
b.packageValue,
|
|
|
|
b.price1,
|
|
|
|
b.price2,
|
|
|
|
b.price3,
|
|
|
|
b.minPrice,
|
|
|
|
b.isChecked,
|
|
|
|
b.location,
|
|
|
|
b.weight,
|
|
|
|
b.itemOriginalFk
|
|
|
|
FROM tmp.buy tb
|
|
|
|
JOIN vn.buy b ON b.id = tb.id;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|