<?php if(false){ ?><style><?php } ?>
<?php function dialogo_product_css(){ ?>
#_dialogo_product .window_body{
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-evenly;
	align-items: stretch;
	align-content: stretch;
}
#_dialogo_product .window_body .column{
	width:49%;
	min-width: 300px;
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: stretch;
	align-content: stretch;
}
#_dialogo_product .window_body .column .input_image{
    width: 90%;
    max-width: 350px;
    min-height: 200px;
    margin: 5px auto;
    border: 1px solid #cccccc;
    border-radius: 10px;
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    cursor: pointer;
    font-weight: bold;
    background-color: #ffffff;
    -webkit-text-stroke-width: 0.2px;
    -webkit-text-stroke-color: #ffffff;
    -webkit-text-fill-color: #000000;
}
#_dialogo_product .window_body .column .row_image{
	width: 100%;
	height: 100px;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: space-between;
	align-items: center;
	align-content: center;
	border: 1px solid #cccccc;
}
#_dialogo_product .window_body .column .row_image ul{
	margin: 0px;
	padding: 0px;
	border: 0px;
	list-style: none;
	overflow: auto;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	align-content: center;
}
#_dialogo_product .window_body .column .row_image ul li{
	margin: 0px;
	padding: 0px;
	border: 0px;
	width: 100px;
	height: 100px;
    background-size: contain; 
    background-repeat: no-repeat; 
    background-position: center center;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: flex-end;
	align-content: flex-end;
	cursor: pointer;
}
#_dialogo_product .window_body .column .row_image ul li .btn_remove{
	width: 25px;
	height: 25px;
	max-width: 25px;
	max-height: 25px;
	min-width: 25px;
	min-height: 25px;
	background: black;
	border-radius: 50%;
	color: white;
	font-weight: bold;
	cursor: pointer;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	align-content: center;
}
#_dialogo_product .window_body .column .row_image div{
	width: 40px;
	min-width: 40px;
	height: 100%;
	border-left: 1px solid #cccccc;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	align-content: center;
}
#_dialogo_product .window_body .column .row_image div svg{
	width: 30px;
	height: 30px;
	cursor: pointer;
}
@media (max-width: 780px) {
#_dialogo_product .window_body .column{
	width: 95%;
}
}
<?php } ?>
<?php if(false){ ?></style><?php } ?>
<?php function dialogo_product_almacen_html(){ ?>
	<div class="background_window" id="_dialogo_producto_unidad" style="z-index:300;">
		<div class="window" style="max-width:75%;max-height:75%;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Ingresar Producto y Cantidad</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<br />
				<div class="buscador_input">
					<input type="text" placeholder="producto" />
					<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M11 6C13.7614 6 16 8.23858 16 11M16.6588 16.6549L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke="#1C274C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>
				</div>
				<div class="buscador_input cantidad_input">
					<input type="number" placeholder="Cantidad a ingresar" />
				</div>
				<div class="buscador_input precio_input">
					<input type="number" placeholder="Precio de venta" />
				</div>
				<br />
				<div class="table_view">
					<table style="width:100%;">
						<thead>
							<tr>
								<th class="v_column_1" width="40px">Nº</th>
								<th class="v_column_2" width="100px">Imagen</th>
								<th class="v_column_3" width="100px">Código</th>
								<th class="v_column_4">Articulo</th>
								<th class="v_column_5" width="100px">Fabricante</th>
								<th class="v_column_6" width="100px">Modelo</th>
								<th class="v_column_7" width="100px">Serie</th>
								<th class="v_column_8" width="70px">Stock minimo</th>
								<th class="v_column_9" width="100px">Estado</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Registrar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
<?php } ?>
<?php function dialogo_product_html(){ ?>
	<div class="background_window" id="_dialogo_producto_unidad" style="z-index:300;">
		<div class="window" style="max-width:75%;max-height:75%;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Seleccionar Producto Unitario</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<br />
				<div class="buscador_input">
					<input type="text" placeholder="producto" />
					<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M11 6C13.7614 6 16 8.23858 16 11M16.6588 16.6549L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke="#1C274C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>
				</div>
				<br />
				<div class="table_view">
					<table style="width:100%;">
						<thead>
							<tr>
								<th class="v_column_1" width="40px">Nº</th>
								<th class="v_column_2" width="100px">Imagen</th>
								<th class="v_column_3" width="100px">Código</th>
								<th class="v_column_4">Articulo</th>
								<th class="v_column_5" width="100px">Fabricante</th>
								<th class="v_column_6" width="100px">Modelo</th>
								<th class="v_column_7" width="100px">Serie</th>
								<th class="v_column_8" width="70px">Stock minimo</th>
								<th class="v_column_9" width="100px">Estado</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
			<div class="window_buttons">
				<button class="btn_void buttons_active"><span>Ninguno</span></button>
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Seleccionar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
	<div class="background_window" id="_dialogo_categoria" style="z-index:200;">
		<div class="window" style="max-width:400px;max-height: 150px;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Registrar nueva categoria</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<div style="width:auto;padding: 0px 10px;">
					<input type="hidden" id="txt_cat_codigo" name="txt_cat_codigo" value="0" />
					<div class="input_text"><span>Código</span><input type="text" id="txt_cat_codigo_reg" name="txt_cat_codigo_reg" /></div>
					<div class="input_text"><span>Nombre</span><input type="text" id="txt_cat_nombre" name="txt_cat_nombre" /></div>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Aceptar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
	<div class="background_window" id="_dialogo_medidas" style="z-index:200;">
		<div class="window" style="max-width:400px;max-height: 150px;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Registrar nueva medida</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<div style="width:auto;padding: 0px 10px;">
					<input type="hidden" id="txt_unid_codigo" name="txt_unid_codigo" value="0" />
					<div class="input_text"><span>Nombre</span><input type="text" id="txt_unid_nombre" name="txt_unid_nombre" /></div>
					<div class="input_text"><span>Simbolo</span><input type="text" id="txt_unid_simbolo" name="txt_unid_simbolo" /></div>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Aceptar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
	<div class="background_window" id="_dialogo_proveedor" style="z-index:200;">
		<div class="window" style="max-width:400px;max-height: 200px;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Registrar nuevo proveedor</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<div style="width:auto;padding: 0px 10px;">
					<input type="hidden" id="txt_prov_codigo" name="txt_prov_codigo" value="0" />
					<div class="input_text"><span>Nombre</span><input type="text" id="txt_prov_nombre" name="txt_prov_nombre" /></div>
					<div class="input_select"><span>Tipo de documento</span><select type="text" id="txt_prov_tipo_documento" name="txt_prov_tipo_documento" ><option>Sin Número</option><option>DNI</option><option>RUC</option></select></div>
					<div class="input_text"><span>Número de documento</span><input type="text" id="txt_prov_numero_documento" name="txt_prov_numero_documento" /></div>
					<div class="input_text"><span>Domicilio</span><input type="text" id="txt_prov_direccion" name="txt_prov_direccion" /></div>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Aceptar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
	<div class="background_window" id="_dialogo_responsable" style="z-index:200;">
		<div class="window" style="max-width:400px;max-height: 200px;">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Registrar nuevo responsable</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<div style="width:auto;padding: 0px 10px;">
					<input type="hidden" id="txt_res_codigo" name="txt_res_codigo" value="0" />
					<div class="input_text"><span>Nombre</span><input type="text" id="txt_res_nombre" name="txt_res_nombre" /></div>
					<div class="input_select"><span>Tipo de documento</span><select type="text" id="txt_res_tipo_documento" name="txt_res_tipo_documento" ><option>Sin Número</option><option>DNI</option><option>RUC</option></select></div>
					<div class="input_text"><span>Número de documento</span><input type="text" id="txt_res_numero_documento" name="txt_res_numero_documento" /></div>
					<div class="input_text"><span>Domicilio</span><input type="text" id="txt_res_direccion" name="txt_res_direccion" /></div>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Aceptar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
	<div class="background_window" id="_dialogo_product" style="z-index:100;">
		<div class="window">
			<div class="window_title">
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21.9844 10C21.9473 8.68893 21.8226 7.85305 21.4026 7.13974C20.8052 6.12523 19.7294 5.56066 17.5777 4.43152L15.5777 3.38197C13.8221 2.46066 12.9443 2 12 2C11.0557 2 10.1779 2.46066 8.42229 3.38197L6.42229 4.43152C4.27063 5.56066 3.19479 6.12523 2.5974 7.13974C2 8.15425 2 9.41667 2 11.9415V12.0585C2 14.5833 2 15.8458 2.5974 16.8603C3.19479 17.8748 4.27063 18.4393 6.42229 19.5685L8.42229 20.618C10.1779 21.5393 11.0557 22 12 22C12.9443 22 13.8221 21.5393 15.5777 20.618L17.5777 19.5685C19.7294 18.4393 20.8052 17.8748 21.4026 16.8603C21.8226 16.1469 21.9473 15.3111 21.9844 14" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> <path d="M21 7.5L17 9.5M12 12L3 7.5M12 12V21.5M12 12C12 12 14.7426 10.6287 16.5 9.75C16.6953 9.65237 17 9.5 17 9.5M17 9.5V13M17 9.5L7.5 4.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
				<div>Registrar nuevo producto</div>
				<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="btn_close">
					<path d="M10.0303 8.96967C9.73741 8.67678 9.26253 8.67678 8.96964 8.96967C8.67675 9.26256 8.67675 9.73744 8.96964 10.0303L10.9393 12L8.96966 13.9697C8.67677 14.2626 8.67677 14.7374 8.96966 15.0303C9.26255 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9696 15.0303C14.2625 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2625 15.0303 13.9697L13.0606 12L15.0303 10.0303C15.3232 9.73746 15.3232 9.26258 15.0303 8.96969C14.7374 8.6768 14.2625 8.6768 13.9696 8.96969L12 10.9394L10.0303 8.96967Z" fill="#ff0000"></path> 
					<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0574 1.25H11.9426C9.63424 1.24999 7.82519 1.24998 6.41371 1.43975C4.96897 1.63399 3.82895 2.03933 2.93414 2.93414C2.03933 3.82895 1.63399 4.96897 1.43975 6.41371C1.24998 7.82519 1.24999 9.63422 1.25 11.9426V12.0574C1.24999 14.3658 1.24998 16.1748 1.43975 17.5863C1.63399 19.031 2.03933 20.1711 2.93414 21.0659C3.82895 21.9607 4.96897 22.366 6.41371 22.5603C7.82519 22.75 9.63423 22.75 11.9426 22.75H12.0574C14.3658 22.75 16.1748 22.75 17.5863 22.5603C19.031 22.366 20.1711 21.9607 21.0659 21.0659C21.9607 20.1711 22.366 19.031 22.5603 17.5863C22.75 16.1748 22.75 14.3658 22.75 12.0574V11.9426C22.75 9.63423 22.75 7.82519 22.5603 6.41371C22.366 4.96897 21.9607 3.82895 21.0659 2.93414C20.1711 2.03933 19.031 1.63399 17.5863 1.43975C16.1748 1.24998 14.3658 1.24999 12.0574 1.25ZM3.9948 3.9948C4.56445 3.42514 5.33517 3.09825 6.61358 2.92637C7.91356 2.75159 9.62177 2.75 12 2.75C14.3782 2.75 16.0864 2.75159 17.3864 2.92637C18.6648 3.09825 19.4355 3.42514 20.0052 3.9948C20.5749 4.56445 20.9018 5.33517 21.0736 6.61358C21.2484 7.91356 21.25 9.62177 21.25 12C21.25 14.3782 21.2484 16.0864 21.0736 17.3864C20.9018 18.6648 20.5749 19.4355 20.0052 20.0052C19.4355 20.5749 18.6648 20.9018 17.3864 21.0736C16.0864 21.2484 14.3782 21.25 12 21.25C9.62177 21.25 7.91356 21.2484 6.61358 21.0736C5.33517 20.9018 4.56445 20.5749 3.9948 20.0052C3.42514 19.4355 3.09825 18.6648 2.92637 17.3864C2.75159 16.0864 2.75 14.3782 2.75 12C2.75 9.62177 2.75159 7.91356 2.92637 6.61358C3.09825 5.33517 3.42514 4.56445 3.9948 3.9948Z" fill="#ff0000"></path>
				</svg>
			</div>
			<div class="window_body">
				<div class="column" style="justify-content: center;">
					<div class="input_image" id="btn_agregar_imagen">Seleccionar imagen</div>
				</div>
				<div class="column">
					<input type="hidden" id="txt_prod_codigo" name="txt_prod_codigo" value="0" />
					<input type="hidden" id="txt_prod_imagenes" name="txt_prod_imagenes" value="" />
					<div class="input_text"><span>Nombre del producto (*)</span><input type="text" id="txt_prod_nombre" name="txt_prod_nombre" /></div>
					<div class="input_text"><span>Nombre alternativo</span><input type="text" id="txt_prod_nombre_alternativo" name="txt_prod_nombre_alternativo" /></div>
					<div class="input_text"><span>Código del producto</span><input type="text" id="txt_prod_cod_codigo" name="txt_prod_cod_codigo" /></div>
					<div class="input_text"><span>Código de barras</span><input type="text" id="txt_prod_cod_barras" name="txt_prod_cod_barras" /></div>
					<div class="input_text" style="display:none;"><span>Código de almacén</span><input type="text" id="txt_prod_cod_almacen" name="txt_prod_cod_almacen" /></div>
					<div class="input_select" style="display:none;"><span>Categoria</span><select id="txt_prod_categoria" name="txt_prod_categoria"><option value="0">* Nueva Categoria *</option></select></div>
					<div class="input_text"><span>Fabricante</span><input type="text" id="txt_prod_fabricante" name="txt_prod_fabricante" /></div>
					<div class="input_text"><span>Modelo</span><input type="text" id="txt_prod_modelo" name="txt_prod_modelo" /></div>
					<div class="input_text"><span>Serie</span><input type="text" id="txt_prod_serie" name="txt_prod_serie" /></div>
					<div class="input_text" style="display:none;"><span>Peso en Kilogramos (Kg)</span><input type="number" min="0" step="0.1" id="txt_prod_peso" name="txt_prod_peso" style="text-align:right;" /></div>
					<div class="input_select" style="display:none;"><span>Unidad de medida</span><select id="txt_prod_unidad_medida" name="txt_prod_unidad_medida"><option value="0">* Nueva Unidad de Medida *</option></select></div>
					<br />
					<div class="input_text"><span>Stock minimo (*)</span><input type="number" step="1" min="1" id="txt_prod_stock_minimo" name="txt_prod_stock_minimo" style="text-align:right;" /></div>
					<div class="input_select"><span>Estado (*)</span><select id="txt_prod_estado" name="txt_prod_estado"><option value="Activo">Activo</option><option value="Inactivo">Inactivo</option></select></div>
					<br />
					<input type="hidden" id="txt_prod_unitario_id" name="txt_prod_unitario_id" value="" />
					<div class="input_text"><span>Producto unitario</span><button class="btn_vincular_unidades" style="flex:1;">No vender por unidad</button></div>
					<div class="input_text"><span>Fracciones</span><input type="number" value="1" min="1" step="1" id="txt_prod_fracciones" name="txt_prod_fracciones" style="text-align:right;" /></div>
				</div>
			</div>
			<div class="window_buttons">
				<span style="flex:1;"></span>
				<button class="btn_accept buttons_active"><span>Aceptar</span></button>&nbsp;
				<button class="btn_close buttons_active"><span>Cancelar</span></button>
			</div>
		</div>
	</div>
<?php } ?>
<?php if(false){ ?><script><?php } ?>
<?php function dialogo_product_almacen_javascript(){ ?>
var _dialog_product_options = {
	codigo: 0,
	buscar: "",
	func_accept: function(){},
	func_cancel: function(){},
	autocompete_fabricante: [],
	autocompete_modelo: [],
	autocompete_serie: [],
}
function load_dialog_product_unidad(){
	let valor = $("#_dialogo_producto_unidad .buscador_input input").val();
    $.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_producto.php",
		data: {
			accion: "lista",
			buscar: valor,
			items_pagina: 0,
			items_cantidad: 0,
			orden: "ASC"
		},
		success: function (datos) {
			//console.log(datos);
			$("#_dialogo_producto_unidad .table_view .row_data").remove();
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					let childs = $("#_dialogo_producto_unidad .table_view .row_data table");
					let imagenes = row.imagen.split(",");
					let html = '';
					html += '<tr class="row_data" data-producto="'+row.producto_id+'" >';
					html += '<td align="center" class="v_column_1 td_numero"><span>'+(childs.length+1)+'</span><input type="checkbox" style="display:none;" /></td>';
					if (imagenes[0].length <= 0){
						html += '<td class="v_column_2 td_imagen_producto" align="center" data-img=""><img data-img="" src="libreria/imagenes/sin_imagen.png" height="50"></td>';
					} else {
						html += '<td class="v_column_2 td_imagen_producto" align="center" data-img="'+imagenes[0]+'"><img data-img="'+imagenes[0]+'" src="libreria/imagenes/productos/'+imagenes[0]+'" height="50"></td>';
					}
					html += '<td class="v_column_3" align="left">'+row.codigo+'</td>';
					html += '<td class="v_column_4" align="left">'+row.nombre+'</td>';
					html += '<td class="v_column_5" align="left">'+row.fabricante+'</td>';
					html += '<td class="v_column_6" align="left">'+row.modelo+'</td>';
					html += '<td class="v_column_7" align="left">'+row.serie+'</td>';
					html += '<td class="v_column_8 td_stock_minimo" align="right" width="70"><div class="dv_input_disabled">ud. '+row.stock_minimo+'</div></td>';
					html += '<td class="v_column_9" align="left">'+row.estado+'</td>';
					html += '</tr> \
					';
					$("#_dialogo_producto_unidad .table_view table").append(html);
				}
				//vista_columnas_ventas();
			}
		},
		error: function (){
			$("#_dialogo_producto_unidad .table_view .row_data").remove();
		}
	});
}
function open_dialog_product_almacen(func_accept, func_cancel){
	let max_height = $("#_dialogo_producto_unidad .window").innerHeight();
	let title_height = $("#_dialogo_producto_unidad .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_producto_unidad .window .window_buttons").outerHeight();
	$("#_dialogo_producto_unidad .window .window_body").height(max_height-(title_height+buttons_height));
	$("#_dialogo_producto_unidad .table_view .row_data").remove();
	$("#_dialogo_producto_unidad input[type='text']").val("");
	$("#_dialogo_producto_unidad input[type='number']").val("");
	_dialog_product_options.buscar = "";
	_dialog_product_options.codigo = 0;
	_dialog_product_options.func_accept = func_accept;
	_dialog_product_options.func_cancel = func_cancel;
	$("#_dialogo_producto_unidad").css("display", "flex");
}
<?php } ?>
<?php function dialogo_product_javascript(){ ?>
var _dialog_categoria_options = {
	codigo: 0,
	func_accept: function(){},
	func_cancel: function(){},
}
var _dialog_medidas_options = {
	codigo: 0,
	func_accept: function(){},
	func_cancel: function(){},
}
var _dialog_proveedor_options = {
	codigo: 0,
	func_accept: function(){},
	func_cancel: function(){},
}
var _dialog_responsable_options = {
	codigo: 0,
	func_accept: function(){},
	func_cancel: function(){},
}
var _dialog_product_options = {
	codigo: 0,
	buscar: "",
	func_accept: function(){},
	func_cancel: function(){},
	autocompete_fabricante: [],
	autocompete_modelo: [],
	autocompete_serie: [],
}
function load_dialog_categoria(){
	$.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_categoria.php",
		data: {
			accion: "lista",
			buscar: "",
		},
		success: function (datos) {
			//console.log(datos);
			$("#txt_prod_categoria").html("<option value='0'>* Nueva Categoria *</option>");
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					$("#txt_prod_categoria").append("<option value='"+row.categoria_id+"'>"+row.codigo+" | "+row.nombre+"</option>");
				}
			}
			$("#txt_prod_categoria").val("");
		},
		error: function (){
			$("#txt_prod_categoria").html("<option value='0'>* Nueva Categoria *</option>");
			$("#txt_prod_categoria").val("");
		}
	});
}
function open_dialog_categoria(func_accept, func_cancel){
	let max_height = $("#_dialogo_categoria .window").innerHeight();
	let title_height = $("#_dialogo_categoria .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_categoria .window .window_buttons").outerHeight();
	$("#_dialogo_categoria .window .window_body").height(max_height-(title_height+buttons_height));
	_dialog_categoria_options.func_accept = func_accept;
	_dialog_categoria_options.func_cancel = func_cancel;
	clear_dialog_categoria();
	$("#_dialogo_categoria").css("display", "flex");
}
function clear_dialog_categoria(){
	$("#txt_cat_codigo").val("0");
	$("#txt_cat_codigo_reg").val("");
	$("#txt_cat_nombre").val("");
}
function load_dialog_medidas(){
	$.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_unidad_medida.php",
		data: {
			accion: "lista",
			buscar: "",
		},
		success: function (datos) {
			//console.log(datos);
			$("#txt_prod_unidad_medida").html("<option value='0'>* Nueva Unidad de Medida *</option>");
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					$("#txt_prod_unidad_medida").append("<option value='"+row.unidad_medida_id+"'>"+row.simbolo+" | "+row.nombre+"</option>");
				}
			}
			$("#txt_prod_unidad_medida").val("");
		},
		error: function (){
			$("#txt_prod_unidad_medida").html("<option value='0'>* Nueva Unidad de Medida *</option>");
			$("#txt_prod_unidad_medida").val("");
		}
	});
}
function open_dialog_medidas(func_accept, func_cancel){
	let max_height = $("#_dialogo_medidas .window").innerHeight();
	let title_height = $("#_dialogo_medidas .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_medidas .window .window_buttons").outerHeight();
	$("#_dialogo_medidas .window .window_body").height(max_height-(title_height+buttons_height));
	_dialog_medidas_options.func_accept = func_accept;
	_dialog_medidas_options.func_cancel = func_cancel;
	clear_dialog_medidas();
	$("#_dialogo_medidas").css("display", "flex");
}
function clear_dialog_medidas(){
	$("#txt_unid_codigo").val("0");
	$("#txt_unid_nombre").val("");
	$("#txt_unid_simbolo").val("");
}

function open_dialog_proveedor(func_accept, func_cancel){
	let max_height = $("#_dialogo_proveedor .window").innerHeight();
	let title_height = $("#_dialogo_proveedor .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_proveedor .window .window_buttons").outerHeight();
	$("#_dialogo_proveedor .window .window_body").height(max_height-(title_height+buttons_height));
	_dialog_proveedor_options.func_accept = func_accept;
	_dialog_proveedor_options.func_cancel = func_cancel;
	clear_dialog_proveedor();
	$("#_dialogo_proveedor").css("display", "flex");
}
function clear_dialog_proveedor(){
	$("#txt_prov_codigo").val("0");
	$("#txt_prov_nombre").val("");
	$("#txt_prov_tipo_documento").val("");
	$("#txt_prov_numero_documento").val("");
	$("#txt_prov_direccion").val("");
}

function open_dialog_responsable(func_accept, func_cancel){
	let max_height = $("#_dialogo_responsable .window").innerHeight();
	let title_height = $("#_dialogo_responsable .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_responsable .window .window_buttons").outerHeight();
	$("#_dialogo_responsable .window .window_body").height(max_height-(title_height+buttons_height));
	_dialog_responsable_options.func_accept = func_accept;
	_dialog_responsable_options.func_cancel = func_cancel;
	clear_dialog_responsable();
	$("#_dialogo_responsable").css("display", "flex");
}
function clear_dialog_responsable(){
	$("#txt_res_codigo").val("0");
	$("#txt_res_nombre").val("");
	$("#txt_res_tipo_documento").val("");
	$("#txt_res_numero_documento").val("");
	$("#txt_res_direccion").val("");
}

function load_dialog_product_unidad(){
	let valor = $("#_dialogo_producto_unidad .buscador_input input").val();
    $.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_producto.php",
		data: {
			accion: "lista",
			buscar: valor,
			items_pagina: 0,
			items_cantidad: 0,
			orden: "ASC"
		},
		success: function (datos) {
			//console.log(datos);
			$("#_dialogo_producto_unidad .table_view .row_data").remove();
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					let childs = $("#_dialogo_producto_unidad .table_view .row_data table");
					let imagenes = row.imagen.split(",");
					let html = '';
					html += '<tr class="row_data" data-producto="'+row.producto_id+'" >';
					html += '<td align="center" class="v_column_1 td_numero"><span>'+(childs.length+1)+'</span><input type="checkbox" style="display:none;" /></td>';
					if (imagenes[0].length <= 0){
						html += '<td class="v_column_2 td_imagen_producto" align="center" data-img=""><img data-img="" src="libreria/imagenes/sin_imagen.png" height="50"></td>';
					} else {
						html += '<td class="v_column_2 td_imagen_producto" align="center" data-img="'+imagenes[0]+'"><img data-img="'+imagenes[0]+'" src="libreria/imagenes/productos/'+imagenes[0]+'" height="50"></td>';
					}
					html += '<td class="v_column_3" align="left">'+row.codigo+'</td>';
					html += '<td class="v_column_4" align="left">'+row.nombre+'</td>';
					html += '<td class="v_column_5" align="left">'+row.fabricante+'</td>';
					html += '<td class="v_column_6" align="left">'+row.modelo+'</td>';
					html += '<td class="v_column_7" align="left">'+row.serie+'</td>';
					html += '<td class="v_column_8 td_stock_minimo" align="right" width="70"><div class="dv_input_disabled">ud. '+row.stock_minimo+'</div></td>';
					html += '<td class="v_column_9" align="left">'+row.estado+'</td>';
					html += '</tr> \
					';
					$("#_dialogo_producto_unidad .table_view table").append(html);
				}
				//vista_columnas_ventas();
			}
		},
		error: function (){
			$("#_dialogo_producto_unidad .table_view .row_data").remove();
		}
	});
}
function clear_dialog_product(){
	$("#txt_prod_nombre").val("");
	$("#txt_prod_nombre_alternativo").val("");
	$("#txt_prod_cod_codigo").val("");
	$("#txt_prod_cod_barras").val("");
	$("#txt_prod_cod_almacen").val("");
	$("#txt_prod_categoria").prev().val("");
	$("#txt_prod_categoria").val("");
	$("#txt_prod_fabricante").prev().val("");
	$("#txt_prod_fabricante").val("");
	$("#txt_prod_modelo").prev().val("");
	$("#txt_prod_modelo").val("");
	$("#txt_prod_serie").val("");
	$("#txt_prod_unidad_medida").prev().val("");
	$("#txt_prod_unidad_medida").val("");
	$("#txt_prod_peso").val("");
	$("#txt_prod_stock_minimo").val("");
	$("#txt_prod_unitario_id").val("");
	$("#txt_prod_fracciones").val("");
	$("#_dialogo_product .input_image").css("background-image", "none");
	$("#_dialogo_product .row_image ul").html("");
}
function open_dialog_product(func_accept, func_cancel){
	let max_height = $("#_dialogo_product .window").innerHeight();
	let title_height = $("#_dialogo_product .window .window_title").outerHeight();
	let buttons_height = $("#_dialogo_product .window .window_buttons").outerHeight();
	$("#_dialogo_product .window .window_body").height(max_height-(title_height+buttons_height));
	_dialog_product_options.func_accept = func_accept;
	_dialog_product_options.func_cancel = func_cancel;
	clear_dialog_product();
	$("#_dialogo_product").css("display", "flex");
}
<?php } ?>
<?php function dialogo_product_almacen_ready(){ ?>
    $("#_dialogo_producto_unidad .buscador_input").on("input[type='text']", function(event) {
		if (event.originalEvent.inputType === 'insertLineBreak') { // Comprueba si se ha ingresado un "retorno de carro" (Enter)
			let valor = $(this).val();
			//ctrl_datos.buscar = valor;
			load_dialog_product_unidad();
		}
	});$("#_dialogo_producto_unidad .buscador_input input[type='text']").on("keydown", function(event) {
		if (event.keyCode === 13) {
			let valor = $(this).val();
			//ctrl_datos.buscar = valor;
			load_dialog_product_unidad();
			event.preventDefault();
		}
	});
	$("#_dialogo_producto_unidad .buscador_input input[type='text']").next().click(function(){
		if ($("#_dialogo_producto_unidad .buscador_input input[type='text']").prop("disabled")){
			return;
		}
		let valor = $("#_dialogo_producto_unidad .buscador_input input[type='text']").val();
		//ctrl_datos.buscar = valor;
		load_dialog_product_unidad();
	});
	$("#_dialogo_producto_unidad .table_view").on("click", ".row_data", function(){
		$("#_dialogo_producto_unidad .table_view .row_select").removeClass("row_select");
		$(this).addClass("row_select");
	});
	$("#_dialogo_producto_unidad .btn_close").click(function (){
		$("#_dialogo_producto_unidad").css("display", "none");
	});
	$("#_dialogo_producto_unidad .btn_accept").click(function (){
		let filas = $("#_dialogo_producto_unidad .table_view .row_select");
		if (filas.length == 1){
			let producto_indice = $("#_dialogo_producto_unidad .table_view .row_select").attr("data-producto");
			let producto_nombre = $("#_dialogo_producto_unidad .table_view .row_select").find(".v_column_4").html();
			if (_dialog_product_options.func_accept != null){
				let cantidad = $("#_dialogo_producto_unidad .cantidad_input input[type='number']").val();
				let precio = $("#_dialogo_producto_unidad .precio_input input[type='number']").val();
				if (cantidad.length == 0){cantidad = 0;}
				if (precio.length == 0){precio = 0;}
				_dialog_product_options.func_accept(producto_indice, producto_nombre, cantidad, precio);
				$("#_dialogo_producto_unidad").css("display", "none");
			}
		} else {
			open_dialog_alert("Debe de seleccionar el producto");
		}
	});
<?php } ?>
<?php function dialogo_product_ready(){ ?>
	$("#_dialogo_product .btn_accept").click(function (){
		let txt_prod_codigo = $("#txt_prod_codigo").val();
		let txt_prod_nombre = $("#txt_prod_nombre").val().trim();
		let txt_prod_nombre_alternativo = $("#txt_prod_nombre_alternativo").val().trim();
		let txt_prod_cod_codigo = $("#txt_prod_cod_codigo").val().trim();
		let txt_prod_cod_barras = $("#txt_prod_cod_barras").val().trim();
		let txt_prod_cod_almacen = $("#txt_prod_cod_almacen").val().trim();
		let txt_prod_categoria = $("#txt_prod_categoria").val();
		let txt_prod_fabricante = $("#txt_prod_fabricante").val().trim();
		let txt_prod_modelo = $("#txt_prod_modelo").val().trim();
		let txt_prod_serie = $("#txt_prod_serie").val().trim();
		let txt_prod_unidad_medida = $("#txt_prod_unidad_medida").val();
		let txt_prod_peso = $("#txt_prod_peso").val().trim();
		let txt_prod_stock_minimo = $("#txt_prod_stock_minimo").val().trim();
		let txt_prod_unitario_id = $("#txt_prod_unitario_id").val();
		let txt_prod_fracciones = $("#txt_prod_fracciones").val();
		let txt_prod_imagenes = $("#txt_prod_imagenes").val().trim();
		let txt_prod_estado = $("#txt_prod_estado").val();
		if (txt_prod_peso == null || txt_prod_peso == undefined || txt_prod_peso.length <= 0){
			txt_prod_peso = "0";
		}
		if (txt_prod_stock_minimo == null || txt_prod_stock_minimo == undefined || txt_prod_stock_minimo.length <= 0){
			txt_prod_stock_minimo = 0;
		}
		if (txt_prod_unitario_id == null || txt_prod_unitario_id == undefined || txt_prod_unitario_id.length <= 0){
			txt_prod_unitario_id = 0;
		}
		if (txt_prod_fracciones == null || txt_prod_fracciones == undefined || txt_prod_fracciones.length <= 0){
			txt_prod_fracciones = 1;
		}
		if (txt_prod_categoria == null || txt_prod_categoria == undefined || txt_prod_categoria.length <= 0){
			txt_prod_categoria = "0";
		} else {
			txt_prod_categoria = txt_prod_categoria.trim();
		}
		if (txt_prod_unidad_medida == null || txt_prod_unidad_medida == undefined || txt_prod_unidad_medida.length <= 0){
			txt_prod_unidad_medida = "0";
		} else {
			txt_prod_unidad_medida = txt_prod_unidad_medida.trim();
		}
		let txt_prod_unitario_nombre = "";
		if (txt_prod_unitario_id > 0){
			txt_prod_unitario_nombre = $("#_dialogo_product .btn_vincular_unidades").html();
		}
		if (txt_prod_nombre.length <= 0){
			open_dialog_alert("Debe de ingresar el nombre del producto");
		} else if (txt_prod_stock_minimo <= 0){
			open_dialog_alert("Debe de ingresar el stock minimo del producto");
		} else {
			$.ajax({
				type: 'POST',
				dataType: "json",
				url: "control/ctrl_producto.php",
				data: {
					accion: "registrar",
					txt_codigo: txt_prod_codigo,
					txt_prod_nombre: txt_prod_nombre,
					txt_prod_nombre_alternativo: txt_prod_nombre_alternativo,
					txt_prod_cod_codigo: txt_prod_cod_codigo,
					txt_prod_cod_barras: txt_prod_cod_barras,
					txt_prod_cod_almacen: txt_prod_cod_almacen,
					txt_prod_categoria: txt_prod_categoria,
					txt_prod_fabricante: txt_prod_fabricante,
					txt_prod_modelo: txt_prod_modelo,
					txt_prod_serie: txt_prod_serie,
					txt_prod_unidad_medida: txt_prod_unidad_medida,
					txt_prod_peso: txt_prod_peso,
					txt_prod_stock_minimo: txt_prod_stock_minimo,
					txt_prod_unitario_id: txt_prod_unitario_id,
					txt_prod_fracciones: txt_prod_fracciones,
					txt_prod_estado: txt_prod_estado,
					txt_prod_imagenes: txt_prod_imagenes,
				},
				success: function (datos) {
					//console.log(datos);
					//datos = JSON.parse(datos);
					if (datos.estado == "ok") {
						let data = {
							codigo: txt_prod_codigo,
							nombre: txt_prod_nombre,
							nombre_alternativo: txt_prod_nombre_alternativo,
							cod_codigo: txt_prod_cod_codigo,
							cod_barras: txt_prod_cod_barras,
							cod_almacen: txt_prod_cod_almacen,
							categoria: txt_prod_categoria,
							fabricante: txt_prod_fabricante,
							modelo: txt_prod_modelo,
							serie: txt_prod_serie,
							unidad_medida: txt_prod_unidad_medida,
							peso: txt_prod_peso,
							stock_minimo: txt_prod_stock_minimo,
							prod_unitario_id: txt_prod_unitario_id,
							prod_unitario_nombre: txt_prod_unitario_nombre,
							prod_fracciones: txt_prod_fracciones,
							estado: txt_prod_estado,
							imagenes: txt_prod_imagenes
						}
						_dialog_product_options.func_accept(datos.codigo, data);
						$("#_dialogo_product").css("display", "none");
					} else if (datos.estado == "error") {
						open_dialog_alert(datos.mensaje);
					} else {
						open_dialog_alert("ocurrió un error inesperado.");
					}
				}
			});
		}
	});
	$("#_dialogo_product .btn_close").click(function (){
		$("#_dialogo_product").css("display", "none");
	});
	$("#btn_agregar_imagen").click(function(){
		open_dialog_image("productos", function(archivo, directorio){
			if (archivo.length > 0){
				$("#_dialogo_product .input_image").css("background-image", "url(libreria/imagenes/productos/"+archivo+")");
				$("#txt_prod_imagenes").val(archivo);
			}
		});
	});
	$("#txt_prod_categoria").change(function(){
		if ($(this).val() == "0"){
			$(this).val("");
			open_dialog_categoria(function(codigo, cat_codigo_reg, cat_nombre){}, function(){})
		}
	});
	$("#txt_prod_unidad_medida").change(function(){
		if ($(this).val() == "0"){
			$(this).val("");
			open_dialog_medidas(function(codigo, cat_codigo_reg, cat_nombre){}, function(){})
		}
	});
	$("#_dialogo_product .row_image ul").on("click", "li", function(){
		let archivo = $(this).attr("data-image");
		$("#_dialogo_product .input_image").css("background-image", "url(libreria/imagenes/productos/"+archivo+")");
	});
	$("#_dialogo_product .row_image ul").on("click", ".btn_remove", function(){
		$(this).parent().remove();
		$("#_dialogo_product .input_image").css("background-image", "");
		let childs = $("#_dialogo_product .row_image ul li");
		let imagenes = [];
		for (let idx=0; idx<childs.length; idx++){
			let child = childs[idx];
			imagenes.push($(child).attr("data-image"));
		}
		$("#txt_prod_imagenes").val(imagenes.join(","));
	});
	$("#txt_prod_fabricante").autocomplete({
		source: _dialog_product_options.autocompete_fabricante,
		minLength: 2,
	});
	$("#txt_prod_modelo").autocomplete({
		source: _dialog_product_options.autocompete_modelo,
		minLength: 2,
	});
	$("#txt_prod_serie").autocomplete({
		source: _dialog_product_options.autocompete_serie,
		minLength: 2,
	});
	$("#txt_prod_stock_minimo").change(function(){
		let val = $(this).val();
		if (val == undefined || parseInt(val) < 1){
			$(this).val(1);
		}
	});
	$("#txt_prod_fracciones").change(function(){
		let val = $(this).val();
		if (val == undefined || parseInt(val) < 1){
			$(this).val(1);
		}
	});
	$("#_dialogo_product").on("click", ".btn_vincular_unidades", function(){
		$("#_dialogo_producto_unidad").css("display", "flex");
	});
    $("#_dialogo_producto_unidad .buscador_input").on("input", function(event) {
		if (event.originalEvent.inputType === 'insertLineBreak') { // Comprueba si se ha ingresado un "retorno de carro" (Enter)
			let valor = $(this).val();
			//ctrl_datos.buscar = valor;
			load_dialog_product_unidad();
		}
	});
    $("#_dialogo_producto_unidad .buscador_input input").on("keydown", function(event) {
		if (event.keyCode === 13) {
			let valor = $(this).val();
			//ctrl_datos.buscar = valor;
			load_dialog_product_unidad();
			event.preventDefault();
		}
	});
	$("#_dialogo_producto_unidad .buscador_input input").next().click(function(){
		if ($("#_dialogo_producto_unidad .buscador_input input").prop("disabled")){
			return;
		}
		let valor = $("#_dialogo_producto_unidad .buscador_input input").val();
		//ctrl_datos.buscar = valor;
		load_dialog_product_unidad();
	});
	$("#_dialogo_producto_unidad .table_view").on("click", ".row_data", function(){
		$("#_dialogo_producto_unidad .table_view .row_select").removeClass("row_select");
		$(this).addClass("row_select");
	});
	$("#_dialogo_producto_unidad .btn_void").click(function (){
		$("#txt_prod_unitario_id").val(0);
		$("#_dialogo_product .btn_vincular_unidades").html("No vender por unidad");
		$("#_dialogo_producto_unidad").css("display", "none");
	});
	$("#_dialogo_producto_unidad .btn_close").click(function (){
		$("#_dialogo_producto_unidad").css("display", "none");
	});
	$("#_dialogo_producto_unidad .btn_accept").click(function (){
		let filas = $("#_dialogo_producto_unidad .table_view .row_select");
		if (filas.length == 1){
			let producto_indice = $("#_dialogo_producto_unidad .table_view .row_select").attr("data-producto");
			if ($("#txt_prod_codigo").val() == producto_indice){
				open_dialog_alert("No se puede utilizar el producto seleccionado.");
			} else {
    			let producto_nombre = $("#_dialogo_producto_unidad .table_view .row_select").find(".v_column_4").html();
    			$("#_dialogo_product .btn_vincular_unidades").html(producto_nombre);
    			$("#txt_prod_unitario_id").val(producto_indice);
			}
			$("#_dialogo_producto_unidad").css("display", "none");
		} else {
			open_dialog_alert("Debe de seleccionar el producto unitario");
		}
	});
	$.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_producto.php",
		data: {
			accion: "fabricantes",
			buscar: "",
		},
		success: function (datos) {
			//console.log(datos);
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					_dialog_product_options.autocompete_fabricante.push(row.nombre);
				}
			}
		}
	});
	$.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_producto.php",
		data: {
			accion: "modelos",
			buscar: "",
		},
		success: function (datos) {
			//console.log(datos);
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					_dialog_product_options.autocompete_modelo.push(row.nombre);
				}
			}
		}
	});
	$.ajax({
		type: 'POST',
		dataType: "json",
		url: "control/ctrl_producto.php",
		data: {
			accion: "series",
			buscar: "",
		},
		success: function (datos) {
			//console.log(datos);
			if (datos.estado == "ok") {
				for(let idx=0; idx<datos.datos.length; idx++){
					let row = datos.datos[idx];
					_dialog_product_options.autocompete_serie.push(row.nombre);
				}
			}
		},
		error: function (){
		}
	});
	//
	$("#_dialogo_categoria .btn_close").click(function (){
		$("#_dialogo_categoria").css("display", "none");
	});
	$("#_dialogo_categoria .btn_accept").click(function (){
		let txt_cat_codigo = $("#txt_cat_codigo").val().trim();
		let txt_cat_codigo_reg = $("#txt_cat_codigo_reg").val().trim();
		let txt_cat_nombre = $("#txt_cat_nombre").val().trim();
		if (txt_cat_nombre.length <= 0){
			open_dialog_alert("Ingrese el Nombre de la categoria");
		} else {
			open_loading();
			$.ajax({
				type: 'POST',
				dataType: "json",
				url: "control/ctrl_categoria.php",
				data: {
					accion: "registrar",
					txt_codigo: txt_cat_codigo,
					txt_cat_codigo: txt_cat_codigo_reg,
					txt_cat_nombre: txt_cat_nombre,
				},
				success: function (datos) {
					//console.log(datos);
					if (datos.estado == "ok") {
						$("#txt_prod_categoria").append("<option value='"+datos.codigo+"'>"+txt_cat_codigo_reg+" | "+txt_cat_nombre+"</option>");
						$("#txt_prod_categoria").val(datos.codigo);
						_dialog_categoria_options.func_accept(datos.codigo, txt_cat_codigo_reg, txt_cat_nombre);
						clear_dialog_categoria();
						$("#_dialogo_categoria").css("display", "none");
					} else if (datos.estado == "error") {
						open_dialog_alert(datos.mensaje);
					} else {
						open_dialog_alert("ocurrió un error inesperado.");
					}
					close_loading();
				},
				error: function (){
					open_dialog_alert("ocurrió un error inesperado.");
					close_loading();
				}
			});
		}
	});
	load_dialog_categoria();
	//
	$("#_dialogo_medidas .btn_close").click(function (){
		$("#_dialogo_medidas").css("display", "none");
	});
	$("#_dialogo_medidas .btn_accept").click(function (){
		let txt_unid_codigo = $("#txt_unid_codigo").val().trim();
		let txt_unid_nombre = $("#txt_unid_nombre").val().trim();
		let txt_unid_simbolo = $("#txt_unid_simbolo").val().trim();
		if (txt_unid_nombre.length <= 0){
			open_dialog_alert("Ingrese el Nombre de la unidad de medida");
		} else if (txt_unid_simbolo.length <= 0){
			open_dialog_alert("Ingrese el Simbolo de la unidad de medida");
		} else {
			open_loading();
			$.ajax({
				type: 'POST',
				dataType: "json",
				url: "control/ctrl_unidad_medida.php",
				data: {
					accion: "registrar",
					txt_codigo: txt_unid_codigo,
					txt_unid_nombre: txt_unid_nombre,
					txt_unid_simbolo: txt_unid_simbolo,
				},
				success: function (datos) {
					//console.log(datos);
					if (datos.estado == "ok") {
						$("#txt_prod_unidad_medida").append("<option value='"+datos.codigo+"'>"+txt_unid_simbolo+" | "+txt_unid_nombre+"</option>");
						$("#txt_prod_unidad_medida").val(datos.codigo);
						_dialog_medidas_options.func_accept(datos.codigo, txt_unid_simbolo, txt_unid_nombre);
						clear_dialog_medidas();
						$("#_dialogo_medidas").css("display", "none");
					} else if (datos.estado == "error") {
						open_dialog_alert(datos.mensaje);
					} else {
						open_dialog_alert("ocurrió un error inesperado.");
					}
					close_loading();
				},
				error: function (){
					open_dialog_alert("ocurrió un error inesperado.");
					close_loading();
				}
			});
		}
	});
	load_dialog_medidas();
	//
	$("#_dialogo_proveedor .btn_close").click(function (){
		$("#_dialogo_proveedor").css("display", "none");
	});
	$("#_dialogo_proveedor .btn_accept").click(function (){
		let txt_prov_codigo = $("#txt_prov_codigo").val().trim();
		let txt_prov_nombre = $("#txt_prov_nombre").val().trim();
		let txt_prov_tipo_documento = $("#txt_prov_tipo_documento").val();
		let txt_prov_numero_documento = $("#txt_prov_numero_documento").val().trim();
		let txt_prov_direccion = $("#txt_prov_direccion").val().trim();
		if (txt_prov_tipo_documento == null || txt_prov_tipo_documento == undefined || txt_prov_tipo_documento.length == 0){
			txt_prov_tipo_documento = "Sin Número"
		}
		if (txt_prov_nombre.length <= 0){
			open_dialog_alert("Ingrese el Nombre del Proveedor");
		} else {
			open_loading();
			$.ajax({
				type: "POST",
				dataType: "json",
				url: "control/ctrl_proveedor.php",
				data: {
					accion: "registrar",
					txt_codigo: txt_prov_codigo,
					txt_nombre: txt_prov_nombre,
					txt_documento_tipo: txt_prov_tipo_documento,
					txt_documento_numero: txt_prov_numero_documento,
					txt_direccion: txt_prov_direccion,
				},
				success: function (datos) {
					//console.log(datos);
					if (datos.estado == "ok") {
						$("#txt_prod_proveedor").append("<option value='"+datos.codigo+"'>"+datos.tipo_documento+": "+datos.numero_documento+" | "+datos.nombre+"</option>");
						$("#txt_prod_proveedor").val(datos.codigo);
						_dialog_proveedor_options.func_accept(datos.codigo, {nombre:txt_prov_nombre, documento_tipo:txt_prov_tipo_documento, documento_numero:txt_prov_numero_documento});
						clear_dialog_proveedor();
						$("#_dialogo_proveedor").css("display", "none");
					} else if (datos.estado == "error") {
						open_dialog_alert(datos.mensaje);
					} else {
						open_dialog_alert("ocurrió un error inesperado.");
					}
					close_loading();
				},
				error: function (){
					open_dialog_alert("ocurrió un error inesperado.");
					close_loading();
				}
			});
		}
	});
	//
	$("#_dialogo_responsable .btn_close").click(function (){
		$("#_dialogo_responsable").css("display", "none");
	});
	$("#_dialogo_responsable .btn_accept").click(function (){
		let txt_res_codigo = $("#txt_res_codigo").val().trim();
		let txt_res_nombre = $("#txt_res_nombre").val().trim();
		let txt_res_tipo_documento = $("#txt_res_tipo_documento").val();
		let txt_res_numero_documento = $("#txt_res_numero_documento").val().trim();
		let txt_res_direccion = $("#txt_res_direccion").val().trim();
		if (txt_res_tipo_documento == null || txt_res_tipo_documento == undefined || txt_res_tipo_documento.length == 0){
			txt_res_tipo_documento = "Sin Número"
		}
		if (txt_res_nombre.length <= 0){
			open_dialog_alert("Ingrese el Nombre del Proveedor");
		} else {
			open_loading();
			$.ajax({
				type: "POST",
				dataType: "json",
				url: "control/ctrl_responsable.php",
				data: {
					accion: "registrar",
					txt_codigo: txt_res_codigo,
					txt_nombre: txt_res_nombre,
					txt_documento_tipo: txt_res_tipo_documento,
					txt_documento_numero: txt_res_numero_documento,
					txt_direccion: txt_res_direccion,
				},
				success: function (datos) {
					//console.log(datos);
					if (datos.estado == "ok") {
						$("#txt_prod_responsable").append("<option value='"+datos.codigo+"'>"+datos.tipo_documento+": "+datos.numero_documento+" | "+datos.nombre+"</option>");
						$("#txt_prod_responsable").val(datos.codigo);
						_dialog_responsable_options.func_accept(datos.codigo, {nombre:txt_res_nombre, documento_tipo:txt_res_tipo_documento, documento_numero:txt_res_numero_documento});
						clear_dialog_responsable();
						$("#_dialogo_responsable").css("display", "none");
					} else if (datos.estado == "error") {
						open_dialog_alert(datos.mensaje);
					} else {
						open_dialog_alert("ocurrió un error inesperado.");
					}
					close_loading();
				},
				error: function (){
					open_dialog_alert("ocurrió un error inesperado.");
					close_loading();
				}
			});
		}
	});
<?php } ?>
<?php if(false){ ?></script><?php } ?>
