GnuCash
Contact   Instructions
Bug 796914 - Customer Summary is giving error
Summary: Customer Summary is giving error
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Reports (show other bugs)
Version: 3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: reports
QA Contact: reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-15 16:07 EDT by Bilal Arshad
Modified: 2018-10-29 21:43 EDT (History)
3 users (show)

See Also:


Attachments
Trace Flile (2.53 KB, application/octet-stream)
2018-10-15 16:07 EDT, Bilal Arshad
no flags Details

Description Bilal Arshad 2018-10-15 16:07:36 EDT
Created attachment 373029 [details]
Trace Flile

customer summary report is giving the error 

it seems if we have the expense against the customer, but still, no sale is booked against that customer, the report shows error, but if we open the same file with the older version like 2.6 it shows correct report.
Comment 1 Christopher Lam 2018-10-16 01:15:39 EDT
Seems to be a division/0 error calculating the profit.

income seems to be $0
profit seems to be $3760

this customer summary report is a weird report. can you explain the specifics of how you're using it?

e.g. you're purchasing for customer and billing customer afterwards at a higher price? if there's no sales then what should the markup be (profit=+ve / sales=0)?
Comment 2 Bilal Arshad 2018-10-16 02:01:57 EDT
let me explain my business,

we supply manpower, we pay manpower salary and accommodation and transportation expenses on the due date,   but we can only invoice we receive actual time sheer form company, on that base we invoice customer with the pre-agreed rate per hour, which is always higher than the agreed rate with our manpower, (we pay manpower fix wages plus over time, but we charge customers per hour rate )

report should look like this(produce by 2.6v of GNUCASH) (thsi is only report show custoemr wise income an expence - very important report )



Customer Summary 01/01/2018 - 12/31/2018

10/16/2018
Customer	Profit	         Markup	Sales	        Expense
ADVOC	        Dhs(3,620.00)	 0%	Dhs0.00	        Dhs3,620.00
Al Biyan Water	Dhs3,803.54	62%	Dhs6,117.00	Dhs2,313.46
Red Diamond	Dhs(22,586.00)	 0%	Dhs0.00	        Dhs22,586.00
No Customer	Dhs(76,717.78)	 0%	Dhs0.00	        Dhs76,717.78
Total	        Dhs(99,120.24)	-1620%	Dhs6,117.00	Dhs105,237.24
Comment 3 Christopher Lam 2018-10-16 02:34:39 EDT
not sure why 3.3 is showing an error; afaik this report has not been changed for years.

try modify customer-summary.scm as follows

line 652-654:
--------
(define (markup-percent profit sales)
  (let ((m (if (zero? sales) 0
               (gnc-numeric-div profit sales 1000 GNC-HOW-RND-ROUND))))
    (* 100 (gnc-numeric-to-double m))))
--------
Comment 4 Bilal Arshad 2018-10-16 04:38:26 EDT
it worked !!!

Many thanks, 

Please update it in build as well for the next version, or as you like
Comment 5 Christopher Lam 2018-10-29 21:43:39 EDT
Thank you for report, it'll be fixed in 3.4 onwards.

Note You need to log in before you can comment on or make changes to this bug.