                <form action="" name="thisformfac" autocomplete="off" enctype="multipart/form-data">
                  <div class="form-row">
                    <div class="col-12 col-lg-9 col-xl-10">
                      <div class="form-group">
                        <div class="form-row">
                          <div class="col-12 col-sm-6 col-md-3">
                            <label for="txtSerieI">Serie</label>
                            <input type="text" class="form-control form-control-sm form-control-as" id="txtSerieI" maxlength="20">
                          </div>
                          <div class="col-12 col-sm-6 col-md-3">
                            <label for="numNumI">Número</label>
                            <input type="number" class="form-control form-control-sm form-control-as" id="numNumI" placeholder="0" oninput="numberInt(this, 20, event);" min="1">
                          </div>
                          <div class="col-12 col-sm-6 col-md-3">
                            <label for="txtNitI">Nit</label>
                            <input type="text" class="form-control form-control-sm form-control-as" id="txtNitI" maxlength="20">
                          </div>
                          <div class="col-12 col-sm-6 col-md-3">
                            <label for="selTipoI">Tipo</label>
                            <select class="form-control form-control-sm form-control-as calcular" name="selTipoI" id="selTipoI">
                              <?php
                                while ($rec = $db->fetchAssoc($select['tipoc'])) {
                                  echo  '<option value="'.$rec['tc_cod'].'" data-impues="'.$rec['tc_impues'].'" data-pone="'.$rec['tc_pone'].'">'.utf8_encode($rec['tc_nom']).'</option>';
                                }
                              ?>
                            </select>
                          </div>
                        </div>

                        <div class="form-row">
                          <div class="col-12">
                            <label for="txtProvI">Proveedor</label>
                            <input type="text" class="form-control form-control-sm form-control-as" id="txtProvI">
                          </div>
                        </div>

                        <div class="form-row align-items-center">
                          <div class="col-sm-6">
                            <div class="form-row align-items-end">
                              <div class="col-md-8">
                                <label for="dtFecI">Fecha del Documento</label>
                                <input type="date" class="form-control form-control-sm form-control-as" id="dtFecI" placeholder="">
                              </div>
                              <div class="col-7">
                                <label for="selMesI">Mes a Reportar</label>
                                <select class="form-control form-control-sm form-control-as" name="selMesI" id="selMesI">
                                  <?php
                                    while ($rec = $db->fetchAssoc($select['meses'])) {
                                      echo  '<option value="'.$rec['mes_cod'].'">'.utf8_encode($rec['mes_nom']).'</option>';
                                    }
                                  ?>
                                </select>
                              </div>
                              <div class="col-5">
                                <label for="numAnoI">Año a Reportar</label>
                                <input type="number" class="form-control form-control-sm form-control-as" id="numAnoI" placeholder="AAAA">
                              </div>
                            </div>
                          </div>
                          <div class="col-sm-6">
                            <div class="form-row text-center align-items-end">
                              <div class="col-6">
                                <label class="pr-1">Retención ISR</label><br>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crRet1I" name="crRetI" class="custom-control-input calcular" value="S">
                                  <label class="custom-control-label" for="crRet1I">Si</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crRet2I" name="crRetI" class="custom-control-input calcular" value="N">
                                  <label class="custom-control-label" for="crRet2I">No</label>
                                </div>
                              </div>
                              <div class="col-6">
                                <label class="pr-1">Retención IVA</label><br>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crReti1I" name="crRetiI" class="custom-control-input calcular" value="S">
                                  <label class="custom-control-label" for="crReti1I">Si</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crReti2I" name="crRetiI" class="custom-control-input calcular" value="N">
                                  <label class="custom-control-label" for="crReti2I">No</label>
                                </div>
                              </div>
                              <div class="col-6">
                                <label class="pr-1">Caja Chica</label><br>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crCaja1I" name="crCajaI" class="custom-control-input" value="S">
                                  <label class="custom-control-label" for="crCaja1I">Si</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crCaja2I" name="crCajaI" class="custom-control-input" value="N">
                                  <label class="custom-control-label" for="crCaja2I">No</label>
                                </div>
                              </div>
                              <div class="col-6">
                                <label class="pr-1">Incluir en el Libro</label><br>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crAfe1I" name="crAfeI" class="custom-control-input" value="S">
                                  <label class="custom-control-label" for="crAfe1I">Si</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                  <input type="radio" id="crAfe2I" name="crAfeI" class="custom-control-input" value="N">
                                  <label class="custom-control-label" for="crAfe2I">No</label>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>

                        <div class="form-row align-items-end">
                          <div class="col-6 col-sm-3">
                            <label for="numBienI">Compras</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numBienI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numServI">Servicios</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numServI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numPequeI">Pequeño Contribuyente Bienes</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numPequeI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numPeque2I">Pequeño Contribuyente Servicios</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numPeque2I" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                        </div>

                        <div class="form-row align-items-end">
                          <div class="col-6 col-sm-3">
                            <label for="numImpI">Importa. Centro América</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numImpI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numImpreI">Importa. Resto del Mundo</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numImpreI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numTasamI">Tasa Municipal</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numTasamI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numMediI">Medicamentos</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numMediI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                        </div>

                        <div class="form-row align-items-end">
                          <div class="col-6 col-sm-3">
                            <label for="numNoafeI">No Afecto Decreto 29-89</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numNoafeI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numVehiI">Valor Vehículo</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numVehiI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-5 col-sm-3">
                            <label for="numVehiaI">Antigüedad Vehículo</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numVehiaI" placeholder="0" oninput="numberInt(this, 2, event);" min="0">
                          </div>
                          <div class="col-7 col-sm-3 text-center">
                            <label class="pr-1">Tipo de Vehículo</label><br>
                            <div class="custom-control custom-radio custom-control-inline">
                              <input type="radio" id="crTvehi1I" name="crTvehiI" class="custom-control-input calcular" value="C">
                              <label class="custom-control-label" for="crTvehi1I">Carro</label>
                            </div>
                            <div class="custom-control custom-radio custom-control-inline">
                              <input type="radio" id="crTvehi2I" name="crTvehiI" class="custom-control-input calcular" value="M">
                              <label class="custom-control-label" for="crTvehi2I">Moto</label>
                            </div>
                          </div>
                        </div>
                      </div>

                      <div class="form-group">
                        <h3 class="text-light">Combustible</h3>

                        <div class="form-row align-items-end">
                          <div class="col-6 col-sm-3">
                            <label for="numTfacomI">Total de Factura Combustible</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numTfacomI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numGalosI">Galones Super</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numGalosI" placeholder="0.000" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numGalorI">Galones Regular</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numGalorI" placeholder="0.000" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                          <div class="col-6 col-sm-3">
                            <label for="numGalodI">Galones Diesel</label>
                            <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numGalodI" placeholder="0.000" oninput="numberDec(this, 14, 2);" min="0">
                          </div>
                        </div>

                        <div class="form-row">
                          <div class="col-12 text-center">
                            <label for="numCombI">Valor Afecto Combustible</label>
                            <input type="number" class="form-control form-control-sm form-control-as form-info text-center limpiari" id="numCombI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                      </div>

                      <div class="form-group">
                        <div class="form-row">
                        </div>
                        <div class="form-row">
                          <div class="col-12">
                            <label for="txtConI">Concepto</label>
                            <textarea class="form-control form-control-sm form-control-as limpiari" id="txtConI" rows="3"></textarea>
                          </div>
                        </div>
                      </div>

                      <div class="form-row">
                        <div class="col-md-3">
                          <label for="txtCta1g">Ctas Gasto</label>
                          <input type="text" class="form-control form-control-sm form-control-as" id="txtCta1g" placeholder="" maxlength="14">
                        </div>
                        <div class="col-md-6">
                          <label for="txtCta1gNom">Descripción Cuenta de Gasto</label>
                          <input type="text" class="form-control form-control-sm form-control-as form-info bg-dark" id="txtCta1gNom" placeholder="Cuenta no definida" disabled>
                        </div>
                        <div class="col-md-3">
                          <label for="numCta1gV">Valor</label>
                          <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numCta1gV" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                        </div>
                      </div>
                      <div class="form-row">
                        <div class="col-md-3">
                          <input type="text" class="form-control form-control-sm form-control-as" id="txtCta2g" placeholder="" maxlength="14">
                        </div>
                        <div class="col-md-6">
                          <input type="text" class="form-control form-control-sm form-control-as form-info bg-dark" id="txtCta2gNom" placeholder="Cuenta no definida" disabled>
                        </div>
                        <div class="col-md-3">
                          <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numCta2gV" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                        </div>
                      </div>
                      <div class="form-row">
                        <div class="col-md-3">
                          <input type="text" class="form-control form-control-sm form-control-as" id="txtCta3g" placeholder="" maxlength="14">
                        </div>
                        <div class="col-md-6">
                          <input type="text" class="form-control form-control-sm form-control-as form-info bg-dark" id="txtCta3gNom" placeholder="Cuenta no definida" disabled>
                        </div>
                        <div class="col-md-3">
                          <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numCta3gV" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                        </div>
                      </div>
                      <div class="form-row">
                        <div class="col-md-3">
                          <input type="text" class="form-control form-control-sm form-control-as" id="txtCta4g" placeholder="" maxlength="14">
                        </div>
                        <div class="col-md-6">
                          <input type="text" class="form-control form-control-sm form-control-as form-info bg-dark" id="txtCta4gNom" placeholder="Cuenta no definida" disabled>
                        </div>
                        <div class="col-md-3">
                          <input type="number" class="form-control form-control-sm form-control-as calcular limpiari" id="numCta4gV" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0">
                        </div>
                      </div>
                      <div class="form-row text-right">
                          <div class="col-md-3">
                            <label>  </label>
                          </div>
                          <div class="col-md-3">
                            <label>  </label>
                          </div>
                          <div class="col-md-3">
                            <label for="numSumCta">Sumatoria</label>
                          </div>
                          <div class="col-md-3">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiari text-right" id="numSumCta" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                      </div>
                      <div class="form-row text-right">
                          <div class="col-md-3">
                            <label>  </label>
                          </div>
                          <div class="col-md-3">
                            <label>  </label>
                          </div>
                          <div class="col-md-3">
                            <label for="numFalCta">Valor Falta</label>
                          </div>
                          <div class="col-md-3">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiari text-right" id="numFalCta" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                      </div>
                      <div class="form-row text-right">
                          <div class="col-md-3">
                            <label>  </label>
                          </div>
                      </div>

                    </div>
                    <div class="col-12 col-lg-3 col-xl-2 text-left mt-5">
                      <div class="form-group position-fixed-lg w-lg-3 w-xl-2">

                        <div class="form-row align-items-center">
                          <div class="col-12">
                              <h3 class="text-light">Impuestos y Totales</h3>
                          </div>
                        </div>
                        <div class="form-row align-items-center">
                          <div class="col-6">
                            <label for="numRetI">Ret. ISR</label>
                          </div>
                          <div class="col-6">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiar text-right bg-dark" id="numRetI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                        <div class="form-row align-items-center">
                          <div class="col-6">
                            <label for="numRetiI">Ret. IVA</label>
                          </div>
                          <div class="col-6">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiar text-right bg-dark" id="numRetiI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                        <div class="form-row align-items-center">
                          <div class="col-6">
                            <label for="numSubI">Subtotal</label>
                          </div>
                          <div class="col-6">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiar text-right bg-dark" id="numSubI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                        <div class="form-row align-items-center">
                          <div class="col-6">
                            <label for="numIvaI">IVA</label>
                          </div>
                          <div class="col-6">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiar text-right bg-dark" id="numIvaI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                        <div class="form-row align-items-center">
                          <div class="col-6">
                            <label for="numTotI">Total</label>
                          </div>
                          <div class="col-6">
                            <input type="number" class="form-control form-control-sm form-control-as form-info limpiar text-right bg-dark" id="numTotI" placeholder="0.00" oninput="numberDec(this, 14, 2);" min="0" disabled>
                          </div>
                        </div>
                        <div class="form-row">
                          <div class="col-12 mt-2">
                            <button class="btn btn-danger btn-block" id="btnRegresar" type="button">Regresar</button>
                          </div>
                          <div class="col-12 mt-2">
                            <button class="btn btn-success btn-block" id="btnGuardarI" type="button">Guardar Factura</button>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </form>