Duplicate customer name on tax invoice

Derek Atkins warlord at MIT.EDU
Wed Mar 23 08:56:37 EDT 2011


Mike,

Mike Evans <mikee at saxicola.idps.co.uk> writes:

> Hi David
> I think I'd like to fix the problem at source, so to speak, rather than 
> intoduce  work-arounds in the invoice.  This way future upgrades won't break 
> peoples invoices and the simple invoice as well as the guile invoices will all 
> work as they should.  Dereks' suggestion is the correct change to make in 
> taxinvoice.eguile.scm (line 56) along with two minor changes in busines-
> core.scm.  This should make all the reports work as they should and updates 
> will not affect anybody adversely.
>
> I've put a partial diff below for busines-core.scm.  The changes can be made 
> manually by taking out the lines marked - and adding the lines markes +.  If 
> you're happy to do that (after making a backup!) and it works OK for you then 
> I'll make sure the changes get into the source.
>
>
> @@ -35,12 +35,14 @@
>    (define (just-name name)
>      (if name name ""))
>  
> -  (let ((type (gncOwnerGetType owner)))
> +  (let ((type (gncOwnerGetType owner))
> +               (addr (gnc:owner-get-address owner))
> +       )
>      (cond
>        ((eqv? type GNC-OWNER-JOB)
>         (gnc:owner-get-name-dep (gncJobGetOwner
>                                 (gncOwnerGetJob owner))))
> -      (else (just-name (gncOwnerGetName owner))))))
> +      (else (just-name (gncAddressGetName addr))))))
>  
>  (define (gnc:owner-get-address-dep owner)
>    (define (add-if-exists lst new)
> @@ -54,8 +56,6 @@
>       (else (string-append (build-string (cdr lst)) "\n" (car lst)))))
>    (let ((lst '())
>         (addr (gnc:owner-get-address owner)))
> -; Added gncAddressGetName  <mikee at saxicola.co.uk>
> -    (set! lst (add-if-exists lst (gncAddressGetName  addr)))
>      (set! lst (add-if-exists lst (gncAddressGetAddr1 addr)))
>      (set! lst (add-if-exists lst (gncAddressGetAddr2 addr)))
>      (set! lst (add-if-exists lst (gncAddressGetAddr3 addr)))

I think there is still some confusion here.  There are three things that
need to be printable:

* Company Name
* Contact Name (AddressName)
* Address

At least here in the USA there are a couple ways it's done:

   Contact Name
   Company Name
   Address
or
   Company Name
   Address
   Attn Contact Name

The invoice reports have all defaulted to the first representation, and
the code was implemented that way.  It sounds like another report wants
the second representation, which is harder to do as currently
implemented.

Please make sure we allow both representations.

Similarly, we need to check whether Company Name == Contact Name and if
so only print it once.

> Regards Mike E

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list