mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:07:32 -05:00 
			
		
		
		
	Fix sum on PnL report
This commit is contained in:
		
							parent
							
								
									3ec92c8025
								
							
						
					
					
						commit
						92a7fc10d2
					
				@ -59,7 +59,7 @@ class ProfitAndLossReport extends AbstractReport
 | 
				
			|||||||
            $this->data[] = [
 | 
					            $this->data[] = [
 | 
				
			||||||
                trans('texts.expense'),
 | 
					                trans('texts.expense'),
 | 
				
			||||||
                $client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
 | 
					                $client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
 | 
				
			||||||
                $expense->present()->amount,
 | 
					                '-' . $expense->present()->amount,
 | 
				
			||||||
                $expense->present()->expense_date,
 | 
					                $expense->present()->expense_date,
 | 
				
			||||||
                $expense->present()->category,
 | 
					                $expense->present()->category,
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
 | 
				
			|||||||
@ -474,7 +474,7 @@
 | 
				
			|||||||
			if (str.indexOf(':') >= 0) {
 | 
								if (str.indexOf(':') >= 0) {
 | 
				
			||||||
				return roundToTwo(moment.duration(str).asHours());
 | 
									return roundToTwo(moment.duration(str).asHours());
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				var number = Number(str.replace(/[^0-9]+/g, ''));
 | 
									var number = Number(str.replace(/[^0-9\-]+/g, ''));
 | 
				
			||||||
				return number / 100;
 | 
									return number / 100;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -528,7 +528,7 @@
 | 
				
			|||||||
				            var txt = $(this).find("td").eq(i).text();
 | 
									            var txt = $(this).find("td").eq(i).text();
 | 
				
			||||||
				            subtotal += convertStringToNumber(txt);
 | 
									            subtotal += convertStringToNumber(txt);
 | 
				
			||||||
				          });
 | 
									          });
 | 
				
			||||||
				          $cell.find(".group-count").append(' - ' + label + ': ' + roundToTwo(subtotal));
 | 
									          $cell.find(".group-count").append(' - ' + label + ': ' + roundToTwo(subtotal, true));
 | 
				
			||||||
					  }
 | 
										  }
 | 
				
			||||||
			        },
 | 
								        },
 | 
				
			||||||
			    }
 | 
								    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user