|
@@ -268,11 +268,9 @@ function report_works (reporting){
|
|
|
factSearch: function(){
|
|
|
var self = this;
|
|
|
var desde =this.$el.find('#from').val();
|
|
|
- console.log(desde);
|
|
|
var hasta =this.$el.find('#to').val();
|
|
|
var customer= this.$el.find('#customer').val().split('-');
|
|
|
var content = self.content;
|
|
|
- console.log(content[0].date_in);
|
|
|
if (desde.length > 0){
|
|
|
var date= desde.split('/');
|
|
|
content = _.filter(content, function (inv){
|
|
@@ -283,7 +281,6 @@ function report_works (reporting){
|
|
|
var date= hasta.split('/');
|
|
|
content = _.filter(content, function (inv){
|
|
|
return inv.date <= (date[2]+"-"+date[1]+"-"+date[0]);
|
|
|
- // return inv.date <= hasta;
|
|
|
});
|
|
|
}
|
|
|
if (customer != ""){
|
|
@@ -302,48 +299,28 @@ function report_works (reporting){
|
|
|
getObjetPdf: function(){
|
|
|
var self = this;
|
|
|
var rows=[];
|
|
|
- var data = self.content;
|
|
|
- var desde =this.$el.find('#from').val();
|
|
|
- var hasta =this.$el.find('#to').val();
|
|
|
- var customer= this.$el.find('#customer').val().split('-');
|
|
|
- if (desde.length > 0){
|
|
|
- var date= desde.split('/');
|
|
|
- data = _.filter(data, function (inv){
|
|
|
- return inv.date_in >= (date[2]+"-"+date[1]+"-"+date[0]);
|
|
|
- });
|
|
|
- }
|
|
|
- if (hasta.length > 0){
|
|
|
- var date= desde.split('/');
|
|
|
- data = _.filter(data, function (inv){
|
|
|
- return inv.date_in <= (date[2]+"-"+date[1]+"-"+date[0]);
|
|
|
- });
|
|
|
- }
|
|
|
- if (customer != ""){
|
|
|
- data = _.filter(data, function(inv){
|
|
|
- return inv.customer_id == customer[0];
|
|
|
- });
|
|
|
- }
|
|
|
- rows = data;
|
|
|
+ rows = self.rowsData;
|
|
|
+
|
|
|
// valor Aseguradora
|
|
|
- var secure_total = _.reduce(_.map(data,function(map){
|
|
|
+ var secure_total = _.reduce(_.map(rows,function(map){
|
|
|
return(map.intsecure_amount);
|
|
|
}),function(memo, num){
|
|
|
return memo + num;
|
|
|
},0);
|
|
|
// valor Particular
|
|
|
- var particular_total = _.reduce(_.map(data,function(map){
|
|
|
+ var particular_total = _.reduce(_.map(rows,function(map){
|
|
|
return(map.intparticular_amount);
|
|
|
}),function(memo, num){
|
|
|
return memo + num;
|
|
|
},0);
|
|
|
// Monto ya cobrado
|
|
|
- var pay_total = _.reduce(_.map(data,function(map){
|
|
|
+ var pay_total = _.reduce(_.map(rows,function(map){
|
|
|
return(map.intpay_amount);
|
|
|
}),function(memo, num){
|
|
|
return memo + num;
|
|
|
},0);
|
|
|
// Monto a Cobrar
|
|
|
- var collect_total = _.reduce(_.map(data,function(map){
|
|
|
+ var collect_total = _.reduce(_.map(rows,function(map){
|
|
|
return(map.intcollect);
|
|
|
}),function(memo, num){
|
|
|
return memo + num;
|
|
@@ -406,9 +383,9 @@ function report_works (reporting){
|
|
|
customer : {columnWidth: '8px'},
|
|
|
car : {columnWidth: '8px'},
|
|
|
agent : {columnWidth: '8px'},
|
|
|
- date_in : {columnWidth: '5px'},
|
|
|
- secure_amount : {columnWidth: '8px'},
|
|
|
- particular_amount : {columnWidth: '8px'},
|
|
|
+ date_in : {halign:'center',columnWidth: '5px'},
|
|
|
+ secure_amount : {halign:'right',columnWidth: '8px'},
|
|
|
+ particular_amount : {halign:'right',columnWidth: '8px'},
|
|
|
state: {halign:'right',columnWidth: '8px'},
|
|
|
pay_amount: {halign:'right',columnWidth: '8px'},
|
|
|
collect: {halign:'right',columnWidth: '8px'},
|