<div class="row" id="<?php $windowid= date('YmdHis'); echo $windowid;?>">
	<!--Cliente-->
	<div class="form-group">
		<label class="control-label col-sm-1">Cliente:</label>
		<div class="col-sm-11">
			<select id="pago-credito-cliente" class="form-control">
				<option value="" disabled selected>Seleccione uno...</option>
				<?php if(count($clientes)>0):foreach($clientes as $cliente):?>
				<option value="<?php echo $cliente->id;?>" data-nombre="<?php echo $cliente->nombre;?>" data-direccion="<?php echo $cliente->direccion;?>" data-dui="<?php echo $cliente->dui;?>" data-nit="<?php echo $cliente->nit;?>" data-nrc="<?php echo $cliente->nrc;?>" data-giro="<?php echo $cliente->giro;?>"><?php echo $cliente->nombre." - ".$cliente->razon;?></option>
				<?php endforeach;endif;?>
			</select>
		</div>
	</div>
	<!--Informacion creditos-->
	<div class="form-group p-sm">				
	</div>
	<!--Documentos-->
	<div class="form-group m-t-sm">
		<!--Documentos pendientes de pago-->
		<div class="col-sm-6">
			<div class="ibox float-e-margins" style="margin-bottom:0px;">
				<div class="ibox-title">
					<h5>Documentos pendientes</h5>
				</div>
				<div class="ibox-content">
					<div id="pago-credito-doc-pendientes" class="panel-group" style="height:375px;overflow-y:scroll;margin-bottom:0px;">
					</div>
				</div>
			</div>
		</div>
		<!--Documentos pendientes a pagar-->
		<div class="col-sm-6">
			<div class="ibox float-e-margins" style="margin-bottom:0px;">
				<div class="ibox-title">
					<h5>Documentos a pagar</h5>
				</div>
				<div class="ibox-content">
					<div id="pago-credito-doc-pagar" class="panel-group" style="height:275px;overflow-y:scroll;margin-bottom:0px;">
					</div>
				</div>
			</div>
			<div id="documentos-pagar-totales">
				<table class="table"> 
					<tbody>
						<tr class="total-totalneto-wrapper">
							<td style="padding:4px;" class="text-right">Total Neto</td>
							<td style="padding:4px;" >$</td>
							<td style="padding:4px;" class="data-total" data-grabado="" data-exento="" data-nosujeto="" data-value="0.00">0.00</td>
						</tr>
						<tr class="total-impuestos-wrapper">
							<td style="padding:4px;" class="text-right">Impuestos</td>
							<td style="padding:4px;">$</td>
							<td style="padding:4px;" class="data-total" data-iva="" data-rentencion="" data-percepcion="" data-value="0.00">0.00</td>
						</tr>
						<tr class="total-total-wrapper">
							<td style="padding:4px;" class="text-right"><strong>TOTAL</strong></td>
							<td style="padding:4px;">$</td>
							<td style="padding:4px;font-size:16px;" class="data-total"  data-totalfac="" data-totaltrans="" data-value="0.00"><strong>0.00</strong></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="clearfix"></div>
	</div>
	<div class="form-group" style="margin:0; text-align:center;">
		<button type="button" class="btn btn-danger btn-rounded" onclick="Custombox.close();">Cancelar</button>
		<button type="button" id="guardar-pago-credito-btn" class="btn btn-primary btn-rounded">Guardar</button>
	</div>
	<!--Hiddens-->
	<div>
	</div>
	<!--Modales-->
	<div>
		<!--Informacion de pago-->
		<div class="modal inmodal fade" id="pago-credito-info-wrapper" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-md">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="">Informaci&oacute;n de pago</h4>
					</div>
					<div class="modal-body">
						<!--Informacion de pago-->
						<div class="form-group">
							<!--Documento de pago-->
							<div class="col-sm-5">
								<label class="control-label">Documento de pago:</label>
								<select class="form-control" id="pago-credito-doc-pago">
									<option value="6" selected>Recibo</option>
								</select>
							</div>
							<!--Serie documento de pago-->
							<div class="col-sm-4">
								<label class="control-label">Serie:</label>
								<select class="form-control" id="pago-credito-doc-serie-pago">
								</select>
							</div>
							<!--Numero documento de pago-->
							<div class="col-sm-3">
								<label class="control-label">N&uacute;mero:</label>
								<input type="text" class="form-control" id="pago-credito-numdoc-pago">
							</div>
							<div class="clearfix"></div>
						</div>
						<!--Informacion de facturacion-->
						<div id="pago-credito-fac-info-wrapper" style="display:none;">
						<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label><input type="checkbox" id="pago-credito-fac-transito" checked> Facturar los producto cobrados pendientes</label>
							</div>
							<div class="form-group">
								<!--Documento de facturacion-->
								<div class="col-sm-5">
									<label class="control-label">Documento de facturacion:</label>
									<select class="form-control" id="pago-credito-doc-fac-pago" disabled>
										<option value="1" Selected>Factura</option>
										<option value="2">Comprobante de cr&eacute;dito fiscal</option>
										<option value="3">Ticket</option>
									</select>
								</div>
								<!--Serie documento de facturacion-->
								<div class="col-sm-4">
									<label class="control-label">Serie:</label>
									<select class="form-control" id="pago-credito-doc-fac-serie-pago" disabled>
									</select>
								</div>
								<!--Numero documento de facturacion-->
								<div class="col-sm-3">
									<label class="control-label">Numero:</label>
									<input type="text" class="form-control" id="pago-credito-numdoc-fac-pago" disabled>
								</div>
								<div class="clearfix"></div>
							</div>
							<!--Modificar info documento de facturacion-->
							<div class="form-group text-center">
									<a href="javascript:void(0);" id="pago-credito-doc-mod-info-link" style="text-decoration:underline;"><i class="fa fa-edit"></i> Modificar mas informaci&oacute;n de factura</a>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" id="pago-credito-info-cancel" class="btn btn-white" data-dismiss="modal">Cancelar</button>
						<button type="button" id="pago-credito-info-guardar" class="btn btn-primary">Aceptar</button>
					</div>
				</div>
			</div>
		</div>
		<!--Factura info-->
		<div class="modal inmodal fade" id="pago-credito-info-docs" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-md">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="">Informaci&oacute;n de factura</h4>
					</div>
					<div class="modal-body">
						<div class="alert alert-info">
							<strong>La informaci&oacute;n que modifique en este formulario solo afetar&aacute; al documento impreso</strong>, para guardar la transacci&oacute;n en el sistema se usar&aacute; la informaci&oacute;n original.
						</div>
						<div class="form-group">
							<!--Cliente-->
							<div class="col-sm-8">
								<label>Cliente: </label>
								<div class="input-group">
									<input type="text" id="pago-credito-info-docs-cliente" class="form-control" data-default="" data-prev=""> 
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler cliente"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
								
							</div>
							<!--Fecha-->
							<div class="col-sm-4">
								<label>Fecha: </label>
								<div class="input-group">
									<input type="text" id="pago-credito-info-docs-fecha" class="form-control" readonly="readonly" data-default="<?php echo gmdate('Y-m-d',strtotime('- 6 hours'));?>" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler fecha"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="form-group">
							<!--Direccion-->
							<div class="col-sm-12">
								<label>Direcci&oacute;n: </label>
								<div class="input-group">
									<input type="text"  id="pago-credito-info-docs-direccion" class="form-control" data-default="" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler direcci&oacute;n"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="form-group">
							<!--DUI-->
							<div class="col-sm-4" style="padding:0px 5px 0px 15px;">
								<label>DUI: </label>
								<div class="input-group">
									<input type="text" id="pago-credito-info-docs-dui" class="form-control" data-default="" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler DUI"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<!--NIT-->
							<div class="col-sm-5" style="padding:0px 5px 0px 5px;">
								<label>NIT: </label>
								<div class="input-group">
									<input type="text"id="pago-credito-info-docs-nit"  class="form-control" data-default="" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler NIT"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<!--NRC-->
							<div class="col-sm-3" style="padding:0px 15px 0px 5px;">
								<label>NRC: </label>
								<div class="input-group">
									<input type="text" id="pago-credito-info-docs-nrc" class="form-control" data-default="" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler NRC"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="form-group">
							<!--Giro-->
							<div class="col-sm-12">
								<label>Giro: </label>
								<div class="input-group">
									<input type="text"  id="pago-credito-info-docs-giro" class="form-control" data-default="" data-prev="">
									<span class="input-group-btn">
										<button class="btn btn-white info-docs-field-reset-btn" title="Restabler giro"><i class="fa fa-refresh"></i></button>
									</span>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" id="pago-credito-info-docs-cancelar-btn" class="btn btn-white">Cancelar</button>
						<button type="button" id="pago-credito-info-docs-guardar-btn" class="btn btn-primary">Aceptar</button>
					</div>
				</div>
			</div>
		</div>
		<!--Cliente info-->
		<div class="modal inmodal fade" id="pago-credito-cliente-docs" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="">Documentos del cliente</h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="control-label">DUI:</label>
							<input type="text" class="form-control" id="pago-credito-cliente-dui" value="<?php if(isset($ventainfo)) echo $ventainfo->cliente_dui;?>">
						</div>
						<div class="form-group">
							<label class="control-label">NIT:</label>
							<input type="text" class="form-control" id="pago-credito-cliente-nit" value="<?php if(isset($ventainfo)) echo $ventainfo->cliente_nit;?>">
						</div>
						<div class="form-group">
							<label class="control-label">NRC:</label>
							<input type="text" class="form-control" id="pago-credito-cliente-nrc" value="<?php if(isset($ventainfo)) echo $ventainfo->cliente_nrc;?>">
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" id="pago-credito-cliente-docs-cancel-btn" class="btn btn-white" data-dismiss="modal">Cancelar</button>
						<button type="button" id="pago-credito-cliente-docs-guardar-btn" class="btn btn-primary">Aceptar</button>
					</div>
				</div>
			</div>
		</div>
		<!--Forma de pago info-->
		<div class="modal inmodal fade" id="pago-credito-forma-pago" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="">Forma de pago</h4>
					</div>
					<div class="modal-body">
						<h1 class="text-center" style="font-size:48px" id="pago-credito-forma-pago-total"></h1>
						<h3 class="text-muted text-center">Total</h3>
						<div class="form-group">
							<label class="control-label">Forma de pago:</label>
							<select class="form-control" id="pago-credito-forma-pago-select">
								<option value="1" selected>Efectivo</option>
								<option value="2">Cheque</option>
								<option value="3">Pos</option>
							</select>
						</div>
						<div id="pago-credito-efectivo-frame">
							<div class="form-group">
								<label class="control-label">Efectivo:</label>
								<input type="text" class="form-control input-lg" id="pago-credito-forma-pago-efectivo" style="font-size:32px;">
							</div>
							<div class="form-group">
								<label class="control-label">Cambio:</label>
								<input type="text" class="form-control input-lg" readonly id="pago-credito-forma-pago-cambio" style="font-size:32px;">
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" id="pago-credito-fpago-cancel-btn" class="btn btn-white" data-dismiss="modal">Cancelar</button>
						<button type="button" id="pago-credito-fpago-guardar-btn" class="btn btn-primary">Aceptar</button>
					</div>
				</div>
			</div>
		</div>
		<!--Confirmar-->
		<div class="modal inmodal fade" id="pago-credito-confirmar" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="">Confirmar Pago</h4>
					</div>
					<div class="modal-body">
						<h1 class="text-center"  id="pago-credito-procesar-status-icon"><i class="fa fa-question-circle fa-5x" style="color:#23C6C8;"></i></h1>
						<h3 class="text-muted text-center" id="pago-credito-procesar-status-text">&iquest;Desea guardar este pago?</h3>
						
						<div style='margin:20px'>
							<table class='table'>
								<tr>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px;'>Total</h3></td>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px;'>$</h3></td>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px; text-align:right;' id="pago-credito-confirm-total"></h3></td>
								</tr>
								<tr class='pago-credito-confirm-efectivo-table'>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px;'>Efectivo</h3></td>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px;' >$</h3></td>
									<td><h3 style='line-height:normal;font-weight:normal;margin:0px;text-align:right;' id="pago-credito-confirm-efectivo"></h3></td>
								</tr>
								<tr class='pago-credito-confirm-efectivo-table'>
									<td><h2 style='line-height:normal;margin:0px;'>Cambio</h2></td>
									<td><h2 style='line-height:normal;margin:0px;'>$</h2></td>
									<td><h2 style='line-height:normal;margin:0px;text-align:right;' id="pago-credito-confirm-cambio"></h2></td>
								</tr>
							</table>
						</div>
					</div>
					<div class="modal-footer" id="pago-credito-confirmar-buttons">
						<button type="button" id="pago-credito-cancelar-guardar-btn" class="btn btn-white" data-dismiss="modal">Cancelar</button>
						<button type="button" id="pago-credito-confirmar-guardar-btn" class="btn btn-primary">Guardar pago</button>
						<button type='button' style="display:none" id='pago-credito-confirmar-salir-btn' class='btn btn-danger'>Salir</button>
					</div>
				</div>
			</div>
		</div>
		
	</div>
</div>
<script>
	var transacciones_pago_credito_app= new Transacciones_pago_credito_app();
	transacciones_pago_credito_app.initializeEnviroment("<?php echo base_url();?>","<?php echo $windowid;?>","<?php echo $caja;?>");
</script>