<div class="d-flex justify-content-between">
	<div>
		<h4 id="html_documento"><?php if (isset($html_documento)) { echo $html_documento; } ?></h4>
	</div>

	<div></div>
</div>


<!-- Datos Clientes -->
<?php if (isset($cliente)) { ?>
	<div class="col-lg-6 col-12">
		<div class="card p-2">
			<div class="d-flex justify-content-between">
				<div>
					<?= $cliente['contacto'] ?> <br>
					<small class="text-muted"><?= $cliente['telefono1'] ?></small>
				</div>
				<div>
					<?php if (isset($nde)) { echo 'Nde: '. $nde['id']; } ?> <br>
					<small class="text-muted"><?php if (isset($nde)) { echo '$'. $nde['total_d']; } ?></small>
					
				</div>
			</div>
		</div>
	</div>
<?php  } ?>


<form id="<?php if (isset($form_doc)) { echo $form_doc; } ?>">
	<!-- Token CSRF -->
    <input type="hidden" name="csrf_test_name" value="<?= csrf_hash(); ?>">

	<div class="col-12">
		<div class="card">
			<div class="row">

				<?php if (isset($cliente['id'])) { ?>
					<div class="col-lg-1 col-3">
						<div class="form-floating">
							<input type="text" class="form-control" name="id_cliente" placeholder="Id_cliente" required="required" value="<?= $cliente['id'] ?>" readonly>
							<label for="id_cliente">Id Cliente</label>
						</div>
					</div>
				<?php } ?>

				<?php if (isset($nde['id'])) { ?>
					<div class="col-lg-1 col-3">
						<div class="form-floating">
							<input type="text" class="form-control" name="id_nde" placeholder="Id_nde" required="required" value="<?= $nde['id'] ?>" readonly>
							<label for="id_nde">Id Nde</label>
						</div>
					</div>
				<?php } ?>

				<?php if (isset($orden['id'])) { ?>
					<div class="col-lg-1 col-3">
						<div class="form-floating">
							<input type="text" class="form-control" name="id_orden" placeholder="Id_orden" required="required" value="<?= $orden['id'] ?>" readonly>
							<label for="id_orden">Id Orden</label>
						</div>
					</div>
				<?php } ?>

				<?php if (isset($compra['id'])) { ?>
					<div class="col-lg-1 col-3">
						<div class="form-floating">
							<input type="text" class="form-control" name="id_compra" placeholder="Id_compra" required="required" value="<?= $compra['id'] ?>" readonly>
							<label for="id_compra">Id Compra</label>
						</div>
					</div>
				<?php } ?>

				<?php if (isset($venta['id'])) { ?>
					<div class="col-lg-1 col-3">
						<div class="form-floating">
							<input type="text" class="form-control" name="id_venta" placeholder="Id_venta" required="required" value="<?= $venta['id'] ?>" readonly>
							<label for="id_venta">Id Venta</label>
						</div>
					</div>
				<?php } ?>

			</div>
		</div>


		<div class="card p-2 mb-2">
			<div class="row">
				<div class="col-lg-3 col-6">
					<div class="form-floating mb-2">
						<select id="asiento" name="asiento" class="form-select">
							<option value="Ingreso">Ingreso</option>
							<option value="Egreso">Egreso</option>
							<option value="Cambio_Divisa">Cambio_Divisa</option>
							<option value="Otros">Otros</option>
						</select>
						<label class="text-muted">Asiento</label>
					</div>
				</div>
				<div class="col-lg-3 col-6">
					<div class="form-floating">
						<select id="categoria" name="categoria" class="form-select">
							<?php if (isset($nde)) { ?>
								<option value="<?php echo $nde['categoria']; ?>" <?= 'selected' ?> ><?php echo $nde['categoria']; ?></option>
							<?php } ?>
							<option value="Servicio">Servicio</option>
							<option value="Mercancia">Mercancia</option>                           
							<option value="Comisiones">Comisiones</option>
							<option value="Gastos Operativos">Gastos Operativos</option>                       
							<option value="Caja Chica">Caja Chica</option>
							<option value="Nomina">Nomina</option>                           
							<option value="Prestamos">Prestamos</option>
							<option value="Activos">Activos</option>                          
							<option value="Cambio Divisas">Cambio Divisas</option>                            
							<option value="Otros">Otros</option>
						</select>
						<label class="text-muted">Categoria</label>
					</div>
				</div>
				<div class="col-lg-3 col-6 align-content-center">
					<div class="form-floating">
						<div class="form-check">
							<input class="form-check-input" type="checkbox" value="" name="check_pago_total">
							<label class="form-check-label" for="check_pago_total">
								Pago Total
							</label>
						</div>
					</div>                  	
				</div>
			</div>

			<div class="row">	
				<div class="col-lg-3 col-4">
					<div class="form-floating mb-2">
						<input type="number" step="any" class="form-control" name="monto_d" placeholder=" " maxlength="10"
						value="<?php if (isset($nde['total_d'])) {echo $nde['total_d']; } ?>">
						<label for="total_d">Monto que esta pagando $</label>
					</div>
				</div>
				<div class="col-lg-3 col-4">
					<div class="form-floating mb-2">
						<input type="number" step="any" class="form-control" name="monto_bs" placeholder="Precio_Bs" maxlength="20" 
						value="<?php if (isset($nde['total_bs'])) {echo $nde['total_bs']; } ?>">
						<label for="total_bs">Monto que esta pagando Bs</label>
					</div>
				</div>
				<div class="col-lg-3 col-4">
					<div class="form-floating mb-2">
						<input type="number" step="any" class="form-control" name="tasa" placeholder="Tasa" maxlength="10" 
						value="<?php if (isset($nde['tasa'])) {echo $nde['tasa']; } ?>">
						<label for="tasa">Tasa</label>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-lg-3 col-md-6 col-6">
					<div class="form-floating mb-2">
						<input type="datetime-local" class="form-control" name="fecha_emision" placeholder=" " step="1" 
						value="<?php if (isset($post['fecha_emision'])) {echo $post['fecha_emision']; } ?>">
						<label class="text-muted" for="fecha_emision" class="text-muted">Fecha Emision</label>
					</div>
				</div>
				<div class="col-lg-3 col-md-6 col-6">
					<div class="form-floating">
						<select id="forma_pago" name="forma_pago" class="form-select">
							<option value="Efectivo">Efectivo</option>                           
							<option value="Punto Venta">Punto Venta</option>
							<option value="Pago Movil">Pago Movil</option>
							<option value="Transferencia">Transferencia</option>                        
							<option value="PayPal">PayPal</option>                        
							<option value="Otros">Otros</option>
						</select>
						<label class="text-muted"></label>
					</div>
				</div>
				<div class="col-lg-3 col-md-6 col-6">
					<div class="form-floating">
						<select id="banco" name="banco" class="form-select">
							<option value="Caja">Caja</option>       
							<option value="Venezuela">Venezuela</option>
							<option value="Banesco">Banesco</option>                           
							<option value="Bicentenario">Bicentenario</option>                  
							<option value="Exterior">Exterior</option>                           
							<option value="Mercantil">Mercantil</option>
							<option value="Bancamiga">Bancamiga</option>                         
							<option value="Provincial">Provincial</option>                
							<option value="Otros">Otros</option>
						</select>
						<label class="text-muted"></label>
					</div>
				</div>
				<div class="col-lg-3 col-6">
					<div class="form-floating mb-2">
						<input type="text" class="form-control" name="ref" placeholder="Referencia" style="text-transform: uppercase;">
						<label class="text-muted" for="ref">Referencia</label>
					</div>
				</div>
				<div class="col-12">
					<div class="form-floating mb-2">
						<input type="text" class="form-control" name="concepto" placeholder="concepto" style="text-transform: capitalize;">
						<label class="text-muted" for="concepto">Concepto</label>
					</div>
				</div>
			</div>
		</div>

		<!-- BOTON SUBMIT -->
		<div class="card bg-transparent border-0">
			<div class="d-flex justify-content-end ">
				<button class="btn btn-sm btn-dark btn-enviar " type="submit">Guardar <i class="bi bi-hdd"></i></button>
			</div>
		</div>

	</div>

</form>