view/js/ncf_functions.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 20
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 4
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 1
1
/*
2
 * Copyright (C) 2016 Joe Nilson <joenilson at gmail.com>
3
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
/**
18
 * Funciones para el manejo de NCF para Republica Dominicana
19
 * versión 1
20
 * @TODO Agregar boton de Corregir NCF
21
 * @TODO Manejar el boton de Rectificar por aqui
22
 * @TODO Manejar el boton de Anular por aqui
23
 *
24
 */
25
function calcular(){
26
    var m =  $("#monto_rectificar").val();
27
    var i =  $("#impuesto_rectificar").val();
28
    var mt = m*((i/100)+1);
29
    mt.toFixed(4);
30
    $("#monto_total").val(mt);
31
}
32
33
$(document).ready(function() {
34
    $("#b_rectificar").click(function(event) {
35
        event.preventDefault();
36
        $("#modal_rectificar").modal('show');
37
    });
38
    $("#link_eliminar").click(function(event){
39
        event.preventDefault();
40
        $("#f_eliminar").attr('action', url_borrar_factura);
0 ignored issues
show
Bug introduced by
The variable url_borrar_factura seems to be never declared. If this is a global, consider adding a /** global: url_borrar_factura */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
41
        $("#f_eliminar").attr('motivo', $("#motivo").val());
42
        $("#f_eliminar").submit();
43
    });
44
});
45
46