|
@@ -41,7 +41,7 @@ openerp.report_invoice_utility = function (instance, local) {
|
|
|
try {
|
|
|
date = $.datepicker.parseDate( dateFormat1, (fechaSel[1]+"/"+fechaSel[0]+"/"+fechaSel[2]));
|
|
|
} catch( error ) {
|
|
|
- date = null;
|
|
|
+ date = null;
|
|
|
}
|
|
|
return date;
|
|
|
}
|
|
@@ -115,12 +115,19 @@ openerp.report_invoice_utility = function (instance, local) {
|
|
|
return defer;
|
|
|
},
|
|
|
// Cansultar
|
|
|
+ verifFecha: function (desde, hasta){
|
|
|
+ var status = false;
|
|
|
+ if (((desde.length == 0) && (hasta.length > 0)) || ((desde.length > 0) && (hasta.length == 0))){
|
|
|
+ status = true;
|
|
|
+ }
|
|
|
+ return status;
|
|
|
+ },
|
|
|
submitForm: function (e) {
|
|
|
var desde =this.$el.find('#from').val();
|
|
|
var hasta =this.$el.find('#to').val();
|
|
|
e.preventDefault();
|
|
|
var formData = this.$(e.currentTarget).serializeJSON();
|
|
|
- if ((formData.journal == 0) || (((desde.length == 0) && (hasta.length > 0)) || ((desde.length > 0) && (hasta.length == 0)))){
|
|
|
+ if ((formData.journal == 0) || ((this.verifFecha(desde,hasta)) === true)){
|
|
|
$("#dialog" ).dialog({
|
|
|
autoOpen: true,
|
|
|
resizable: false,
|
|
@@ -175,7 +182,7 @@ openerp.report_invoice_utility = function (instance, local) {
|
|
|
var currency_new;
|
|
|
var item = this.invoices[i];
|
|
|
var id = item.currency_id[0];
|
|
|
- currency_new = this.getCutrrency(id)
|
|
|
+ currency_new = this.getCutrrency(id);
|
|
|
if (!currency_new){
|
|
|
currency_new={};
|
|
|
currency_new.rate=1;
|
|
@@ -205,8 +212,8 @@ openerp.report_invoice_utility = function (instance, local) {
|
|
|
|
|
|
for (var i = 0; i < this.invoiceLines.length; i++) {
|
|
|
item = this.invoiceLines[i];
|
|
|
- invoice = this.getInvoice(item.id)
|
|
|
- producto =this.getProduct(item.product_id)
|
|
|
+ invoice = this.getInvoice(item.id);
|
|
|
+ producto =this.getProduct(item.product_id);
|
|
|
if (!producto){
|
|
|
producto={};
|
|
|
producto.standard_price=0;
|