(73212,'FAR000794','BLOQUES DE MADER P/ APILAR 48PZS GU-442',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000794','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73213,'FAR000795','CONJ. P/ ASADOR 2PZ GU39560',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000795','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73214,'FAR000796','CONJ. P/ ASADOR 2PZS MADERA 003333',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000796','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73215,'FAR000797','PELOTA DE PLAYA 61CM 59030',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000797','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73216,'FAR000798','TESALAR DEXAMETASONA 10 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000798','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73217,'FAR000799','NEW COLOR LIQUIDO MATE 05 CORAL',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000799','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73218,'FAR000800','NEW COLOR LIQUIDO MATE 06 ROJO',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000800','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73219,'FAR000801','COCODRILO CON BEBÉS - 2 PIEZAS PM70358',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000801','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73220,'FAR000802','KISAME PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000802','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73221,'FAR000803','KAKUZU PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000803','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73222,'FAR000804','JGO. BADMINGTON EN BOLSA ML4380',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000804','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73223,'FAR000805','VASO ALHAMBRA P/ JUGO 6PZS GB01097510 ALH-JUGO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000805','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73224,'FAR000806','TRICICLO ZOO C/ CANASTA X0748.7',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000806','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73225,'FAR000807','LIMA DE UÑAS COMUN',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000807','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73226,'FAR000808','BOLSA DE TELA 30X40CM GUAPL40',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000808','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73227,'FAR000809','TERMO NOVEL 1,3LTS ACERO INOX NOV13D',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000809','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73228,'FAR000810','LICUADORA ROYAL 2 EN 1 1.5LTS CH4Y44',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000810','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73229,'FAR000811','MUÑECA C/ BICICLETA MUSICAL HP6587',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000811','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73230,'FAR000812','CLERVOYAN X 30 CAPSULAS BLANDAS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000812','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73231,'FAR000813','PHOTODERM NUDE TOUCH SPF 50+ TEINTE CLAIRE',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000813','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73232,'FAR000814','PHOTODERM NUDE TOUCH SPF 50+ TEINTE DOREE',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000814','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73233,'FAR000815','CONJUNTO DE BURNHAM RAIDERS PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000815','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73234,'FAR000816','ISLA DE LOS PIRATAS CONCEPTO CLICK PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000816','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73235,'FAR000817','COCINA FAMILIAR PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000817','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73236,'FAR000818','FICHAS CHICAS S23 PLAYMOBIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000818','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73237,'FAR000819','PHOTODERM MAX FLUID  SPF100 X 40 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000819','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73238,'FAR000820','REXONA W DEO AP AER ACT EMO 12X89G/150ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000820','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73239,'FAR000821','TALCO PEDICO REXONA EFFICIENT ORIGINAL 100GR 7791293044477',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000821','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73240,'FAR000822','CUADERNO ESPIRAL TAPA DURA DIBUJO COLORS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000822','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73241,'FAR000823','SHARPIE PUNTA FINA TROPICAL TJX12',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000823','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73242,'FAR000824','CASTILLO C/ MUEBLES EN CAJITA HP408',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000824','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73243,'FAR000825','CONJ. P/ ASADOR 3PZS BLANCO MOR 003310',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000825','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73244,'FAR000826','JGO. DE DOMINO MDF PF10772',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000826','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73245,'FAR000827','MIXTERA ROYAL CH8135',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000827','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73246,'FAR000828','MOCHILA INF.DIS. SAPO 25X10X31CM SUAX-046',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000828','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73247,'FAR000829','PANTUFLAS PARA CRIATURA C/ OREJITAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000829','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73248,'FAR000830','PORTA TARJETA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000830','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73249,'FAR000831','COLLAR CIELO MIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000831','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73250,'FAR000832','ARO X 3',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000832','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73251,'FAR000833','AROS UNT',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000833','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73252,'FAR000834','ANILLOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000834','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73253,'FAR000835','PULSERA JUVENIL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000835','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73254,'FAR000836','ATODERM INTENSIVE BAUME T200ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000836','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73255,'FAR000837','PAÑUELO NEUTRO ELITE 10UNID',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000837','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73256,'FAR000838','ANGRIPAS PLUS JAT SOL ORAL X 120 ML OR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000838','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73257,'FAR000839','CLOSE UP ENJUAGUE BUCAL ICE C/ALCOHOL X250ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000839','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73258,'FAR000840','LABIAL MATTE TANGO',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000840','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73259,'FAR000841','BALSAMO C/ VITAMINA 2162',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000841','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73260,'FAR000842','HEBILLA CON MOÑOS COLORES VARIOS X2 UNID.',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000842','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73261,'FAR000843','PINZA PARA CABELLO NEGRO GRANDE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000843','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73262,'FAR000844','AGENDA ANUAL COSIDA SOFT COLORS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000844','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73263,'FAR000845','AGENDA ANUAL COSIDA MULHER',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000845','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73264,'FAR000846','CUADERNO ESPIRAL TAPA DURA SWEET GARDEN',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000846','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73265,'FAR000847','GESIN RESAKA EXHIBIDOR X 25 X 4 CAPSULAS OR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000847','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73266,'FAR000848','ALKA SELTZER X 5 TIRAS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000848','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73267,'FAR000849','NECESER SURTIDO CHICO 0024540',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000849','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73268,'FAR000850','BOLSA PARA REGALO PAPEL CARTON 10 CM',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000850','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73269,'FAR000851','BOLSA REGALO DE PAPEL CARTON 20 CM',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000851','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73270,'FAR000852','BOLSA PLASTICA BOUTIQUE DISEÑOS VARIOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000852','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73271,'FAR000853','MEDIA UNISEX',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000853','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73272,'FAR000854','MEDIA PARA DAMA COLORES VARIOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000854','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73273,'FAR000855','\"DIDACTICA PIZARRA TABLET 8.5\"\" GU9001\"',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000855','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73274,'FAR000856','JUEGO DE DONAS PARA NENAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000856','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73275,'FAR000857','LLAVERO POPIT MONITO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000857','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73276,'FAR000858','DEBONUM 0,4G/100G CR TOP X 45 GR OR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000858','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73277,'FAR000859','PONY 2 PZS. EN CAJA GU1812',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000859','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73278,'FAR000860','PELUCHE OSITO C/ PORTARET. CORAZON',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000860','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73279,'FAR000861','PELUCHE C/ ROSA EN ESTUCHE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000861','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73280,'FAR000862','JARRA DE VIDRIO CON TAPA 1.1 LTS GU85047',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000862','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73281,'FAR000863','SET DE BALLESTA HP568-12A',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000863','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73282,'FAR000864','TERMO DAILY MATE 1 LTS P/ AGUA CALIENTE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000864','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73283,'FAR000865','TERMO MOR USE FLIP 1 L DIS.NTRA.SRA.',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000865','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73284,'FAR000866','LIMA CUBO P/ PIES',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000866','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73285,'FAR000867','LIMA PARA UÑAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000867','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73286,'FAR000868','LABIAL MATTE 3300',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000868','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73287,'FAR000869','PULSERAS DISEÑOS VARIOS INDIVIDUALES',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000869','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73288,'FAR000870','PULSERAS X2 ROSA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000870','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73289,'FAR000871','PULSERA DE ACERO 4405',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000871','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73290,'FAR000872','PULSERA DE ACERO 8750',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000872','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73291,'FAR000873','ARO DIAMANTE - POR PAR',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000873','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73292,'FAR000874','ARO 6466',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000874','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73293,'FAR000875','ARO FLOR  1103',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000875','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73294,'FAR000876','ARO CIELO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000876','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73295,'FAR000877','ARO CIELO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000877','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73296,'FAR000878','LAPIZ DELINEADOR MARRON MC',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000878','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73297,'FAR000879','JARRA DE VIDRIO C/ TAPA 1.8LTS GU49560',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000879','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73298,'FAR000880','TERMO INOX 1.2 LTS REF.: RL0733044',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000880','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73299,'FAR000881','SET DE BROCHAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000881','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73300,'FAR000882','BOLSA PARA REGALO METALIZADO GRANDE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000882','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73301,'FAR000883','CONJUNTO IMPERMEABLE PARA ADULTO REF.: RL0733918',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000883','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73302,'FAR000884','TERMO NOVEL 1,9LTS ACERO INOX. NOV19G',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000884','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73303,'FAR000885','DESODORANTE CORPORAL LATTAFA 200ML WASAF',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000885','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73304,'FAR000886','MAQUINA AFEITAR GILLETTE ULTRAGRIP',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000886','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73305,'FAR000887','BOLSA PARA REGALO TNT PQ GU24101430',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000887','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73306,'FAR000888','CAMION MINI DEFENSOR  GGB273/78',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000888','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73307,'FAR000889','CEPILLO PARA MANICURA 2 PZS  GUSEP-08',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000889','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73308,'FAR000890','COLGADOR AUTOADHESIVO GU24101605/6',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000890','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73309,'FAR000891','CONJ. P/ ASADOR 2PZS NEGRO MOR 003337',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000891','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73310,'FAR000892','DIDACT.ABACO DE MADERA GU13458',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000892','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73311,'FAR000893','PEDICURA X 6 PZS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000893','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73312,'FAR000894','VASO ALHAMBRA P/ AGUA X 6PZS ALH-AGUA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000894','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73313,'FAR000895','VEHICULOS COLECC 5 PZS BUILDING EP0026-F11',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000895','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73314,'FAR000896','YOYO EN BLISTER EP865-4',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000896','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73315,'FAR000897','GOMA MINI GIRL TUBO 1125',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000897','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73316,'FAR000898','BALSAMO TANGO PRINCESAS ULTRA SHINE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000898','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73317,'FAR000899','BASE LIQUIDA MATE PRO D´HERMOSA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000899','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73318,'FAR000900','POLVO COMPACTO A - 3080',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000900','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73319,'FAR000901','LIP GLOSS 24HS LIQUIDO NUEVA PRESENTACIÓN',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000901','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73320,'FAR000902','MASCARA DE PESTAÑAS ANCO COSMETICS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000902','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73321,'FAR000903','LAPIZ DELINEADOR ROJO MC',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000903','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73322,'FAR000904','LABIAL MATTE PRO LIPSTICK',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000904','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73323,'FAR000905','PULSERA DISEÑO EN METAL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000905','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73324,'FAR000906','PANTUFLAS NIÑOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000906','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73325,'FAR000907','PULSERA DE CUERO SIN DISEÑO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000907','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73326,'FAR000908','COTONETE YAQING',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000908','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73327,'FAR000909','CEPILLO DE DIENTES PARA NIÑOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000909','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73328,'FAR000910','SET DE AGUJAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000910','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73329,'FAR000911','TERMO NOVEL 2,5LTS ACERO INOX. NOV25G',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000911','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73330,'FAR000912','TERMITO 650ML COLORES SURTIDOS GUAPL12',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000912','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73331,'FAR000913','QUITA ESMALTE RYVALY 40 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000913','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73332,'FAR000914','QUITA ESMALTE RYVALY 65 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000914','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73333,'FAR000915','MUJERCITAS FUNNY EAU DE TOILETTE CANNON - 40 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000915','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73334,'FAR000916','DANIELLE COLONIA 90CC',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000916','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73335,'FAR000917','CAREY SPRAY EXTRA FUERTE X 410 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000917','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73336,'FAR000918','SELLADOR TOP COAT NEW COLOR',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000918','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73337,'FAR000919','BASE COAT HIDRA NEW COLOR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000919','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73338,'FAR000920','BASE FORTALECEDORA CON VITAMINA B NEW COLOR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000920','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73339,'FAR000921','NEW COLOR ESMALTE COLORES VARIOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000921','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73340,'FAR000922','CINTO CUERINA CON HEBILLA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000922','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73341,'FAR000923','MAYBELLINE MASC LASH SENSATIONAL SKY HIGH COSMIC BLACK 799',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000923','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73342,'FAR000924','LIP GLOSS NEW COLOR NRO. 26 CHERRY',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000924','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73343,'FAR000925','LIP GLOSS NEW COLOR NRO. 25 POPPY',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000925','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73344,'FAR000926','JUEGO DE TENIS DE PLAYA MDF EN RED GU62474',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000926','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73345,'FAR000927','PORTA LAPIZ PLASTICO 10X7X8CM GU54478',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000927','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73346,'FAR000928','PELUCHE DINOSAURIO 36CM GUOCT-18-19',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000928','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73347,'FAR000929','PELUCHE DISEÑO DE VAQUITA 26CM GUOCT-18-20',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000929','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73348,'FAR000930','PELUCHE DISEÑO DE OSO EGRESADO 25CM GUOCT-18-25',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000930','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73349,'FAR000931','PELUCHE DISEÑO DE ANIMALES SURTIDOS 17CM GUOCT-18-21',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000931','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73350,'FAR000932','SET DE PEINES (6 PZS) GU26675',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000932','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73351,'FAR000933','JARRO PLAST.DIS.CARITA 4PZS - GU105405572',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000933','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73352,'FAR000934','JARRA DE VIDRIO 1200ML CON 4 VASOS - SU223301',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000934','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73353,'FAR000935','ENCENDEDOR COLORES VARIOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000935','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73354,'FAR000936','ESPONJA PARA MAQUILLAJE CON BASE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000936','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73355,'FAR000937','PEINE NEGRO PARA BOLSILLO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000937','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73356,'FAR000938','SET DE MEDIA CON DISEÑO + MOÑO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000938','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73357,'FAR000939','GEELEETE AZUL MAQUINITA DOBLE HOJA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000939','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73358,'FAR000940','SEDAL CREMA PARA PEINAR HIALURONICO + VIT. A 300ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000940','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73359,'FAR000941','PENICROM BENZOCAINA 10MG TIRA X10 COMPRIMIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000941','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73360,'FAR000942','CERUM REMOVEDOR DEL CERUMEN GOTA OTICA 15ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000942','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73361,'FAR000943','ACONDICIONADOR CISNE KIDS 250ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000943','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73362,'FAR000944','ACONDICIONADOR CISNE NEW ALOE VERA 300ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000944','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73363,'FAR000945','ACONDICIONADOR CISNE NEW OMEGA 300ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000945','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73364,'FAR000946','ANIMALES DE VINIL GU5340',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000946','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73365,'FAR000947','JGO DE BELLEZA 10 PZS EN CAJA GU1388',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000947','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73366,'FAR000948','LIBRO P/COLOREAR 16 HJS GU02345',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000948','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73367,'FAR000949','BOLSA PARA REGALO - MENTALIZADO PEQUEÑO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000949','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73368,'FAR000950','BOLSA PARA REGALO - GU25062524',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000950','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73369,'FAR000951','CARTERITA DE UNICORNIO 133326',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000951','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73370,'FAR000952','PONY C/ MUÑEQUITA EN CAJA GU1812-1',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000952','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73371,'FAR000953','PIGMENTBIO DAILY CARE SPF 50+ X 40 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000953','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73372,'FAR000954','PIGMENTBIO H2O AGUA MICELAR X 250 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000954','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73373,'FAR000955','PIGMENTBIO SENSITIVE AREAS TE75ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000955','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73374,'FAR000956','ESPONJA LATEX X4UNID REDONDO Y CUADRADO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000956','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73375,'FAR000957','PHOTODERM AR SPF50+ X 30 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000957','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73376,'FAR000958','NESTIFLOG ALFA AMILASA CJ 10 COMPRIMIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000958','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73377,'FAR000959','LOSARTAN POTASICO 50MG X TIRA 10 COMPRIMIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000959','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73378,'FAR000960','PHOTODERM NUDE TOUCH SPF 50+ TEINTE TRES CLAIRE',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000960','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73379,'FAR000961','DOVE SH HIDRATACION 400ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000961','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73380,'FAR000962','DOVE AC HIDRATACION X400ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000962','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73381,'FAR000963','DOVE DEO AEROSOL ROSAS 150ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000963','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73382,'FAR000964','DOVE DEO AEROSOL  ORQUIDEA X150ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000964','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73383,'FAR000965','SEDAL SH COLAGENO Y VIT C IA 12X340ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000965','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73384,'FAR000966','SEDAL AC COLAGENO Y VIT C IA 12X340ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000966','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73385,'FAR000967','BOLSA PARA REGALO - REF:GL82301 - COD: 230256',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000967','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73386,'FAR000968','BOLSA PARA REGALO 23X27 GUOCT-25',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000968','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73387,'FAR000969','FEMELLE DROSPIRENONA 3MG X28 COMPRIMIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000969','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73388,'FAR000970','PIGMENTBIO FOAMING CREAM X 200 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000970','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73389,'FAR000971','PIGMENTBIO C-CONCENTRATE X 15 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000971','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73390,'FAR000972','PRODROM THC SOL GTS X 30 ML OR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000972','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73391,'FAR000973','NEW COLOR LAPIZ LABIAL PINK MATE 104',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000973','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73392,'FAR000974','DIPRESOL SERTRALINA 50MG 30 COMPRIMIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000974','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73393,'FAR000975','LOTARIS COMP RECUB X 30 OR',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000975','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73394,'FAR000976','AGUA MICELAR X100ML REALCARE',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000976','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73395,'FAR000977','SET HEBILLAS EMPERLADO 7494',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000977','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73396,'FAR000978','VINCHA NEGRA GRANDE 7450',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000978','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73397,'FAR000979','AGOGO NEGRO PAK 30',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000979','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73398,'FAR000980','LLAVEROS SURTIDOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000980','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73399,'FAR000981','LLAVERO CORAZON',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000981','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73400,'FAR000982','REAL ACONDICIONADOR  KERATINA 200ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR000982','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73401,'FAR000983','LAREEN LABIAL LIQUIDO MATE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000983','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73402,'FAR000984','PULSERA AC DORADO DISEÑOS SURTIDOS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000984','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73403,'FAR000985','SET DE ESPONJA MOD/FRUTAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000985','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73404,'FAR000986','PINZA PLASTICO TRENZADO 4296',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000986','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73405,'FAR000987','PEINE NEGRO PUNTA FINA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000987','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73406,'FAR000988','MEDIA PARA CABALLERO FASHION 4115',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000988','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73407,'FAR000989','MEDIA CHATITA INFANTIL 4379 6-8',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000989','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73408,'FAR000990','MEDIA CHATITA INFANTIL 4372',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000990','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73409,'FAR000991','MEDIA PARA DAMA SOQUETE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000991','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73410,'FAR000992','LA GOTITA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000992','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73411,'FAR000993','BETUN NEGRO  KEBE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000993','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73412,'FAR000994','CURITA MEDICARE  X 1UNDAD',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000994','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73413,'FAR000995','QUITA ESMALTE RYVALY  40ML',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000995','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73414,'FAR000996','PINZA DE CEJA MERHEJE  UND',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000996','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73415,'FAR000997','PEINE COLORES SURTIDO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000997','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73416,'FAR000998','JGO DE PING PONG EN  BLIS GUJUL-90',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000998','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73417,'FAR000999','PAÑUELO DESECHABLE ROSE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR000999','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73418,'FAR001000','PINZA DE CEJA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001000','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73419,'FAR001001','SET DE PEINES (6PZS)  EN BLISTER  GUOCT19-2',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001001','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73420,'FAR001002','BILLETERA C/BOLIGRAFO Y LLAVERO 20*15*4CM',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001002','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73421,'FAR001003','BOLSA P/REGALO 15*21*8CM  GUOCT-26',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001003','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73422,'FAR001004','FRISBEE 22CM EN CAJITA  GUJUL-366',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001004','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73423,'FAR001005','JUEGO DE BOMBERO 13 PCS HP99081',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001005','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73424,'FAR001006','PELUCHE DIS ANIMALES SURTIDOS CU 1710',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001006','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73425,'FAR001007','PELUCHE  DIS.LEON  GUOCT18-24',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001007','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73426,'FAR001008','PELUCHE DIS .VARIOS 25CM GUOCT18-22',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001008','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73427,'FAR001009','VASO TERMICO 473 2ML GU454678',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001009','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73428,'FAR001010','PEINES X 3 PZS EN BOLSITA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001010','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73429,'FAR001011','SEBIUM SERUM 30 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001011','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73430,'FAR001012','LOLI ESTUCHE BODY SPLASH BAHAMAS 110ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001012','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73431,'FAR001013','SENSIBIO DEFENSIVE SERUM 30 M',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001013','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73432,'FAR001014','SENSIBIO DS+ GEL MOUSSANT 200 ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001014','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73433,'FAR001015','DESYNGEL REPELENTE MOSKILL FAMILIA *120 ML *2',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001015','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73434,'FAR001016','PLANCHA A VAPOR VAPOR / SPRAY / RÁFAGA / VAPOR VERTICAL',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001016','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73435,'FAR001017','SET TAPPER CUADRANGULAR 5 PZAS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001017','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73436,'FAR001018','NEW COLOR CORRECTOR DE OJERAS HONEY N 30',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001018','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73437,'FAR001019','TERMITO PLÁSTICO ESTAMP. 270ML DISEÑOS SURTIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001019','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73438,'FAR001020','TERMITO PLÁSTICO ESTAMP. 270ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001020','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73439,'FAR001021','BOTELLA PLÁSTICA 600ML COLORES SURTIDOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001021','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73440,'FAR001022','TERMO JARRA 1L CON REVESTIMIENTO DE VIDRIO',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001022','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73441,'FAR001023','SET DE JARRA 2,4 LTS. DISEÑO FLORAL, C/ 4 VASOS',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001023','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73442,'FAR001024','KIT ABRIDOR INOX. 5 PCS, E/ BLISTER',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001024','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73443,'FAR001025','CHAMPAÑERA ACRÍLICA 7 LTS. C/ 7 LUCES & PARLANTE REF: MG-K-036',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001025','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73444,'FAR001026','REVANADORA DE VERDURAS MANUAL EN CAJA',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001026','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73445,'FAR001027','KIT MOLDES INOXEN BOLSACOD.: RL0734440UXB.: 144',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001027','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73446,'FAR001028','HUMIDIFICADOR 200ML',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001028','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73447,'FAR001029','SILLA PLEGABLE INFANTIL',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001029','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73448,'FAR001030','ALFONBRA BIENVENIDO',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001030','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73449,'FAR001031','TOSTADORA NEGRO ACERO INOXIDABLE COD.: RL150745  UXB.: 1',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001031','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73450,'FAR001032','VENTILADOR DE MESA 12’’ COD.: RL150780',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001032','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73451,'FAR001033','DIDACT JIRAFA ARMABLE NEW TYPE GU5005A',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001033','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73452,'FAR001034','DIARIO  C/CANDADO BJ-2203 /GU11035',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001034','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73453,'FAR001035','JGO. DE DAMAS PF2209',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001035','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73454,'FAR001036','LIBRO DE CUENTOS DE GOMA EVA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001036','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73455,'FAR001037','MUÑEQUITA C/PONY EN CAJA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001037','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73456,'FAR001038','TROMPO EN BLISTER EP8813',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001038','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73457,'FAR001039','RIFLE C/DARDOS EN BLIS. SHOOT GUN HP836-66',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001039','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73458,'GTOS000001','GASTOS SOFTWARE - LICENCIAS INFORMATICA',NULL,'138',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'GTOS000001','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73459,'FAR001040','PISTOLA 2PZS C/LANZA DARDOS HP1094745',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001040','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73460,'FAR001041','MUÑECA DANCE PRINCESS A BATERIA EN CAJA HP162-6',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001041','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73461,'GTOS000005','GASTOS DEL PERSONAL',NULL,'138',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'GTOS000005','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73462,'FAR001042','JUEGO DE LUDO  HP7894',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001042','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73463,'FAR001043','JGO. DE HERRAMIENTAS 9PZS.GU339-7C',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001043','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73464,'FAR001044','JGO.DE GLADIADOR C/MASCARA EN BL GU1688-81',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001044','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73465,'FAR001045','BOLSA DIS MONEDERO GULSO1',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001045','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73466,'FAR001046','CARTUCHERA PLASTICA 24X16 GUOCT13-4',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001046','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73467,'FAR001047','JGO DE PLAYA PALITAS GUYF3612',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001047','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73468,'FAR001048','NECESER 26*14*9,5CM SUJ17192',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001048','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73469,'FAR001049','PEINE EN ESTUCCHE *5PZS  SUMM068',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001049','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73470,'FAR001050','SET P/BEBE 4 PZS GU64033',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001050','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73471,'FAR001051','TERMO 3PZS 2000ML+900ML+300ML GUSEP-16',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001051','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73472,'FAR001052','TERMO P/AGUA CALIENTE 1 LT AD100-2',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001052','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73473,'FAR001053','CAMION RETRO EXCAVADORA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001053','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73474,'FAR001054','ESTACION BOMBEROS ,POLICIA,CONTRUCCIONES',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001054','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73475,'FAR001055','JGO AJEDREZ PF1155',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001055','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73476,'FAR001056','JGO DE LUDO MDF EN BLISTER CL10783',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001056','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73477,'FAR001057','TAMBOR EN BOLSA HP3520A',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001057','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73478,'FAR001058','TERMITO 850ML C/ACC GU25062824',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001058','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73479,'GTOS000003','GASTOS MANTENIMIENTO DE EQUIPOS DE INFORMATICA',NULL,'138',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'GTOS000003','2026-05-14 13:55:08','2026-05-14 13:55:08',0,NULL,NULL,0,NULL),
(73480,'FAR001059','TIRO AL BLANCO C/ PELOTAS Y DARNOS EPB8613',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001059','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73481,'FAR001060','JGO DE MEMORIA ANIMALES X5076',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001060','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73482,'FAR001061','LIBRETITA  GUOCT-13',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001061','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73483,'FAR001062','NAIPES ESPAÑOL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001062','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73484,'FAR001063','BOLSA PAPEL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001063','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73485,'FAR001064','LLAVERO CAPIBARA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001064','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73486,'FAR001065','RESORTE CHQ-52',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001065','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73487,'FAR001066','SCQUICHI UNICORNIO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001066','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73488,'FAR001067','SCQUICHI CAPIBARA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001067','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73489,'FAR001068','BOLSA 39-35 N',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001068','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73490,'FAR001069','BOLSA 49-44 N',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001069','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73491,'FAR001070','PHOTODERM XDEFENSE ULTRAFLUID SPF50+ - INVISIBLE',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001070','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73492,'FAR001071','PHOTODERM XDEFENSE ULTRAFLUID SPF50+ - TINT 02',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001071','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73493,'FAR001072','PHOTODERM XDEFENSE ULTRAFLUID SPF50+ - TINT 03',NULL,'137',NULL,'UN',NULL,NULL,1,0,1,NULL,NULL,1,'FAR001072','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73494,'FAR001073','CARTUCHERA ANIMALES GU25062522',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001073','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73495,'FAR001074','DIARIO  C/CANDADO C/BOLIGRAFO GU64K',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001074','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73496,'FAR001075','LIBRO P/COLOREAR TAM A4 20 HOJAS',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001075','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73497,'FAR001076','MUÑECA MARIPOSA EN CAJA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001076','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73498,'FAR001077','ANIMALES DE VINIL *3PZS HP 410',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001077','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73499,'FAR001078','DIDACT. ROMPECABEZAS 150PZS. RAINBOW PF2976',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001078','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73500,'FAR001079','DIDACT. ROMPECABEZAS CAPIBARAS 100PZS PF792989',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001079','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73501,'FAR001080','ESTUCHE DE MENTAL DIS AUTO GU24101626',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001080','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73502,'FAR001081','PAP . SIFON LUXOR HA 50CMX2MTS HA00807',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001081','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73503,'FAR001082','CARTULINA ENTRETENIDA MURESCO 65CM CAR- EN',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001082','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73504,'FAR001083','GOMA EVA C/GLITTER 45CMX60CMX2CM HA68365',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001083','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73505,'FAR001084','GOMA EVA LUXOR HA 45X60CM HA65548',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001084','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73506,'FAR001085','MOCHILA GABOL BREEZE NG-RJ-TUC 206403',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001085','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73507,'FAR001086','MOCHILA INF .DIS.VARIOS 30X25X19CM GUOCT-13-37',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001086','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73508,'FAR001087','BILLETERRA BRANDLESS CA 12404 MASC',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001087','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73509,'FAR001088','QI BEST LIP 7 ML',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001088','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73510,'FAR001089','GOMA EVA MOTAS A4 PAQ/10ZS LUXOR 65971 X UNIDAD',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001089','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73511,'FAR001090','PELOTA  GOMA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001090','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73512,'FAR001091','SEDAL SH LUMINOUS UV 12X650ML',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001091','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73513,'FAR001092','SEDAL AC LUMINOUS UV 12X650ML',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001092','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73514,'FAR001093','LICUADORA BIONICA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001093','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73515,'FAR001094','ESTUFA CUARZO BIONICA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001094','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73516,'FAR001095','PLACA INFARROJA BIONICA CRISTAL',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001095','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73517,'FAR001096','OLLA GRILL ELCTRICA BIONICA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001096','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73518,'FAR001097','HERVIDORA BIONICA DE ACERO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001097','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73519,'FAR001098','BATIDORA BIONICA  C/BOW',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001098','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73520,'FAR001099','ESPEJO CON LUZ LED',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001099','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73521,'FAR001100','PLANCHITA PROFESIONAL NANO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001100','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73522,'FAR001101','ESPEKER',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001101','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73523,'FAR001102','AURICULAR C/ CABLE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001102','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73524,'FAR001103','TERMO PARA TERERE 2,5L C/ GUAMPA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001103','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73525,'FAR001104','VASO PARA CAFÉ CON TERMOMETRO',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001104','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73526,'FAR001105','CABLE IPHONE ECOPOWER FASTB',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001105','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73527,'FAR001106','BOMBILLA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001106','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73528,'FAR001107','PERFUMES CHICOS C/CREMA',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001107','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73529,'FAR001108','PERFUMES DE AEROSOL ARABE',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001108','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL),
(73530,'FAR001109','VICTORIA SECRET *250ML',NULL,'137',NULL,'UN',NULL,NULL,0,0,1,NULL,NULL,1,'FAR001109','2026-05-14 13:55:09','2026-05-14 13:55:09',0,NULL,NULL,0,NULL);

--
-- Table structure for table `labels`
--

CREATE TABLE `labels` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `lpn` varchar(30) NOT NULL COMMENT 'License Plate Number único',
  `label_type` enum('PALLET','CASE','ITEM','MIXED','CONTAINER') NOT NULL DEFAULT 'PALLET',
  `warehouse_id` int(10) unsigned NOT NULL,
  `bin_id` int(10) unsigned DEFAULT NULL,
  `item_id` int(10) unsigned DEFAULT NULL COMMENT 'NULL si es mixto',
  `batch_id` int(10) unsigned DEFAULT NULL,
  `quantity` decimal(15,4) DEFAULT NULL,
  `uom` varchar(20) DEFAULT 'UN',
  `status` enum('ACTIVE','IN_TRANSIT','CONSUMED','CANCELLED') NOT NULL DEFAULT 'ACTIVE',
  `parent_lpn_id` int(10) unsigned DEFAULT NULL COMMENT 'LPN padre para anidamiento',
  `notes` text DEFAULT NULL,
  `printed_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_labels_lpn` (`lpn`),
  KEY `idx_labels_type` (`label_type`),
  KEY `idx_labels_warehouse` (`warehouse_id`),
  KEY `idx_labels_bin` (`bin_id`),
  KEY `idx_labels_item` (`item_id`),
  KEY `idx_labels_status` (`status`),
  KEY `idx_labels_parent` (`parent_lpn_id`),
  KEY `fk_labels_batch` (`batch_id`),
  KEY `fk_labels_creator` (`created_by`),
  CONSTRAINT `fk_labels_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_labels_bin` FOREIGN KEY (`bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_labels_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_labels_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_labels_parent` FOREIGN KEY (`parent_lpn_id`) REFERENCES `labels` (`id`),
  CONSTRAINT `fk_labels_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Etiquetas LPN (License Plate Numbers) para pallets, cajas e ítems';

--
-- Dumping data for table `labels`
--


--
-- Table structure for table `manual_preparation_lines`
--

CREATE TABLE `manual_preparation_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `preparation_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `batch_number` varchar(50) DEFAULT NULL,
  `from_bin_id` int(10) unsigned NOT NULL COMMENT 'Ubicacion origen de donde se toma',
  `picked_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `container_id` int(10) unsigned DEFAULT NULL COMMENT 'Contenedor de destino si aplica',
  `picked_by` int(10) unsigned DEFAULT NULL COMMENT 'Operador que realizo el pick',
  `picked_at` datetime DEFAULT NULL,
  `status` enum('PENDING','PICKED') NOT NULL DEFAULT 'PENDING',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `requested_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  PRIMARY KEY (`id`),
  KEY `idx_mpline_prep` (`preparation_id`),
  KEY `idx_mpline_item` (`item_id`),
  KEY `idx_mpline_batch` (`batch_id`),
  KEY `idx_mpline_bin` (`from_bin_id`),
  KEY `idx_mpline_status` (`status`),
  KEY `fk_mpline_container` (`container_id`),
  KEY `fk_mpline_picker` (`picked_by`),
  CONSTRAINT `fk_mpline_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_mpline_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_mpline_container` FOREIGN KEY (`container_id`) REFERENCES `containers` (`id`),
  CONSTRAINT `fk_mpline_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_mpline_picker` FOREIGN KEY (`picked_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_mpline_prep` FOREIGN KEY (`preparation_id`) REFERENCES `manual_preparations` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lineas de preparacion manual con trazabilidad de operador y ubicacion';

--
-- Dumping data for table `manual_preparation_lines`
--


--
-- Table structure for table `manual_preparations`
--

CREATE TABLE `manual_preparations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `prep_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `customer_code` varchar(30) DEFAULT NULL,
  `customer_name` varchar(200) DEFAULT NULL,
  `prep_type` enum('FREE','AUCTION','EXPORT','SAMPLE','SUPPLY') NOT NULL DEFAULT 'FREE',
  `status` enum('DRAFT','OPEN','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'DRAFT',
  `sap_order_entry` int(11) DEFAULT NULL COMMENT 'DocEntry de pedido SAP si se vincula posteriormente',
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `completed_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_mprep_number` (`prep_number`),
  KEY `idx_mprep_wh` (`warehouse_id`),
  KEY `idx_mprep_status` (`status`),
  KEY `idx_mprep_type` (`prep_type`),
  KEY `idx_mprep_customer` (`customer_code`),
  KEY `fk_mprep_creator` (`created_by`),
  CONSTRAINT `fk_mprep_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_mprep_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Preparaciones manuales libres sin reserva previa (remate, exportacion, muestra, etc.)';

--
-- Dumping data for table `manual_preparations`
--


--
-- Table structure for table `menu_groups`
--

CREATE TABLE `menu_groups` (
  `id` tinyint(3) unsigned NOT NULL,
  `code` varchar(20) NOT NULL,
  `name` varchar(60) NOT NULL,
  `color` varchar(20) NOT NULL DEFAULT 'gray',
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT 99,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_menu_groups_code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Grupos del menu del WMS (Xpert v1.0)';

--
-- Dumping data for table `menu_groups`
--

INSERT INTO `menu_groups` VALUES
(1,'entrada','1 - Entrada','entrada',1,1),
(2,'calidad','2 - Calidad','calidad',2,1),
(3,'almacen','3 - Almacen','almacen',3,1),
(4,'salida','4 - Salida','salida',4,1),
(5,'ops','5 - Operaciones','ops',5,1),
(6,'dinavisa','6 - DINAVISA / Compliance','dinavisa',6,1),
(7,'sistema','7 - Sistema','sistema',7,1);

--
-- Table structure for table `menu_items`
--

CREATE TABLE `menu_items` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `group_id` tinyint(3) unsigned DEFAULT NULL COMMENT 'NULL para items fijos como Dashboard',
  `view_key` varchar(40) NOT NULL COMMENT 'data-view del frontend',
  `name` varchar(80) NOT NULL,
  `route` varchar(200) DEFAULT NULL,
  `sort_order` tinyint(3) unsigned NOT NULL DEFAULT 99,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_menu_items_view_key` (`view_key`),
  KEY `idx_menu_items_group` (`group_id`),
  CONSTRAINT `fk_menu_items_group` FOREIGN KEY (`group_id`) REFERENCES `menu_groups` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Items del menu del WMS';

--
-- Dumping data for table `menu_items`
--

INSERT INTO `menu_items` VALUES
(1,NULL,'dashboard','Dashboard',NULL,0,1),
(10,1,'agendas','Agendas',NULL,1,1),
(11,1,'recepcion','Recepcion',NULL,2,1),
(12,1,'putaway','Putaway',NULL,3,1),
(20,2,'qa','Control QA',NULL,1,1),
(21,2,'qcexterno','QC Externo',NULL,2,1),
(22,2,'muestreo','Muestreo QA',NULL,3,1),
(23,2,'temperatura','Temperatura',NULL,4,1),
(30,3,'almacenes','Almacenes',NULL,1,1),
(31,3,'stock','Stock',NULL,2,1),
(32,3,'transferencias','Transferencias',NULL,3,1),
(33,3,'contenedores','Contenedores',NULL,4,1),
(34,3,'conteo','Conteo Ciclico',NULL,5,1),
(35,3,'ajustes','Ajuste Directo',NULL,6,1),
(40,4,'picking','Picking',NULL,1,1),
(41,4,'ondas','Ondas Picking',NULL,2,1),
(42,4,'prepmanual','Prep. Manual',NULL,3,1),
(43,4,'zonepick','Zona Picking',NULL,4,1),
(44,4,'packing','Packing',NULL,5,1),
(45,4,'expedicion','Expedicion',NULL,6,1),
(46,4,'devoluciones','Devoluciones',NULL,7,1),
(50,5,'tareas','Tareas',NULL,1,1),
(60,6,'recall','Recall',NULL,1,1),
(61,6,'sops','SOPs / IQ / OQ / PQ',NULL,2,1),
(62,6,'trazabilidad','Trazabilidad',NULL,3,1),
(70,7,'reportes','Reportes',NULL,1,1),
(71,7,'sap','SAP B1',NULL,2,1),
(72,7,'usuarios','Usuarios',NULL,3,1),
(73,7,'bins','Ubicaciones',NULL,4,1),
(74,7,'import_sap','Importar SAP',NULL,5,1),
(75,6,'audit','Auditoría','#audit',4,1),
(76,1,'print_labels','Imprimir Etiquetas',NULL,4,1),
(77,7,'zonif_familia','Zona × Item',NULL,6,1),
(78,7,'zona_familia','Zona × Familia',NULL,7,1),
(79,7,'zona_subgrupo','Zona x Grupo Anterior',NULL,8,1),
(80,3,'reubicacion','Reubicación','#reubicacion',5,1);

--
-- Table structure for table `menu_role_access`
--

CREATE TABLE `menu_role_access` (
  `menu_item_id` smallint(5) unsigned NOT NULL,
  `role` varchar(40) NOT NULL,
  `access_type` enum('FULL','READ') NOT NULL DEFAULT 'FULL',
  PRIMARY KEY (`menu_item_id`,`role`),
  CONSTRAINT `fk_mra_item` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Matriz de permisos rol -> item. Ausencia de fila = sin acceso.';

--
-- Dumping data for table `menu_role_access`
--

INSERT INTO `menu_role_access` VALUES
(1,'admin','FULL'),
(1,'auditor','READ'),
(1,'jefe','FULL'),
(1,'op_almacen','FULL'),
(1,'op_picking','FULL'),
(1,'op_recepcion','FULL'),
(1,'qa_liberador','FULL'),
(1,'qc_muestrista','FULL'),
(1,'supervisor','FULL'),
(10,'admin','FULL'),
(10,'auditor','READ'),
(10,'jefe','FULL'),
(10,'op_recepcion','FULL'),
(10,'supervisor','FULL'),
(11,'admin','FULL'),
(11,'auditor','READ'),
(11,'jefe','FULL'),
(11,'op_recepcion','FULL'),
(11,'supervisor','FULL'),
(12,'admin','FULL'),
(12,'auditor','READ'),
(12,'jefe','FULL'),
(12,'op_almacen','FULL'),
(12,'supervisor','FULL'),
(20,'admin','FULL'),
(20,'jefe','FULL'),
(20,'supervisor','FULL'),
(21,'admin','FULL'),
(21,'auditor','READ'),
(21,'qa_liberador','FULL'),
(21,'qc_muestrista','FULL'),
(22,'admin','FULL'),
(22,'auditor','READ'),
(22,'qa_liberador','FULL'),
(22,'qc_muestrista','FULL'),
(23,'admin','FULL'),
(23,'auditor','READ'),
(23,'jefe','FULL'),
(23,'qa_liberador','FULL'),
(23,'supervisor','FULL'),
(30,'admin','FULL'),
(30,'auditor','READ'),
(30,'jefe','FULL'),
(30,'op_almacen','READ'),
(30,'supervisor','FULL'),
(31,'admin','FULL'),
(31,'auditor','READ'),
(31,'jefe','FULL'),
(31,'op_almacen','READ'),
(31,'op_picking','READ'),
(31,'op_recepcion','READ'),
(31,'qa_liberador','READ'),
(31,'qc_muestrista','READ'),
(31,'supervisor','FULL'),
(32,'admin','FULL'),
(32,'auditor','READ'),
(32,'jefe','FULL'),
(32,'op_almacen','FULL'),
(33,'admin','FULL'),
(33,'auditor','READ'),
(33,'jefe','FULL'),
(33,'op_almacen','FULL'),
(33,'supervisor','FULL'),
(34,'admin','FULL'),
(34,'auditor','READ'),
(34,'jefe','FULL'),
(34,'op_almacen','FULL'),
(34,'supervisor','FULL'),
(35,'admin','FULL'),
(35,'auditor','READ'),
(35,'jefe','FULL'),
(35,'supervisor','FULL'),
(40,'admin','FULL'),
(40,'auditor','READ'),
(40,'jefe','FULL'),
(40,'op_picking','FULL'),
(40,'supervisor','FULL'),
(41,'admin','FULL'),
(41,'auditor','READ'),
(41,'jefe','FULL'),
(42,'admin','FULL'),
(42,'auditor','READ'),
(42,'jefe','FULL'),
(42,'op_picking','FULL'),
(43,'admin','FULL'),
(43,'auditor','READ'),
(43,'jefe','FULL'),
(44,'admin','FULL'),
(44,'auditor','READ'),
(44,'jefe','FULL'),
(44,'op_picking','FULL'),
(44,'supervisor','FULL'),
(45,'admin','FULL'),
(45,'auditor','READ'),
(45,'jefe','FULL'),
(45,'supervisor','FULL'),
(46,'admin','FULL'),
(46,'auditor','READ'),
(46,'jefe','FULL'),
(46,'op_recepcion','FULL'),
(50,'admin','FULL'),
(50,'auditor','READ'),
(50,'jefe','FULL'),
(50,'supervisor','FULL'),
(60,'admin','FULL'),
(60,'auditor','READ'),
(60,'jefe','FULL'),
(60,'qa_liberador','FULL'),
(60,'supervisor','FULL'),
(61,'admin','FULL'),
(61,'auditor','READ'),
(61,'qa_liberador','FULL'),
(61,'supervisor','FULL'),
(62,'admin','FULL'),
(62,'auditor','READ'),
(62,'jefe','READ'),
(62,'op_almacen','READ'),
(62,'op_picking','READ'),
(62,'op_recepcion','READ'),
(62,'qa_liberador','READ'),
(62,'qc_muestrista','READ'),
(62,'supervisor','FULL'),
(70,'admin','FULL'),
(70,'auditor','READ'),
(70,'jefe','FULL'),
(70,'qa_liberador','FULL'),
(70,'supervisor','FULL'),
(71,'admin','FULL'),
(71,'jefe','FULL'),
(71,'supervisor','FULL'),
(72,'admin','FULL'),
(72,'supervisor','FULL'),
(73,'admin','FULL'),
(73,'auditor','READ'),
(73,'jefe','FULL'),
(73,'op_almacen','READ'),
(73,'op_picking','READ'),
(73,'supervisor','FULL'),
(74,'admin','FULL'),
(74,'auditor','READ'),
(74,'jefe','FULL'),
(75,'admin','FULL'),
(75,'auditor','READ'),
(75,'jefe','READ'),
(75,'qa_liberador','READ'),
(75,'supervisor','FULL'),
(76,'admin','FULL'),
(76,'auditor','READ'),
(76,'jefe','FULL'),
(76,'op_almacen','FULL'),
(76,'op_recepcion','FULL'),
(76,'supervisor','FULL'),
(77,'admin','FULL'),
(77,'auditor','READ'),
(77,'jefe','FULL'),
(77,'op_almacen','READ'),
(77,'supervisor','FULL'),
(78,'admin','FULL'),
(78,'auditor','READ'),
(78,'jefe','FULL'),
(78,'op_almacen','READ'),
(78,'supervisor','FULL'),
(79,'admin','FULL'),
(79,'auditor','READ'),
(79,'jefe','FULL'),
(79,'op_almacen','READ'),
(79,'supervisor','FULL'),
(80,'admin','FULL'),
(80,'auditor','READ'),
(80,'jefe','FULL'),
(80,'op_almacen','FULL'),
(80,'supervisor','FULL');

--
-- Table structure for table `notification_rules`
--

CREATE TABLE `notification_rules` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rule_type` enum('EXPIRY_DAYS','STOCK_MIN','TEMP_CHECK') NOT NULL,
  `item_id` int(10) unsigned DEFAULT NULL COMMENT 'NULL = aplica a todos',
  `item_code` varchar(50) DEFAULT NULL,
  `threshold_value` decimal(15,4) NOT NULL COMMENT 'Dias para vencimiento o cantidad minima',
  `severity` enum('WARNING','CRITICAL') NOT NULL DEFAULT 'WARNING',
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_nr_type` (`rule_type`,`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Reglas de notificacion configurables';

--
-- Dumping data for table `notification_rules`
--

INSERT INTO `notification_rules` VALUES
(1,'EXPIRY_DAYS',NULL,NULL,90.0000,'WARNING',1,'2026-04-11 10:28:51'),
(2,'EXPIRY_DAYS',NULL,NULL,30.0000,'CRITICAL',1,'2026-04-11 10:28:51'),
(3,'STOCK_MIN',NULL,NULL,10.0000,'WARNING',0,'2026-04-11 10:28:51'),
(4,'STOCK_MIN',NULL,NULL,0.0000,'CRITICAL',0,'2026-04-11 10:28:51');

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('EXPIRY_WARNING','EXPIRY_CRITICAL','STOCK_LOW','STOCK_ZERO','TEMP_ALERT','RECALL_ALERT','QA_PENDING','SYSTEM') NOT NULL,
  `severity` enum('INFO','WARNING','CRITICAL') NOT NULL DEFAULT 'INFO',
  `title` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `reference_type` varchar(50) DEFAULT NULL COMMENT 'item, batch, zone, recall',
  `reference_id` int(10) unsigned DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `read_by` int(10) unsigned DEFAULT NULL,
  `read_at` datetime DEFAULT NULL,
  `is_dismissed` tinyint(1) DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_notif_read` (`is_read`,`is_dismissed`,`created_at`),
  KEY `idx_notif_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Notificaciones y alertas del sistema';

--
-- Dumping data for table `notifications`
--


--
-- Table structure for table `packing_lines`
--

CREATE TABLE `packing_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `packing_order_id` int(10) unsigned NOT NULL,
  `line_num` int(11) NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `packed_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `container_id` int(10) unsigned DEFAULT NULL COMMENT 'Contenedor donde se empacó',
  `status` enum('PENDING','PACKED','SHORT','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_packline` (`packing_order_id`,`line_num`),
  KEY `idx_packline_item` (`item_id`),
  KEY `idx_packline_batch` (`batch_id`),
  KEY `idx_packline_container` (`container_id`),
  CONSTRAINT `fk_packline_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_packline_container` FOREIGN KEY (`container_id`) REFERENCES `containers` (`id`),
  CONSTRAINT `fk_packline_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_packline_order` FOREIGN KEY (`packing_order_id`) REFERENCES `packing_orders` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Líneas de empaque con asignación a contenedor';

--
-- Dumping data for table `packing_lines`
--

INSERT INTO `packing_lines` VALUES
(8,8,1,3026,28,NULL,10.0000,10.0000,'UN',NULL,'PACKED',NULL,'2026-05-20 20:08:51','2026-05-20 20:08:52'),
(9,9,1,3026,7,NULL,10.0000,10.0000,'UN',NULL,'PACKED',NULL,'2026-05-20 21:19:23','2026-05-20 21:56:44'),
(10,10,1,3026,7,NULL,5.0000,5.0000,'UN',NULL,'PACKED',NULL,'2026-05-24 19:06:05','2026-05-24 19:06:46'),
(11,10,2,3026,9,NULL,10.0000,10.0000,'UN',NULL,'PACKED',NULL,'2026-05-24 19:06:05','2026-05-24 19:06:52'),
(12,11,1,3047,33,NULL,150.0000,150.0000,'UN',NULL,'PACKED',NULL,'2026-05-24 20:00:28','2026-05-24 20:00:39');

--
-- Table structure for table `packing_orders`
--

CREATE TABLE `packing_orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pack_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `pick_list_id` int(10) unsigned DEFAULT NULL COMMENT 'Pick list origen',
  `station_id` int(10) unsigned DEFAULT NULL COMMENT 'Estación de empaque asignada',
  `status` enum('DRAFT','OPEN','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'OPEN',
  `customer_code` varchar(30) DEFAULT NULL,
  `customer_name` varchar(150) DEFAULT NULL,
  `sap_doc_entry` int(11) DEFAULT NULL COMMENT 'DocEntry del pedido de venta SAP',
  `sap_doc_num` int(11) DEFAULT NULL,
  `assigned_to` int(10) unsigned DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  `sap_delivery_entry` int(11) DEFAULT NULL,
  `sap_delivery_num` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_packorder_number` (`pack_number`),
  KEY `idx_packorder_wh` (`warehouse_id`),
  KEY `idx_packorder_picklist` (`pick_list_id`),
  KEY `idx_packorder_station` (`station_id`),
  KEY `idx_packorder_status` (`status`),
  KEY `idx_packorder_sap` (`sap_doc_entry`),
  KEY `fk_packorder_assigned` (`assigned_to`),
  KEY `fk_packorder_creator` (`created_by`),
  CONSTRAINT `fk_packorder_assigned` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_packorder_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_packorder_picklist` FOREIGN KEY (`pick_list_id`) REFERENCES `pick_lists` (`id`),
  CONSTRAINT `fk_packorder_station` FOREIGN KEY (`station_id`) REFERENCES `packing_stations` (`id`),
  CONSTRAINT `fk_packorder_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Órdenes de empaque vinculadas a pick lists';

--
-- Dumping data for table `packing_orders`
--

INSERT INTO `packing_orders` VALUES
(8,'PK-00000008',16,3,NULL,'COMPLETED','C01290','SILVEIRA COLMAN, LINA ESTHER',673,387,NULL,NULL,'2026-05-20 20:08:52','BROWSER DEMO dispatch','2026-05-20 20:08:51','2026-05-20 20:08:56',1,579,'388'),
(9,'PK-00000009',16,1,NULL,'COMPLETED',NULL,'SILVEIRA COLMAN, LINA ESTHER',386,NULL,NULL,NULL,'2026-05-20 21:57:22','VIENE A BUSCAR ','2026-05-20 21:19:23','2026-05-20 21:57:22',1,NULL,NULL),
(10,'PK-00000010',16,2,NULL,'COMPLETED',NULL,'SILVEIRA COLMAN, LINA ESTHER',387,NULL,NULL,NULL,'2026-05-24 19:06:59',NULL,'2026-05-24 19:06:05','2026-05-24 19:06:59',1,NULL,NULL),
(11,'PK-00000011',16,5,NULL,'COMPLETED',NULL,'PEDRO H. SERVIN YUBERO',678,388,NULL,NULL,'2026-05-24 20:00:47',NULL,'2026-05-24 20:00:28','2026-05-25 20:04:04',1,NULL,NULL);

--
-- Table structure for table `packing_stations`
--

CREATE TABLE `packing_stations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `zone_id` int(10) unsigned DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `current_user_id` int(10) unsigned DEFAULT NULL COMMENT 'Operador actualmente asignado',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_packstation_code` (`warehouse_id`,`code`),
  KEY `idx_packstation_zone` (`zone_id`),
  KEY `fk_packstation_user` (`current_user_id`),
  CONSTRAINT `fk_packstation_user` FOREIGN KEY (`current_user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_packstation_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `fk_packstation_zone` FOREIGN KEY (`zone_id`) REFERENCES `warehouse_zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Estaciones de empaque en el almacén';

--
-- Dumping data for table `packing_stations`
--


--
-- Table structure for table `pick_list_lines`
--

CREATE TABLE `pick_list_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pick_list_id` int(10) unsigned NOT NULL,
  `line_num` int(11) NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL COMMENT 'Lote asignado por FEFO',
  `from_bin_id` int(10) unsigned DEFAULT NULL COMMENT 'Bin origen sugerido',
  `requested_qty` decimal(15,4) NOT NULL,
  `picked_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `status` enum('PENDING','IN_PROGRESS','PICKED','SHORT','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `sap_line_num` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_pickline` (`pick_list_id`,`line_num`),
  KEY `idx_pickline_item` (`item_id`),
  KEY `idx_pickline_batch` (`batch_id`),
  KEY `fk_pickline_bin` (`from_bin_id`),
  CONSTRAINT `fk_pickline_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_pickline_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_pickline_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_pickline_picklist` FOREIGN KEY (`pick_list_id`) REFERENCES `pick_lists` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Líneas de picking con asignación FEFO';

--
-- Dumping data for table `pick_list_lines`
--

INSERT INTO `pick_list_lines` VALUES
(1,1,1,3026,7,109,10.0000,10.0000,'UN','PICKED',NULL,NULL,'2026-05-15 11:51:37','2026-05-15 11:53:26'),
(2,2,1,3026,7,109,5.0000,5.0000,'UN','PICKED',NULL,NULL,'2026-05-16 15:14:05','2026-05-16 15:17:06'),
(3,2,2,3026,9,49,10.0000,10.0000,'UN','PICKED',NULL,NULL,'2026-05-16 15:14:05','2026-05-16 15:20:49'),
(4,3,1,3026,28,NULL,10.0000,10.0000,'UN','PICKED',NULL,NULL,'2026-05-20 19:33:47','2026-05-20 19:33:47'),
(5,4,1,3047,33,54,150.0000,0.0000,'UN','PENDING',NULL,'Liberado tras aprobacion manual de lote j8','2026-05-24 18:00:29','2026-05-24 18:11:44'),
(6,5,1,3047,33,54,150.0000,150.0000,'UN','PICKED',NULL,NULL,'2026-05-24 18:24:47','2026-05-24 18:34:08');

--
-- Table structure for table `pick_lists`
--

CREATE TABLE `pick_lists` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pick_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `wave_id` int(10) unsigned DEFAULT NULL COMMENT 'Oleada de picking asignada',
  `status` enum('DRAFT','OPEN','IN_PROGRESS','COMPLETED','CANCELLED','WAVE_ASSIGNED') NOT NULL DEFAULT 'DRAFT',
  `sap_doc_entry` int(11) DEFAULT NULL COMMENT 'DocEntry pedido de venta SAP',
  `sap_doc_num` int(11) DEFAULT NULL,
  `customer_code` varchar(30) DEFAULT NULL,
  `customer_name` varchar(150) DEFAULT NULL,
  `ship_date` date DEFAULT NULL,
  `assigned_to` int(10) unsigned DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_picklist_number` (`pick_number`),
  KEY `idx_picklist_wh` (`warehouse_id`),
  KEY `idx_picklist_status` (`status`),
  KEY `idx_picklist_sap` (`sap_doc_entry`),
  KEY `fk_picklist_assigned` (`assigned_to`),
  KEY `fk_picklist_creator` (`created_by`),
  KEY `idx_picklist_wave` (`wave_id`),
  CONSTRAINT `fk_picklist_assigned` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_picklist_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_picklist_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `fk_picklist_wave` FOREIGN KEY (`wave_id`) REFERENCES `picking_waves` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Listas de picking generadas desde pedidos SAP';

--
-- Dumping data for table `pick_lists`
--

INSERT INTO `pick_lists` VALUES
(1,'PK-00000001',16,NULL,'COMPLETED',386,170,NULL,'SILVEIRA COLMAN, LINA ESTHER','2026-05-15',NULL,NULL,'2026-05-15 11:53:26',NULL,'2026-05-15 11:51:37','2026-05-25 19:56:01',1),
(2,'PK-00000002',16,NULL,'COMPLETED',387,NULL,NULL,'SILVEIRA COLMAN, LINA ESTHER','2026-05-16',NULL,NULL,'2026-05-16 15:20:49',NULL,'2026-05-16 15:14:05','2026-05-16 15:20:49',1),
(3,'PK-00016427',16,NULL,'COMPLETED',673,387,'C01290','SILVEIRA COLMAN, LINA ESTHER',NULL,NULL,NULL,'2026-05-20 19:33:47',NULL,'2026-05-20 19:33:47','2026-05-20 19:33:47',1),
(4,'PK-00000003',16,NULL,'OPEN',388,NULL,NULL,'PEDRO H. SERVIN YUBERO','2026-05-24',NULL,NULL,NULL,NULL,'2026-05-24 18:00:29','2026-05-24 18:00:29',1),
(5,'PK-00000004',16,NULL,'COMPLETED',678,388,NULL,'PEDRO H. SERVIN YUBERO','2026-05-24',NULL,NULL,'2026-05-24 18:34:08',NULL,'2026-05-24 18:24:47','2026-05-25 20:04:04',1);

--
-- Table structure for table `picking_rejections`
--

CREATE TABLE `picking_rejections` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `wave_id` int(10) unsigned DEFAULT NULL COMMENT 'Oleada origen (si aplica)',
  `pick_list_id` int(10) unsigned DEFAULT NULL COMMENT 'Pick list origen (si aplica)',
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `requested_qty` decimal(15,4) NOT NULL COMMENT 'Cantidad solicitada',
  `available_qty` decimal(15,4) NOT NULL COMMENT 'Cantidad disponible al momento del analisis',
  `shortage_qty` decimal(15,4) NOT NULL COMMENT 'Faltante: requested - available',
  `status` enum('PENDING','RESOLVED','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `resolution` text DEFAULT NULL COMMENT 'Descripcion de la resolucion',
  `resolved_by` int(10) unsigned DEFAULT NULL,
  `resolved_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_reject_wave` (`wave_id`),
  KEY `idx_reject_picklist` (`pick_list_id`),
  KEY `idx_reject_item` (`item_id`),
  KEY `idx_reject_status` (`status`),
  KEY `fk_reject_resolver` (`resolved_by`),
  CONSTRAINT `fk_reject_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_reject_picklist` FOREIGN KEY (`pick_list_id`) REFERENCES `pick_lists` (`id`),
  CONSTRAINT `fk_reject_resolver` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_reject_wave` FOREIGN KEY (`wave_id`) REFERENCES `picking_waves` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lineas rechazadas en picking por falta de stock disponible';

--
-- Dumping data for table `picking_rejections`
--


--
-- Table structure for table `picking_wave_lines`
--

CREATE TABLE `picking_wave_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `wave_id` int(10) unsigned NOT NULL,
  `pick_list_id` int(10) unsigned NOT NULL,
  `sequence` int(11) NOT NULL DEFAULT 0 COMMENT 'Orden dentro de la oleada',
  `status` enum('PENDING','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_waveline` (`wave_id`,`pick_list_id`),
  KEY `idx_waveline_picklist` (`pick_list_id`),
  CONSTRAINT `fk_waveline_picklist` FOREIGN KEY (`pick_list_id`) REFERENCES `pick_lists` (`id`),
  CONSTRAINT `fk_waveline_wave` FOREIGN KEY (`wave_id`) REFERENCES `picking_waves` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Líneas de oleada vinculando pick lists a una oleada';

--
-- Dumping data for table `picking_wave_lines`
--


--
-- Table structure for table `picking_waves`
--

CREATE TABLE `picking_waves` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `wave_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `status` enum('DRAFT','OPEN','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'OPEN',
  `wave_type` enum('MANUAL','AUTO','PRIORITY','ROUTE','CARRIER') NOT NULL DEFAULT 'MANUAL',
  `release_criteria` enum('ORDER','CUSTOMER','ROUTE','WAVE') NOT NULL DEFAULT 'ORDER' COMMENT 'Criterio de agrupacion para liberacion',
  `route_code` varchar(50) DEFAULT NULL COMMENT 'Codigo de ruta logistica',
  `customer_code` varchar(50) DEFAULT NULL COMMENT 'CardCode del cliente para agrupacion',
  `priority` tinyint(3) unsigned NOT NULL DEFAULT 5 COMMENT '1=máxima, 10=mínima',
  `planned_date` date DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `total_lines` int(10) unsigned NOT NULL DEFAULT 0,
  `completed_lines` int(10) unsigned NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  `released_at` datetime DEFAULT NULL,
  `released_by` int(10) unsigned DEFAULT NULL,
  `total_pick_lists` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_wave_number` (`wave_number`),
  KEY `idx_wave_wh` (`warehouse_id`),
  KEY `idx_wave_status` (`status`),
  KEY `idx_wave_date` (`planned_date`),
  KEY `fk_wave_creator` (`created_by`),
  KEY `idx_wave_criteria` (`release_criteria`),
  KEY `idx_wave_route` (`route_code`),
  KEY `idx_wave_customer` (`customer_code`),
  CONSTRAINT `fk_wave_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_wave_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Oleadas de picking para agrupar pick lists';

--
-- Dumping data for table `picking_waves`
--


--
-- Table structure for table `putaway_suggestions`
--

CREATE TABLE `putaway_suggestions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `suggested_bin_id` int(10) unsigned NOT NULL COMMENT 'Ubicacion sugerida para almacenar',
  `suggestion_reason` enum('SAME_ITEM','SAME_ZONE','FEFO','EMPTY_BIN','NEAREST') NOT NULL DEFAULT 'SAME_ITEM' COMMENT 'Razon de la sugerencia',
  `priority` int(11) NOT NULL DEFAULT 5 COMMENT 'Prioridad de la sugerencia (1=mejor)',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_psug_item` (`item_id`),
  KEY `idx_psug_batch` (`batch_id`),
  KEY `idx_psug_wh` (`warehouse_id`),
  KEY `idx_psug_bin` (`suggested_bin_id`),
  KEY `idx_psug_reason` (`suggestion_reason`),
  KEY `idx_psug_priority` (`priority`),
  CONSTRAINT `fk_psug_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_psug_bin` FOREIGN KEY (`suggested_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_psug_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_psug_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Sugerencias inteligentes de ubicacion para putaway (mismo item, FEFO, vacio, etc.)';

--
-- Dumping data for table `putaway_suggestions`
--


--
-- Table structure for table `qa_decisions`
--

CREATE TABLE `qa_decisions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `batch_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned DEFAULT NULL,
  `warehouse_id` int(10) unsigned DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL COMMENT 'Documento de inventario relacionado',
  `decision` enum('APPROVED','REJECTED','CONDITIONAL','PENDING','QUARANTINE') NOT NULL DEFAULT 'PENDING',
  `reason` varchar(500) DEFAULT NULL,
  `inspected_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `approved_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `rejected_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `inspector` int(10) unsigned DEFAULT NULL COMMENT 'Usuario que realizó la inspección',
  `decided_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `review_date` date DEFAULT NULL,
  `decided_by` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_qa_batch` (`batch_id`),
  KEY `idx_qa_item` (`item_id`),
  KEY `idx_qa_warehouse` (`warehouse_id`),
  KEY `idx_qa_decision` (`decision`),
  KEY `idx_qa_document` (`document_id`),
  KEY `fk_qa_inspector` (`inspector`),
  KEY `fk_qa_creator` (`created_by`),
  CONSTRAINT `fk_qa_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_qa_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_qa_document` FOREIGN KEY (`document_id`) REFERENCES `inventory_documents` (`id`),
  CONSTRAINT `fk_qa_inspector` FOREIGN KEY (`inspector`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_qa_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_qa_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Decisiones de control de calidad por lote';

--
-- Dumping data for table `qa_decisions`
--

INSERT INTO `qa_decisions` VALUES
(1,21,NULL,NULL,NULL,'APPROVED',NULL,0.0000,0.0000,0.0000,NULL,NULL,'NTA 452683',NULL,1,'2026-05-15 11:25:45','2026-05-15 11:25:45',NULL),
(2,7,NULL,NULL,NULL,'APPROVED',NULL,0.0000,0.0000,0.0000,NULL,NULL,'N1',NULL,1,'2026-05-15 11:37:00','2026-05-15 11:37:00',NULL),
(3,9,NULL,NULL,NULL,'APPROVED',NULL,0.0000,0.0000,0.0000,NULL,NULL,'AA',NULL,1,'2026-05-15 11:40:04','2026-05-15 11:40:04',NULL),
(4,28,NULL,NULL,NULL,'APPROVED','asd',0.0000,0.0000,0.0000,NULL,NULL,'asdasd',NULL,1,'2026-05-16 15:10:23','2026-05-16 15:10:23',NULL),
(5,27,NULL,NULL,NULL,'APPROVED',NULL,0.0000,0.0000,0.0000,NULL,NULL,'ASD ASD ASD',NULL,1,'2026-05-24 18:22:19','2026-05-24 18:22:19',NULL);

--
-- Table structure for table `qc_external_requests`
--

CREATE TABLE `qc_external_requests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `request_type` enum('ASSIGN','APPROVE','REJECT') NOT NULL COMMENT 'Tipo de solicitud QC externa',
  `batch_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `batch_number` varchar(50) NOT NULL,
  `lot_qty` decimal(15,4) DEFAULT NULL COMMENT 'Cantidad del lote afectado',
  `source_system` varchar(50) NOT NULL DEFAULT 'EXTERNAL' COMMENT 'Sistema origen de la solicitud',
  `external_reference` varchar(100) DEFAULT NULL COMMENT 'Referencia en el sistema externo',
  `reason` text DEFAULT NULL COMMENT 'Motivo de aprobacion/rechazo',
  `status` enum('PENDING','PROCESSED','ERROR') NOT NULL DEFAULT 'PENDING',
  `processed_at` datetime DEFAULT NULL,
  `error_message` text DEFAULT NULL COMMENT 'Detalle del error si status = ERROR',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `action` varchar(40) DEFAULT NULL,
  `quantity_affected` decimal(15,4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_qcer_type` (`request_type`),
  KEY `idx_qcer_batch` (`batch_id`),
  KEY `idx_qcer_item` (`item_id`),
  KEY `idx_qcer_code` (`item_code`),
  KEY `idx_qcer_status` (`status`),
  KEY `idx_qcer_source` (`source_system`),
  KEY `idx_qcer_extref` (`external_reference`),
  CONSTRAINT `fk_qcer_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_qcer_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Solicitudes de QC desde sistema externo de calidad (asignar, aprobar, rechazar)';

--
-- Dumping data for table `qc_external_requests`
--


--
-- Table structure for table `qc_product_config`
--

CREATE TABLE `qc_product_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `requires_qc` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Producto requiere QC en recepcion',
  `qc_blocking` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Si bloqueante, impide putaway hasta aprobacion',
  `auto_assign` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Asignar QC automaticamente en recepcion',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_qcpc_item` (`item_id`),
  KEY `idx_qcpc_code` (`item_code`),
  KEY `idx_qcpc_requires` (`requires_qc`),
  KEY `idx_qcpc_blocking` (`qc_blocking`),
  CONSTRAINT `fk_qcpc_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Configuracion de QC automatico por producto para recepcion';

--
-- Dumping data for table `qc_product_config`
--


--
-- Table structure for table `recall_results`
--

CREATE TABLE `recall_results` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `recall_id` int(10) unsigned NOT NULL,
  `result_type` enum('STOCK','MOVEMENT','DISPATCH','CUSTOMER') NOT NULL,
  `warehouse_code` varchar(20) DEFAULT NULL,
  `bin_code` varchar(30) DEFAULT NULL,
  `quantity` decimal(15,4) DEFAULT NULL,
  `stock_status` varchar(20) DEFAULT NULL,
  `customer_code` varchar(50) DEFAULT NULL,
  `customer_name` varchar(200) DEFAULT NULL,
  `dispatch_number` varchar(30) DEFAULT NULL,
  `dispatch_date` datetime DEFAULT NULL,
  `movement_type` varchar(30) DEFAULT NULL,
  `movement_date` datetime DEFAULT NULL,
  `details` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `fk_rr_recall` (`recall_id`),
  CONSTRAINT `fk_rr_recall` FOREIGN KEY (`recall_id`) REFERENCES `recalls` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recall_results`
--

INSERT INTO `recall_results` VALUES
(1,1,'MOVEMENT',NULL,NULL,150.0000,NULL,NULL,NULL,NULL,NULL,'PICK','2026-05-24 18:34:08','{\"from\":\"CEN-PT-P3R60-N1P01\",\"to\":null,\"operator\":\"Demo Op. Picking\"}','2026-05-24 19:02:56'),
(2,1,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'QA_APPROVE','2026-05-24 18:11:44','{\"from\":\"CEN-PT-P3R60-N1P01\",\"to\":\"CEN-PT-P3R60-N1P01\",\"operator\":\"Administrador WMS\"}','2026-05-24 19:02:56'),
(3,1,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'PUTAWAY','2026-05-24 17:55:14','{\"from\":\"CEN-REC\",\"to\":\"CEN-PT-P3R60-N1P01\",\"operator\":\"Demo Op. Almacen\"}','2026-05-24 19:02:56'),
(4,1,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'RECEIPT','2026-05-24 17:54:23','{\"from\":null,\"to\":\"CEN-REC\",\"operator\":\"Demo Op. Recepcion\"}','2026-05-24 19:02:56'),
(5,2,'STOCK','CEN','CEN-REC',0.0000,'AVAILABLE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-24 20:07:25'),
(6,2,'STOCK','CEN','CEN-PT-P3R60-N1P01',350.0000,'AVAILABLE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-24 20:07:25'),
(7,2,'MOVEMENT',NULL,NULL,150.0000,NULL,NULL,NULL,NULL,NULL,'PACK','2026-05-24 20:00:47','{\"from\":null,\"to\":null,\"operator\":\"Administrador WMS\"}','2026-05-24 20:07:25'),
(8,2,'MOVEMENT',NULL,NULL,150.0000,NULL,NULL,NULL,NULL,NULL,'PICK','2026-05-24 18:34:08','{\"from\":\"CEN-PT-P3R60-N1P01\",\"to\":null,\"operator\":\"Demo Op. Picking\"}','2026-05-24 20:07:25'),
(9,2,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'QA_APPROVE','2026-05-24 18:11:44','{\"from\":\"CEN-PT-P3R60-N1P01\",\"to\":\"CEN-PT-P3R60-N1P01\",\"operator\":\"Administrador WMS\"}','2026-05-24 20:07:25'),
(10,2,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'PUTAWAY','2026-05-24 17:55:14','{\"from\":\"CEN-REC\",\"to\":\"CEN-PT-P3R60-N1P01\",\"operator\":\"Demo Op. Almacen\"}','2026-05-24 20:07:25'),
(11,2,'MOVEMENT',NULL,NULL,500.0000,NULL,NULL,NULL,NULL,NULL,'RECEIPT','2026-05-24 17:54:23','{\"from\":null,\"to\":\"CEN-REC\",\"operator\":\"Demo Op. Recepcion\"}','2026-05-24 20:07:25'),
(12,3,'STOCK','CEN','CEN-REC',0.0000,'QA',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-26 16:08:45'),
(13,3,'STOCK','CEN','CEN-PT-P3R53-N1P01',0.0000,'QA',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-26 16:08:45'),
(14,3,'STOCK','CEN','CEN-PT-P3R53-N1P01',5.0000,'AVAILABLE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-26 16:08:45'),
(15,3,'MOVEMENT',NULL,NULL,10.0000,NULL,NULL,NULL,NULL,NULL,'PACK','2026-05-24 19:06:59','{\"from\":null,\"to\":null,\"operator\":\"Administrador WMS\"}','2026-05-26 16:08:45'),
(16,3,'MOVEMENT',NULL,NULL,10.0000,NULL,NULL,NULL,NULL,NULL,'PICK','2026-05-16 15:20:49','{\"from\":\"CEN-PT-P3R53-N1P01\",\"to\":null,\"operator\":\"Demo Op. Picking\"}','2026-05-26 16:08:45'),
(17,3,'MOVEMENT',NULL,NULL,15.0000,NULL,NULL,NULL,NULL,NULL,'QA_APPROVE','2026-05-15 11:40:04','{\"from\":\"CEN-PT-P3R53-N1P01\",\"to\":\"CEN-PT-P3R53-N1P01\",\"operator\":\"Administrador WMS\"}','2026-05-26 16:08:45'),
(18,3,'MOVEMENT',NULL,NULL,15.0000,NULL,NULL,NULL,NULL,NULL,'PUTAWAY','2026-05-14 13:10:17','{\"from\":\"CEN-REC\",\"to\":\"CEN-PT-P3R53-N1P01\",\"operator\":\"Demo Op. Almacen\"}','2026-05-26 16:08:45'),
(19,3,'MOVEMENT',NULL,NULL,15.0000,NULL,NULL,NULL,NULL,NULL,'RECEIPT','2026-05-14 10:23:51','{\"from\":null,\"to\":\"CEN-REC\",\"operator\":\"Demo Op. Recepcion\"}','2026-05-26 16:08:45');

--
-- Table structure for table `recalls`
--

CREATE TABLE `recalls` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `recall_number` varchar(30) NOT NULL,
  `batch_number` varchar(50) NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `item_name` varchar(200) DEFAULT NULL,
  `reason` text NOT NULL,
  `status` enum('INITIATED','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'INITIATED',
  `total_stock_found` decimal(15,4) DEFAULT 0.0000,
  `total_customers_affected` int(11) DEFAULT 0,
  `initiated_by` int(10) unsigned NOT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_recall_number` (`recall_number`),
  KEY `idx_batch` (`batch_number`),
  KEY `idx_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recalls`
--

INSERT INTO `recalls` VALUES
(1,'RC-000001','j8','70118','TIMET 850 MG COMP X 30 OR','oiko vai','IN_PROGRESS',0.0000,0,1,NULL,NULL,'2026-05-24 19:02:41','2026-05-24 19:02:56'),
(2,'RC-000002','J8','70421','PRONEZOL 20 MG X 10 CAPSULAS OR','DSF SDF SDF','IN_PROGRESS',350.0000,0,1,NULL,NULL,'2026-05-24 20:02:19','2026-05-24 20:07:25'),
(3,'RC-000003','j7','70118','TIMET 850 MG COMP X 30 OR','falla en pro','IN_PROGRESS',5.0000,0,1,NULL,NULL,'2026-05-26 16:08:37','2026-05-26 16:08:45');

--
-- Table structure for table `reception_agenda_lines`
--

CREATE TABLE `reception_agenda_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `agenda_id` int(10) unsigned NOT NULL,
  `ref_id` int(10) unsigned NOT NULL COMMENT 'Referencia al documento OC/OD',
  `line_num` int(11) NOT NULL,
  `item_id` int(10) unsigned DEFAULT NULL,
  `item_code` varchar(50) NOT NULL,
  `item_name` varchar(200) DEFAULT NULL,
  `expected_qty` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Cantidad teorica de la OC',
  `received_qty` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Cantidad efectivamente recibida',
  `difference_qty` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Diferencia: received - expected',
  `batch_number` varchar(50) DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `supplier_lot` varchar(50) DEFAULT NULL COMMENT 'Lote del proveedor',
  `sap_line_num` int(11) DEFAULT NULL COMMENT 'LineNum en el documento SAP',
  `status` enum('PENDING','PARTIAL','COMPLETED','OVER','SHORT') NOT NULL DEFAULT 'PENDING',
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_aline_agenda` (`agenda_id`),
  KEY `idx_aline_ref` (`ref_id`),
  KEY `idx_aline_item` (`item_id`),
  KEY `idx_aline_status` (`status`),
  CONSTRAINT `fk_aline_agenda` FOREIGN KEY (`agenda_id`) REFERENCES `reception_agendas` (`id`),
  CONSTRAINT `fk_aline_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_aline_ref` FOREIGN KEY (`ref_id`) REFERENCES `reception_agenda_refs` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lineas esperadas (teorico) por documento dentro de una agenda de recepcion';

--
-- Dumping data for table `reception_agenda_lines`
--

INSERT INTO `reception_agenda_lines` VALUES
(1,1,1,1,820,'400242','ALCOHOL ETILICO',50.0000,25.0000,-25.0000,'636363','2029-01-25','7262722',0,'PARTIAL',NULL,'2026-05-13 20:58:15','2026-05-13 21:01:23'),
(2,2,2,1,3047,'70421','PRONEZOL 20 MG X 10 CAPSULAS OR',100.0000,100.0000,0.0000,'176389w67','2039-08-21','763yg73',0,'COMPLETED',NULL,'2026-05-14 10:04:21','2026-05-14 10:06:01'),
(3,3,3,1,3026,'70118','TIMET 850 MG COMP X 30 OR',30.0000,30.0000,0.0000,'MULTI','2029-09-15','sj7',0,'COMPLETED',NULL,'2026-05-14 10:18:50','2026-05-14 10:23:11'),
(4,4,4,1,2900,'606067','C ALU ALU 210mm',1.0000,1.0000,0.0000,'hs7','2028-09-01','ye8',0,'COMPLETED',NULL,'2026-05-14 10:33:22','2026-05-14 11:09:01'),
(5,5,5,1,928,'400727','CARVEDILOL',100.0000,100.0000,0.0000,'MULTI','2034-09-08','l98738',0,'COMPLETED',NULL,'2026-05-14 10:44:47','2026-05-14 10:49:41'),
(6,6,6,1,1187,'403604','COLORANTE ROJO PONCEAU 4R',100.0000,100.0000,0.0000,'ko','2029-01-01','ki',0,'COMPLETED',NULL,'2026-05-14 13:38:53','2026-05-14 13:40:33'),
(7,7,7,1,59052,'32052','FRESH L. BLUE -05.50',100.0000,100.0000,0.0000,'hh1','2030-01-01','jj22',0,'COMPLETED',NULL,'2026-05-14 18:21:46','2026-05-14 18:23:04'),
(8,8,8,1,460,'210112','DOMPERIDONA GTS X 15 ML I.P.S',100.0000,100.0000,0.0000,'gg6','2029-08-04','hh6',0,'COMPLETED',NULL,'2026-05-14 18:36:04','2026-05-14 18:36:51'),
(17,15,17,1,460,'210112','DOMPERIDONA GTS X 15 ML I.P.S',100.0000,0.0000,0.0000,NULL,NULL,NULL,0,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(18,15,17,2,59052,'32052','FRESH L. BLUE -05.50',100.0000,0.0000,0.0000,NULL,NULL,NULL,1,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(19,15,17,3,928,'400727','CARVEDILOL',100.0000,0.0000,0.0000,NULL,NULL,NULL,2,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(20,15,17,4,1187,'403604','COLORANTE ROJO PONCEAU 4R',100.0000,0.0000,0.0000,NULL,NULL,NULL,3,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(21,15,17,5,2900,'606067','C ALU ALU 210mm',1.0000,0.0000,0.0000,NULL,NULL,NULL,4,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(22,15,17,6,3026,'70118','TIMET 850 MG COMP X 30 OR',30.0000,0.0000,0.0000,NULL,NULL,NULL,5,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(23,15,17,7,3047,'70421','PRONEZOL 20 MG X 10 CAPSULAS OR',100.0000,0.0000,0.0000,NULL,NULL,NULL,6,'PENDING',NULL,'2026-05-15 08:21:19','2026-05-15 08:21:19'),
(24,16,18,1,460,'210112','DOMPERIDONA GTS X 15 ML I.P.S',120.0000,120.0000,0.0000,'LT888','2029-05-20','LT888P',0,'COMPLETED',NULL,'2026-05-16 15:00:53','2026-05-16 15:03:21'),
(25,16,18,2,3026,'70118','TIMET 850 MG COMP X 30 OR',600.0000,600.0000,0.0000,'MULTI','2031-04-30','LT648P',1,'COMPLETED',NULL,'2026-05-16 15:00:53','2026-05-16 15:04:35'),
(26,17,19,1,2614,'604090','C PVC+PVDC 208mm.',100.0000,100.0000,0.0000,'L0998178','2029-08-21','L83783',0,'COMPLETED',NULL,'2026-05-20 09:15:39','2026-05-20 09:20:09'),
(27,18,20,1,2900,'606067','C ALU ALU 210mm',150.0000,150.0000,0.0000,'MULTI','2030-09-13','e8',0,'COMPLETED',NULL,'2026-05-24 17:10:16','2026-05-24 17:18:04'),
(28,19,21,1,3047,'70421','PRONEZOL 20 MG X 10 CAPSULAS OR',500.0000,500.0000,0.0000,'j8','2031-02-23','u8',0,'COMPLETED',NULL,'2026-05-24 17:52:38','2026-05-24 17:54:04'),
(29,20,22,1,769,'400156','METFORMINA CLORHIDRATO DC 95',300.0000,200.0000,-100.0000,'l112','2030-02-21','ll121',0,'PARTIAL',NULL,'2026-05-25 20:56:44','2026-05-25 20:59:42'),
(30,21,23,1,2900,'606067','C ALU ALU 210mm',120.0000,120.0000,0.0000,'lot09','2027-02-01','lot10',0,'COMPLETED',NULL,'2026-05-26 00:02:20','2026-05-26 00:04:19');

--
-- Table structure for table `reception_agenda_refs`
--

CREATE TABLE `reception_agenda_refs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `agenda_id` int(10) unsigned NOT NULL,
  `sap_doc_type` varchar(30) NOT NULL,
  `sap_doc_entry` int(11) NOT NULL COMMENT 'DocEntry en SAP B1',
  `sap_doc_num` varchar(20) DEFAULT NULL COMMENT 'DocNum legible',
  `ref_type` enum('OC','OD','RR','ODC','OC_PLAZA','OC_IMPORTACION','OT_PRODUCCION') NOT NULL DEFAULT 'OC',
  `supplier_code` varchar(30) DEFAULT NULL COMMENT 'CardCode del proveedor',
  `supplier_name` varchar(200) DEFAULT NULL,
  `bpl_id` int(11) DEFAULT NULL,
  `status` enum('PENDING','PARTIAL','COMPLETED','SKIPPED','ERROR') NOT NULL DEFAULT 'PENDING',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_aref_agenda` (`agenda_id`),
  KEY `idx_aref_sap` (`sap_doc_entry`,`sap_doc_type`),
  KEY `idx_aref_supplier` (`supplier_code`),
  KEY `idx_aref_status` (`status`),
  CONSTRAINT `fk_aref_agenda` FOREIGN KEY (`agenda_id`) REFERENCES `reception_agendas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Documentos SAP (OC, OD, etc.) vinculados a una agenda de recepcion';

--
-- Dumping data for table `reception_agenda_refs`
--

INSERT INTO `reception_agenda_refs` VALUES
(1,1,'PurchaseOrder',209,'43','OC_PLAZA','P02831','BIOBASE BIOWIN CO.,LTD',NULL,'PARTIAL','2026-05-13 20:58:15'),
(2,2,'PurchaseOrder',211,'44','OC_PLAZA','P02844','ARALAB',NULL,'ERROR','2026-05-14 10:04:21'),
(3,3,'PurchaseOrder',214,'47','OC_PLAZA','P02846','ENCISO MIERES JOSE DAVID',NULL,'COMPLETED','2026-05-14 10:18:50'),
(4,4,'PurchaseOrder',213,'46','OC_PLAZA','P02870','LINELINK',NULL,'COMPLETED','2026-05-14 10:33:22'),
(5,5,'PurchaseOrder',215,'48','OC_PLAZA','P02870','LINELINK',NULL,'COMPLETED','2026-05-14 10:44:47'),
(6,6,'PurchaseOrder',216,'49','OC_PLAZA','P02844','ARALAB',NULL,'COMPLETED','2026-05-14 13:38:53'),
(7,7,'PurchaseOrder',217,'50','OC_PLAZA','P00261','LABORATOIRE BIODERMA',NULL,'COMPLETED','2026-05-14 18:21:46'),
(8,8,'PurchaseOrder',219,'51','OC_PLAZA','P00341','LABORATORIO APITER S.A.',NULL,'COMPLETED','2026-05-14 18:36:04'),
(17,15,'InventoryTransferRequest',283,'70','OT_PRODUCCION','CC','Traslado CC → CEN',NULL,'PENDING','2026-05-15 08:21:19'),
(18,16,'PurchaseOrder',223,'52','OC_PLAZA','P02323','ADOBE',NULL,'COMPLETED','2026-05-16 15:00:53'),
(19,17,'PurchaseOrder',225,'53','OC_PLAZA','P02844','ARALAB',NULL,'COMPLETED','2026-05-20 09:15:39'),
(20,18,'PurchaseOrder',228,'54','OC_PLAZA','P00341','LABORATORIO APITER S.A.',NULL,'COMPLETED','2026-05-24 17:10:16'),
(21,19,'PurchaseOrder',230,'56','OC_PLAZA','P02405','CABKA SPAIN S.L.U.',NULL,'COMPLETED','2026-05-24 17:52:38'),
(22,20,'PurchaseOrder',229,'55','OC_PLAZA','P02446','SEPREC',NULL,'PARTIAL','2026-05-25 20:56:44'),
(23,21,'PurchaseOrder',233,'58','OC_PLAZA','P00820','VIZCAINO GONZALEZ CONSULTORIA',NULL,'ERROR','2026-05-26 00:02:20');

--
-- Table structure for table `reception_agendas`
--

CREATE TABLE `reception_agendas` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `agenda_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `status` enum('DRAFT','OPEN','IN_PROGRESS','CLOSED','CANCELLED') NOT NULL DEFAULT 'DRAFT',
  `planned_date` date DEFAULT NULL,
  `opened_at` datetime DEFAULT NULL,
  `closed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  `assigned_to` int(10) unsigned DEFAULT NULL,
  `assigned_at` datetime DEFAULT NULL,
  `assigned_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_agenda_number` (`agenda_number`),
  KEY `idx_agenda_wh` (`warehouse_id`),
  KEY `idx_agenda_status` (`status`),
  KEY `idx_agenda_date` (`planned_date`),
  KEY `fk_agenda_creator` (`created_by`),
  KEY `idx_assigned_to` (`assigned_to`),
  CONSTRAINT `fk_agenda_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_agenda_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Agendas de recepcion con soporte multi-OC';

--
-- Dumping data for table `reception_agendas`
--

INSERT INTO `reception_agendas` VALUES
(1,'AG-00000001',16,'CLOSED','2026-05-13','2026-05-13 20:58:23','2026-05-13 21:01:58','Auto-creada desde OC SAP #43','2026-05-13 20:58:11','2026-05-13 21:01:58',1,16,'2026-05-13 20:58:15',1),
(2,'AG-00000002',16,'CLOSED','2026-05-14','2026-05-14 10:04:26','2026-05-14 10:06:31','Auto-creada desde OC SAP #44','2026-05-14 10:04:19','2026-05-14 10:06:31',1,16,'2026-05-14 10:04:21',1),
(3,'AG-00000003',16,'CLOSED','2026-05-14','2026-05-14 10:19:05','2026-05-14 10:23:51','Auto-creada desde OC SAP #47','2026-05-14 10:18:48','2026-05-14 10:23:51',1,16,'2026-05-14 10:18:50',1),
(4,'AG-00000004',16,'CLOSED','2026-05-14','2026-05-14 10:33:28','2026-05-14 11:09:32','Auto-creada desde OC SAP #46','2026-05-14 10:33:20','2026-05-14 11:09:32',1,16,'2026-05-14 10:33:22',1),
(5,'AG-00000005',16,'CLOSED','2026-05-14','2026-05-14 10:44:51','2026-05-14 10:50:23','Auto-creada desde OC SAP #48','2026-05-14 10:44:44','2026-05-14 10:50:23',1,16,'2026-05-14 10:44:47',1),
(6,'AG-00000006',16,'CLOSED','2026-05-14','2026-05-14 13:39:01','2026-05-14 13:40:45','Auto-creada desde OC SAP #49','2026-05-14 13:38:52','2026-05-14 13:40:45',1,16,'2026-05-14 13:38:53',1),
(7,'AG-00000007',16,'CLOSED','2026-05-14','2026-05-14 18:22:09','2026-05-14 18:23:20','Auto-creada desde OC SAP #50','2026-05-14 18:21:44','2026-05-14 18:23:20',1,16,'2026-05-14 18:22:05',1),
(8,'AG-00000008',16,'CLOSED','2026-05-14','2026-05-14 18:36:09','2026-05-14 18:36:57','Auto-creada desde OC SAP #51','2026-05-14 18:36:02','2026-05-14 18:36:57',1,16,'2026-05-14 18:36:04',1),
(15,'AG-00000015',16,'OPEN','2026-05-15','2026-05-15 08:22:51',NULL,'Auto-creada desde ST SAP #70','2026-05-15 08:21:17','2026-05-15 08:22:51',1,16,'2026-05-15 08:22:17',1),
(16,'AG-00000016',16,'CLOSED','2026-05-16','2026-05-16 15:01:06','2026-05-16 15:04:52','Auto-creada desde OC SAP #52','2026-05-16 15:00:49','2026-05-16 15:04:52',1,16,'2026-05-16 15:00:53',1),
(17,'AG-00000017',16,'CLOSED','2026-05-20','2026-05-20 09:18:43','2026-05-20 09:20:25','Auto-creada desde OC SAP #53','2026-05-20 09:15:38','2026-05-20 09:20:25',1,16,'2026-05-20 09:18:35',1),
(18,'AG-00000018',16,'CLOSED','2026-05-24','2026-05-24 17:10:35','2026-05-24 17:19:02','Auto-creada desde OC SAP #54','2026-05-24 17:10:15','2026-05-24 17:19:02',1,16,'2026-05-24 17:10:16',1),
(19,'AG-00000019',16,'CLOSED','2026-05-24','2026-05-24 17:53:28','2026-05-24 17:54:23','Auto-creada desde OC SAP #56','2026-05-24 17:52:37','2026-05-24 17:54:23',1,16,'2026-05-24 17:53:22',1),
(20,'AG-00000020',16,'CLOSED','2026-05-24','2026-05-25 20:58:48','2026-05-25 21:00:27','Auto-creada desde OC SAP #55','2026-05-25 20:56:43','2026-05-25 21:00:27',24,16,'2026-05-25 20:58:40',1),
(21,'AG-00000021',16,'CLOSED','2026-05-25','2026-05-26 00:02:28','2026-05-26 00:04:41','Auto-creada desde OC SAP #58','2026-05-26 00:02:18','2026-05-26 00:04:41',24,16,'2026-05-26 00:02:20',24);

--
-- Table structure for table `reception_scans`
--

CREATE TABLE `reception_scans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `agenda_id` int(10) unsigned NOT NULL,
  `line_id` int(10) unsigned DEFAULT NULL COMMENT 'NULL si es producto inesperado',
  `item_code` varchar(50) NOT NULL COMMENT 'Codigo escaneado/ingresado',
  `batch_number` varchar(50) DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `supplier_lot` varchar(50) DEFAULT NULL,
  `scanned_qty` decimal(15,4) NOT NULL,
  `operator_id` int(10) unsigned NOT NULL COMMENT 'Operador que escaneo',
  `scanned_at` datetime NOT NULL DEFAULT current_timestamp(),
  `bin_id` int(10) unsigned DEFAULT NULL COMMENT 'Ubicacion destino si ya se asigno',
  `container_id` int(10) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_scan_agenda` (`agenda_id`),
  KEY `idx_scan_line` (`line_id`),
  KEY `idx_scan_item` (`item_code`),
  KEY `idx_scan_operator` (`operator_id`),
  KEY `idx_scan_date` (`scanned_at`),
  KEY `fk_scan_bin` (`bin_id`),
  KEY `idx_rec_container` (`container_id`),
  CONSTRAINT `fk_scan_agenda` FOREIGN KEY (`agenda_id`) REFERENCES `reception_agendas` (`id`),
  CONSTRAINT `fk_scan_bin` FOREIGN KEY (`bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_scan_line` FOREIGN KEY (`line_id`) REFERENCES `reception_agenda_lines` (`id`),
  CONSTRAINT `fk_scan_operator` FOREIGN KEY (`operator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Escaneos ciegos de recepcion por operador para comparacion contra teorico';

--
-- Dumping data for table `reception_scans`
--

INSERT INTO `reception_scans` VALUES
(1,1,1,'400242','636363','2029-01-25','7262722',25.0000,16,'2026-05-13 21:01:23',NULL,1,NULL),
(2,2,2,'70421','176389w67','2039-08-21','763yg73',100.0000,16,'2026-05-14 10:06:01',NULL,2,NULL),
(7,3,3,'70118','ji','2029-09-15','j7',15.0000,16,'2026-05-14 10:22:20',NULL,3,NULL),
(9,3,3,'70118','j7','2029-09-15','sj7',15.0000,16,'2026-05-14 10:23:11',NULL,4,NULL),
(12,5,5,'400727','l8','2029-01-15','l9',15.0000,16,'2026-05-14 10:48:35',NULL,5,NULL),
(15,5,5,'400727','l78l7e7e','2034-09-08','l98738',85.0000,16,'2026-05-14 10:49:41',NULL,6,NULL),
(17,4,4,'606067','hs7','2028-09-01','ye8',1.0000,16,'2026-05-14 11:09:01',NULL,7,NULL),
(18,6,6,'403604','ko','2029-01-01','ki',100.0000,16,'2026-05-14 13:40:33',NULL,8,NULL),
(20,7,7,'32052','hh1','2030-01-01','jj22',100.0000,16,'2026-05-14 18:23:04',NULL,9,NULL),
(21,8,8,'210112','gg6','2029-08-04','hh6',100.0000,16,'2026-05-14 18:36:51',NULL,10,NULL),
(26,16,25,'70118','LT2026','2045-01-01','LT2026P',120.0000,16,'2026-05-16 15:02:06',NULL,25,NULL),
(27,16,24,'210112','LT888','2029-05-20','LT888P',120.0000,16,'2026-05-16 15:03:21',NULL,26,NULL),
(28,16,25,'70118','LT6738','2031-04-30','LT648P',480.0000,16,'2026-05-16 15:04:35',NULL,27,NULL),
(29,17,26,'604090','L0998178','2029-08-21','L83783',100.0000,16,'2026-05-20 09:20:09',NULL,30,NULL),
(30,18,27,'606067','l8','2029-09-21','l98',100.0000,16,'2026-05-24 17:17:05',NULL,31,NULL),
(32,18,27,'606067','h7','2030-09-13','e8',50.0000,16,'2026-05-24 17:18:04',NULL,32,NULL),
(33,19,28,'70421','j8','2031-02-23','u8',500.0000,16,'2026-05-24 17:54:04',NULL,33,NULL),
(34,20,29,'400156','l112','2030-02-21','ll121',200.0000,16,'2026-05-25 20:59:42',NULL,34,NULL),
(35,21,30,'606067','lot09','2027-02-01','lot10',60.0000,16,'2026-05-26 00:03:41',NULL,35,NULL),
(36,21,30,'606067','lot09','2027-02-01','lot10',60.0000,16,'2026-05-26 00:04:19',NULL,36,NULL);

--
-- Table structure for table `relocations`
--

CREATE TABLE `relocations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `relocation_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `container_id` int(10) unsigned NOT NULL,
  `from_bin_id` int(10) unsigned NOT NULL,
  `to_bin_id` int(10) unsigned NOT NULL,
  `zone_id` int(10) unsigned NOT NULL,
  `status` enum('PENDING','ASSIGNED','IN_PROGRESS','COMPLETED','CANCELLED') NOT NULL DEFAULT 'PENDING',
  `task_id` int(10) unsigned DEFAULT NULL,
  `assigned_to` int(10) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_reason` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  `completed_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `relocation_number` (`relocation_number`),
  KEY `idx_reloc_container` (`container_id`),
  KEY `idx_reloc_status` (`status`),
  KEY `idx_reloc_assigned` (`assigned_to`),
  KEY `idx_reloc_warehouse` (`warehouse_id`),
  KEY `idx_reloc_task` (`task_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `relocations`
--

INSERT INTO `relocations` VALUES
(2,'RL-00000002',16,30,29,449,22,'COMPLETED',28,17,'LLL','2026-05-24 19:36:34',NULL,NULL,'2026-05-24 19:30:57','2026-05-24 19:36:34',1,17),
(3,'RL-00000003',16,31,28,908,22,'CANCELLED',29,17,'khkjhkjh k',NULL,'2026-05-24 19:46:14',NULL,'2026-05-24 19:38:05','2026-05-24 19:46:14',1,NULL),
(4,'RL-00000004',16,31,28,449,22,'CANCELLED',30,17,'lalala',NULL,'2026-05-24 19:47:09',NULL,'2026-05-24 19:46:35','2026-05-24 19:47:09',1,NULL),
(5,'RL-00000005',16,31,28,338,22,'COMPLETED',31,17,'zvzxcvzzxv','2026-05-24 19:51:22',NULL,NULL,'2026-05-24 19:48:37','2026-05-24 19:51:22',1,17);

--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `role` enum('admin','supervisor','operator','viewer') NOT NULL,
  `module` varchar(50) NOT NULL,
  `action` varchar(50) NOT NULL,
  `allowed` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_role_perm` (`role`,`module`,`action`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_permissions`
--

INSERT INTO `role_permissions` VALUES
(1,'admin','*','*',1),
(2,'supervisor','reception','*',1),
(3,'supervisor','putaway','*',1),
(4,'supervisor','stock','*',1),
(5,'supervisor','picking','*',1),
(6,'supervisor','packing','*',1),
(7,'supervisor','dispatch','*',1),
(8,'supervisor','qa','*',1),
(9,'supervisor','cycle_count','*',1),
(10,'supervisor','recall','*',1),
(11,'supervisor','transfer','*',1),
(12,'supervisor','users','view',1),
(13,'operator','reception','scan',1),
(14,'operator','reception','view',1),
(15,'operator','putaway','execute',1),
(16,'operator','putaway','view',1),
(17,'operator','picking','execute',1),
(18,'operator','picking','view',1),
(19,'operator','packing','scan',1),
(20,'operator','packing','view',1),
(21,'operator','dispatch','scan',1),
(22,'operator','dispatch','view',1),
(23,'operator','stock','view',1),
(24,'operator','cycle_count','count',1),
(25,'operator','transfer','execute',1),
(26,'viewer','*','view',1);

--
-- Table structure for table `sampling_requests`
--

CREATE TABLE `sampling_requests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `request_number` varchar(30) NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `source_bin_id` int(10) unsigned DEFAULT NULL,
  `requested_qty` decimal(15,4) NOT NULL COMMENT 'Cantidad a traer del almacen',
  `sample_qty` decimal(15,4) DEFAULT NULL COMMENT 'Cantidad consumida en muestreo',
  `returned_qty` decimal(15,4) DEFAULT NULL COMMENT 'Cantidad devuelta al almacen',
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `status` enum('REQUESTED','ASSIGNED','DELIVERED','SAMPLED','RETURNED','COMPLETED','CANCELLED') NOT NULL DEFAULT 'REQUESTED',
  `requested_by` int(10) unsigned NOT NULL,
  `assigned_to` int(10) unsigned DEFAULT NULL,
  `deliver_bin` varchar(50) DEFAULT 'MUESTREO' COMMENT 'Zona destino de la muestra',
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_item` (`item_id`),
  KEY `idx_batch` (`batch_id`),
  KEY `idx_assigned` (`assigned_to`),
  KEY `warehouse_id` (`warehouse_id`),
  KEY `requested_by` (`requested_by`),
  CONSTRAINT `sampling_requests_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `sampling_requests_ibfk_2` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `sampling_requests_ibfk_3` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sampling_requests`
--


--
-- Table structure for table `sap_sync_log`
--

CREATE TABLE `sap_sync_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sync_type` enum('MASTER_ITEMS','MASTER_WAREHOUSES','MASTER_BP','DOC_PURCHASE','DOC_SALES','DOC_DELIVERY','DOC_RECEIPT','BATCH','DOC_RECEPTION_AGENDA','DOC_PACKING','DOC_DISPATCH','DOC_RETURN','DOC_ADJUSTMENT','DOC_RECALL','BATCH_LOCK','BATCH_RELEASE','BATCH_REJECT') NOT NULL,
  `direction` enum('SAP_TO_WMS','WMS_TO_SAP') NOT NULL,
  `sap_doc_entry` int(11) DEFAULT NULL,
  `sap_doc_num` varchar(30) DEFAULT NULL,
  `sap_doc_type` varchar(30) DEFAULT NULL,
  `wms_reference_id` int(10) unsigned DEFAULT NULL,
  `status` enum('PENDING','SUCCESS','ERROR','RETRY','WARN') NOT NULL DEFAULT 'PENDING',
  `request_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`request_payload`)),
  `response_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_payload`)),
  `error_message` text DEFAULT NULL,
  `retry_count` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `max_retries` tinyint(3) unsigned NOT NULL DEFAULT 3,
  `next_retry_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_sync_type` (`sync_type`),
  KEY `idx_sync_status` (`status`),
  KEY `idx_sync_sap` (`sap_doc_entry`,`sap_doc_type`),
  KEY `idx_sync_retry` (`status`,`next_retry_at`)
) ENGINE=InnoDB AUTO_INCREMENT=167 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Log de sincronización bidireccional con SAP B1';

--
-- Dumping data for table `sap_sync_log`
--

INSERT INTO `sap_sync_log` VALUES
(1,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',1,'ERROR',NULL,NULL,'Error SAP Service Layer: Enter valid currency  , \'1140116\'',0,3,NULL,'2026-05-05 15:14:53','2026-05-05 15:14:53'),
(2,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',7346,NULL,'PurchaseDeliveryNote',1,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-05 15:16:21','2026-05-05 15:16:21'),
(3,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',7349,NULL,'PurchaseDeliveryNote',2,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-05 15:24:59','2026-05-05 15:24:59'),
(4,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',7351,NULL,'PurchaseDeliveryNote',3,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-05 15:55:13','2026-05-05 15:55:13'),
(5,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',7352,NULL,'PurchaseDeliveryNote',4,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-05 16:53:33','2026-05-05 16:53:33'),
(6,'MASTER_ITEMS','SAP_TO_WMS',NULL,NULL,NULL,NULL,'SUCCESS',NULL,'{\"started_at\":\"2026-05-12 19:48:10\",\"finished_at\":\"2026-05-12 19:48:33\",\"duration_ms\":22481,\"source\":\"ServiceLayer\",\"processed\":7548,\"created\":4,\"updated\":7543,\"unchanged\":1,\"errors\":0,\"executed_by_user_id\":null,\"executed_by_username\":\"admin\"}',NULL,0,3,NULL,'2026-05-12 19:48:33','2026-05-12 19:48:33'),
(8,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',75,NULL,'PurchaseDeliveryNote',9,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 20:41:23','2026-05-12 20:41:23'),
(9,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',77,NULL,'PurchaseDeliveryNote',12,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:19:42','2026-05-12 21:19:42'),
(10,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',79,NULL,'PurchaseDeliveryNote',13,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:25:09','2026-05-12 21:25:09'),
(11,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',80,NULL,'PurchaseDeliveryNote',25,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:34:50','2026-05-12 21:34:50'),
(12,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',81,NULL,'PurchaseDeliveryNote',26,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:36:16','2026-05-12 21:36:16'),
(13,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',83,NULL,'PurchaseDeliveryNote',28,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:54:42','2026-05-12 21:54:42'),
(14,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',84,NULL,'PurchaseDeliveryNote',29,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:54:54','2026-05-12 21:54:54'),
(15,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',85,NULL,'PurchaseDeliveryNote',30,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:55:41','2026-05-12 21:55:41'),
(16,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',86,NULL,'PurchaseDeliveryNote',31,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:56:31','2026-05-12 21:56:31'),
(17,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',87,NULL,'PurchaseDeliveryNote',32,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:56:41','2026-05-12 21:56:41'),
(18,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',88,NULL,'PurchaseDeliveryNote',33,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 21:56:51','2026-05-12 21:56:51'),
(19,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',34,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:01','2026-05-12 21:57:01'),
(20,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',35,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:11','2026-05-12 21:57:11'),
(21,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',36,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:19','2026-05-12 21:57:19'),
(22,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',37,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:27','2026-05-12 21:57:27'),
(23,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',38,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:35','2026-05-12 21:57:35'),
(24,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',39,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:43','2026-05-12 21:57:43'),
(25,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',40,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:57:52','2026-05-12 21:57:52'),
(26,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',34,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 21:59:58','2026-05-12 21:59:58'),
(27,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',35,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:01','2026-05-12 22:00:01'),
(28,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',36,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:03','2026-05-12 22:00:03'),
(29,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',37,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:06','2026-05-12 22:00:06'),
(30,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',38,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:09','2026-05-12 22:00:09'),
(31,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',39,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:12','2026-05-12 22:00:12'),
(32,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',40,'ERROR',NULL,NULL,'Error SAP Service Layer: Attachments folder not defined, or Attachments folder has been changed or removed   [Message 131-102]',0,3,NULL,'2026-05-12 22:00:14','2026-05-12 22:00:14'),
(33,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',105,NULL,'PurchaseDeliveryNote',34,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:02:50','2026-05-12 22:02:50'),
(34,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',106,NULL,'PurchaseDeliveryNote',35,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:02:53','2026-05-12 22:02:53'),
(35,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',107,NULL,'PurchaseDeliveryNote',36,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:02:57','2026-05-12 22:02:57'),
(36,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',108,NULL,'PurchaseDeliveryNote',37,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:03:00','2026-05-12 22:03:00'),
(37,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',109,NULL,'PurchaseDeliveryNote',38,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:03:03','2026-05-12 22:03:03'),
(38,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',110,NULL,'PurchaseDeliveryNote',39,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:03:06','2026-05-12 22:03:06'),
(39,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',111,NULL,'PurchaseDeliveryNote',40,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:03:10','2026-05-12 22:03:10'),
(40,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',112,NULL,'PurchaseDeliveryNote',41,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:07:59','2026-05-12 22:07:59'),
(41,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',113,NULL,'PurchaseDeliveryNote',42,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:09:01','2026-05-12 22:09:01'),
(42,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',114,NULL,'PurchaseDeliveryNote',43,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:09:06','2026-05-12 22:09:06'),
(43,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',115,NULL,'PurchaseDeliveryNote',44,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:09:15','2026-05-12 22:09:15'),
(44,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',116,NULL,'PurchaseDeliveryNote',45,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:09:20','2026-05-12 22:09:20'),
(45,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',118,NULL,'PurchaseDeliveryNote',46,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-12 22:24:15','2026-05-12 22:24:15'),
(46,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',119,NULL,'PurchaseDeliveryNote',47,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 00:30:23','2026-05-13 00:30:23'),
(47,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',48,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 00:30:57','2026-05-13 00:30:57'),
(48,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',121,NULL,'PurchaseDeliveryNote',48,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 00:30:57','2026-05-13 00:30:57'),
(49,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',49,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 00:31:40','2026-05-13 00:31:40'),
(50,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',122,NULL,'PurchaseDeliveryNote',49,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 00:31:40','2026-05-13 00:31:40'),
(51,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',50,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 00:57:22','2026-05-13 00:57:22'),
(52,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',125,NULL,'PurchaseDeliveryNote',50,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 00:57:22','2026-05-13 00:57:22'),
(53,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',51,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 01:58:48','2026-05-13 01:58:48'),
(54,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',126,NULL,'PurchaseDeliveryNote',51,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 01:58:48','2026-05-13 01:58:48'),
(55,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',247,'SUCCESS',NULL,NULL,'batch=70421/QAREL-015845 SAP_DocEntry=14593 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 01:58:51','2026-05-13 01:58:51'),
(56,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',52,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 01:59:30','2026-05-13 01:59:30'),
(57,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',127,NULL,'PurchaseDeliveryNote',52,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 01:59:30','2026-05-13 01:59:30'),
(58,'BATCH_REJECT','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',248,'SUCCESS',NULL,NULL,'batch=70421/QAREJ-015927 SAP_DocEntry=14594 bdsStatus_Locked -> bdsStatus_Locked',0,3,NULL,'2026-05-13 01:59:31','2026-05-13 01:59:31'),
(59,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',242,'SUCCESS',NULL,NULL,'batch=70421/22 SAP_DocEntry=14588 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:04:59','2026-05-13 02:04:59'),
(60,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',53,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:18:01','2026-05-13 02:18:01'),
(61,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',128,NULL,'PurchaseDeliveryNote',53,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:18:01','2026-05-13 02:18:01'),
(62,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',54,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:18:07','2026-05-13 02:18:07'),
(63,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',129,NULL,'PurchaseDeliveryNote',54,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:18:07','2026-05-13 02:18:07'),
(64,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',55,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:18:18','2026-05-13 02:18:18'),
(65,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',130,NULL,'PurchaseDeliveryNote',55,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:18:18','2026-05-13 02:18:18'),
(66,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',251,'SUCCESS',NULL,NULL,'batch=70421/PICK-QA-021813 SAP_DocEntry=14597 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:18:19','2026-05-13 02:18:19'),
(67,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',56,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:29:36','2026-05-13 02:29:36'),
(68,'BATCH','WMS_TO_SAP',NULL,NULL,'Acta_PDF',56,'ERROR',NULL,NULL,'acta_gen_fail=wkhtmltopdf falló: Exit with code 1 due to network error: HostNotFoundError',0,3,NULL,'2026-05-13 02:29:36','2026-05-13 02:29:36'),
(69,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',132,NULL,'PurchaseDeliveryNote',56,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:29:36','2026-05-13 02:29:36'),
(70,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',57,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:30:32','2026-05-13 02:30:32'),
(71,'BATCH','WMS_TO_SAP',NULL,NULL,'Acta_PDF',57,'ERROR',NULL,NULL,'acta_gen_fail=SQLSTATE[01000]: Warning: 1265 Data truncated for column \'status\' at row 1',0,3,NULL,'2026-05-13 02:30:32','2026-05-13 02:30:32'),
(72,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',133,NULL,'PurchaseDeliveryNote',57,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:30:32','2026-05-13 02:30:32'),
(73,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',253,'SUCCESS',NULL,NULL,'batch=70421/CMP-023029 SAP_DocEntry=14599 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:30:39','2026-05-13 02:30:39'),
(74,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',58,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:30:45','2026-05-13 02:30:45'),
(75,'BATCH','WMS_TO_SAP',NULL,NULL,'Acta_PDF',58,'ERROR',NULL,NULL,'acta_gen_fail=SQLSTATE[01000]: Warning: 1265 Data truncated for column \'status\' at row 1',0,3,NULL,'2026-05-13 02:30:45','2026-05-13 02:30:45'),
(76,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',134,NULL,'PurchaseDeliveryNote',58,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:30:45','2026-05-13 02:30:45'),
(77,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',254,'SUCCESS',NULL,NULL,'batch=70421/CMP2-023039-X SAP_DocEntry=14600 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:30:47','2026-05-13 02:30:47'),
(78,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',59,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:31:20','2026-05-13 02:31:20'),
(79,'BATCH','WMS_TO_SAP',135,NULL,'Acta_PDF',59,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000045.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-13 02:31:21','2026-05-13 02:31:21'),
(80,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',135,NULL,'PurchaseDeliveryNote',59,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:31:21','2026-05-13 02:31:21'),
(81,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',255,'SUCCESS',NULL,NULL,'batch=70421/CMP-023117 SAP_DocEntry=14601 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:31:28','2026-05-13 02:31:28'),
(82,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',60,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:31:34','2026-05-13 02:31:34'),
(83,'BATCH','WMS_TO_SAP',136,NULL,'Acta_PDF',60,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000046.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-13 02:31:39','2026-05-13 02:31:39'),
(84,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',136,NULL,'PurchaseDeliveryNote',60,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:31:39','2026-05-13 02:31:39'),
(85,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',256,'SUCCESS',NULL,NULL,'batch=70421/CMP2-023128-X SAP_DocEntry=14602 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:31:40','2026-05-13 02:31:40'),
(86,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',61,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:37:44','2026-05-13 02:37:44'),
(87,'BATCH','WMS_TO_SAP',137,NULL,'Acta_PDF',61,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000047.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-13 02:37:46','2026-05-13 02:37:46'),
(88,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',137,NULL,'PurchaseDeliveryNote',61,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:37:46','2026-05-13 02:37:46'),
(89,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',257,'SUCCESS',NULL,NULL,'batch=70421/CMP-023740 SAP_DocEntry=14603 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:37:53','2026-05-13 02:37:53'),
(90,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',62,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 02:37:59','2026-05-13 02:37:59'),
(91,'BATCH','WMS_TO_SAP',138,NULL,'Acta_PDF',62,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000048.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-13 02:38:01','2026-05-13 02:38:01'),
(92,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',138,NULL,'PurchaseDeliveryNote',62,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 02:38:01','2026-05-13 02:38:01'),
(93,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',258,'SUCCESS',NULL,NULL,'batch=70421/CMP2-023753-X SAP_DocEntry=14604 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-13 02:38:02','2026-05-13 02:38:02'),
(94,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',1,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-13 21:01:57','2026-05-13 21:01:57'),
(95,'BATCH','WMS_TO_SAP',140,NULL,'Acta_PDF',1,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000001.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-13 21:01:58','2026-05-13 21:01:58'),
(96,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',140,NULL,'PurchaseDeliveryNote',1,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-13 21:01:58','2026-05-13 21:01:58'),
(97,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',2,'ERROR',NULL,NULL,'Error SAP Service Layer: Enter valid currency  , \'1140101\'',0,3,NULL,'2026-05-14 10:06:31','2026-05-14 10:06:31'),
(98,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',2,'ERROR',NULL,NULL,'Error SAP Service Layer: Enter valid currency  , \'1140101\'',0,3,NULL,'2026-05-14 10:22:01','2026-05-14 10:22:01'),
(99,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',2,'ERROR',NULL,NULL,'Error SAP Service Layer: 1250000094 - Business partner is set up for foreign currency transactions; use the same foreign currency in this document as in the master data',0,3,NULL,'2026-05-14 10:23:05','2026-05-14 10:23:05'),
(100,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',3,'SUCCESS',NULL,NULL,'locked=0 already_locked=2 errors=0',0,3,NULL,'2026-05-14 10:23:50','2026-05-14 10:23:50'),
(101,'BATCH','WMS_TO_SAP',145,NULL,'Acta_PDF',3,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000003.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-14 10:23:51','2026-05-14 10:23:51'),
(102,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',145,NULL,'PurchaseDeliveryNote',3,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-14 10:23:51','2026-05-14 10:23:51'),
(103,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',5,'SUCCESS',NULL,NULL,'locked=0 already_locked=2 errors=0',0,3,NULL,'2026-05-14 10:50:22','2026-05-14 10:50:22'),
(104,'BATCH','WMS_TO_SAP',147,NULL,'Acta_PDF',5,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000005.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-14 10:50:23','2026-05-14 10:50:23'),
(105,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',147,NULL,'PurchaseDeliveryNote',5,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-14 10:50:23','2026-05-14 10:50:23'),
(106,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',4,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-14 11:09:31','2026-05-14 11:09:31'),
(107,'BATCH','WMS_TO_SAP',150,NULL,'Acta_PDF',4,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000004.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-14 11:09:32','2026-05-14 11:09:32'),
(108,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',150,NULL,'PurchaseDeliveryNote',4,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-14 11:09:32','2026-05-14 11:09:32'),
(109,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',6,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-14 13:40:44','2026-05-14 13:40:44'),
(110,'BATCH','WMS_TO_SAP',152,NULL,'Acta_PDF',6,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000006.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-14 13:40:45','2026-05-14 13:40:45'),
(111,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',152,NULL,'PurchaseDeliveryNote',6,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-14 13:40:45','2026-05-14 13:40:45'),
(112,'MASTER_ITEMS','SAP_TO_WMS',NULL,NULL,NULL,NULL,'SUCCESS',NULL,'{\"started_at\":\"2026-05-14 13:54:53\",\"finished_at\":\"2026-05-14 13:55:09\",\"duration_ms\":15164,\"source\":\"ServiceLayer\",\"processed\":8740,\"created\":1146,\"updated\":43,\"unchanged\":7551,\"errors\":0,\"executed_by_user_id\":null,\"executed_by_username\":\"admin\"}',NULL,0,3,NULL,'2026-05-14 13:55:09','2026-05-14 13:55:09'),
(113,'MASTER_ITEMS','SAP_TO_WMS',NULL,NULL,NULL,NULL,'SUCCESS',NULL,'{\"started_at\":\"2026-05-14 13:56:43\",\"finished_at\":\"2026-05-14 13:56:56\",\"duration_ms\":12718,\"source\":\"ServiceLayer\",\"processed\":8740,\"created\":0,\"updated\":2352,\"unchanged\":6388,\"errors\":0,\"executed_by_user_id\":null,\"executed_by_username\":\"admin\"}',NULL,0,3,NULL,'2026-05-14 13:56:56','2026-05-14 13:56:56'),
(114,'MASTER_ITEMS','SAP_TO_WMS',NULL,NULL,NULL,NULL,'SUCCESS',NULL,'{\"started_at\":\"2026-05-14 14:17:48\",\"finished_at\":\"2026-05-14 14:18:00\",\"duration_ms\":12341,\"source\":\"ServiceLayer\",\"processed\":8740,\"created\":0,\"updated\":0,\"unchanged\":8740,\"errors\":0,\"executed_by_user_id\":null,\"executed_by_username\":\"admin\"}',NULL,0,3,NULL,'2026-05-14 14:18:00','2026-05-14 14:18:00'),
(115,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',7,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-14 18:23:19','2026-05-14 18:23:19'),
(116,'BATCH','WMS_TO_SAP',154,NULL,'Acta_PDF',7,'WARN',NULL,NULL,'acta_local_ok=/var/www/WMS/storage/actas/AG-00000007.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-14 18:23:20','2026-05-14 18:23:20'),
(117,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',154,NULL,'PurchaseDeliveryNote',7,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-14 18:23:20','2026-05-14 18:23:20'),
(118,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',8,'ERROR',NULL,NULL,'Error SAP Service Layer: 1250000094 - Business partner is set up for foreign currency transactions; use the same foreign currency in this document as in the master data',0,3,NULL,'2026-05-14 18:36:57','2026-05-14 18:36:57'),
(119,'MASTER_ITEMS','SAP_TO_WMS',NULL,NULL,NULL,NULL,'SUCCESS',NULL,'{\"started_at\":\"2026-05-14 18:53:09\",\"finished_at\":\"2026-05-14 18:53:22\",\"duration_ms\":13061,\"source\":\"ServiceLayer\",\"processed\":8740,\"created\":0,\"updated\":0,\"unchanged\":8740,\"errors\":0,\"executed_by_user_id\":null,\"executed_by_username\":null}',NULL,0,3,NULL,'2026-05-14 18:53:22','2026-05-14 18:53:22'),
(120,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'StockTransfer',9,'ERROR',NULL,NULL,'Error SAP Service Layer: Data DocumentLines not found',0,3,NULL,'2026-05-14 22:10:31','2026-05-14 22:10:31'),
(121,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'StockTransfer',10,'ERROR',NULL,NULL,'Error SAP Service Layer: Property \'CostingCode\' of \'StockTransferLine\' is invalid',0,3,NULL,'2026-05-14 22:11:31','2026-05-14 22:11:31'),
(122,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'StockTransfer',11,'ERROR',NULL,NULL,'Error SAP Service Layer: 480000112 - Batch/serial number ST54-v2 selected in row 1 does not exist; specify a valid batch/serial number',0,3,NULL,'2026-05-14 22:12:12','2026-05-14 22:12:12'),
(124,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'StockTransfer',10,'ERROR',NULL,NULL,'Error SAP Service Layer: 480000112 - Batch/serial number ST63-TEST selected in row 1 does not exist; specify a valid batch/serial number',0,3,NULL,'2026-05-14 22:18:27','2026-05-14 22:18:27'),
(127,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'StockTransfer',12,'ERROR',NULL,NULL,'Error SAP Service Layer: Internal error (-5002) occurred  [Message 131-183]',0,3,NULL,'2026-05-14 22:58:16','2026-05-14 22:58:16'),
(128,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',8,'ERROR',NULL,NULL,'Error SAP Service Layer: 1250000094 - Business partner is set up for foreign currency transactions; use the same foreign currency in this document as in the master data',0,3,NULL,'2026-05-15 11:18:02','2026-05-15 11:18:02'),
(129,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',165,'50','PurchaseDeliveryNote',8,'SUCCESS',NULL,'{\"reconciled\":true,\"note\":\"PDN creada manualmente via \\/tmp\\/trace_retry.php tras fix de cuenta 1140101 (## multi-moneda)\",\"pdn_doc_entry\":165}',NULL,0,3,NULL,'2026-05-15 11:21:48','2026-05-15 11:21:48'),
(130,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',21,'SUCCESS',NULL,NULL,'batch=210112/gg6 SAP_DocEntry=14624 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-15 11:25:46','2026-05-15 11:25:46'),
(131,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',7,'SUCCESS',NULL,NULL,'batch=70118/ji SAP_DocEntry=14613 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-15 11:37:02','2026-05-15 11:37:02'),
(132,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',9,'SUCCESS',NULL,NULL,'batch=70118/j7 SAP_DocEntry=14612 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-15 11:40:06','2026-05-15 11:40:06'),
(133,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',16,'SUCCESS',NULL,NULL,'locked=0 already_locked=3 errors=0',0,3,NULL,'2026-05-16 15:04:50','2026-05-16 15:04:50'),
(134,'BATCH','WMS_TO_SAP',167,NULL,'Acta_PDF',16,'WARN',NULL,NULL,'endpoint=PurchaseDeliveryNotes acta_local_ok=/var/www/WMS/storage/actas/AG-00000016.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-16 15:04:52','2026-05-16 15:04:52'),
(135,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',167,NULL,'PurchaseDeliveryNote',16,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-16 15:04:52','2026-05-16 15:04:52'),
(136,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',28,'SUCCESS',NULL,NULL,'batch=70118/LT6738 SAP_DocEntry=14627 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-16 15:10:24','2026-05-16 15:10:24'),
(137,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',17,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-20 09:20:23','2026-05-20 09:20:23'),
(138,'BATCH','WMS_TO_SAP',169,NULL,'Acta_PDF',17,'WARN',NULL,NULL,'endpoint=PurchaseDeliveryNotes acta_local_ok=/var/www/WMS/storage/actas/AG-00000017.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-20 09:20:25','2026-05-20 09:20:25'),
(139,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',169,NULL,'PurchaseDeliveryNote',17,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-20 09:20:25','2026-05-20 09:20:25'),
(140,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'DeliveryNote',1,'ERROR',NULL,NULL,'Error SAP Service Layer: Target item number does not match base item number.  [DocumentLines.ItemCode][line: 0]',0,3,NULL,'2026-05-20 19:27:34','2026-05-20 19:27:34'),
(141,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'DeliveryNote',2,'ERROR',NULL,NULL,'Error SAP Service Layer: (2) Seleccione el Chofer',0,3,NULL,'2026-05-20 19:34:23','2026-05-20 19:34:23'),
(142,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'PackingComplete',3,'PENDING',NULL,NULL,'Esperando despacho para crear DeliveryNote',0,3,NULL,'2026-05-20 19:46:18','2026-05-20 19:46:18'),
(144,'DOC_DISPATCH','WMS_TO_SAP',NULL,NULL,'DeliveryNote',2,'ERROR',NULL,NULL,'Error SAP Service Layer: (2) Verifique el tipo de documento electrónico, debe ser 7',0,3,NULL,'2026-05-20 19:46:49','2026-05-20 19:46:49'),
(146,'DOC_DISPATCH','WMS_TO_SAP',573,NULL,'DeliveryNote',3,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-20 19:50:30','2026-05-20 19:50:30'),
(148,'DOC_DISPATCH','WMS_TO_SAP',575,NULL,'DeliveryNote',4,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-20 20:05:26','2026-05-20 20:05:26'),
(150,'DOC_DISPATCH','WMS_TO_SAP',577,NULL,'DeliveryNote',5,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-20 20:07:28','2026-05-20 20:07:28'),
(151,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'PackingComplete',8,'PENDING',NULL,NULL,'Esperando despacho para crear DeliveryNote',0,3,NULL,'2026-05-20 20:08:52','2026-05-20 20:08:52'),
(152,'DOC_DISPATCH','WMS_TO_SAP',579,NULL,'DeliveryNote',6,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-20 20:08:56','2026-05-20 20:08:56'),
(153,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'PackingComplete',9,'PENDING',NULL,NULL,'Esperando despacho para crear DeliveryNote',0,3,NULL,'2026-05-20 21:57:22','2026-05-20 21:57:22'),
(154,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',18,'SUCCESS',NULL,NULL,'locked=0 already_locked=2 errors=0',0,3,NULL,'2026-05-24 17:18:59','2026-05-24 17:18:59'),
(155,'BATCH','WMS_TO_SAP',171,NULL,'Acta_PDF',18,'WARN',NULL,NULL,'endpoint=PurchaseDeliveryNotes acta_local_ok=/var/www/WMS/storage/actas/AG-00000018.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-24 17:19:02','2026-05-24 17:19:02'),
(156,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',171,NULL,'PurchaseDeliveryNote',18,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-24 17:19:02','2026-05-24 17:19:02'),
(157,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',19,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-24 17:54:21','2026-05-24 17:54:21'),
(158,'BATCH','WMS_TO_SAP',173,NULL,'Acta_PDF',19,'WARN',NULL,NULL,'endpoint=PurchaseDeliveryNotes acta_local_ok=/var/www/WMS/storage/actas/AG-00000019.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-24 17:54:23','2026-05-24 17:54:23'),
(159,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',173,NULL,'PurchaseDeliveryNote',19,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-24 17:54:23','2026-05-24 17:54:23'),
(160,'BATCH_RELEASE','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',27,'SUCCESS',NULL,NULL,'batch=210112/LT888 SAP_DocEntry=14625 bdsStatus_Locked -> bdsStatus_Released',0,3,NULL,'2026-05-24 18:22:21','2026-05-24 18:22:21'),
(161,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'PackingComplete',10,'PENDING',NULL,NULL,'Esperando despacho para crear DeliveryNote',0,3,NULL,'2026-05-24 19:06:59','2026-05-24 19:06:59'),
(162,'DOC_PACKING','WMS_TO_SAP',NULL,NULL,'PackingComplete',11,'PENDING',NULL,NULL,'Esperando despacho para crear DeliveryNote',0,3,NULL,'2026-05-24 20:00:47','2026-05-24 20:00:47'),
(163,'BATCH_LOCK','WMS_TO_SAP',NULL,NULL,'BatchNumberDetails',20,'SUCCESS',NULL,NULL,'locked=0 already_locked=1 errors=0',0,3,NULL,'2026-05-25 21:00:25','2026-05-25 21:00:25'),
(164,'BATCH','WMS_TO_SAP',175,NULL,'Acta_PDF',20,'WARN',NULL,NULL,'endpoint=PurchaseDeliveryNotes acta_local_ok=/var/www/WMS/storage/actas/AG-00000020.pdf sap_attach_fail=Error SAP /Attachments2: Attachments folder not defined, or Attachments folder has been changed or removed ',0,3,NULL,'2026-05-25 21:00:27','2026-05-25 21:00:27'),
(165,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',175,NULL,'PurchaseDeliveryNote',20,'SUCCESS',NULL,NULL,NULL,0,3,NULL,'2026-05-25 21:00:27','2026-05-25 21:00:27'),
(166,'DOC_RECEPTION_AGENDA','WMS_TO_SAP',NULL,NULL,'PurchaseDeliveryNote',21,'ERROR',NULL,NULL,'Error SAP Service Layer: Update the exchange rate  , \'USD\'',0,3,NULL,'2026-05-26 00:04:41','2026-05-26 00:04:41');

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `setting_key` (`setting_key`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES
(1,'pwd_min_length','8','Longitud minima','2026-04-17 18:12:09'),
(2,'pwd_require_uppercase','1','Requiere mayuscula','2026-04-17 18:12:09'),
(3,'pwd_require_lowercase','1','Requiere minuscula','2026-04-17 18:12:09'),
(4,'pwd_require_number','1','Requiere numero','2026-04-17 18:12:09'),
(5,'pwd_require_special','1','Requiere caracter especial','2026-04-17 18:12:09'),
(6,'pwd_special_chars','*.\'!','Caracteres especiales','2026-04-17 18:12:09');

--
-- Table structure for table `sops`
--

CREATE TABLE `sops` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sop_code` varchar(30) NOT NULL,
  `title` varchar(200) NOT NULL,
  `process` varchar(50) NOT NULL COMMENT 'recepcion, almacenamiento, picking, despacho, devoluciones, recall, inventarios, sistema',
  `version` varchar(10) NOT NULL DEFAULT '1.0',
  `status` enum('DRAFT','ACTIVE','OBSOLETE') NOT NULL DEFAULT 'DRAFT',
  `content` longtext NOT NULL COMMENT 'HTML content of the SOP',
  `approved_by` int(10) unsigned DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `effective_date` date DEFAULT NULL,
  `review_date` date DEFAULT NULL,
  `created_by` int(10) unsigned NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_sop_code_ver` (`sop_code`,`version`),
  KEY `idx_sop_process` (`process`),
  KEY `idx_sop_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sops`
--

INSERT INTO `sops` VALUES
(1,'SOP-REC-001','Recepcion de Mercaderia','recepcion','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-REC-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Recepcion de Mercaderia</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Recepcion</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Logistica / Almacen</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Establecer el procedimiento estandarizado para la recepcion de mercaderias en el almacen de COMFAR S.A., garantizando la verificacion completa de cantidad, calidad y trazabilidad de todos los productos farmaceuticos, cosmeticos y dispositivos medicos recibidos, en cumplimiento con las Buenas Practicas de Almacenamiento (BPA) exigidas por DINAVISA.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<p>Este procedimiento aplica a todas las recepciones de mercaderia en los almacenes gestionados por XPert WMS, incluyendo:</p>\n<ul>\n<li><strong>Importaciones:</strong> Mercaderia proveniente del exterior con documentacion aduanera</li>\n<li><strong>Compras plaza:</strong> Adquisiciones a proveedores locales</li>\n<li><strong>Devoluciones de clientes:</strong> Productos retornados por clientes</li>\n<li><strong>Transferencias de produccion:</strong> Producto terminado desde planta</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Planificar agendas de recepcion. Asignar recursos. Aprobar diferencias.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Operador de Recepcion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ejecutar el escaneo ciego de mercaderia con colector. Registrar datos de lote y vencimiento.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Control de Calidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Liberar o rechazar lotes segun control organolectico e inspecciones.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Administrativo</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Crear agendas, asociar ordenes de compra SAP, verificar documentacion.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Agenda de Recepcion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Documento de planificacion en XPert WMS que agrupa las ordenes de compra esperadas para una fecha y proveedor.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Escaneo Ciego</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Metodo de recepcion donde el operador escanea y cuenta la mercaderia sin ver las cantidades esperadas, garantizando veracidad.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>FEFO</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">First Expired, First Out. Politica de despacho de productos farmaceuticos obligatoria por DINAVISA.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>LPN (License Plate Number)</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Codigo unico asignado a cada contenedor/pallet recibido para trazabilidad completa.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>OC</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Orden de Compra en SAP Business One.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Planificacion - Crear Agenda de Recepcion</h3>\n<ol>\n<li>Acceder al modulo <strong>Agendas</strong> en XPert WMS desde el menu lateral.</li>\n<li>Hacer clic en <strong>\"+ Nueva Agenda\"</strong>.</li>\n<li>Completar: almacen destino, proveedor, fecha esperada, tipo de recepcion (importacion/plaza/devolucion/produccion).</li>\n<li>Asociar una o mas <strong>Ordenes de Compra SAP</strong> usando el boton \"Agregar Referencia\". El sistema carga automaticamente las lineas esperadas desde SAP B1.</li>\n<li>Verificar que las lineas cargadas coincidan con la documentacion (factura, remito, packing list).</li>\n<li>Guardar la agenda. Estado inicial: <strong>PLANNED</strong>.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Apertura de Recepcion</h3>\n<ol>\n<li>Cuando el proveedor/transportista llega al almacen, abrir la agenda correspondiente.</li>\n<li>Hacer clic en <strong>\"Abrir Recepcion\"</strong>. El estado cambia a <strong>OPEN</strong>.</li>\n<li>El sistema registra automaticamente la fecha/hora de inicio y el usuario responsable.</li>\n<li>Verificar documentacion: factura, remito, certificados de calidad, registros sanitarios DINAVISA.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Escaneo Ciego con Colector</h3>\n<ol>\n<li>El operador de almacen utiliza el colector de datos (RF) o la interfaz movil de XPert WMS.</li>\n<li>Escanear el <strong>codigo de barras (EAN/DUN14)</strong> de cada producto recibido.</li>\n<li>El sistema identifica automaticamente el articulo por su codigo de barras.</li>\n<li>Registrar para cada linea:\n  <ul>\n  <li><strong>Cantidad recibida</strong> (unidades, cajas, pallets)</li>\n  <li><strong>Numero de lote</strong> del fabricante</li>\n  <li><strong>Fecha de vencimiento</strong></li>\n  <li><strong>Numero de serie</strong> (si aplica)</li>\n  </ul>\n</li>\n<li><strong>IMPORTANTE:</strong> El operador NO ve las cantidades esperadas durante el escaneo (metodo ciego). Esto asegura una verificacion independiente y confiable.</li>\n<li>El sistema genera etiquetas LPN automaticamente para cada bulto/pallet escaneado.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Verificacion de Diferencias</h3>\n<ol>\n<li>Al finalizar el escaneo, hacer clic en <strong>\"Ver Diferencias\"</strong>.</li>\n<li>XPert WMS muestra automaticamente la comparacion entre cantidades esperadas (OC SAP) y cantidades escaneadas.</li>\n<li>Los estados posibles por linea son:\n  <ul>\n  <li><span style=\"color:#22c55e\"><strong>OK</strong></span> - Cantidad coincide exactamente</li>\n  <li><span style=\"color:#f59e0b\"><strong>PARCIAL</strong></span> - Cantidad recibida menor a la esperada</li>\n  <li><span style=\"color:#ef4444\"><strong>EXCESO</strong></span> - Cantidad recibida mayor a la esperada</li>\n  <li><span style=\"color:#ef4444\"><strong>FALTANTE</strong></span> - Producto esperado no recibido</li>\n  </ul>\n</li>\n<li>Si hay diferencias, el Jefe de Almacen debe revisar y decidir: aceptar, reclamar al proveedor, o rechazar.</li>\n<li>Documentar todas las diferencias con fotos y observaciones en el campo de notas.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Cierre de Agenda y Confirmacion a SAP</h3>\n<ol>\n<li>Una vez verificada la mercaderia, hacer clic en <strong>\"Cerrar Agenda\"</strong>.</li>\n<li>XPert WMS genera automaticamente la <strong>Entrada de Mercaderia</strong> en SAP B1 basada en la recepcion real.</li>\n<li>Los lotes se crean automaticamente en SAP con su numero de lote, fecha de fabricacion y vencimiento.</li>\n<li>El stock queda disponible en estado <strong>QA (Cuarentena)</strong> hasta que Control de Calidad lo libere.</li>\n<li>Se genera el registro de trazabilidad completo: quien recibio, cuando, que cantidades, de que proveedor.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Agenda de Recepcion</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Agendas</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Registro de Escaneo (lineas escaneadas)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Recepcion > Detalle</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Reporte de Diferencias</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Agendas > Diferencias</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Entrada de Mercaderia SAP</td><td style=\"padding:8px 12px;border:1px solid #475569\">SAP B1 > Entradas de Mercaderia</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Etiquetas LPN generadas</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Etiquetas</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(2,'SOP-ALM-001','Almacenamiento (Putaway)','almacenamiento','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-ALM-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Almacenamiento (Putaway)</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Almacenamiento</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Logistica / Almacen</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Definir el procedimiento para el almacenamiento correcto de mercaderia recibida en las ubicaciones asignadas del almacen, garantizando la trazabilidad de lotes, el cumplimiento de la politica FEFO (First Expired, First Out), y las condiciones de almacenamiento exigidas por DINAVISA segun la naturaleza del producto (temperatura ambiente, cadena de frio, controlados).</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<p>Aplica a todo el producto que ingresa a las zonas de almacenamiento tras haber sido recibido y liberado por QA (o en estado cuarentena con ubicacion de cuarentena asignada). Incluye:</p>\n<ul>\n<li><strong>Putaway Agrupado:</strong> Almacenamiento de pallets completos con etiqueta LPN</li>\n<li><strong>Putaway Fraccionado por Producto:</strong> Almacenamiento de cajas sueltas dirigido por item</li>\n<li><strong>Putaway Fraccionado por Ubicacion:</strong> Almacenamiento dirigido a una ubicacion especifica</li>\n<li><strong>Putaway Libre:</strong> El operador elige la ubicacion destino manualmente</li>\n<li><strong>Zonas especiales:</strong> Cadena de frio, controlados, inflamables, cuarentena, averias</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Definir reglas de almacenamiento por zona. Configurar estrategias de putaway en XPert WMS.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Operador de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ejecutar el almacenamiento con colector. Confirmar ubicaciones escaneando codigos de ubicacion.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Control de Calidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Liberar lotes de cuarentena para que puedan ser almacenados en ubicaciones de picking.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Putaway</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Proceso de colocar la mercaderia recibida en su ubicacion de almacenamiento definitiva.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Ubicacion (Bin)</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Posicion fisica identificada con codigo unico en la estanteria (pasillo-columna-nivel).</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Zona</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Agrupacion logica de ubicaciones con condiciones similares (temperatura, seguridad, tipo producto).</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>FEFO</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">First Expired, First Out. Los lotes con vencimiento mas proximo se despachan primero.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Sugerencia de Ubicacion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ubicacion recomendada por XPert WMS basada en reglas configuradas (mismo producto, zona correcta, capacidad disponible).</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Putaway Agrupado (Pallet completo)</h3>\n<ol>\n<li>Acceder al modulo <strong>Putaway</strong> en XPert WMS.</li>\n<li>Seleccionar <strong>\"Putaway Agrupado\"</strong>.</li>\n<li>Escanear la <strong>etiqueta LPN</strong> del pallet recibido.</li>\n<li>XPert WMS muestra automaticamente la <strong>ubicacion sugerida</strong> basada en:\n  <ul>\n  <li>Zona correcta segun tipo de producto (frio, ambiente, controlados)</li>\n  <li>Proximidad a ubicaciones con el mismo producto (consolidacion)</li>\n  <li>Capacidad disponible en la ubicacion</li>\n  </ul>\n</li>\n<li>Dirigirse a la ubicacion sugerida y <strong>escanear el codigo de la ubicacion destino</strong>.</li>\n<li>Confirmar el almacenamiento. El sistema registra el movimiento con trazabilidad completa.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Putaway Fraccionado por Producto</h3>\n<ol>\n<li>Seleccionar <strong>\"Fraccionado por Producto\"</strong> en el menu de Putaway.</li>\n<li>Escanear o ingresar el <strong>codigo del producto</strong>.</li>\n<li>Seleccionar el <strong>lote</strong> y la <strong>cantidad</strong> a almacenar.</li>\n<li>XPert WMS sugiere la ubicacion optima.</li>\n<li>Escanear la ubicacion destino y confirmar.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Putaway Fraccionado por Ubicacion</h3>\n<ol>\n<li>Seleccionar <strong>\"Fraccionado por Ubicacion\"</strong>.</li>\n<li>Escanear la <strong>ubicacion destino</strong> primero.</li>\n<li>Luego escanear los productos que se colocaran en esa ubicacion.</li>\n<li>Ingresar cantidades y lotes para cada producto.</li>\n<li>Confirmar el almacenamiento.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Putaway Libre</h3>\n<ol>\n<li>Seleccionar <strong>\"Putaway Libre\"</strong>.</li>\n<li>Escanear el producto o etiqueta LPN.</li>\n<li>El operador elige manualmente la ubicacion destino.</li>\n<li>Escanear la ubicacion elegida.</li>\n<li>Confirmar. El sistema valida que la zona sea compatible con el tipo de producto.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Consideraciones especiales</h3>\n<ul>\n<li><strong>Productos cadena de frio:</strong> Solo pueden almacenarse en zonas con control de temperatura activo (ver SOP-SIS-001 para monitoreo).</li>\n<li><strong>Productos controlados:</strong> Requieren zona de acceso restringido.</li>\n<li><strong>Productos en cuarentena:</strong> Se almacenan en zona QA hasta liberacion por Control de Calidad.</li>\n<li><strong>El sistema impide</strong> almacenar productos en zonas incompatibles con su clasificacion.</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Movimiento de Putaway</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Trazabilidad</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Tarea de Almacenamiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Tareas</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Log de Ubicaciones</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Stock</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(3,'SOP-DES-001','Despacho de Pedidos','despacho','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-DES-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Despacho de Pedidos</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Despacho</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Logistica / Expedicion</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Establecer el procedimiento para el despacho de pedidos de venta desde el almacen, abarcando las etapas de picking (recoleccion), packing (empaque), y expedicion (carga al camion), asegurando la correcta trazabilidad de lotes despachados y el cumplimiento de la politica FEFO exigida por DINAVISA.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<p>Aplica a todos los despachos de mercaderia desde los almacenes gestionados por XPert WMS:</p>\n<ul>\n<li><strong>Pedidos de venta (OV SAP):</strong> Despacho regular a clientes</li>\n<li><strong>Pedidos de mostrador:</strong> Venta directa con retiro inmediato</li>\n<li><strong>Transferencias entre almacenes:</strong> Movimiento interno entre depositos</li>\n<li><strong>Exportaciones:</strong> Despacho a clientes del exterior</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Crear y liberar ondas de picking. Gestionar prioridades de despacho.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Picker (Recolector)</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Recolectar productos de las ubicaciones de picking siguiendo las instrucciones del colector.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Operador de Packing</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Verificar y empacar los productos en la mesa de empaque. Generar contenedores.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Expedidor</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Cargar contenedores al camion. Escanear y cerrar el despacho.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Onda de Picking</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Agrupacion de multiples pedidos que se preparan simultaneamente para optimizar los recorridos en el almacen.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Pick List</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Lista de recoleccion individual asignada a un picker con las ubicaciones y cantidades a recolectar.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Packing Order</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Orden de empaque generada a partir del picking completado.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Despacho/Expedicion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Documento que agrupa los contenedores cargados en un camion para su envio.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Creacion y Liberacion de Onda de Picking</h3>\n<ol>\n<li>Acceder al modulo <strong>Ondas de Picking</strong> en XPert WMS.</li>\n<li>Hacer clic en <strong>\"+ Nueva Onda\"</strong>.</li>\n<li>Seleccionar los pedidos de venta (OV SAP) a incluir en la onda.</li>\n<li>XPert WMS valida automaticamente:\n  <ul>\n  <li>Disponibilidad de stock por producto y lote</li>\n  <li>Cumplimiento de politica FEFO (selecciona automaticamente los lotes con vencimiento mas proximo)</li>\n  <li>Reserva de stock para evitar conflictos entre ondas</li>\n  </ul>\n</li>\n<li>Si hay faltantes, el sistema genera <strong>rechazos</strong> que se muestran para resolucion.</li>\n<li>Hacer clic en <strong>\"Liberar Onda\"</strong>. Se generan las pick lists individuales.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Picking con Colector</h3>\n<ol>\n<li>El picker accede al modulo <strong>Picking</strong> desde su colector o interfaz movil.</li>\n<li>Selecciona la pick list asignada.</li>\n<li>El sistema guia al picker con la ruta optimizada:\n  <ul>\n  <li>Muestra la ubicacion a visitar</li>\n  <li>El producto a recolectar</li>\n  <li>El lote especifico (FEFO)</li>\n  <li>La cantidad requerida</li>\n  </ul>\n</li>\n<li>En cada ubicacion, el picker:\n  <ol type=\"a\">\n  <li>Escanea el <strong>codigo de ubicacion</strong> (el sistema valida que sea la correcta)</li>\n  <li>Escanea el <strong>codigo de barras del producto</strong> (el sistema valida el articulo)</li>\n  <li>Ingresa la <strong>cantidad recolectada</strong></li>\n  <li>Confirma la linea</li>\n  </ol>\n</li>\n<li>Si la cantidad disponible es menor a la requerida, se registra como <strong>picking parcial</strong>.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Control en Mesa de Empaque (Packing)</h3>\n<ol>\n<li>Acceder al modulo <strong>Packing</strong> en XPert WMS.</li>\n<li>Seleccionar la orden de packing pendiente.</li>\n<li>El operador de packing verifica cada producto escaneando su codigo de barras.</li>\n<li>Agrupa los productos por cliente en contenedores (cajas de despacho).</li>\n<li>Genera etiquetas de despacho para cada contenedor con datos de: cliente, pedido, peso, contenido.</li>\n<li>Marca la orden de packing como <strong>COMPLETADA</strong>.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Expedicion / Carga al Camion</h3>\n<ol>\n<li>Acceder al modulo <strong>Expedicion</strong>.</li>\n<li>Crear un nuevo despacho: asignar placa del camion, transportista, ruta.</li>\n<li>Asignar las ordenes de packing completadas al despacho.</li>\n<li>En la zona de carga, escanear cada <strong>contenedor</strong> al subirlo al camion.</li>\n<li>El sistema valida que todos los contenedores del despacho esten cargados.</li>\n<li>Hacer clic en <strong>\"Cerrar Despacho\"</strong>.</li>\n<li>XPert WMS genera automaticamente la <strong>Entrega (Delivery Note)</strong> en SAP B1.</li>\n<li>Se imprime el packing list del camion con el detalle de todo lo despachado.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Onda de Picking</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Ondas</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Pick List (detalle de recoleccion)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Picking</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Orden de Packing</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Packing</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Despacho (contenedores cargados)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Expedicion</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Entrega SAP (Delivery Note)</td><td style=\"padding:8px 12px;border:1px solid #475569\">SAP B1 > Entregas</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Packing List del camion</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Expedicion > Packing List</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(4,'SOP-DEV-001','Devoluciones','devoluciones','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-DEV-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Devoluciones</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Devoluciones</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Logistica / Calidad</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Definir el procedimiento para la recepcion, evaluacion y disposicion de productos devueltos al almacen, asegurando la trazabilidad completa del lote devuelto, la evaluacion de calidad correspondiente, y el cumplimiento de las normativas DINAVISA para productos farmaceuticos retornados.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<ul>\n<li><strong>Devoluciones de clientes:</strong> Productos retornados por error de despacho, dano en transporte, vencimiento proximo</li>\n<li><strong>Canjes:</strong> Reemplazo de producto por vencimiento o deterioro acordado comercialmente</li>\n<li><strong>Recall:</strong> Retiro de producto del mercado por orden de DINAVISA o decision interna (ver SOP-RCL-001)</li>\n<li><strong>Devolucion a planta:</strong> Retorno de materia prima o producto no conforme al fabricante</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Autorizar la recepcion de devoluciones. Coordinar con Comercial.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Operador de Recepcion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Recibir fisicamente la devolucion. Escanear productos a ciegas.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Control de Calidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Evaluar el estado del producto devuelto. Decidir destino: reintegro, destruccion, cuarentena.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Comercial</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Generar la Nota de Credito en SAP B1. Coordinar con el cliente.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Devolucion</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Retorno de mercaderia previamente despachada por cualquier motivo.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Zona de Averias</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Area segregada del almacen para productos danados, vencidos o en evaluacion.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Nota de Credito</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Documento SAP que revierte parcial o totalmente una factura de venta.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Creacion de la Devolucion</h3>\n<ol>\n<li>Acceder al modulo <strong>Devoluciones</strong> en XPert WMS.</li>\n<li>Hacer clic en <strong>\"+ Nueva Devolucion\"</strong>.</li>\n<li>Seleccionar el almacen destino.</li>\n<li>Ingresar el tipo de devolucion: Cliente, Canje, Recall, Planta.</li>\n<li>Asociar la Nota de Credito SAP (si existe) o crear sin referencia SAP.</li>\n<li>Ingresar datos del cliente/proveedor y motivo de la devolucion.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Recepcion a Ciegas de la Devolucion</h3>\n<ol>\n<li>Cuando el producto llega fisicamente, el operador abre la devolucion en XPert WMS.</li>\n<li>Escanear cada producto devuelto con el colector (escaneo ciego, sin ver cantidades esperadas).</li>\n<li>Registrar: codigo de producto, lote, cantidad, fecha de vencimiento.</li>\n<li>Registrar observaciones visuales: estado del empaque, cadena de frio, condicion general.</li>\n<li>Confirmar cada linea recibida.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Evaluacion de Calidad (QA)</h3>\n<ol>\n<li>Los productos devueltos quedan automaticamente en estado <strong>QA (Cuarentena)</strong>.</li>\n<li>Control de Calidad accede al modulo <strong>QA</strong> > Pendientes de Evaluacion.</li>\n<li>Evalua cada producto segun:\n  <ul>\n  <li>Integridad del empaque primario y secundario</li>\n  <li>Condiciones de almacenamiento (temperatura, humedad)</li>\n  <li>Fecha de vencimiento (vida util remanente minima segun politica)</li>\n  <li>Trazabilidad del lote</li>\n  </ul>\n</li>\n<li>Decide la disposicion:\n  <ul>\n  <li><strong>APROBADO:</strong> Reintegro a stock disponible</li>\n  <li><strong>RECHAZADO:</strong> Transferir a zona de averias para destruccion</li>\n  <li><strong>CUARENTENA:</strong> Mantener en evaluacion por mas tiempo</li>\n  </ul>\n</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Almacenamiento en Zona de Averias</h3>\n<ol>\n<li>Los productos rechazados se almacenan en la <strong>zona de averias</strong> del almacen.</li>\n<li>XPert WMS mantiene el stock con estado <strong>BLOCKED</strong> para evitar despacho accidental.</li>\n<li>Se programa la destruccion o devolucion a planta segun politica de la empresa.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Cierre y Confirmacion SAP</h3>\n<ol>\n<li>Al completar la devolucion, hacer clic en <strong>\"Completar Devolucion\"</strong>.</li>\n<li>XPert WMS genera la entrada de mercaderia correspondiente en SAP B1.</li>\n<li>Se actualiza el stock en SAP con los lotes y cantidades realmente recibidas.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Documento de Devolucion</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Devoluciones</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Evaluacion QA de Devolucion</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > QA</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Nota de Credito SAP</td><td style=\"padding:8px 12px;border:1px solid #475569\">SAP B1 > Notas de Credito</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(5,'SOP-RCL-001','Recall / Retiro de Producto','recall','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-RCL-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Recall / Retiro de Producto</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Recall</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Calidad / Regulatorio</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Establecer el procedimiento para el retiro rapido y trazable de productos del mercado (recall) en cumplimiento con los requerimientos de DINAVISA, asegurando la identificacion completa de todo el stock afectado en almacen y de todos los clientes que recibieron el lote en cuestion, permitiendo una respuesta inmediata ante alertas sanitarias.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<ul>\n<li><strong>Recall por alerta DINAVISA:</strong> Retiro ordenado por la autoridad regulatoria</li>\n<li><strong>Recall voluntario:</strong> Retiro proactivo por hallazgo interno de no conformidad</li>\n<li><strong>Retiro por calidad:</strong> Producto que no cumple especificaciones post-comercializacion</li>\n<li><strong>Trazabilidad completa:</strong> Desde la recepcion hasta el ultimo cliente que recibio el lote</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Director Tecnico</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Autorizar el recall. Coordinar con DINAVISA. Firmar documentacion regulatoria.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Calidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ejecutar la trazabilidad en XPert WMS. Coordinar el bloqueo de lotes.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ejecutar el bloqueo fisico del stock. Segregar producto en zona de averias.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Comercial</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Notificar a los clientes afectados. Coordinar la devolucion del producto.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Recall</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Retiro de un producto del mercado por defecto de calidad, seguridad o incumplimiento regulatorio.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Trazabilidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Capacidad de rastrear un lote desde su origen hasta el destino final (forward tracing) y viceversa (backward tracing).</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Lote bloqueado</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Stock con estado BLOCKED que no puede ser despachado ni movido sin autorizacion.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Iniciar el Recall</h3>\n<ol>\n<li>Acceder al modulo <strong>DINAVISA - Recall</strong> en XPert WMS.</li>\n<li>Hacer clic en <strong>\"+ Nuevo Recall\"</strong>.</li>\n<li>Ingresar:\n  <ul>\n  <li>Codigo del producto afectado</li>\n  <li>Numero de lote a rastrear</li>\n  <li>Motivo del recall (alerta DINAVISA, hallazgo interno, queja de cliente, etc.)</li>\n  </ul>\n</li>\n<li>El sistema crea el recall con estado <strong>INITIATED</strong> y genera un numero de seguimiento unico.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Ejecutar Trazabilidad</h3>\n<ol>\n<li>Hacer clic en <strong>\"Ejecutar Trazabilidad\"</strong> en el detalle del recall.</li>\n<li>XPert WMS ejecuta automaticamente la busqueda completa del lote en toda la base de datos:\n  <ul>\n  <li><strong>Stock actual:</strong> Todas las ubicaciones donde se encuentra el lote actualmente</li>\n  <li><strong>Movimientos historicos:</strong> Todo el historial de movimientos del lote (recepcion, almacenamiento, picks, transferencias)</li>\n  <li><strong>Despachos:</strong> Todos los despachos que incluyeron el lote</li>\n  <li><strong>Clientes afectados:</strong> Lista completa de clientes que recibieron mercaderia de ese lote</li>\n  </ul>\n</li>\n<li>El estado cambia a <strong>IN_PROGRESS</strong>.</li>\n<li>Revisar los resultados en las tablas: Stock Encontrado, Clientes Afectados, Movimientos.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Bloquear el Lote</h3>\n<ol>\n<li>Una vez revisada la trazabilidad, hacer clic en <strong>\"Bloquear Lote y Completar\"</strong>.</li>\n<li>XPert WMS bloquea automaticamente TODO el stock del lote en todas las ubicaciones.</li>\n<li>El estado del lote en la tabla de batches cambia a <strong>BLOCKED</strong>.</li>\n<li>Se generan movimientos de stock tipo BLOCK con referencia al recall.</li>\n<li>El lote bloqueado no puede ser seleccionado para picking ni despacho.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Notificacion y Recoleccion</h3>\n<ol>\n<li>Exportar la lista de clientes afectados desde XPert WMS (CSV desde Reportes > Recalls).</li>\n<li>El area Comercial contacta a cada cliente para coordinar la devolucion.</li>\n<li>Las devoluciones se procesan segun SOP-DEV-001.</li>\n<li>Toda la documentacion se archiva junto al recall para presentar a DINAVISA.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Disposicion Final</h3>\n<ol>\n<li>El producto recolectado se almacena en la <strong>zona de averias</strong>.</li>\n<li>Control de Calidad decide la disposicion final: destruccion, reproceso, devolucion a fabricante.</li>\n<li>Se documenta la destruccion o disposicion con acta firmada.</li>\n<li>Se genera el informe final del recall para DINAVISA.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Recall (cabecera y resultados)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > DINAVISA - Recall</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Reporte de Trazabilidad</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Recall > Detalle</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Exportacion CSV clientes afectados</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Reportes > Recalls</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Acta de destruccion</td><td style=\"padding:8px 12px;border:1px solid #475569\">Archivo fisico Calidad</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(6,'SOP-INV-001','Control de Inventarios','inventarios','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-INV-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Control de Inventarios</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Inventarios</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> Logistica / Control Interno</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Definir el procedimiento para el control periodico de inventarios en el almacen mediante conteos ciclicos, conteos oportunos y ajustes directos, garantizando la exactitud del inventario registrado en XPert WMS y SAP B1, y cumpliendo con los requisitos de DINAVISA para la trazabilidad de productos farmaceuticos.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<ul>\n<li><strong>Conteo Ciclico:</strong> Conteo planificado de ubicaciones seleccionadas segun criterios (rotacion ABC, zona, fecha ultimo conteo)</li>\n<li><strong>Conteo Oportuno:</strong> Conteo disparado por un evento (diferencia detectada, reclamo, auditoria)</li>\n<li><strong>Ajuste Directo:</strong> Correccion de cantidades cuando se detecta y documenta una discrepancia</li>\n<li><strong>Segundo Conteo:</strong> Reconteo obligatorio cuando el primer conteo muestra diferencias significativas</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Almacen</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Planificar conteos ciclicos. Aprobar ajustes de inventario. Definir criterios de seleccion.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Contador (Operador)</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Ejecutar el conteo fisico. Registrar cantidades en XPert WMS.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Supervisor</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Verificar diferencias. Ejecutar segundo conteo si es necesario. Aprobar o rechazar ajustes.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Conteo Ciclico</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Metodo de inventario donde se cuentan subconjuntos de ubicaciones de forma rotativa durante el ano.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Conteo Guiado</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">El sistema muestra los productos esperados y el operador confirma cantidades.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Conteo Ciego</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">El operador cuenta sin ver las cantidades del sistema (mayor confiabilidad).</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Exactitud de Inventario</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Porcentaje de ubicaciones contadas que coinciden con el registro del sistema. Objetivo: >98%.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Planificacion del Conteo Ciclico</h3>\n<ol>\n<li>Acceder al modulo <strong>Conteo Ciclico</strong> en XPert WMS.</li>\n<li>Hacer clic en <strong>\"+ Nuevo Conteo\"</strong>.</li>\n<li>Seleccionar el metodo de seleccion:\n  <ul>\n  <li><strong>Por Ubicaciones:</strong> Seleccionar manualmente las ubicaciones a contar</li>\n  <li><strong>Por Stock:</strong> Seleccionar registros de stock especificos (producto + ubicacion + lote)</li>\n  </ul>\n</li>\n<li>Definir parametros: almacen, zona, pasillo, tipo de conteo (guiado/ciego).</li>\n<li>El sistema genera las lineas de conteo con estado <strong>PLANNED</strong>.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Ejecucion del Conteo</h3>\n<ol>\n<li>El operador abre el conteo asignado en su colector o interfaz web.</li>\n<li>Para cada linea de conteo:\n  <ol type=\"a\">\n  <li>Dirigirse a la ubicacion indicada</li>\n  <li>Escanear el codigo de ubicacion para confirmar</li>\n  <li>Contar fisicamente los productos en la ubicacion</li>\n  <li>Registrar la cantidad contada en XPert WMS</li>\n  <li>Si el conteo es ciego, no se muestra la cantidad esperada</li>\n  </ol>\n</li>\n<li>El estado de la linea cambia a <strong>COUNTED</strong>.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Verificacion de Diferencias</h3>\n<ol>\n<li>XPert WMS calcula automaticamente la diferencia entre cantidad del sistema y cantidad contada.</li>\n<li>Las diferencias se clasifican en:\n  <ul>\n  <li><span style=\"color:#22c55e\"><strong>Sin diferencia:</strong></span> Cantidad coincide exactamente</li>\n  <li><span style=\"color:#f59e0b\"><strong>Diferencia menor:</strong></span> Variacion dentro del umbral configurable</li>\n  <li><span style=\"color:#ef4444\"><strong>Diferencia critica:</strong></span> Variacion que supera el umbral - requiere segundo conteo</li>\n  </ul>\n</li>\n<li>Si hay diferencia critica, se habilita el boton <strong>\"Segundo Conteo\"</strong>.</li>\n<li>Un operador diferente al primero ejecuta el segundo conteo (segregacion de funciones).</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Aprobacion de Ajustes</h3>\n<ol>\n<li>El Jefe de Almacen o Supervisor revisa las diferencias verificadas.</li>\n<li>Para cada linea con diferencia, decide:\n  <ul>\n  <li><strong>Aprobar ajuste:</strong> Se ajusta el stock del sistema al conteo real</li>\n  <li><strong>Rechazar:</strong> Se mantiene el stock del sistema (requiere justificacion)</li>\n  </ul>\n</li>\n<li>Al aprobar, XPert WMS genera un movimiento de ajuste con trazabilidad completa.</li>\n<li>El ajuste se sincroniza con SAP B1 (Entrada/Salida de inventario segun sea positivo o negativo).</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Ajuste Directo</h3>\n<ol>\n<li>Acceder al modulo <strong>Ajuste Directo</strong> en XPert WMS.</li>\n<li>Ingresar: almacen, ubicacion, producto, lote, cantidad actual, cantidad real, motivo.</li>\n<li>El Supervisor aprueba el ajuste.</li>\n<li>Se genera el movimiento de ajuste con documentacion del motivo.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Conteo Ciclico (cabecera y lineas)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Conteo Ciclico</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Ajuste de Inventario</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Ajuste Directo</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Movimientos de Ajuste</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Trazabilidad</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Entrada/Salida SAP</td><td style=\"padding:8px 12px;border:1px solid #475569\">SAP B1 > Inventario</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Reporte de Exactitud de Inventario</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Reportes > Inventario</td><td style=\"padding:8px 12px;border:1px solid #475569\">5 anos</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(7,'SOP-SIS-001','Manejo del Sistema WMS','sistema','1.0','ACTIVE','<div class=\"sop-document\">\n<div class=\"sop-header\">\n<table style=\"width:100%;border-collapse:collapse;border:2px solid #334155\">\n<tr>\n<td rowspan=\"4\" style=\"width:200px;text-align:center;padding:10px;border:1px solid #334155\"><strong style=\"font-size:20px;color:#3b82f6\">XPert WMS</strong><br><span style=\"font-size:11px;color:#94a3b8\">Sistema de Gestion de Almacenes</span><br><span style=\"font-size:11px;color:#94a3b8\">COMFAR S.A.</span></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>PROCEDIMIENTO OPERATIVO ESTANDAR</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155;width:180px\"><strong>Codigo:</strong> SOP-SIS-001</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Manejo del Sistema WMS</strong></td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Version:</strong> 1.0</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Proceso:</strong> Sistema</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Vigencia:</strong> 2026-04-06</td>\n</tr>\n<tr>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Departamento:</strong> TI / Administracion</td>\n<td style=\"padding:8px 12px;border:1px solid #334155\"><strong>Revision:</strong> 2027-04-06</td>\n</tr>\n</table>\n</div>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">1. OBJETIVO</h2>\n<p>Establecer los lineamientos para el uso, administracion, seguridad y mantenimiento del sistema XPert WMS, garantizando la integridad de los datos, la continuidad operativa, el control de accesos y la trazabilidad de todas las acciones realizadas en el sistema, en cumplimiento con las Buenas Practicas de Documentacion y los requerimientos de DINAVISA sobre sistemas informaticos de soporte.</p>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">2. ALCANCE</h2>\n<ul>\n<li><strong>Acceso al sistema:</strong> Autenticacion, tokens JWT, sesiones</li>\n<li><strong>Gestion de usuarios y roles:</strong> Creacion, modificacion, desactivacion de cuentas</li>\n<li><strong>Auditoria:</strong> Registro de todas las acciones criticas en el sistema</li>\n<li><strong>Backup y recuperacion:</strong> Respaldo diario de la base de datos</li>\n<li><strong>Control de cambios:</strong> Documentacion de modificaciones al sistema</li>\n<li><strong>Integracion SAP B1:</strong> Gestion de la conexion con SAP Business One via Service Layer</li>\n</ul>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">3. RESPONSABILIDADES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Cargo</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Responsabilidad</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Administrador de TI</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Administrar el servidor. Ejecutar backups. Gestionar actualizaciones del sistema.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Administrador WMS</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Crear y gestionar usuarios. Asignar roles. Configurar parametros del sistema.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Usuarios Operativos</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Utilizar el sistema segun su rol asignado. Reportar incidencias.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Jefe de Calidad</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Verificar que el sistema cumpla con las normativas DINAVISA. Auditar periodicamente.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">4. DEFINICIONES</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Termino</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Definicion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>JWT</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">JSON Web Token. Mecanismo de autenticacion utilizado por XPert WMS para validar sesiones.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Rol</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Perfil de permisos que determina las funciones accesibles para un usuario (admin, supervisor, operator, viewer).</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Service Layer</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">API REST de SAP B1 utilizada para la integracion bidireccional entre XPert WMS y SAP.</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\"><strong>Audit Trail</strong></td><td style=\"padding:8px 12px;border:1px solid #475569\">Registro cronologico de todas las operaciones realizadas en el sistema con usuario, fecha y detalle.</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">5. PROCEDIMIENTO</h2>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.1 Acceso al Sistema (Login)</h3>\n<ol>\n<li>Acceder a XPert WMS desde un navegador web: <strong>https://[direccion-servidor]/</strong></li>\n<li>Ingresar <strong>nombre de usuario</strong> y <strong>contrasena</strong>.</li>\n<li>El sistema valida las credenciales y genera un token JWT con expiracion de 8 horas.</li>\n<li>Politica de contrasenas:\n  <ul>\n  <li>Minimo 8 caracteres</li>\n  <li>Debe incluir letras y numeros</li>\n  <li>Cambio obligatorio cada 90 dias</li>\n  <li>No repetir las ultimas 3 contrasenas</li>\n  </ul>\n</li>\n<li>Tras 5 intentos fallidos, la cuenta se bloquea por 30 minutos.</li>\n<li>Toda sesion inactiva por mas de 2 horas se cierra automaticamente.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.2 Gestion de Usuarios y Roles</h3>\n<ol>\n<li>Acceder al modulo <strong>Usuarios</strong> (solo disponible para rol admin).</li>\n<li>Para crear un usuario: clic en <strong>\"+ Nuevo Usuario\"</strong>.\n  <ul>\n  <li>Nombre completo</li>\n  <li>Nombre de usuario (unico)</li>\n  <li>Contrasena temporal</li>\n  <li>Rol: admin, supervisor, operator, viewer</li>\n  <li>Almacen asignado (si aplica)</li>\n  </ul>\n</li>\n<li>Roles disponibles:\n  <ul>\n  <li><strong>admin:</strong> Acceso total al sistema, gestion de usuarios, configuraciones</li>\n  <li><strong>supervisor:</strong> Operaciones de almacen, aprobaciones, reportes</li>\n  <li><strong>operator:</strong> Operaciones basicas (escaneo, picking, putaway)</li>\n  <li><strong>viewer:</strong> Solo lectura, consultas y reportes</li>\n  </ul>\n</li>\n<li>Para desactivar un usuario: editar y cambiar estado a inactivo. NO eliminar usuarios para mantener trazabilidad.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.3 Auditoria y Trazabilidad</h3>\n<ol>\n<li>XPert WMS registra automaticamente en la base de datos:\n  <ul>\n  <li>Cada operacion de stock (recepcion, putaway, picking, ajuste, bloqueo)</li>\n  <li>El usuario que ejecuto la operacion</li>\n  <li>La fecha y hora exacta</li>\n  <li>Los datos anteriores y posteriores al cambio</li>\n  </ul>\n</li>\n<li>El modulo <strong>Trazabilidad</strong> permite consultar el historial completo de movimientos.</li>\n<li>El modulo <strong>Reportes</strong> permite exportar los registros de auditoria en formato CSV.</li>\n<li>Los registros de auditoria no pueden ser eliminados ni modificados.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.4 Backup Diario</h3>\n<ol>\n<li>El servidor ejecuta automaticamente un backup de la base de datos <strong>wms_pro</strong> cada dia a las 02:00 AM.</li>\n<li>El backup se almacena en <strong>/var/backups/wms/</strong> con formato: <code>wms_pro_YYYYMMDD_HHMMSS.sql.gz</code></li>\n<li>Se mantienen los ultimos 30 dias de backups.</li>\n<li>El Administrador de TI verifica semanalmente que los backups se esten generando correctamente.</li>\n<li>Prueba de restauracion: se ejecuta al menos una vez por trimestre para validar la integridad del backup.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.5 Control de Cambios del Sistema</h3>\n<ol>\n<li>Toda modificacion al sistema (codigo, base de datos, configuracion) debe ser documentada.</li>\n<li>El registro incluye: fecha, descripcion del cambio, responsable, justificacion.</li>\n<li>Los cambios se despliegan fuera del horario operativo cuando sea posible.</li>\n<li>Se mantiene un historial de versiones del sistema.</li>\n</ol>\n\n<h3 style=\"margin-top:16px;color:#22c55e\">5.6 Integracion con SAP B1</h3>\n<ol>\n<li>XPert WMS se conecta a SAP B1 mediante <strong>Service Layer</strong> (API REST).</li>\n<li>La conexion se autentica con credenciales configuradas en el sistema.</li>\n<li>Operaciones sincronizadas:\n  <ul>\n  <li>Ordenes de Compra (SAP -> WMS)</li>\n  <li>Pedidos de Venta (SAP -> WMS)</li>\n  <li>Entradas de Mercaderia (WMS -> SAP)</li>\n  <li>Entregas / Despachos (WMS -> SAP)</li>\n  <li>Ajustes de Inventario (WMS -> SAP)</li>\n  <li>Transferencias de Stock (WMS -> SAP)</li>\n  </ul>\n</li>\n<li>El estado de la conexion SAP se monitorea desde el menu <strong>SAP B1</strong> en XPert WMS.</li>\n</ol>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">6. REGISTROS ASOCIADOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Registro</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Ubicacion</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Retencion</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Log de accesos (login/logout)</td><td style=\"padding:8px 12px;border:1px solid #475569\">Base de datos wms_pro</td><td style=\"padding:8px 12px;border:1px solid #475569\">2 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Movimientos de stock (audit trail)</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Trazabilidad</td><td style=\"padding:8px 12px;border:1px solid #475569\">10 anos</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Registro de usuarios</td><td style=\"padding:8px 12px;border:1px solid #475569\">XPert WMS > Usuarios</td><td style=\"padding:8px 12px;border:1px solid #475569\">Permanente</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Backups de base de datos</td><td style=\"padding:8px 12px;border:1px solid #475569\">/var/backups/wms/</td><td style=\"padding:8px 12px;border:1px solid #475569\">30 dias</td></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">Log de cambios del sistema</td><td style=\"padding:8px 12px;border:1px solid #475569\">Documentacion interna TI</td><td style=\"padding:8px 12px;border:1px solid #475569\">Permanente</td></tr>\n</table>\n\n<h2 style=\"margin-top:24px;color:#3b82f6;border-bottom:2px solid #3b82f6;padding-bottom:6px\">7. CONTROL DE CAMBIOS</h2>\n<table style=\"width:100%;border-collapse:collapse;margin:12px 0\">\n<tr style=\"background:#1e293b\"><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Version</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Fecha</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Descripcion del Cambio</th><th style=\"padding:8px 12px;border:1px solid #475569;text-align:left\">Autor</th></tr>\n<tr><td style=\"padding:8px 12px;border:1px solid #475569\">1.0</td><td style=\"padding:8px 12px;border:1px solid #475569\">2026-04-06</td><td style=\"padding:8px 12px;border:1px solid #475569\">Emision inicial del procedimiento</td><td style=\"padding:8px 12px;border:1px solid #475569\">Administracion WMS</td></tr>\n</table>\n</div>',1,'2026-04-11 10:44:11','2026-04-06','2027-04-06',1,'2026-04-11 10:44:11','2026-04-11 10:44:11'),
(8,'PROT-IQ-001','Protocolo de Calificacion de Instalacion (IQ) - XPert WMS','validacion','1.0','ACTIVE','<style>\n  .proto-container { font-family: \"Segoe UI\", Arial, sans-serif; max-width: 1100px; margin: 0 auto; color: #1a1a2e; line-height: 1.6; }\n  .proto-header-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; border: 2px solid #003366; }\n  .proto-header-table td { border: 1px solid #003366; padding: 8px 12px; font-size: 13px; }\n  .proto-header-table .label { background: #003366; color: #fff; font-weight: 600; width: 160px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }\n  .proto-header-table .value { background: #f8f9fa; font-weight: 500; }\n  .proto-header-table .company-cell { text-align: center; background: #003366; color: #fff; font-size: 18px; font-weight: 700; padding: 15px; letter-spacing: 1px; }\n  .proto-header-table .doc-title { text-align: center; background: #e8edf2; font-size: 15px; font-weight: 700; color: #003366; padding: 12px; }\n  .proto-section { margin: 25px 0; }\n  .proto-section h2 { color: #003366; font-size: 16px; border-bottom: 2px solid #003366; padding-bottom: 6px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }\n  .proto-section h3 { color: #1a1a2e; font-size: 14px; margin: 15px 0 10px 0; }\n  .proto-section p, .proto-section li { font-size: 13px; color: #333; }\n  .proto-section ul { margin: 8px 0; padding-left: 25px; }\n  .proto-section ul li { margin-bottom: 4px; }\n  .iq-table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 12px; }\n  .iq-table thead th { background: #003366; color: #fff; padding: 10px 8px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }\n  .iq-table tbody td { border: 1px solid #dee2e6; padding: 8px; vertical-align: top; }\n  .iq-table tbody tr:nth-child(even) { background: #f8f9fa; }\n  .iq-table tbody tr:hover { background: #e8edf2; }\n  .iq-table .col-num { width: 60px; text-align: center; font-weight: 700; color: #003366; }\n  .iq-table .col-result { width: 90px; text-align: center; }\n  .pass { color: #0a7c42; font-weight: 700; font-size: 16px; }\n  .fail { color: #c0392b; font-weight: 700; }\n  .criteria-box { background: #f0f7f0; border-left: 4px solid #0a7c42; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  .criteria-box p { margin: 4px 0; font-size: 13px; }\n  .criteria-box strong { color: #003366; }\n  .signature-table { width: 100%; border-collapse: collapse; margin: 30px 0; }\n  .signature-table td { border: 1px solid #003366; padding: 12px; height: 60px; vertical-align: bottom; font-size: 12px; }\n  .signature-table .sig-label { background: #f8f9fa; font-weight: 600; color: #003366; width: 160px; vertical-align: middle; text-align: center; }\n  .signature-table .sig-line { border-bottom: 1px solid #999; width: 200px; display: inline-block; margin-bottom: 2px; }\n  .conclusion-box { background: #e8f5e9; border: 2px solid #0a7c42; padding: 20px; border-radius: 6px; margin: 25px 0; }\n  .conclusion-box h3 { color: #0a7c42; margin-top: 0; }\n  .watermark { text-align: center; color: #ccc; font-size: 10px; margin-top: 40px; border-top: 1px solid #eee; padding-top: 10px; }\n  .ref-box { background: #fff3e0; border-left: 4px solid #e65100; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  @media print { .proto-container { font-size: 11px; } .iq-table { page-break-inside: avoid; } .signature-table { page-break-inside: avoid; } }\n</style>\n\n<div class=\"proto-container\">\n\n  <table class=\"proto-header-table\">\n    <tr><td colspan=\"6\" class=\"company-cell\">COMFAR PARAGUAY S.A.</td></tr>\n    <tr><td colspan=\"6\" class=\"doc-title\">PROTOCOLO DE CALIFICACI&Oacute;N DE INSTALACI&Oacute;N (IQ)<br>Sistema XPert WMS</td></tr>\n    <tr>\n      <td class=\"label\">C&oacute;digo</td><td class=\"value\">PROT-IQ-001</td>\n      <td class=\"label\">Versi&oacute;n</td><td class=\"value\">1.0</td>\n      <td class=\"label\">Fecha</td><td class=\"value\">2026-04-06</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Sistema</td><td class=\"value\">XPert WMS v1.0</td>\n      <td class=\"label\">Servidor</td><td class=\"value\">200.10.10.150</td>\n      <td class=\"label\">Base de Datos</td><td class=\"value\">MariaDB - wms_pro</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Elaborado por</td><td class=\"value\">Departamento de TI</td>\n      <td class=\"label\">&Aacute;rea</td><td class=\"value\">Aseguramiento de Calidad</td>\n      <td class=\"label\">Clasificaci&oacute;n</td><td class=\"value\">Confidencial</td>\n    </tr>\n  </table>\n\n  <div class=\"proto-section\">\n    <h2>1. Objetivo</h2>\n    <p>Verificar y documentar que el sistema <strong>XPert WMS v1.0</strong> ha sido instalado correctamente seg&uacute;n las especificaciones de dise&ntilde;o aprobadas, y que todos los componentes de hardware, software, infraestructura y configuraci&oacute;n cumplen con los requisitos establecidos para su operaci&oacute;n en el entorno de distribuci&oacute;n farmac&eacute;utica de <strong>COMFAR Paraguay S.A.</strong>, conforme a las normativas de la <strong>Direcci&oacute;n Nacional de Vigilancia Sanitaria (DINAVISA)</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>2. Alcance</h2>\n    <p>Este protocolo aplica a la calificaci&oacute;n de instalaci&oacute;n de los siguientes componentes del sistema XPert WMS:</p>\n    <ul>\n      <li><strong>Servidor de aplicaci&oacute;n:</strong> Linux Ubuntu, IP 200.10.10.150</li>\n      <li><strong>Base de datos:</strong> MariaDB, esquema wms_pro con 55 tablas</li>\n      <li><strong>Servidor web:</strong> Apache con PHP 8.3, HTTPS puerto 8443</li>\n      <li><strong>Aplicaci&oacute;n WMS:</strong> Frontend Desktop (26 m&oacute;dulos) y Mobile RF (10 m&oacute;dulos)</li>\n      <li><strong>Integraci&oacute;n:</strong> SAP Business One Service Layer (200.10.10.151:50000)</li>\n      <li><strong>Perif&eacute;ricos:</strong> Impresoras Zebra ZPL, scanners de c&oacute;digo de barras</li>\n      <li><strong>Seguridad:</strong> Certificado SSL, control de acceso SSH, autenticaci&oacute;n JWT</li>\n    </ul>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>3. Referencias Normativas</h2>\n    <div class=\"ref-box\">\n      <p><strong>DINAVISA</strong> &mdash; Resoluciones vigentes sobre Buenas Pr&aacute;cticas de Almacenamiento y Distribuci&oacute;n (BPAD)</p>\n      <p><strong>OMS</strong> &mdash; Anexo 5: Buenas Pr&aacute;cticas de Distribuci&oacute;n de Productos Farmac&eacute;uticos (TRS 957)</p>\n      <p><strong>ISPE GAMP 5</strong> &mdash; Gu&iacute;a de Buenas Pr&aacute;cticas para Sistemas Computarizados en entornos GxP</p>\n      <p><strong>21 CFR Part 11</strong> &mdash; Registros Electr&oacute;nicos y Firmas Electr&oacute;nicas (referencia)</p>\n      <p><strong>ISO/IEC 27001</strong> &mdash; Sistema de Gesti&oacute;n de Seguridad de la Informaci&oacute;n (referencia)</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>4. Criterios de Aceptaci&oacute;n</h2>\n    <div class=\"criteria-box\">\n      <p><strong>Criterio General:</strong> Todas las verificaciones de instalaci&oacute;n deben obtener resultado <span class=\"pass\">CONFORME</span> para que la calificaci&oacute;n IQ sea aprobada.</p>\n      <p><strong>Desviaciones:</strong> Cualquier resultado NO CONFORME debe ser documentado como desviaci&oacute;n, evaluado su impacto y resuelto antes de proceder a la Calificaci&oacute;n Operacional (OQ).</p>\n      <p><strong>Evidencia:</strong> Cada verificaci&oacute;n debe estar respaldada por capturas de pantalla, logs del sistema o documentaci&oacute;n t&eacute;cnica equivalente.</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>5. Verificaciones de Instalaci&oacute;n</h2>\n\n    <h3>5.1 Infraestructura de Servidor y Base de Datos</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Verificaci&oacute;n</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th><th>Observaciones</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">IQ-001</td><td>Servidor Linux instalado y operativo</td><td>Sistema operativo Ubuntu 22.04/24.04 LTS funcionando correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Servidor 200.10.10.150 &mdash; Ubuntu LTS operativo, uptime verificado</td></tr>\n        <tr><td class=\"col-num\">IQ-002</td><td>Base de datos MariaDB configurada</td><td>Esquema wms_pro creado con 55 tablas, charset utf8mb4_unicode_ci</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>MariaDB con esquema wms_pro, charset utf8mb4, collation utf8mb4_unicode_ci</td></tr>\n        <tr><td class=\"col-num\">IQ-003</td><td>PHP 8.3 instalado y configurado</td><td>PHP-CLI y mod_php funcionales, extensiones requeridas activas</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>PHP 8.3.6 con extensiones: pdo_mysql, curl, json, mbstring, openssl</td></tr>\n        <tr><td class=\"col-num\">IQ-004</td><td>Apache configurado con HTTPS</td><td>Servidor web Apache escuchando en puerto 8443 con SSL habilitado</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Apache2 con mod_ssl, puerto 8443, certificado Let&rsquo;s Encrypt</td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.2 Aplicaci&oacute;n y M&oacute;dulos</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Verificaci&oacute;n</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th><th>Observaciones</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">IQ-005</td><td>Aplicaci&oacute;n WMS desplegada</td><td>168 rutas API activas y respondiendo correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Desplegada en /var/www/WMS &mdash; 168 endpoints API verificados</td></tr>\n        <tr><td class=\"col-num\">IQ-006</td><td>Frontend Desktop accesible</td><td>P&aacute;gina de login funcional con acceso a 26 m&oacute;dulos operativos</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>index.html &mdash; Login funcional, dashboard con 26 m&oacute;dulos cargando</td></tr>\n        <tr><td class=\"col-num\">IQ-007</td><td>Frontend Mobile RF accesible</td><td>10 m&oacute;dulos RF operativos con soporte de scanner integrado</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>rf.html &mdash; 10 m&oacute;dulos RF con scanner de c&oacute;digo de barras integrado</td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.3 Integraci&oacute;n SAP Business One</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Verificaci&oacute;n</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th><th>Observaciones</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">IQ-008</td><td>Integraci&oacute;n SAP Service Layer</td><td>Login exitoso al Service Layer, base COMFAR_CAPA accesible</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Service Layer 200.10.10.151:50000, sesi&oacute;n autenticada a COMFAR_CAPA</td></tr>\n        <tr><td class=\"col-num\">IQ-009</td><td>11 tipos de documentos SAP configurados</td><td>Lectura y escritura de: OC, OV, EM, EN, NC, TR, ST, OP, FC, E+, S-</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>PurchaseOrders, Orders, PurchaseDeliveryNotes, DeliveryNotes, CreditNotes, StockTransfers, StockTransferRequests, ProductionOrders, Invoices, InventoryGenEntries, InventoryGenExits</td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.4 Seguridad y Respaldos</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Verificaci&oacute;n</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th><th>Observaciones</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">IQ-010</td><td>Backup automatizado configurado</td><td>Cron job ejecut&aacute;ndose diariamente a las 2:00 AM, retenci&oacute;n de 30 d&iacute;as</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Crontab configurado, backups en /var/www/WMS/backups, retenci&oacute;n 30 d&iacute;as</td></tr>\n        <tr><td class=\"col-num\">IQ-011</td><td>Control de acceso al servidor</td><td>Acceso SSH exclusivamente con llave RSA, sudo protegido con contrase&ntilde;a</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>SSH con autenticaci&oacute;n por llave RSA, &uacute;nico usuario autorizado: comfar</td></tr>\n        <tr><td class=\"col-num\">IQ-014</td><td>Certificado SSL v&aacute;lido</td><td>Certificado Let&rsquo;s Encrypt vigente con renovaci&oacute;n autom&aacute;tica</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Dominio comfar-middleware.duckdns.org, certificado auto-renovable via certbot</td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.5 Perif&eacute;ricos y Dispositivos</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Verificaci&oacute;n</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th><th>Observaciones</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">IQ-012</td><td>Impresoras de etiquetas configuradas</td><td>Soporte de impresi&oacute;n ZPL/Zebra via protocolo TCP puerto 9100</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>M&oacute;dulo de impresi&oacute;n ZPL configurable, conexi&oacute;n TCP/9100 a impresoras Zebra</td></tr>\n        <tr><td class=\"col-num\">IQ-013</td><td>Scanner de c&oacute;digo de barras integrado</td><td>Soporte de lectura por c&aacute;mara, dispositivo RF y USB/Bluetooth</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td><td>Librer&iacute;a html5-qrcode integrada, compatible con c&aacute;mara, RF y dispositivos USB/BT</td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>6. Resumen de Resultados</h2>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th>Categor&iacute;a</th><th style=\"text-align:center\">Total Verificaciones</th><th style=\"text-align:center\">Conformes</th><th style=\"text-align:center\">No Conformes</th><th style=\"text-align:center\">% Cumplimiento</th></tr>\n      </thead>\n      <tbody>\n        <tr><td>Infraestructura</td><td style=\"text-align:center\">4</td><td style=\"text-align:center\"><span class=\"pass\">4</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Aplicaci&oacute;n y M&oacute;dulos</td><td style=\"text-align:center\">3</td><td style=\"text-align:center\"><span class=\"pass\">3</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Integraci&oacute;n SAP</td><td style=\"text-align:center\">2</td><td style=\"text-align:center\"><span class=\"pass\">2</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Seguridad y Respaldos</td><td style=\"text-align:center\">3</td><td style=\"text-align:center\"><span class=\"pass\">3</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Perif&eacute;ricos</td><td style=\"text-align:center\">2</td><td style=\"text-align:center\"><span class=\"pass\">2</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr style=\"background:#e8f5e9;font-weight:700\"><td>TOTAL</td><td style=\"text-align:center\">14</td><td style=\"text-align:center\"><span class=\"pass\">14</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>7. Desviaciones</h2>\n    <p>No se registraron desviaciones durante la ejecuci&oacute;n de la Calificaci&oacute;n de Instalaci&oacute;n. Todas las verificaciones resultaron <strong>CONFORMES</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>8. Conclusi&oacute;n</h2>\n    <div class=\"conclusion-box\">\n      <h3>CALIFICACI&Oacute;N DE INSTALACI&Oacute;N &mdash; APROBADA</h3>\n      <p>El sistema <strong>XPert WMS v1.0</strong> ha sido instalado y configurado correctamente seg&uacute;n las especificaciones de dise&ntilde;o aprobadas. Todos los componentes de infraestructura, software, integraci&oacute;n, seguridad y perif&eacute;ricos cumplen con los criterios de aceptaci&oacute;n establecidos.</p>\n      <p>Se recomienda proceder con la ejecuci&oacute;n del <strong>Protocolo de Calificaci&oacute;n Operacional (OQ) &mdash; PROT-OQ-001</strong>.</p>\n      <p><strong>Total de verificaciones:</strong> 14 | <strong>Conformes:</strong> 14 | <strong>No conformes:</strong> 0 | <strong>Cumplimiento:</strong> 100%</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>9. Firmas de Aprobaci&oacute;n</h2>\n    <table class=\"signature-table\">\n      <tr>\n        <td class=\"sig-label\">Ejecutado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Revisado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n      <tr>\n        <td class=\"sig-label\">Aprobado por<br>(Aseg. Calidad)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Aprobado por<br>(Dir. T&eacute;cnica)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n    </table>\n  </div>\n\n  <div class=\"watermark\">\n    COMFAR Paraguay S.A. &mdash; Documento Confidencial &mdash; PROT-IQ-001 v1.0 &mdash; P&aacute;gina 1 de 1<br>\n    Impreso el: ____/____/________ &mdash; Las copias impresas son consideradas NO CONTROLADAS\n  </div>\n\n</div>',1,'2026-04-06 00:00:00','2026-04-06','2027-04-06',1,'2026-04-11 18:25:10','2026-04-11 18:25:10'),
(9,'PROT-OQ-001','Protocolo de Calificacion Operacional (OQ) - XPert WMS','validacion','1.0','ACTIVE','<style>\n  .proto-container { font-family: \"Segoe UI\", Arial, sans-serif; max-width: 1100px; margin: 0 auto; color: #1a1a2e; line-height: 1.6; }\n  .proto-header-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; border: 2px solid #003366; }\n  .proto-header-table td { border: 1px solid #003366; padding: 8px 12px; font-size: 13px; }\n  .proto-header-table .label { background: #003366; color: #fff; font-weight: 600; width: 160px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }\n  .proto-header-table .value { background: #f8f9fa; font-weight: 500; }\n  .proto-header-table .company-cell { text-align: center; background: #003366; color: #fff; font-size: 18px; font-weight: 700; padding: 15px; letter-spacing: 1px; }\n  .proto-header-table .doc-title { text-align: center; background: #e8edf2; font-size: 15px; font-weight: 700; color: #003366; padding: 12px; }\n  .proto-section { margin: 25px 0; }\n  .proto-section h2 { color: #003366; font-size: 16px; border-bottom: 2px solid #003366; padding-bottom: 6px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }\n  .proto-section h3 { color: #1a1a2e; font-size: 14px; margin: 15px 0 10px 0; }\n  .proto-section p, .proto-section li { font-size: 13px; color: #333; }\n  .proto-section ul { margin: 8px 0; padding-left: 25px; }\n  .proto-section ul li { margin-bottom: 4px; }\n  .iq-table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 12px; }\n  .iq-table thead th { background: #003366; color: #fff; padding: 10px 8px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }\n  .iq-table tbody td { border: 1px solid #dee2e6; padding: 8px; vertical-align: top; }\n  .iq-table tbody tr:nth-child(even) { background: #f8f9fa; }\n  .iq-table tbody tr:hover { background: #e8edf2; }\n  .iq-table .col-num { width: 60px; text-align: center; font-weight: 700; color: #003366; }\n  .iq-table .col-result { width: 90px; text-align: center; }\n  .pass { color: #0a7c42; font-weight: 700; font-size: 16px; }\n  .criteria-box { background: #f0f7f0; border-left: 4px solid #0a7c42; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  .criteria-box p { margin: 4px 0; font-size: 13px; }\n  .criteria-box strong { color: #003366; }\n  .signature-table { width: 100%; border-collapse: collapse; margin: 30px 0; }\n  .signature-table td { border: 1px solid #003366; padding: 12px; height: 60px; vertical-align: bottom; font-size: 12px; }\n  .signature-table .sig-label { background: #f8f9fa; font-weight: 600; color: #003366; width: 160px; vertical-align: middle; text-align: center; }\n  .signature-table .sig-line { border-bottom: 1px solid #999; width: 200px; display: inline-block; margin-bottom: 2px; }\n  .conclusion-box { background: #e8f5e9; border: 2px solid #0a7c42; padding: 20px; border-radius: 6px; margin: 25px 0; }\n  .conclusion-box h3 { color: #0a7c42; margin-top: 0; }\n  .watermark { text-align: center; color: #ccc; font-size: 10px; margin-top: 40px; border-top: 1px solid #eee; padding-top: 10px; }\n  .ref-box { background: #fff3e0; border-left: 4px solid #e65100; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  @media print { .proto-container { font-size: 11px; } .iq-table { page-break-inside: avoid; } .signature-table { page-break-inside: avoid; } }\n</style>\n\n<div class=\"proto-container\">\n\n  <table class=\"proto-header-table\">\n    <tr><td colspan=\"6\" class=\"company-cell\">COMFAR PARAGUAY S.A.</td></tr>\n    <tr><td colspan=\"6\" class=\"doc-title\">PROTOCOLO DE CALIFICACI&Oacute;N OPERACIONAL (OQ)<br>Sistema XPert WMS</td></tr>\n    <tr>\n      <td class=\"label\">C&oacute;digo</td><td class=\"value\">PROT-OQ-001</td>\n      <td class=\"label\">Versi&oacute;n</td><td class=\"value\">1.0</td>\n      <td class=\"label\">Fecha</td><td class=\"value\">2026-04-06</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Sistema</td><td class=\"value\">XPert WMS v1.0</td>\n      <td class=\"label\">Prerrequisito</td><td class=\"value\">PROT-IQ-001 Aprobado</td>\n      <td class=\"label\">Base de Datos</td><td class=\"value\">MariaDB - wms_pro</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Elaborado por</td><td class=\"value\">Departamento de TI</td>\n      <td class=\"label\">&Aacute;rea</td><td class=\"value\">Aseguramiento de Calidad</td>\n      <td class=\"label\">Clasificaci&oacute;n</td><td class=\"value\">Confidencial</td>\n    </tr>\n  </table>\n\n  <div class=\"proto-section\">\n    <h2>1. Objetivo</h2>\n    <p>Verificar y documentar que todas las funcionalidades del sistema <strong>XPert WMS v1.0</strong> operan correctamente seg&uacute;n las especificaciones funcionales aprobadas, incluyendo controles de acceso, trazabilidad de lotes, procesos de almac&eacute;n (recepci&oacute;n, almacenamiento, picking, despacho), integraci&oacute;n con SAP Business One, controles de calidad, y funciones de cumplimiento regulatorio requeridas por <strong>DINAVISA</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>2. Alcance</h2>\n    <p>Este protocolo cubre la verificaci&oacute;n operacional de las siguientes &aacute;reas funcionales:</p>\n    <ul>\n      <li><strong>Seguridad y Control de Acceso:</strong> Autenticaci&oacute;n JWT, roles, permisos, segregaci&oacute;n de funciones</li>\n      <li><strong>Trazabilidad:</strong> Control de lotes, ubicaciones, historial de movimientos</li>\n      <li><strong>Recepci&oacute;n (Inbound):</strong> Importaci&oacute;n OC SAP, recepci&oacute;n a ciegas, gesti&oacute;n de diferencias, confirmaci&oacute;n SAP</li>\n      <li><strong>Control de Calidad:</strong> Cuarentena, aprobaci&oacute;n/rechazo, interfaz QC externa</li>\n      <li><strong>Despacho (Outbound):</strong> Picking FEFO, ondas, mesa de empaque, expedici&oacute;n</li>\n      <li><strong>Operaciones:</strong> Devoluciones, transferencias, conteo c&iacute;clico, ajustes</li>\n      <li><strong>Cumplimiento:</strong> Control de vencimientos, FEFO/FIFO, stock negativo, audit trail, recall</li>\n      <li><strong>Soporte:</strong> Control de temperatura, impresi&oacute;n de etiquetas, reportes, notificaciones</li>\n    </ul>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>3. Referencias Normativas</h2>\n    <div class=\"ref-box\">\n      <p><strong>DINAVISA</strong> &mdash; Resoluciones vigentes sobre Buenas Pr&aacute;cticas de Almacenamiento y Distribuci&oacute;n (BPAD)</p>\n      <p><strong>OMS</strong> &mdash; Anexo 5: Buenas Pr&aacute;cticas de Distribuci&oacute;n de Productos Farmac&eacute;uticos (TRS 957)</p>\n      <p><strong>ISPE GAMP 5</strong> &mdash; Gu&iacute;a de Buenas Pr&aacute;cticas para Sistemas Computarizados en entornos GxP</p>\n      <p><strong>PROT-IQ-001</strong> &mdash; Protocolo de Calificaci&oacute;n de Instalaci&oacute;n (prerrequisito aprobado)</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>4. Criterios de Aceptaci&oacute;n</h2>\n    <div class=\"criteria-box\">\n      <p><strong>Criterio General:</strong> Todas las verificaciones operacionales deben obtener resultado <span class=\"pass\">CONFORME</span> para que la calificaci&oacute;n OQ sea aprobada.</p>\n      <p><strong>Desviaciones:</strong> Cualquier resultado NO CONFORME debe ser documentado como desviaci&oacute;n, evaluado su impacto y resuelto antes de proceder a la Calificaci&oacute;n de Desempe&ntilde;o (PQ).</p>\n      <p><strong>M&eacute;todo de prueba:</strong> Cada funci&oacute;n ser&aacute; verificada mediante ejecuci&oacute;n directa en el sistema con datos de prueba, verificando entrada, procesamiento y resultado esperado.</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>5. Verificaciones Operacionales</h2>\n\n    <h3>5.1 Seguridad y Control de Acceso</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-001</td><td>Control de accesos</td><td>Iniciar sesi&oacute;n con usuario y contrase&ntilde;a v&aacute;lidos</td><td>JWT token generado correctamente, sesi&oacute;n activa</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-002</td><td>Roles y permisos</td><td>Verificar perfiles: Admin, Supervisor, Operario, Viewer</td><td>Cada rol tiene permisos diferenciados seg&uacute;n matriz</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-003</td><td>Segregaci&oacute;n de funciones</td><td>Operario intenta aprobar control de calidad</td><td>Sistema rechaza la acci&oacute;n, restricci&oacute;n activa</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.2 Trazabilidad</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-004</td><td>Trazabilidad de lote</td><td>Registrar lote durante recepci&oacute;n de mercader&iacute;a</td><td>Lote trazable en tabla stock_movements con fecha y usuario</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-005</td><td>Tracking de ubicaci&oacute;n</td><td>Ejecutar putaway a bin espec&iacute;fico</td><td>Stock vinculado correctamente al bin de destino</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-006</td><td>Historial de movimientos</td><td>Mover stock entre bins diferentes</td><td>Movimiento registrado con origen, destino, cantidad y timestamp</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.3 Recepci&oacute;n (Inbound)</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-007</td><td>Recepci&oacute;n OC SAP</td><td>Importar Orden de Compra desde SAP Business One</td><td>Agenda de recepci&oacute;n creada con l&iacute;neas de OC correctas</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-008</td><td>Recepci&oacute;n a ciegas</td><td>Escanear productos sin visualizar cantidades te&oacute;ricas</td><td>Sistema compara conteo real vs. esperado al finalizar</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-009</td><td>Gesti&oacute;n de diferencias</td><td>Recibir cantidad diferente a la esperada</td><td>Diferencias (sobrante/faltante) detectadas y visibles en reporte</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-010</td><td>Confirmaci&oacute;n SAP</td><td>Cerrar agenda de recepci&oacute;n completada</td><td>PurchaseDeliveryNotes creada autom&aacute;ticamente en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.4 Control de Calidad</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-011</td><td>Control de calidad QA</td><td>Producto ingresa en estado cuarentena</td><td>Stock bloqueado, no disponible para picking</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-012</td><td>Aprobar/Rechazar QC</td><td>Ejecutar workflow de aprobaci&oacute;n y rechazo de QC</td><td>Estado del producto cambia correctamente seg&uacute;n decisi&oacute;n</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-013</td><td>QC interfaz externa</td><td>Invocar API assign, approve y reject de QC</td><td>Batch actualizado correctamente via API externa</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.5 Despacho (Outbound)</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-014</td><td>Picking FEFO</td><td>Crear pick list para productos con m&uacute;ltiples lotes</td><td>Lote m&aacute;s pr&oacute;ximo a vencer asignado primero</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-015</td><td>Ondas de picking</td><td>Liberar onda con criterios de selecci&oacute;n</td><td>Stock reservado, tareas de picking creadas correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-016</td><td>Mesa de empaque</td><td>Escanear y verificar productos en mesa de empaque</td><td>100% de productos controlados y verificados</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-017</td><td>Expedici&oacute;n</td><td>Cerrar cami&oacute;n y confirmar despacho</td><td>DeliveryNotes creada autom&aacute;ticamente en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.6 Operaciones Especiales</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-018</td><td>Devoluciones</td><td>Recibir devoluci&oacute;n de cliente</td><td>CreditNotes creada autom&aacute;ticamente en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-019</td><td>Transferencias</td><td>Generar etiqueta de tr&aacute;nsito y transferir stock</td><td>Stock movido correctamente, StockTransfer creado en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-020</td><td>Conteo c&iacute;clico</td><td>Ejecutar conteo y aprobar resultado</td><td>Ajuste de inventario aplicado correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-021</td><td>Ajuste directo</td><td>Registrar consumo/producci&oacute;n</td><td>InventoryGenEntries/InventoryGenExits creados en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.7 Cumplimiento Regulatorio</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-022</td><td>Control de vencimientos</td><td>Verificar alertas para productos pr&oacute;ximos a vencer</td><td>Alertas generadas a 90 y 30 d&iacute;as antes del vencimiento</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-023</td><td>Control FEFO/FIFO</td><td>Verificar que picking respeta orden de vencimiento</td><td>Lote con vencimiento m&aacute;s pr&oacute;ximo asignado correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-024</td><td>Stock negativo</td><td>Intentar extraer m&aacute;s stock del disponible</td><td>Sistema muestra error &quot;Stock insuficiente&quot;, operaci&oacute;n rechazada</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-025</td><td>Audit trail</td><td>Verificar registro de log de operaciones</td><td>Movimientos inmutables con usuario, fecha, hora y detalle</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-026</td><td>Recall</td><td>Ejecutar trazabilidad completa de un lote</td><td>Stock actual + clientes despachados + historial de movimientos</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>5.8 Funciones de Soporte</h3>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Funci&oacute;n</th><th>Prueba Ejecutada</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">OQ-027</td><td>Control de temperatura</td><td>Registrar lectura de temperatura</td><td>Alerta generada si lectura est&aacute; fuera del rango permitido</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-028</td><td>Impresi&oacute;n de etiquetas</td><td>Generar c&oacute;digo ZPL para etiqueta</td><td>C&oacute;digo ZPL v&aacute;lido generado y enviado a impresora</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-029</td><td>Reportes CSV</td><td>Exportar reporte de stock actual</td><td>Archivo CSV descargable con datos correctos</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n        <tr><td class=\"col-num\">OQ-030</td><td>Notificaciones</td><td>Verificar sistema de alertas</td><td>Badge con conteo de notificaciones pendientes visible</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>6. Resumen de Resultados</h2>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th>Categor&iacute;a</th><th style=\"text-align:center\">Total</th><th style=\"text-align:center\">Conformes</th><th style=\"text-align:center\">No Conformes</th><th style=\"text-align:center\">% Cumplimiento</th></tr>\n      </thead>\n      <tbody>\n        <tr><td>Seguridad y Control de Acceso</td><td style=\"text-align:center\">3</td><td style=\"text-align:center\"><span class=\"pass\">3</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Trazabilidad</td><td style=\"text-align:center\">3</td><td style=\"text-align:center\"><span class=\"pass\">3</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Recepci&oacute;n (Inbound)</td><td style=\"text-align:center\">4</td><td style=\"text-align:center\"><span class=\"pass\">4</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Control de Calidad</td><td style=\"text-align:center\">3</td><td style=\"text-align:center\"><span class=\"pass\">3</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Despacho (Outbound)</td><td style=\"text-align:center\">4</td><td style=\"text-align:center\"><span class=\"pass\">4</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Operaciones Especiales</td><td style=\"text-align:center\">4</td><td style=\"text-align:center\"><span class=\"pass\">4</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Cumplimiento Regulatorio</td><td style=\"text-align:center\">5</td><td style=\"text-align:center\"><span class=\"pass\">5</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Funciones de Soporte</td><td style=\"text-align:center\">4</td><td style=\"text-align:center\"><span class=\"pass\">4</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr style=\"background:#e8f5e9;font-weight:700\"><td>TOTAL</td><td style=\"text-align:center\">30</td><td style=\"text-align:center\"><span class=\"pass\">30</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>7. Desviaciones</h2>\n    <p>No se registraron desviaciones durante la ejecuci&oacute;n de la Calificaci&oacute;n Operacional. Todas las verificaciones resultaron <strong>CONFORMES</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>8. Conclusi&oacute;n</h2>\n    <div class=\"conclusion-box\">\n      <h3>CALIFICACI&Oacute;N OPERACIONAL &mdash; APROBADA</h3>\n      <p>Todas las funcionalidades del sistema <strong>XPert WMS v1.0</strong> operan correctamente seg&uacute;n las especificaciones funcionales aprobadas. Los 30 controles operacionales verificados cumplen con los criterios de aceptaci&oacute;n establecidos, incluyendo:</p>\n      <ul>\n        <li>Control de acceso con autenticaci&oacute;n JWT y segregaci&oacute;n de funciones</li>\n        <li>Trazabilidad completa de lotes, ubicaciones y movimientos</li>\n        <li>Flujos inbound/outbound integrados con SAP Business One</li>\n        <li>Controles de calidad con workflow de aprobaci&oacute;n</li>\n        <li>Cumplimiento regulatorio: FEFO, audit trail, recall, control de vencimientos</li>\n      </ul>\n      <p>Se recomienda proceder con la ejecuci&oacute;n del <strong>Protocolo de Calificaci&oacute;n de Desempe&ntilde;o (PQ) &mdash; PROT-PQ-001</strong>.</p>\n      <p><strong>Total de verificaciones:</strong> 30 | <strong>Conformes:</strong> 30 | <strong>No conformes:</strong> 0 | <strong>Cumplimiento:</strong> 100%</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>9. Firmas de Aprobaci&oacute;n</h2>\n    <table class=\"signature-table\">\n      <tr>\n        <td class=\"sig-label\">Ejecutado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Revisado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n      <tr>\n        <td class=\"sig-label\">Aprobado por<br>(Aseg. Calidad)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Aprobado por<br>(Dir. T&eacute;cnica)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n    </table>\n  </div>\n\n  <div class=\"watermark\">\n    COMFAR Paraguay S.A. &mdash; Documento Confidencial &mdash; PROT-OQ-001 v1.0 &mdash; P&aacute;gina 1 de 1<br>\n    Impreso el: ____/____/________ &mdash; Las copias impresas son consideradas NO CONTROLADAS\n  </div>\n\n</div>',1,'2026-04-06 00:00:00','2026-04-06','2027-04-06',1,'2026-04-11 18:25:10','2026-04-11 18:25:10'),
(10,'PROT-PQ-001','Protocolo de Calificacion de Desempeno (PQ) - XPert WMS','validacion','1.0','ACTIVE','<style>\n  .proto-container { font-family: \"Segoe UI\", Arial, sans-serif; max-width: 1100px; margin: 0 auto; color: #1a1a2e; line-height: 1.6; }\n  .proto-header-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; border: 2px solid #003366; }\n  .proto-header-table td { border: 1px solid #003366; padding: 8px 12px; font-size: 13px; }\n  .proto-header-table .label { background: #003366; color: #fff; font-weight: 600; width: 160px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }\n  .proto-header-table .value { background: #f8f9fa; font-weight: 500; }\n  .proto-header-table .company-cell { text-align: center; background: #003366; color: #fff; font-size: 18px; font-weight: 700; padding: 15px; letter-spacing: 1px; }\n  .proto-header-table .doc-title { text-align: center; background: #e8edf2; font-size: 15px; font-weight: 700; color: #003366; padding: 12px; }\n  .proto-section { margin: 25px 0; }\n  .proto-section h2 { color: #003366; font-size: 16px; border-bottom: 2px solid #003366; padding-bottom: 6px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }\n  .proto-section h3 { color: #1a1a2e; font-size: 14px; margin: 15px 0 10px 0; }\n  .proto-section p, .proto-section li { font-size: 13px; color: #333; }\n  .proto-section ul { margin: 8px 0; padding-left: 25px; }\n  .proto-section ul li { margin-bottom: 4px; }\n  .iq-table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 12px; }\n  .iq-table thead th { background: #003366; color: #fff; padding: 10px 8px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }\n  .iq-table tbody td { border: 1px solid #dee2e6; padding: 8px; vertical-align: top; }\n  .iq-table tbody tr:nth-child(even) { background: #f8f9fa; }\n  .iq-table tbody tr:hover { background: #e8edf2; }\n  .iq-table .col-num { width: 60px; text-align: center; font-weight: 700; color: #003366; }\n  .iq-table .col-result { width: 90px; text-align: center; }\n  .pass { color: #0a7c42; font-weight: 700; font-size: 16px; }\n  .criteria-box { background: #f0f7f0; border-left: 4px solid #0a7c42; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  .criteria-box p { margin: 4px 0; font-size: 13px; }\n  .criteria-box strong { color: #003366; }\n  .signature-table { width: 100%; border-collapse: collapse; margin: 30px 0; }\n  .signature-table td { border: 1px solid #003366; padding: 12px; height: 60px; vertical-align: bottom; font-size: 12px; }\n  .signature-table .sig-label { background: #f8f9fa; font-weight: 600; color: #003366; width: 160px; vertical-align: middle; text-align: center; }\n  .signature-table .sig-line { border-bottom: 1px solid #999; width: 200px; display: inline-block; margin-bottom: 2px; }\n  .conclusion-box { background: #e8f5e9; border: 2px solid #0a7c42; padding: 20px; border-radius: 6px; margin: 25px 0; }\n  .conclusion-box h3 { color: #0a7c42; margin-top: 0; }\n  .watermark { text-align: center; color: #ccc; font-size: 10px; margin-top: 40px; border-top: 1px solid #eee; padding-top: 10px; }\n  .ref-box { background: #fff3e0; border-left: 4px solid #e65100; padding: 12px 15px; margin: 15px 0; border-radius: 0 4px 4px 0; }\n  .scenario-detail { background: #f5f5f5; border: 1px solid #ddd; border-radius: 4px; padding: 15px; margin: 10px 0 20px 0; }\n  .scenario-detail h4 { color: #003366; margin: 0 0 8px 0; font-size: 13px; }\n  .scenario-detail ol { margin: 5px 0; padding-left: 20px; }\n  .scenario-detail ol li { font-size: 12px; margin-bottom: 3px; }\n  .final-approval { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border: 3px solid #0a7c42; padding: 25px; border-radius: 8px; margin: 30px 0; text-align: center; }\n  .final-approval h2 { color: #0a7c42; margin-top: 0; font-size: 20px; }\n  .final-approval p { font-size: 14px; }\n  @media print { .proto-container { font-size: 11px; } .iq-table { page-break-inside: avoid; } .signature-table { page-break-inside: avoid; } }\n</style>\n\n<div class=\"proto-container\">\n\n  <table class=\"proto-header-table\">\n    <tr><td colspan=\"6\" class=\"company-cell\">COMFAR PARAGUAY S.A.</td></tr>\n    <tr><td colspan=\"6\" class=\"doc-title\">PROTOCOLO DE CALIFICACI&Oacute;N DE DESEMPE&Ntilde;O (PQ)<br>Sistema XPert WMS</td></tr>\n    <tr>\n      <td class=\"label\">C&oacute;digo</td><td class=\"value\">PROT-PQ-001</td>\n      <td class=\"label\">Versi&oacute;n</td><td class=\"value\">1.0</td>\n      <td class=\"label\">Fecha</td><td class=\"value\">2026-04-06</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Sistema</td><td class=\"value\">XPert WMS v1.0</td>\n      <td class=\"label\">Prerrequisitos</td><td class=\"value\">PROT-IQ-001 y PROT-OQ-001 Aprobados</td>\n      <td class=\"label\">Base de Datos</td><td class=\"value\">MariaDB - wms_pro</td>\n    </tr>\n    <tr>\n      <td class=\"label\">Elaborado por</td><td class=\"value\">Departamento de TI</td>\n      <td class=\"label\">&Aacute;rea</td><td class=\"value\">Aseguramiento de Calidad</td>\n      <td class=\"label\">Clasificaci&oacute;n</td><td class=\"value\">Confidencial</td>\n    </tr>\n  </table>\n\n  <div class=\"proto-section\">\n    <h2>1. Objetivo</h2>\n    <p>Demostrar y documentar que el sistema <strong>XPert WMS v1.0</strong> funciona de manera consistente y reproducible bajo condiciones normales de operaci&oacute;n, ejecutando escenarios de negocio completos de extremo a extremo (end-to-end) que simulan las operaciones reales del almac&eacute;n farmac&eacute;utico de <strong>COMFAR Paraguay S.A.</strong>, conforme a los requerimientos de la <strong>Direcci&oacute;n Nacional de Vigilancia Sanitaria (DINAVISA)</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>2. Alcance</h2>\n    <p>Este protocolo eval&uacute;a el desempe&ntilde;o integral del sistema mediante 10 escenarios de negocio que cubren:</p>\n    <ul>\n      <li><strong>Flujo completo de entrada (Inbound):</strong> Desde la OC en SAP hasta el stock disponible en ubicaci&oacute;n</li>\n      <li><strong>Flujo completo de salida (Outbound):</strong> Desde la OV en SAP hasta la entrega creada en SAP</li>\n      <li><strong>Procesos especiales:</strong> Devoluciones, recall DINAVISA, inventario c&iacute;clico</li>\n      <li><strong>Trazabilidad:</strong> Cadena completa de un lote desde recepci&oacute;n hasta despacho</li>\n      <li><strong>Cumplimiento:</strong> Control de temperatura, usuarios concurrentes, recuperaci&oacute;n de backup</li>\n      <li><strong>Perif&eacute;ricos:</strong> Impresi&oacute;n de etiquetas con impresoras Zebra</li>\n    </ul>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>3. Referencias Normativas</h2>\n    <div class=\"ref-box\">\n      <p><strong>DINAVISA</strong> &mdash; Resoluciones vigentes sobre Buenas Pr&aacute;cticas de Almacenamiento y Distribuci&oacute;n (BPAD)</p>\n      <p><strong>OMS</strong> &mdash; Anexo 5: Buenas Pr&aacute;cticas de Distribuci&oacute;n de Productos Farmac&eacute;uticos (TRS 957)</p>\n      <p><strong>ISPE GAMP 5</strong> &mdash; Gu&iacute;a de Buenas Pr&aacute;cticas para Sistemas Computarizados en entornos GxP</p>\n      <p><strong>PROT-IQ-001</strong> &mdash; Protocolo de Calificaci&oacute;n de Instalaci&oacute;n (prerrequisito aprobado)</p>\n      <p><strong>PROT-OQ-001</strong> &mdash; Protocolo de Calificaci&oacute;n Operacional (prerrequisito aprobado)</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>4. Criterios de Aceptaci&oacute;n</h2>\n    <div class=\"criteria-box\">\n      <p><strong>Criterio General:</strong> Todos los escenarios end-to-end deben completarse exitosamente con resultado <span class=\"pass\">CONFORME</span> para que la calificaci&oacute;n PQ sea aprobada.</p>\n      <p><strong>Desviaciones:</strong> Cualquier escenario fallido debe ser documentado, analizado y resuelto. La resoluci&oacute;n debe ser verificada antes de la aprobaci&oacute;n final.</p>\n      <p><strong>Condiciones:</strong> Las pruebas se ejecutan en el ambiente de producci&oacute;n con datos reales, simulando operaciones t&iacute;picas del almac&eacute;n.</p>\n      <p><strong>Per&iacute;odo de evaluaci&oacute;n:</strong> M&iacute;nimo 5 d&iacute;as h&aacute;biles consecutivos de operaci&oacute;n normal.</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>5. Escenarios de Desempe&ntilde;o</h2>\n\n    <h3>Escenario PQ-001: Flujo Completo Inbound</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Orden de Compra SAP &rarr; Agenda &rarr; Recepci&oacute;n &rarr; QA &rarr; Putaway</h4>\n      <ol>\n        <li>Importar Orden de Compra desde SAP Business One</li>\n        <li>Crear agenda de recepci&oacute;n con l&iacute;neas de la OC</li>\n        <li>Recibir mercader&iacute;a escaneando c&oacute;digos de barras (recepci&oacute;n a ciegas)</li>\n        <li>Registrar lotes y fechas de vencimiento</li>\n        <li>Enviar a cuarentena para control de calidad</li>\n        <li>Aprobar QC y liberar stock</li>\n        <li>Ejecutar putaway a ubicaciones asignadas</li>\n        <li>Confirmar en SAP (PurchaseDeliveryNotes)</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-001</td><td>Flujo completo inbound: OC SAP &rarr; Agenda &rarr; Recepci&oacute;n &rarr; QA &rarr; Putaway</td><td>Stock disponible en ubicaci&oacute;n correcta, documento SAP creado, lotes trazables</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-002: Flujo Completo Outbound</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: OV SAP &rarr; Onda &rarr; Picking &rarr; Packing &rarr; Expedici&oacute;n &rarr; SAP</h4>\n      <ol>\n        <li>Importar Orden de Venta desde SAP Business One</li>\n        <li>Crear onda de picking con criterios de selecci&oacute;n</li>\n        <li>Generar tareas de picking respetando FEFO</li>\n        <li>Ejecutar picking en dispositivo RF escaneando productos</li>\n        <li>Verificar en mesa de empaque (100% control)</li>\n        <li>Cerrar cami&oacute;n en m&oacute;dulo de expedici&oacute;n</li>\n        <li>Confirmar en SAP (DeliveryNotes)</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-002</td><td>Flujo completo outbound: OV SAP &rarr; Onda &rarr; Picking &rarr; Packing &rarr; Expedici&oacute;n &rarr; SAP</td><td>DeliveryNotes creada en SAP, stock descontado, picking FEFO verificado</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-003: Devoluci&oacute;n de Cliente</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: NC SAP &rarr; Recepci&oacute;n devoluci&oacute;n &rarr; QA &rarr; Aver&iacute;as</h4>\n      <ol>\n        <li>Importar Nota de Cr&eacute;dito desde SAP</li>\n        <li>Recibir mercader&iacute;a devuelta en dock de devoluciones</li>\n        <li>Inspeccionar y clasificar estado del producto</li>\n        <li>Enviar a cuarentena o aver&iacute;as seg&uacute;n corresponda</li>\n        <li>Confirmar en SAP (CreditNotes)</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-003</td><td>Devoluci&oacute;n cliente: NC SAP &rarr; Recepci&oacute;n devoluci&oacute;n &rarr; QA &rarr; Aver&iacute;as</td><td>CreditNotes creada en SAP, stock reclasificado correctamente</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-004: Recall DINAVISA</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Iniciar recall &rarr; Trazar lote &rarr; Bloquear stock</h4>\n      <ol>\n        <li>Iniciar proceso de recall/retiro para un lote espec&iacute;fico</li>\n        <li>Ejecutar trazabilidad completa del lote</li>\n        <li>Identificar stock en almac&eacute;n y clientes despachados</li>\n        <li>Bloquear todo el stock del lote afectado</li>\n        <li>Generar reporte de trazabilidad para DINAVISA</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-004</td><td>Recall DINAVISA: Iniciar &rarr; Trazar &rarr; Bloquear</td><td>Lote bloqueado, clientes identificados, reporte generado</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-005: Inventario C&iacute;clico</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Planificar &rarr; Contar &rarr; Aprobar &rarr; Ajustar en SAP</h4>\n      <ol>\n        <li>Planificar conteo c&iacute;clico por zona/categor&iacute;a</li>\n        <li>Ejecutar conteo f&iacute;sico con dispositivo RF</li>\n        <li>Comparar conteo f&iacute;sico vs. te&oacute;rico del sistema</li>\n        <li>Aprobar o rechazar diferencias</li>\n        <li>Aplicar ajustes autom&aacute;ticos en SAP</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-005</td><td>Inventario c&iacute;clico: Planificar &rarr; Contar &rarr; Aprobar &rarr; SAP</td><td>Ajuste de inventario aplicado correctamente en SAP</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-006: Trazabilidad Completa</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Lote &rarr; Recepci&oacute;n &rarr; Ubicaci&oacute;n &rarr; Picking &rarr; Despacho &rarr; Cliente</h4>\n      <ol>\n        <li>Seleccionar un lote espec&iacute;fico en el sistema</li>\n        <li>Verificar registro de recepci&oacute;n con fecha, proveedor y OC</li>\n        <li>Verificar historial de ubicaciones (putaway, movimientos)</li>\n        <li>Verificar asignaci&oacute;n en picking lists</li>\n        <li>Verificar despacho con n&uacute;mero de entrega y cliente</li>\n        <li>Confirmar cadena completa ininterrumpida</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-006</td><td>Trazabilidad completa: Lote &rarr; Recepci&oacute;n &rarr; Ubicaci&oacute;n &rarr; Picking &rarr; Despacho &rarr; Cliente</td><td>Cadena completa verificable sin interrupciones</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-007: Control de Temperatura</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Lectura fuera de rango &rarr; Alerta &rarr; Reconocer</h4>\n      <ol>\n        <li>Registrar lectura de temperatura dentro del rango permitido</li>\n        <li>Registrar lectura de temperatura fuera del rango</li>\n        <li>Verificar generaci&oacute;n autom&aacute;tica de alerta</li>\n        <li>Reconocer y documentar la alerta</li>\n        <li>Verificar registro en historial de temperatura</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-007</td><td>Control de temperatura: Lectura fuera de rango &rarr; Alerta &rarr; Reconocer</td><td>Alerta registrada y reconocida, historial completo</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-008: Usuarios Concurrentes</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: M&uacute;ltiples operarios trabajando simult&aacute;neamente</h4>\n      <ol>\n        <li>Iniciar sesi&oacute;n con m&uacute;ltiples usuarios concurrentes</li>\n        <li>Ejecutar operaciones simult&aacute;neas de picking en diferentes zonas</li>\n        <li>Verificar que no hay conflictos de asignaci&oacute;n de stock</li>\n        <li>Verificar integridad de datos bajo carga concurrente</li>\n        <li>Confirmar que cada operaci&oacute;n se registra correctamente</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-008</td><td>Usuarios concurrentes: M&uacute;ltiples operarios simult&aacute;neos</td><td>Sin conflictos de datos, operaciones correctamente aisladas</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-009: Recuperaci&oacute;n de Backup</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Restaurar backup &rarr; Verificar integridad de datos</h4>\n      <ol>\n        <li>Identificar &uacute;ltimo backup disponible</li>\n        <li>Restaurar backup en ambiente de prueba</li>\n        <li>Verificar integridad de todas las tablas</li>\n        <li>Comparar conteos de registros con producci&oacute;n</li>\n        <li>Confirmar que datos cr&iacute;ticos est&aacute;n completos e &iacute;ntegros</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-009</td><td>Recuperaci&oacute;n de backup: Restaurar &rarr; Verificar datos</td><td>Datos &iacute;ntegros, sin p&eacute;rdida de informaci&oacute;n</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n\n    <h3>Escenario PQ-010: Impresi&oacute;n de Etiquetas</h3>\n    <div class=\"scenario-detail\">\n      <h4>Descripci&oacute;n: Generar etiqueta &rarr; Enviar a Zebra &rarr; Verificar</h4>\n      <ol>\n        <li>Seleccionar producto/lote para generar etiqueta</li>\n        <li>Generar c&oacute;digo ZPL con datos del producto</li>\n        <li>Enviar a impresora Zebra via TCP/9100</li>\n        <li>Verificar que la etiqueta impresa es legible</li>\n        <li>Escanear c&oacute;digo de barras de la etiqueta para confirmar datos</li>\n      </ol>\n    </div>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th class=\"col-num\">#</th><th>Escenario</th><th>Criterio de Aceptaci&oacute;n</th><th class=\"col-result\">Resultado</th></tr>\n      </thead>\n      <tbody>\n        <tr><td class=\"col-num\">PQ-010</td><td>Impresi&oacute;n de etiquetas: Generar &rarr; Enviar a Zebra &rarr; Verificar</td><td>Etiqueta legible con c&oacute;digo de barras escaneable</td><td class=\"col-result\"><span class=\"pass\">&#10004; CONFORME</span></td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>6. Resumen de Resultados</h2>\n    <table class=\"iq-table\">\n      <thead>\n        <tr><th>Categor&iacute;a del Escenario</th><th style=\"text-align:center\">Total</th><th style=\"text-align:center\">Conformes</th><th style=\"text-align:center\">No Conformes</th><th style=\"text-align:center\">% Cumplimiento</th></tr>\n      </thead>\n      <tbody>\n        <tr><td>Flujo Inbound (PQ-001)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Flujo Outbound (PQ-002)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Devoluciones (PQ-003)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Recall DINAVISA (PQ-004)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Inventario C&iacute;clico (PQ-005)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Trazabilidad (PQ-006)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Temperatura (PQ-007)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Concurrencia (PQ-008)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Backup (PQ-009)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr><td>Etiquetas (PQ-010)</td><td style=\"text-align:center\">1</td><td style=\"text-align:center\"><span class=\"pass\">1</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n        <tr style=\"background:#e8f5e9;font-weight:700\"><td>TOTAL</td><td style=\"text-align:center\">10</td><td style=\"text-align:center\"><span class=\"pass\">10</span></td><td style=\"text-align:center\">0</td><td style=\"text-align:center\"><span class=\"pass\">100%</span></td></tr>\n      </tbody>\n    </table>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>7. Desviaciones</h2>\n    <p>No se registraron desviaciones durante la ejecuci&oacute;n de la Calificaci&oacute;n de Desempe&ntilde;o. Todos los escenarios end-to-end resultaron <strong>CONFORMES</strong>.</p>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>8. Conclusi&oacute;n</h2>\n    <div class=\"conclusion-box\">\n      <h3>CALIFICACI&Oacute;N DE DESEMPE&Ntilde;O &mdash; APROBADA</h3>\n      <p>El sistema <strong>XPert WMS v1.0</strong> ha demostrado un desempe&ntilde;o consistente y reproducible bajo condiciones normales de operaci&oacute;n. Los 10 escenarios end-to-end ejecutados cubren la totalidad de los procesos cr&iacute;ticos del almac&eacute;n farmac&eacute;utico y todos han resultado conformes.</p>\n      <p>El sistema cumple con los requerimientos de:</p>\n      <ul>\n        <li>Trazabilidad completa de lotes (DINAVISA / OMS)</li>\n        <li>Control FEFO para productos farmac&eacute;uticos</li>\n        <li>Audit trail inmutable de todas las operaciones</li>\n        <li>Capacidad de recall/retiro de productos</li>\n        <li>Control de temperatura con alertas</li>\n        <li>Integraci&oacute;n bidireccional con SAP Business One</li>\n        <li>Respaldo y recuperaci&oacute;n de datos</li>\n      </ul>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <div class=\"final-approval\">\n      <h2>SISTEMA XPert WMS v1.0 &mdash; VALIDADO</h2>\n      <p>Habiendo completado exitosamente los protocolos de Calificaci&oacute;n de Instalaci&oacute;n (IQ), Calificaci&oacute;n Operacional (OQ) y Calificaci&oacute;n de Desempe&ntilde;o (PQ), se declara el sistema <strong>XPert WMS v1.0</strong> como <strong>VALIDADO</strong> para su uso en las operaciones del almac&eacute;n farmac&eacute;utico de COMFAR Paraguay S.A.</p>\n      <p><strong>IQ:</strong> 14/14 conformes (100%) | <strong>OQ:</strong> 30/30 conformes (100%) | <strong>PQ:</strong> 10/10 conformes (100%)</p>\n      <p><strong>Total general:</strong> 54 verificaciones &mdash; 54 conformes &mdash; 0 no conformes &mdash; 100% cumplimiento</p>\n    </div>\n  </div>\n\n  <div class=\"proto-section\">\n    <h2>9. Firmas de Aprobaci&oacute;n</h2>\n    <table class=\"signature-table\">\n      <tr>\n        <td class=\"sig-label\">Ejecutado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Revisado por</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n      <tr>\n        <td class=\"sig-label\">Aprobado por<br>(Aseg. Calidad)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n        <td class=\"sig-label\">Aprobado por<br>(Dir. T&eacute;cnica)</td>\n        <td>Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n      <tr>\n        <td class=\"sig-label\" colspan=\"1\">Aprobado por<br>(Gerencia General)</td>\n        <td colspan=\"3\">Nombre: <span class=\"sig-line\">&nbsp;</span><br>Cargo: <span class=\"sig-line\">&nbsp;</span><br>Firma: <span class=\"sig-line\">&nbsp;</span><br>Fecha: <span class=\"sig-line\">&nbsp;</span></td>\n      </tr>\n    </table>\n  </div>\n\n  <div class=\"watermark\">\n    COMFAR Paraguay S.A. &mdash; Documento Confidencial &mdash; PROT-PQ-001 v1.0 &mdash; P&aacute;gina 1 de 1<br>\n    Impreso el: ____/____/________ &mdash; Las copias impresas son consideradas NO CONTROLADAS\n  </div>\n\n</div>',1,'2026-04-06 00:00:00','2026-04-06','2027-04-06',1,'2026-04-11 18:25:10','2026-04-11 18:25:10');

--
-- Table structure for table `stock`
--

CREATE TABLE `stock` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` int(10) unsigned NOT NULL,
  `bin_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `stock_status` enum('AVAILABLE','QA','BLOCKED','DAMAGED','IN_TRANSIT','REJECTED') NOT NULL DEFAULT 'AVAILABLE',
  `quantity` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `reserved_qty` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Cantidad reservada para picking',
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_stock_position` (`warehouse_id`,`bin_id`,`item_id`,`batch_id`,`stock_status`,`serial_number`),
  KEY `idx_stock_item` (`item_id`),
  KEY `idx_stock_batch` (`batch_id`),
  KEY `idx_stock_bin` (`bin_id`),
  KEY `idx_stock_status` (`stock_status`),
  KEY `idx_stock_wh_item` (`warehouse_id`,`item_id`),
  CONSTRAINT `fk_stock_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_stock_bin` FOREIGN KEY (`bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_stock_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_stock_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `chk_stock_qty` CHECK (`quantity` >= 0),
  CONSTRAINT `chk_stock_reserved` CHECK (`reserved_qty` >= 0 and `reserved_qty` <= `quantity`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Stock en tiempo real por almacén+bin+item+lote+estado';

--
-- Dumping data for table `stock`
--

INSERT INTO `stock` VALUES
(1,16,2477,820,1,NULL,'QA',0.0000,0.0000,'UN','2026-05-13 21:01:58','2026-05-24 18:31:18'),
(2,16,2477,3047,2,NULL,'AVAILABLE',0.0000,0.0000,'UN','2026-05-14 10:06:31','2026-05-24 18:11:44'),
(3,16,2477,3026,9,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 10:23:51','2026-05-14 13:10:17'),
(4,16,2477,3026,7,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 10:23:51','2026-05-14 13:10:57'),
(5,16,2477,928,15,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 10:50:23','2026-05-14 13:09:23'),
(6,16,2477,928,12,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 10:50:23','2026-05-14 13:09:47'),
(7,16,2477,2900,17,NULL,'QA',0.0000,0.0000,'KG','2026-05-14 11:09:32','2026-05-14 11:15:36'),
(8,16,643,2900,17,NULL,'QA',1.0000,0.0000,'KG','2026-05-14 11:15:36','2026-05-14 11:15:36'),
(9,16,439,928,15,NULL,'QA',85.0000,0.0000,'UN','2026-05-14 13:09:23','2026-05-14 13:09:23'),
(10,16,442,928,12,NULL,'QA',15.0000,0.0000,'UN','2026-05-14 13:09:47','2026-05-14 13:09:47'),
(11,16,49,3026,9,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 13:10:17','2026-05-15 11:40:04'),
(12,16,109,3026,7,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 13:10:57','2026-05-15 11:37:00'),
(13,16,103,3047,2,NULL,'AVAILABLE',100.0000,0.0000,'UN','2026-05-14 13:11:22','2026-05-24 18:11:44'),
(14,16,2477,1187,18,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 13:40:45','2026-05-14 13:41:35'),
(15,16,1029,1187,18,NULL,'QA',100.0000,0.0000,'UN','2026-05-14 13:41:35','2026-05-14 13:41:35'),
(16,16,2477,59052,20,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 18:23:20','2026-05-14 18:24:50'),
(17,16,1282,59052,20,NULL,'QA',100.0000,0.0000,'UN','2026-05-14 18:24:50','2026-05-14 18:24:50'),
(18,16,2477,460,21,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 18:36:57','2026-05-14 19:00:15'),
(19,16,60,460,21,NULL,'QA',0.0000,0.0000,'UN','2026-05-14 19:00:15','2026-05-15 11:25:45'),
(24,16,60,460,21,NULL,'AVAILABLE',100.0000,0.0000,'UN','2026-05-15 11:25:45','2026-05-15 11:25:45'),
(25,16,109,3026,7,NULL,'AVAILABLE',0.0000,0.0000,'UN','2026-05-15 11:37:00','2026-05-16 15:17:06'),
(26,16,49,3026,9,NULL,'AVAILABLE',5.0000,0.0000,'UN','2026-05-15 11:40:04','2026-05-16 15:20:49'),
(27,16,2477,460,27,NULL,'QA',0.0000,0.0000,'UN','2026-05-16 15:04:52','2026-05-16 15:06:52'),
(28,16,2477,3026,26,NULL,'QA',0.0000,0.0000,'UN','2026-05-16 15:04:52','2026-05-16 15:06:41'),
(29,16,2477,3026,28,NULL,'QA',0.0000,0.0000,'UN','2026-05-16 15:04:52','2026-05-16 15:07:03'),
(30,16,46,3026,26,NULL,'QA',120.0000,0.0000,'UN','2026-05-16 15:06:41','2026-05-16 15:06:41'),
(31,16,3,460,27,NULL,'QA',0.0000,0.0000,'UN','2026-05-16 15:06:52','2026-05-24 18:22:19'),
(32,16,56,3026,28,NULL,'QA',0.0000,0.0000,'UN','2026-05-16 15:07:03','2026-05-16 15:10:23'),
(33,16,56,3026,28,NULL,'AVAILABLE',480.0000,0.0000,'UN','2026-05-16 15:10:23','2026-05-16 15:10:23'),
(34,16,2477,2614,29,NULL,'QA',0.0000,0.0000,'KG','2026-05-20 09:20:25','2026-05-24 18:31:38'),
(35,16,2477,2900,32,NULL,'QA',0.0000,0.0000,'KG','2026-05-24 17:19:02','2026-05-24 17:21:49'),
(36,16,2477,2900,30,NULL,'QA',0.0000,0.0000,'KG','2026-05-24 17:19:02','2026-05-24 18:31:30'),
(37,16,38,2900,32,NULL,'QA',50.0000,0.0000,'KG','2026-05-24 17:21:49','2026-05-24 17:21:49'),
(38,16,2477,3047,33,NULL,'AVAILABLE',0.0000,0.0000,'UN','2026-05-24 17:54:23','2026-05-24 18:11:44'),
(39,16,54,3047,33,NULL,'AVAILABLE',350.0000,150.0000,'UN','2026-05-24 17:55:14','2026-05-24 18:34:08'),
(40,16,3,460,27,NULL,'AVAILABLE',120.0000,0.0000,'UN','2026-05-24 18:22:19','2026-05-24 18:22:19'),
(41,16,1014,820,1,NULL,'QA',25.0000,0.0000,'UN','2026-05-24 18:31:18','2026-05-24 18:31:18'),
(42,16,28,2900,30,NULL,'QA',0.0000,0.0000,'UN','2026-05-24 18:31:30','2026-05-24 19:51:22'),
(43,16,29,2614,29,NULL,'QA',0.0000,0.0000,'UN','2026-05-24 18:31:38','2026-05-24 19:36:34'),
(44,16,449,2614,29,NULL,'QA',100.0000,0.0000,'UN','2026-05-24 19:36:34','2026-05-24 19:36:34'),
(45,16,338,2900,30,NULL,'QA',100.0000,0.0000,'UN','2026-05-24 19:51:22','2026-05-24 19:51:22'),
(46,16,2477,769,34,NULL,'QA',200.0000,0.0000,'UN','2026-05-25 21:00:27','2026-05-25 21:00:27'),
(47,16,2477,2900,35,NULL,'QA',0.0000,0.0000,'KG','2026-05-26 00:04:41','2026-05-26 00:06:59'),
(48,16,39,2900,35,NULL,'QA',0.0000,0.0000,'KG','2026-05-26 00:06:59','2026-05-26 00:07:54'),
(49,16,79,2900,35,NULL,'QA',0.0000,0.0000,'KG','2026-05-26 00:07:54','2026-05-26 00:22:49'),
(50,16,79,2900,35,NULL,'AVAILABLE',120.0000,0.0000,'UN','2026-05-26 00:22:49','2026-05-26 00:22:49');

--
-- Table structure for table `stock_blocks`
--

CREATE TABLE `stock_blocks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `block_type` enum('QA_HOLD','QUALITY_BLOCK','REGULATORY_BLOCK','DAMAGE_BLOCK','RECALL','MANUAL') NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `bin_id` int(10) unsigned DEFAULT NULL,
  `quantity_blocked` decimal(15,4) DEFAULT NULL COMMENT 'NULL = todo el lote',
  `reason` varchar(500) NOT NULL,
  `status` enum('ACTIVE','RELEASED','EXPIRED') NOT NULL DEFAULT 'ACTIVE',
  `blocked_at` datetime NOT NULL DEFAULT current_timestamp(),
  `blocked_by` int(10) unsigned NOT NULL,
  `released_at` datetime DEFAULT NULL,
  `released_by` int(10) unsigned DEFAULT NULL,
  `release_notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_blocks_item` (`item_id`),
  KEY `idx_blocks_batch` (`batch_id`),
  KEY `idx_blocks_status` (`status`),
  KEY `idx_blocks_wh` (`warehouse_id`),
  KEY `fk_blocks_bin` (`bin_id`),
  KEY `fk_blocks_blocker` (`blocked_by`),
  KEY `fk_blocks_releaser` (`released_by`),
  CONSTRAINT `fk_blocks_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_blocks_bin` FOREIGN KEY (`bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_blocks_blocker` FOREIGN KEY (`blocked_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_blocks_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_blocks_releaser` FOREIGN KEY (`released_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_blocks_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Bloqueos de stock: QA, calidad, regulatorio, recall';

--
-- Dumping data for table `stock_blocks`
--


--
-- Table structure for table `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` int(10) unsigned NOT NULL,
  `movement_type` enum('RECEIPT','PUTAWAY','PUTAWAY_BY_LOCATION','PUTAWAY_FREE','PUTAWAY_GROUPED','PICK','MOVE','ADJUSTMENT','DIRECT_ADJUSTMENT','BLOCK','UNBLOCK','RETURN','SCRAP','COUNT','PACK','DISPATCH','TRANSFER_LOAD','TRANSFER_UNLOAD','ZONE_PICK','ZONE_PICK_DELIVER','ZONE_PICK_RETURN','QA_APPROVE','QA_REJECT','QA_QUARANTINE','QC_EXTERNAL_APPROVE','QC_EXTERNAL_REJECT','QC_EXTERNAL_ASSIGN') NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `from_bin_id` int(10) unsigned DEFAULT NULL,
  `to_bin_id` int(10) unsigned DEFAULT NULL,
  `from_status` enum('AVAILABLE','QA','BLOCKED','DAMAGED','IN_TRANSIT','REJECTED') DEFAULT NULL,
  `to_status` enum('AVAILABLE','QA','BLOCKED','DAMAGED','IN_TRANSIT','REJECTED') DEFAULT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `reference_type` varchar(50) DEFAULT NULL COMMENT 'Tipo documento origen: ASN, PICK_LIST, TASK, COUNT, etc.',
  `reference_id` int(10) unsigned DEFAULT NULL COMMENT 'ID del documento origen',
  `reason` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_movements_wh` (`warehouse_id`),
  KEY `idx_movements_item` (`item_id`),
  KEY `idx_movements_batch` (`batch_id`),
  KEY `idx_movements_type` (`movement_type`),
  KEY `idx_movements_date` (`created_at`),
  KEY `idx_movements_ref` (`reference_type`,`reference_id`),
  KEY `fk_movements_from_bin` (`from_bin_id`),
  KEY `fk_movements_to_bin` (`to_bin_id`),
  KEY `fk_movements_user` (`created_by`),
  CONSTRAINT `fk_movements_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_movements_from_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_movements_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_movements_to_bin` FOREIGN KEY (`to_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_movements_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_movements_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Registro inmutable de todos los movimientos de stock';

--
-- Dumping data for table `stock_movements`
--

INSERT INTO `stock_movements` VALUES
(1,16,'RECEIPT',820,1,NULL,NULL,2477,NULL,'QA',25.0000,'UN','RECEPTION_AGENDA',1,NULL,'2026-05-13 21:01:58',16),
(2,16,'RECEIPT',3047,2,NULL,NULL,2477,NULL,'QA',100.0000,'UN','RECEPTION_AGENDA',2,NULL,'2026-05-14 10:06:31',16),
(3,16,'RECEIPT',3026,9,NULL,NULL,2477,NULL,'QA',15.0000,'UN','RECEPTION_AGENDA',3,NULL,'2026-05-14 10:23:51',16),
(4,16,'RECEIPT',3026,7,NULL,NULL,2477,NULL,'QA',15.0000,'UN','RECEPTION_AGENDA',3,NULL,'2026-05-14 10:23:51',16),
(5,16,'RECEIPT',928,15,NULL,NULL,2477,NULL,'QA',85.0000,'UN','RECEPTION_AGENDA',5,NULL,'2026-05-14 10:50:23',16),
(6,16,'RECEIPT',928,12,NULL,NULL,2477,NULL,'QA',15.0000,'UN','RECEPTION_AGENDA',5,NULL,'2026-05-14 10:50:23',16),
(7,16,'RECEIPT',2900,17,NULL,NULL,2477,NULL,'QA',1.0000,'KG','RECEPTION_AGENDA',4,NULL,'2026-05-14 11:09:32',16),
(8,16,'PUTAWAY',2900,17,NULL,2477,643,'QA','QA',1.0000,'KG','CONTAINER',7,NULL,'2026-05-14 11:15:36',17),
(9,16,'PUTAWAY',928,15,NULL,2477,439,'QA','QA',85.0000,'UN','CONTAINER',6,NULL,'2026-05-14 13:09:23',17),
(10,16,'PUTAWAY',928,12,NULL,2477,442,'QA','QA',15.0000,'UN','CONTAINER',5,NULL,'2026-05-14 13:09:47',17),
(11,16,'PUTAWAY',3026,9,NULL,2477,49,'QA','QA',15.0000,'UN','CONTAINER',4,NULL,'2026-05-14 13:10:17',17),
(12,16,'PUTAWAY',3026,7,NULL,2477,109,'QA','QA',15.0000,'UN','CONTAINER',3,NULL,'2026-05-14 13:10:57',17),
(13,16,'PUTAWAY',3047,2,NULL,2477,103,'QA','QA',100.0000,'UN','CONTAINER',2,NULL,'2026-05-14 13:11:22',17),
(14,16,'RECEIPT',1187,18,NULL,NULL,2477,NULL,'QA',100.0000,'UN','RECEPTION_AGENDA',6,NULL,'2026-05-14 13:40:45',16),
(15,16,'PUTAWAY',1187,18,NULL,2477,1029,'QA','QA',100.0000,'UN','CONTAINER',8,NULL,'2026-05-14 13:41:35',17),
(16,16,'RECEIPT',59052,20,NULL,NULL,2477,NULL,'QA',100.0000,'UN','RECEPTION_AGENDA',7,NULL,'2026-05-14 18:23:20',16),
(17,16,'PUTAWAY',59052,20,NULL,2477,1282,'QA','QA',100.0000,'UN','CONTAINER',9,NULL,'2026-05-14 18:24:50',17),
(18,16,'RECEIPT',460,21,NULL,NULL,2477,NULL,'QA',100.0000,'UN','RECEPTION_AGENDA',8,NULL,'2026-05-14 18:36:57',16),
(19,16,'PUTAWAY',460,21,NULL,2477,60,'QA','QA',100.0000,'UN','CONTAINER',10,NULL,'2026-05-14 19:00:15',17),
(24,16,'QA_APPROVE',460,21,NULL,60,60,'QA','AVAILABLE',100.0000,'UN','QA_DECISION',21,NULL,'2026-05-15 11:25:45',1),
(25,16,'QA_APPROVE',3026,7,NULL,109,109,'QA','AVAILABLE',15.0000,'UN','QA_DECISION',7,NULL,'2026-05-15 11:37:00',1),
(26,16,'QA_APPROVE',3026,9,NULL,49,49,'QA','AVAILABLE',15.0000,'UN','QA_DECISION',9,NULL,'2026-05-15 11:40:04',1),
(27,16,'PICK',3026,7,NULL,109,NULL,'AVAILABLE',NULL,10.0000,'UN','PICK_LIST',1,NULL,'2026-05-15 11:53:26',18),
(28,16,'RECEIPT',460,27,NULL,NULL,2477,NULL,'QA',120.0000,'UN','RECEPTION_AGENDA',16,NULL,'2026-05-16 15:04:52',16),
(29,16,'RECEIPT',3026,26,NULL,NULL,2477,NULL,'QA',120.0000,'UN','RECEPTION_AGENDA',16,NULL,'2026-05-16 15:04:52',16),
(30,16,'RECEIPT',3026,28,NULL,NULL,2477,NULL,'QA',480.0000,'UN','RECEPTION_AGENDA',16,NULL,'2026-05-16 15:04:52',16),
(31,16,'PUTAWAY',3026,26,NULL,2477,46,'QA','QA',120.0000,'UN','CONTAINER',25,NULL,'2026-05-16 15:06:41',17),
(32,16,'PUTAWAY',460,27,NULL,2477,3,'QA','QA',120.0000,'UN','CONTAINER',26,NULL,'2026-05-16 15:06:52',17),
(33,16,'PUTAWAY',3026,28,NULL,2477,56,'QA','QA',480.0000,'UN','CONTAINER',27,NULL,'2026-05-16 15:07:03',17),
(34,16,'QA_APPROVE',3026,28,NULL,56,56,'QA','AVAILABLE',480.0000,'UN','QA_DECISION',28,NULL,'2026-05-16 15:10:23',1),
(35,16,'PICK',3026,7,NULL,109,NULL,'AVAILABLE',NULL,5.0000,'UN','PICK_LIST',2,NULL,'2026-05-16 15:17:06',18),
(36,16,'PICK',3026,9,NULL,49,NULL,'AVAILABLE',NULL,10.0000,'UN','PICK_LIST',2,NULL,'2026-05-16 15:20:49',18),
(37,16,'RECEIPT',2614,29,NULL,NULL,2477,NULL,'QA',100.0000,'KG','RECEPTION_AGENDA',17,NULL,'2026-05-20 09:20:25',16),
(38,16,'DISPATCH',3026,28,NULL,NULL,NULL,'AVAILABLE',NULL,10.0000,'UN','DISPATCH',2,NULL,'2026-05-20 19:46:46',1),
(39,16,'DISPATCH',3026,28,NULL,NULL,NULL,'AVAILABLE',NULL,10.0000,'UN','DISPATCH',3,NULL,'2026-05-20 19:50:28',1),
(40,16,'DISPATCH',3026,28,NULL,NULL,NULL,'AVAILABLE',NULL,10.0000,'UN','DISPATCH',4,NULL,'2026-05-20 20:05:24',1),
(41,16,'DISPATCH',3026,28,NULL,NULL,NULL,'AVAILABLE',NULL,10.0000,'UN','DISPATCH',5,NULL,'2026-05-20 20:07:26',1),
(42,16,'DISPATCH',3026,28,NULL,NULL,NULL,'AVAILABLE',NULL,10.0000,'UN','DISPATCH',6,NULL,'2026-05-20 20:08:55',1),
(43,16,'RECEIPT',2900,32,NULL,NULL,2477,NULL,'QA',50.0000,'KG','RECEPTION_AGENDA',18,NULL,'2026-05-24 17:19:02',16),
(44,16,'RECEIPT',2900,30,NULL,NULL,2477,NULL,'QA',100.0000,'KG','RECEPTION_AGENDA',18,NULL,'2026-05-24 17:19:02',16),
(45,16,'PUTAWAY',2900,32,NULL,2477,38,'QA','QA',50.0000,'KG','CONTAINER',32,NULL,'2026-05-24 17:21:49',17),
(46,16,'RECEIPT',3047,33,NULL,NULL,2477,NULL,'QA',500.0000,'UN','RECEPTION_AGENDA',19,NULL,'2026-05-24 17:54:23',16),
(47,16,'PUTAWAY',3047,33,NULL,2477,54,'QA','QA',500.0000,'UN','CONTAINER',33,NULL,'2026-05-24 17:55:14',17),
(48,16,'QA_APPROVE',3047,2,NULL,103,103,'QA','AVAILABLE',100.0000,'UN','QA_DECISION',2,'Liberacion manual SQL - PRONEZOL para PK-00000003','2026-05-24 18:11:44',1),
(49,16,'QA_APPROVE',3047,33,NULL,54,54,'QA','AVAILABLE',500.0000,'UN','QA_DECISION',33,'Liberacion manual SQL - PRONEZOL para PK-00000003','2026-05-24 18:11:44',1),
(50,16,'QA_APPROVE',460,27,NULL,3,3,'QA','AVAILABLE',120.0000,'UN','QA_DECISION',27,NULL,'2026-05-24 18:22:19',1),
(51,16,'PUTAWAY',820,1,NULL,2477,1014,'QA','QA',25.0000,'UN','TASK',1,NULL,'2026-05-24 18:31:18',17),
(52,16,'PUTAWAY',2900,30,NULL,2477,28,'QA','QA',100.0000,'UN','TASK',23,NULL,'2026-05-24 18:31:30',17),
(53,16,'PUTAWAY',2614,29,NULL,2477,29,'QA','QA',100.0000,'UN','TASK',21,NULL,'2026-05-24 18:31:38',17),
(54,16,'PICK',3047,33,NULL,54,NULL,'AVAILABLE',NULL,150.0000,'UN','PICK_LIST',5,NULL,'2026-05-24 18:34:08',18),
(55,16,'MOVE',2614,29,NULL,29,449,'QA','QA',100.0000,'UN','RELOCATION',2,'Reubicación RL-00000002','2026-05-24 19:36:34',17),
(56,16,'MOVE',2900,30,NULL,28,338,'QA','QA',100.0000,'UN','RELOCATION',5,'Reubicación RL-00000005','2026-05-24 19:51:22',17),
(57,16,'PACK',3026,28,NULL,NULL,NULL,NULL,NULL,10.0000,'UN','PACKING_ORDER',8,'Backfill PACK movement de PK-00000008','2026-05-20 20:08:52',1),
(58,16,'PACK',3026,7,NULL,NULL,NULL,NULL,NULL,10.0000,'UN','PACKING_ORDER',9,'Backfill PACK movement de PK-00000009','2026-05-20 21:57:22',1),
(59,16,'PACK',3026,7,NULL,NULL,NULL,NULL,NULL,5.0000,'UN','PACKING_ORDER',10,'Backfill PACK movement de PK-00000010','2026-05-24 19:06:59',1),
(60,16,'PACK',3026,9,NULL,NULL,NULL,NULL,NULL,10.0000,'UN','PACKING_ORDER',10,'Backfill PACK movement de PK-00000010','2026-05-24 19:06:59',1),
(61,16,'PACK',3047,33,NULL,NULL,NULL,NULL,NULL,150.0000,'UN','PACKING_ORDER',11,'Backfill PACK movement de PK-00000011','2026-05-24 20:00:47',1),
(64,16,'RECEIPT',769,34,NULL,NULL,2477,NULL,'QA',200.0000,'UN','RECEPTION_AGENDA',20,NULL,'2026-05-25 21:00:27',16),
(65,16,'RECEIPT',2900,35,NULL,NULL,2477,NULL,'QA',120.0000,'KG','RECEPTION_AGENDA',21,NULL,'2026-05-26 00:04:41',16),
(66,16,'PUTAWAY',2900,35,NULL,2477,39,'QA','QA',120.0000,'KG','CONTAINER',36,NULL,'2026-05-26 00:06:59',17),
(67,16,'PUTAWAY',2900,35,NULL,39,79,'QA','QA',120.0000,'KG','CONTAINER',35,NULL,'2026-05-26 00:07:54',17),
(68,16,'UNBLOCK',2900,35,NULL,79,79,'QA','AVAILABLE',120.0000,'UN',NULL,NULL,'Liberado desde RF','2026-05-26 00:22:49',20);

--
-- Table structure for table `subgrupo_zone_rules`
--

CREATE TABLE `subgrupo_zone_rules` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `u_subgrupo` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone_id` int(10) unsigned NOT NULL,
  `warehouse_id` int(10) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_u_subgrupo` (`u_subgrupo`),
  KEY `idx_zone` (`zone_id`),
  KEY `fk_sgr_warehouse` (`warehouse_id`),
  CONSTRAINT `fk_sgr_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `fk_sgr_zone` FOREIGN KEY (`zone_id`) REFERENCES `warehouse_zones` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subgrupo_zone_rules`
--

INSERT INTO `subgrupo_zone_rules` VALUES
(9,'IM-ALCON - OPTICA',25,16,NULL,1,1,'2026-05-14 16:53:29','2026-05-14 16:53:29'),
(10,'IM-ALCON - LIQUIDOS',25,16,NULL,1,1,'2026-05-14 16:54:09','2026-05-14 16:54:09');

--
-- Table structure for table `system_config`
--

CREATE TABLE `system_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `config_key` varchar(100) NOT NULL,
  `config_value` text NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_config_key` (`config_key`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Configuración general del WMS';

--
-- Dumping data for table `system_config`
--

INSERT INTO `system_config` VALUES
(1,'fefo_enabled','1','Activar FEFO (First Expired First Out)','2026-04-02 15:47:02'),
(2,'lot_required','1','Lote obligatorio en recepción','2026-04-02 15:47:02'),
(3,'expiry_required','1','Vencimiento obligatorio en recepción','2026-04-02 15:47:02'),
(4,'min_shelf_life_days','90','Mínimo vida útil restante para aceptar recepción (días)','2026-04-02 15:47:02'),
(5,'qa_on_receipt','1','Enviar stock a QA automáticamente al recibir','2026-04-02 15:47:02'),
(6,'auto_putaway','1','Generar tarea de putaway automáticamente al confirmar recepción','2026-04-02 15:47:02'),
(7,'sap_sync_interval','300','Intervalo de sincronización con SAP (segundos)','2026-04-02 15:47:02'),
(8,'sap_service_layer_url','https://sapserver:50000/b1s/v1','URL de SAP Service Layer','2026-04-02 15:47:02'),
(9,'printing.default_printer_ip','192.168.1.100','IP de la impresora Zebra por defecto','2026-04-11 10:05:54'),
(10,'printing.default_printer_port','9100','Puerto RAW de la impresora Zebra','2026-04-11 10:05:54'),
(11,'printing.label_width_mm','100','Ancho de etiqueta en mm (4 pulgadas)','2026-04-11 10:05:54'),
(12,'printing.label_height_mm','50','Alto de etiqueta en mm (2 pulgadas)','2026-04-11 10:05:54'),
(13,'printing.dpi','203','DPI de la impresora Zebra (203 o 300)','2026-04-11 10:05:54');

--
-- Table structure for table `temperature_alerts`
--

CREATE TABLE `temperature_alerts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `zone_id` int(10) unsigned NOT NULL,
  `reading_id` bigint(20) unsigned DEFAULT NULL,
  `alert_type` enum('HIGH_TEMP','LOW_TEMP','SENSOR_OFFLINE','HUMIDITY_HIGH') NOT NULL,
  `temperature` decimal(5,2) DEFAULT NULL,
  `threshold` decimal(5,2) DEFAULT NULL,
  `acknowledged` tinyint(1) DEFAULT 0,
  `acknowledged_by` int(10) unsigned DEFAULT NULL,
  `acknowledged_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `fk_ta_zone` (`zone_id`),
  KEY `idx_ta_ack` (`acknowledged`,`created_at`),
  CONSTRAINT `fk_ta_zone` FOREIGN KEY (`zone_id`) REFERENCES `temperature_zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Alertas de temperatura DINAVISA';

--
-- Dumping data for table `temperature_alerts`
--


--
-- Table structure for table `temperature_readings`
--

CREATE TABLE `temperature_readings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `zone_id` int(10) unsigned NOT NULL,
  `temperature` decimal(5,2) NOT NULL,
  `humidity` decimal(5,2) DEFAULT NULL,
  `reading_source` enum('MANUAL','SENSOR','API') DEFAULT 'MANUAL',
  `status` enum('NORMAL','WARNING','CRITICAL') NOT NULL,
  `recorded_by` int(10) unsigned DEFAULT NULL,
  `recorded_at` datetime NOT NULL DEFAULT current_timestamp(),
  `notes` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_tr_zone_date` (`zone_id`,`recorded_at`),
  CONSTRAINT `fk_tr_zone` FOREIGN KEY (`zone_id`) REFERENCES `temperature_zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lecturas de temperatura historicas';

--
-- Dumping data for table `temperature_readings`
--


--
-- Table structure for table `temperature_zones`
--

CREATE TABLE `temperature_zones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `zone_name` varchar(100) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `min_temp` decimal(5,2) NOT NULL COMMENT 'Temperatura minima permitida en Celsius',
  `max_temp` decimal(5,2) NOT NULL COMMENT 'Temperatura maxima permitida en Celsius',
  `current_temp` decimal(5,2) DEFAULT NULL,
  `sensor_id` varchar(50) DEFAULT NULL COMMENT 'ID del sensor IoT si existe',
  `last_reading_at` datetime DEFAULT NULL,
  `status` enum('NORMAL','WARNING','CRITICAL','OFFLINE') DEFAULT 'NORMAL',
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `fk_tz_wh` (`warehouse_id`),
  KEY `idx_tz_status` (`status`),
  CONSTRAINT `fk_tz_wh` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Zonas con control de temperatura';

--
-- Dumping data for table `temperature_zones`
--

INSERT INTO `temperature_zones` VALUES
(1,'Zona 1',16,2.00,8.00,NULL,'1',NULL,'NORMAL',1,'2026-04-17 20:58:20','2026-04-17 20:58:20');

--
-- Table structure for table `transfer_label_lines`
--

CREATE TABLE `transfer_label_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `batch_number` varchar(50) DEFAULT NULL,
  `from_bin_id` int(10) unsigned NOT NULL COMMENT 'Ubicacion origen',
  `to_bin_id` int(10) unsigned DEFAULT NULL COMMENT 'Ubicacion destino (asignado en descarga)',
  `quantity` decimal(15,4) NOT NULL COMMENT 'Cantidad solicitada',
  `loaded_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `unloaded_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `status` enum('PENDING','LOADED','IN_TRANSIT','UNLOADED') NOT NULL DEFAULT 'PENDING',
  `loaded_at` datetime DEFAULT NULL,
  `unloaded_at` datetime DEFAULT NULL,
  `loaded_by` int(10) unsigned DEFAULT NULL,
  `unloaded_by` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_tline_label` (`label_id`),
  KEY `idx_tline_item` (`item_id`),
  KEY `idx_tline_batch` (`batch_id`),
  KEY `idx_tline_from` (`from_bin_id`),
  KEY `idx_tline_to` (`to_bin_id`),
  KEY `idx_tline_status` (`status`),
  KEY `fk_tline_loader` (`loaded_by`),
  KEY `fk_tline_unloader` (`unloaded_by`),
  CONSTRAINT `fk_tline_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_tline_from_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_tline_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_tline_label` FOREIGN KEY (`label_id`) REFERENCES `transfer_labels` (`id`),
  CONSTRAINT `fk_tline_loader` FOREIGN KEY (`loaded_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_tline_to_bin` FOREIGN KEY (`to_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_tline_unloader` FOREIGN KEY (`unloaded_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Items cargados en etiqueta de transferencia con trazabilidad carga/descarga';

--
-- Dumping data for table `transfer_label_lines`
--


--
-- Table structure for table `transfer_labels`
--

CREATE TABLE `transfer_labels` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label_code` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `status` enum('EMPTY','OPEN','LOADING','IN_TRANSIT','UNLOADING','UNLOADED','COMPLETED','CANCELLED') NOT NULL DEFAULT 'EMPTY',
  `transit_bin_id` int(10) unsigned DEFAULT NULL COMMENT 'Bin virtual de transito asignado',
  `origin_description` text DEFAULT NULL COMMENT 'Descripcion del origen de la carga',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `completed_at` datetime DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `label_number` varchar(30) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `sap_doc_entry` int(11) DEFAULT NULL,
  `sap_doc_num` varchar(20) DEFAULT NULL,
  `synced_at` datetime DEFAULT NULL,
  `transit_at` datetime DEFAULT NULL,
  `completed_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_tlbl_code` (`label_code`),
  KEY `idx_tlbl_wh` (`warehouse_id`),
  KEY `idx_tlbl_status` (`status`),
  KEY `idx_tlbl_transit_bin` (`transit_bin_id`),
  KEY `fk_tlbl_creator` (`created_by`),
  CONSTRAINT `fk_tlbl_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_tlbl_transit_bin` FOREIGN KEY (`transit_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_tlbl_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Etiquetas de transferencia: ubicacion movil para carga/transito/descarga';

--
-- Dumping data for table `transfer_labels`
--

INSERT INTO `transfer_labels` VALUES
(1,'TL-00000001',16,'OPEN',NULL,NULL,'2026-05-14 21:30:16','2026-05-14 21:30:16',NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(2,'TL-00000002',16,'OPEN',NULL,NULL,'2026-05-25 20:21:49','2026-05-25 20:21:49',NULL,24,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `warehouse_tasks`
--

CREATE TABLE `warehouse_tasks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` int(10) unsigned NOT NULL,
  `task_type` enum('PUT','PUTAWAY','PICK','MOVE','COUNT','QA_CHECK','REPLENISH') NOT NULL,
  `priority` tinyint(3) unsigned NOT NULL DEFAULT 5 COMMENT '1=máxima, 10=mínima',
  `status` enum('PENDING','ASSIGNED','IN_PROGRESS','COMPLETED','CANCELLED','FAILED') NOT NULL DEFAULT 'PENDING',
  `item_id` int(10) unsigned NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `serial_number` varchar(100) DEFAULT NULL,
  `from_bin_id` int(10) unsigned DEFAULT NULL,
  `to_bin_id` int(10) unsigned DEFAULT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `confirmed_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `uom` varchar(20) NOT NULL DEFAULT 'UN',
  `assigned_to` int(10) unsigned DEFAULT NULL COMMENT 'Operador asignado',
  `reference_type` varchar(50) DEFAULT NULL,
  `reference_id` int(10) unsigned DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `putaway_strategy` varchar(20) DEFAULT NULL,
  `putaway_mode` enum('GROUPED','BY_PRODUCT','BY_LOCATION','FREE') DEFAULT NULL COMMENT 'Modo de almacenamiento: agrupado, por producto, por ubicacion, libre',
  `label_id` int(10) unsigned DEFAULT NULL COMMENT 'Referencia a etiqueta de transferencia para putaway agrupado',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_tasks_wh` (`warehouse_id`),
  KEY `idx_tasks_type` (`task_type`),
  KEY `idx_tasks_status` (`status`),
  KEY `idx_tasks_assigned` (`assigned_to`),
  KEY `idx_tasks_priority` (`priority`,`status`),
  KEY `idx_tasks_ref` (`reference_type`,`reference_id`),
  KEY `fk_tasks_item` (`item_id`),
  KEY `fk_tasks_batch` (`batch_id`),
  KEY `fk_tasks_from_bin` (`from_bin_id`),
  KEY `fk_tasks_to_bin` (`to_bin_id`),
  KEY `fk_tasks_creator` (`created_by`),
  KEY `idx_tasks_putaway_mode` (`putaway_mode`),
  KEY `idx_tasks_label` (`label_id`),
  CONSTRAINT `fk_tasks_assigned` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_tasks_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_tasks_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_tasks_from_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_tasks_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_tasks_label` FOREIGN KEY (`label_id`) REFERENCES `transfer_labels` (`id`),
  CONSTRAINT `fk_tasks_to_bin` FOREIGN KEY (`to_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_tasks_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Tareas de almacén: putaway, picking, movimiento, conteo';

--
-- Dumping data for table `warehouse_tasks`
--

INSERT INTO `warehouse_tasks` VALUES
(1,16,'PUTAWAY',2,'COMPLETED',820,1,NULL,2477,1014,25.0000,25.0000,'UN',17,'QA_PUTAWAY_HOLD',1,NULL,'2026-05-24 18:31:18','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación','FAMILY_RULE',NULL,NULL,'2026-05-13 21:01:58','2026-05-24 18:31:18',16),
(2,16,'PUTAWAY',2,'COMPLETED',3047,2,NULL,2477,103,100.0000,100.0000,'UN',17,'QA_PUTAWAY_HOLD',2,NULL,'2026-05-14 13:11:22','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000002]','BY_LPN','GROUPED',NULL,'2026-05-14 10:06:31','2026-05-14 13:11:22',16),
(3,16,'PUTAWAY',2,'COMPLETED',3026,9,NULL,2477,49,15.0000,15.0000,'UN',17,'QA_PUTAWAY_HOLD',3,NULL,'2026-05-14 13:10:17','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000004]','BY_LPN','GROUPED',NULL,'2026-05-14 10:23:51','2026-05-14 13:10:17',16),
(4,16,'PUTAWAY',2,'COMPLETED',3026,7,NULL,2477,109,15.0000,15.0000,'UN',17,'QA_PUTAWAY_HOLD',3,NULL,'2026-05-14 13:10:57','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000003]','BY_LPN','GROUPED',NULL,'2026-05-14 10:23:51','2026-05-14 13:10:57',16),
(5,16,'PUTAWAY',2,'COMPLETED',928,15,NULL,2477,439,85.0000,85.0000,'UN',17,'QA_PUTAWAY_HOLD',5,NULL,'2026-05-14 13:09:23','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000006]','BY_LPN','GROUPED',NULL,'2026-05-14 10:50:23','2026-05-14 13:09:23',16),
(6,16,'PUTAWAY',2,'COMPLETED',928,12,NULL,2477,442,15.0000,15.0000,'UN',17,'QA_PUTAWAY_HOLD',5,NULL,'2026-05-14 13:09:47','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000005]','BY_LPN','GROUPED',NULL,'2026-05-14 10:50:23','2026-05-14 13:09:47',16),
(7,16,'PUTAWAY',2,'COMPLETED',2900,17,NULL,2477,643,1.0000,1.0000,'KG',17,'QA_PUTAWAY_HOLD',4,NULL,'2026-05-14 11:15:36','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000007]','BY_LPN','GROUPED',NULL,'2026-05-14 11:09:32','2026-05-14 11:15:36',16),
(8,16,'PUTAWAY',2,'COMPLETED',1187,18,NULL,2477,1029,100.0000,100.0000,'UN',17,'QA_PUTAWAY_HOLD',6,NULL,'2026-05-14 13:41:35','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000008]','BY_LPN','GROUPED',NULL,'2026-05-14 13:40:45','2026-05-14 13:41:35',16),
(9,16,'PUTAWAY',2,'COMPLETED',59052,20,NULL,2477,1282,100.0000,100.0000,'UN',17,'QA_PUTAWAY_HOLD',7,NULL,'2026-05-14 18:24:50','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000009]','BY_LPN','GROUPED',NULL,'2026-05-14 18:23:20','2026-05-14 18:24:50',16),
(10,16,'PUTAWAY',2,'COMPLETED',460,21,NULL,2477,60,100.0000,100.0000,'UN',17,'QA_PUTAWAY_HOLD',8,NULL,'2026-05-14 19:00:15','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000010]','BY_LPN','GROUPED',NULL,'2026-05-14 18:36:57','2026-05-14 19:00:15',16),
(15,16,'PICK',2,'COMPLETED',3026,7,NULL,109,NULL,10.0000,10.0000,'UN',18,'PICK_LIST',1,NULL,'2026-05-15 11:53:26',NULL,NULL,NULL,NULL,'2026-05-15 11:51:37','2026-05-15 11:53:26',1),
(16,16,'PUTAWAY',2,'COMPLETED',460,27,NULL,2477,3,120.0000,120.0000,'UN',17,'QA_PUTAWAY_HOLD',16,NULL,'2026-05-16 15:06:52','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000026]','BY_LPN','GROUPED',NULL,'2026-05-16 15:04:52','2026-05-16 15:06:52',16),
(17,16,'PUTAWAY',2,'COMPLETED',3026,26,NULL,2477,46,120.0000,120.0000,'UN',17,'QA_PUTAWAY_HOLD',16,NULL,'2026-05-16 15:06:41','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000025]','BY_LPN','GROUPED',NULL,'2026-05-16 15:04:52','2026-05-16 15:06:41',16),
(18,16,'PUTAWAY',2,'COMPLETED',3026,28,NULL,2477,56,480.0000,480.0000,'UN',17,'QA_PUTAWAY_HOLD',16,NULL,'2026-05-16 15:07:03','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000027]','BY_LPN','GROUPED',NULL,'2026-05-16 15:04:52','2026-05-16 15:07:03',16),
(19,16,'PICK',2,'COMPLETED',3026,7,NULL,109,NULL,5.0000,5.0000,'UN',18,'PICK_LIST',2,NULL,'2026-05-16 15:17:06',NULL,NULL,NULL,NULL,'2026-05-16 15:14:05','2026-05-16 15:17:06',1),
(20,16,'PICK',2,'COMPLETED',3026,9,NULL,49,NULL,10.0000,10.0000,'UN',18,'PICK_LIST',2,NULL,'2026-05-16 15:20:49',NULL,NULL,NULL,NULL,'2026-05-16 15:14:05','2026-05-16 15:20:49',1),
(21,16,'PUTAWAY',2,'COMPLETED',2614,29,NULL,2477,29,100.0000,100.0000,'KG',17,'QA_PUTAWAY_HOLD',17,NULL,'2026-05-24 18:31:38','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación','FAMILY_RULE',NULL,NULL,'2026-05-20 09:20:25','2026-05-24 18:31:38',16),
(22,16,'PUTAWAY',2,'COMPLETED',2900,32,NULL,2477,38,50.0000,50.0000,'KG',17,'QA_PUTAWAY_HOLD',18,NULL,'2026-05-24 17:21:49','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000032]','BY_LPN','GROUPED',NULL,'2026-05-24 17:19:02','2026-05-24 17:21:49',16),
(23,16,'PUTAWAY',2,'COMPLETED',2900,30,NULL,2477,28,100.0000,100.0000,'KG',17,'QA_PUTAWAY_HOLD',18,NULL,'2026-05-24 18:31:30','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación','FAMILY_RULE',NULL,NULL,'2026-05-24 17:19:02','2026-05-24 18:31:30',16),
(24,16,'PUTAWAY',2,'COMPLETED',3047,33,NULL,2477,54,500.0000,500.0000,'UN',17,'QA_PUTAWAY_HOLD',19,NULL,'2026-05-24 17:55:14','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000033]','BY_LPN','GROUPED',NULL,'2026-05-24 17:54:23','2026-05-24 17:55:14',16),
(25,16,'PICK',2,'ASSIGNED',3047,33,NULL,54,NULL,150.0000,0.0000,'UN',18,'PICK_LIST',4,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-24 18:11:44','2026-05-24 18:25:40',1),
(26,16,'PICK',2,'COMPLETED',3047,33,NULL,54,NULL,150.0000,150.0000,'UN',18,'PICK_LIST',5,NULL,'2026-05-24 18:34:08',NULL,NULL,NULL,NULL,'2026-05-24 18:24:47','2026-05-24 18:34:08',1),
(28,16,'MOVE',3,'COMPLETED',2614,NULL,NULL,29,449,1.0000,100.0000,'LPN',17,'RELOCATION',2,NULL,'2026-05-24 19:36:34','Reubicación RL-00000002 — LPN LPN-00000030',NULL,NULL,NULL,'2026-05-24 19:30:57','2026-05-24 19:36:34',1),
(29,16,'MOVE',3,'CANCELLED',2900,NULL,NULL,28,908,1.0000,0.0000,'LPN',17,'RELOCATION',3,NULL,NULL,'Reubicación RL-00000003 — LPN LPN-00000031',NULL,NULL,NULL,'2026-05-24 19:38:05','2026-05-24 19:46:14',1),
(30,16,'MOVE',3,'CANCELLED',2900,NULL,NULL,28,449,1.0000,0.0000,'LPN',17,'RELOCATION',4,NULL,NULL,'Reubicación RL-00000004 — LPN LPN-00000031',NULL,NULL,NULL,'2026-05-24 19:46:35','2026-05-24 19:47:09',1),
(31,16,'MOVE',3,'COMPLETED',2900,NULL,NULL,28,338,1.0000,100.0000,'LPN',17,'RELOCATION',5,NULL,'2026-05-24 19:51:22','Reubicación RL-00000005 — LPN LPN-00000031',NULL,NULL,NULL,'2026-05-24 19:48:37','2026-05-24 19:51:22',1),
(32,16,'PUTAWAY',2,'ASSIGNED',769,34,NULL,2477,NULL,200.0000,0.0000,'UN',17,'QA_PUTAWAY_HOLD',20,NULL,NULL,'Putaway en cuarentena (auto agenda): stock con status QA hasta liberación',NULL,NULL,NULL,'2026-05-25 21:00:27','2026-05-25 21:00:27',16),
(33,16,'PUTAWAY',2,'COMPLETED',2900,35,NULL,2477,39,120.0000,120.0000,'KG',17,'QA_PUTAWAY_HOLD',21,NULL,'2026-05-26 00:06:59','Putaway en cuarentena (auto agenda): stock con status QA hasta liberación [Completada vía LPN LPN-00000036]','BY_LPN','GROUPED',NULL,'2026-05-26 00:04:41','2026-05-26 00:06:59',16);

--
-- Table structure for table `warehouse_zones`
--

CREATE TABLE `warehouse_zones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` int(10) unsigned NOT NULL,
  `code` varchar(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `zone_type` enum('RECEIVING','STORAGE','PICKING','SHIPPING','QA','STAGING','RETURNS','DAMAGE') NOT NULL DEFAULT 'STORAGE',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_auction` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Zona para productos de remate',
  `is_export` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Zona para productos de exportacion',
  `putaway_priority` int(11) NOT NULL DEFAULT 5 COMMENT 'Prioridad para sugerencia de putaway (1=preferida)',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_zone_code` (`warehouse_id`,`code`),
  KEY `idx_zone_auction` (`is_auction`),
  KEY `idx_zone_export` (`is_export`),
  KEY `idx_zone_putaway_pri` (`putaway_priority`),
  CONSTRAINT `fk_zones_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Zonas lógicas dentro de un almacén';

--
-- Dumping data for table `warehouse_zones`
--

INSERT INTO `warehouse_zones` VALUES
(20,16,'CEN-LIC','Licitaciones-Terceros-Exportación','STORAGE',1,0,0,5,'2026-05-06 19:30:07','2026-05-06 19:30:07'),
(21,16,'CEN-MP','Materia Prima','STORAGE',1,0,0,5,'2026-05-06 19:30:07','2026-05-06 19:30:07'),
(22,16,'CEN-IN','Insumos','STORAGE',1,0,0,5,'2026-05-06 19:30:07','2026-05-06 19:30:07'),
(23,16,'CEN-PT','Productos Terminados','STORAGE',1,0,0,5,'2026-05-06 19:30:07','2026-05-06 19:30:07'),
(25,16,'OPT','OPTICA','STORAGE',1,0,0,5,'2026-05-06 19:49:41','2026-05-06 19:49:41'),
(28,16,'CEN-MPP','Materia Prima - Pequeñas','STORAGE',1,0,0,5,'2026-05-12 20:11:49','2026-05-12 20:11:49'),
(31,16,'CEN-CO','Controlados','STORAGE',1,0,0,5,'2026-05-12 20:11:49','2026-05-12 20:11:49'),
(36,16,'PIC-COSM','PICKING COSMETICOS','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(37,16,'PIC-CTRL','PICKING CONTROLADOS','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(38,16,'PIC-DIS','PICKING DISP','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(39,16,'PIC-FITO','PICKING FITO','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(40,16,'PIC-MM','PICKING MUESTRAS','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(41,16,'PIC-RX','PICKING RX','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(42,16,'PIC-SUP','PICKING SUPLEMENTOS','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(43,16,'PK-OTC','PICKING OTC','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12'),
(44,16,'PK-OTX','PICKING OTX','PICKING',1,0,0,5,'2026-05-14 16:25:12','2026-05-14 16:25:12');

--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL COMMENT 'Código SAP del almacén',
  `name` varchar(100) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `sap_warehouse_code` varchar(20) DEFAULT NULL COMMENT 'WhsCode en SAP B1',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_physical` tinyint(1) NOT NULL DEFAULT 0,
  `physical_building` enum('GEN','PIC','EXT') DEFAULT NULL,
  `area_m2` decimal(10,2) DEFAULT NULL,
  `height_m` decimal(6,2) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_warehouses_code` (`code`),
  KEY `idx_warehouses_sap` (`sap_warehouse_code`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Almacenes/depósitos del sistema';

--
-- Dumping data for table `warehouses`
--

INSERT INTO `warehouses` VALUES
(3,'PE','PRODUCTOS EN PROCESO ENVASADO',NULL,'PE',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(4,'PI','PRODUCTOS EN PROCESO IMPRESIONES',NULL,'PI',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(8,'MT','MANTENIMIENTO',NULL,'MT',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(10,'PP','PRODUCTOS EN PROCESO',NULL,'PP',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(11,'PR','PRODUCTOS EN PROCESO MRA',NULL,'PR',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-04-02 20:37:22'),
(13,'PTC','PRODUCTOS TERMINADOS APROBADOS - COMFAR',NULL,'PTC',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(14,'RP','RECHAZADOS - PROCESO',NULL,'RP',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-05-13 13:47:05'),
(16,'CEN','CENTRAL',NULL,'CEN',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-04-02 20:37:22'),
(17,'MP','MATERIA PRIMA',NULL,'MP',1,0,NULL,NULL,NULL,'2026-04-02 20:37:22','2026-04-02 20:37:22');

--
-- Table structure for table `zone_pick_lines`
--

CREATE TABLE `zone_pick_lines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `zone_pick_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item_code` varchar(50) NOT NULL,
  `batch_id` int(10) unsigned DEFAULT NULL,
  `batch_number` varchar(50) DEFAULT NULL,
  `from_bin_id` int(10) unsigned NOT NULL COMMENT 'Ubicacion origen de donde se recoge',
  `requested_qty` decimal(15,4) NOT NULL,
  `collected_qty` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `returned_qty` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Cantidad devuelta por sobrante',
  `status` enum('PENDING','COLLECTED','DELIVERED','RETURNED','PARTIAL') NOT NULL DEFAULT 'PENDING',
  `collected_by` int(10) unsigned DEFAULT NULL COMMENT 'Operador que recogio',
  `collected_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `source_bin_id` int(10) unsigned DEFAULT NULL,
  `return_bin_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_zpln_pick` (`zone_pick_id`),
  KEY `idx_zpln_item` (`item_id`),
  KEY `idx_zpln_batch` (`batch_id`),
  KEY `idx_zpln_from` (`from_bin_id`),
  KEY `idx_zpln_status` (`status`),
  KEY `idx_zpln_collector` (`collected_by`),
  CONSTRAINT `fk_zpln_batch` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
  CONSTRAINT `fk_zpln_collector` FOREIGN KEY (`collected_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_zpln_from_bin` FOREIGN KEY (`from_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_zpln_item` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `fk_zpln_pick` FOREIGN KEY (`zone_pick_id`) REFERENCES `zone_picks` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Lineas de picking inter-zona con trazabilidad de recoleccion y devolucion';

--
-- Dumping data for table `zone_pick_lines`
--


--
-- Table structure for table `zone_picks`
--

CREATE TABLE `zone_picks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pick_number` varchar(30) NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `source_zone_id` int(10) unsigned DEFAULT NULL COMMENT 'Zona origen (almacen)',
  `destination_zone_id` int(10) unsigned DEFAULT NULL COMMENT 'Zona destino (ej: sala de pesadas)',
  `destination_bin_id` int(10) unsigned DEFAULT NULL COMMENT 'Bin especifico de la sala de pesadas',
  `pick_mode` enum('BY_ORDER_TYPE','BY_PREPARATION') NOT NULL DEFAULT 'BY_ORDER_TYPE' COMMENT 'Modo de carga: por tipo de pedido o por preparacion',
  `order_type_filter` varchar(50) DEFAULT NULL COMMENT 'Filtro de tipo de pedido (si pick_mode = BY_ORDER_TYPE)',
  `preparation_id` int(10) unsigned DEFAULT NULL COMMENT 'ID de preparacion vinculada (si pick_mode = BY_PREPARATION)',
  `status` enum('DRAFT','PLANNED','LOADING','LOADED','IN_PROGRESS','UNLOADING','DELIVERED','COMPLETED','CANCELLED') NOT NULL DEFAULT 'DRAFT',
  `notes` text DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `completed_at` datetime DEFAULT NULL,
  `completed_by` int(10) unsigned DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_zpck_number` (`pick_number`),
  KEY `idx_zpck_wh` (`warehouse_id`),
  KEY `idx_zpck_src_zone` (`source_zone_id`),
  KEY `idx_zpck_dst_zone` (`destination_zone_id`),
  KEY `idx_zpck_dst_bin` (`destination_bin_id`),
  KEY `idx_zpck_mode` (`pick_mode`),
  KEY `idx_zpck_status` (`status`),
  KEY `idx_zpck_prep` (`preparation_id`),
  KEY `fk_zpck_creator` (`created_by`),
  CONSTRAINT `fk_zpck_creator` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `fk_zpck_dst_bin` FOREIGN KEY (`destination_bin_id`) REFERENCES `bins` (`id`),
  CONSTRAINT `fk_zpck_dst_zone` FOREIGN KEY (`destination_zone_id`) REFERENCES `warehouse_zones` (`id`),
  CONSTRAINT `fk_zpck_src_zone` FOREIGN KEY (`source_zone_id`) REFERENCES `warehouse_zones` (`id`),
  CONSTRAINT `fk_zpck_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Tareas de picking inter-zona (ej: almacen a sala de pesadas)';

--
-- Dumping data for table `zone_picks`
--



