 DROP PROCEDURE IF EXISTS sp_alm_headerGuiaRemision_list;
DELIMITER $$
CREATE  PROCEDURE `sp_alm_headerGuiaRemision_list`(IN `Rguia` INT)
    NO SQL
BEGIN

SELECT serieNumero, IssueDate, Note, DescriptionReasonTransfer, TotalGrossWeightGRE, unitCodeGrossWeightGRE, addresseeID, addresseeName, transfermobility, LicensePlateID, DriverPersonID, movedstartdate, Delivery, DeliveryUbi, OriginAddressUbi, OriginAddress, NumberPackages, TypeDocumenttransmitter, transmitterName, TypeDocumentaddressee, motivemovedCode, DriverPersonDocumentType, nameTransportista, date_create, user_create
FROM `tec_referral_guide` WHERE `id` = Rguia ;

END$$
DELIMITER ;

DELIMITER $$
CREATE  PROCEDURE `sp_alm_itemsSale_list`(IN `venta` INT)
    NO SQL
BEGIN

SELECT t.product_id as id, t.code as code, t.name as name, t.quantity as quantity
FROM tec_sale_items t
LEFT JOIN tec_sales s ON s.id = t.sale_id
WHERE s.id=venta ;


END$$
DELIMITER ;