Some General Errors


#1

Kia ora!

I just wanted to advise you of a few general errors I have found.

In the pdf templates for both invoices and quotes:

if ($quote->client_city && $quote->client_zip) {
            echo '<div>' . $quote->client_city . ' ' . $quote->client_zip . '</div>';
        } else {
            if ($quote->client_zip) {
                echo '<div>' . $quote->client_zip . '</div>';
            }
            if ($quote->client_zip) {
                echo '<div>' . $quote->client_zip . '</div>';
            }
        }

and

if ($quote->user_city && $quote->user_zip) {
            echo '<div>' . $quote->user_city . ' ' . $quote->user_zip . '</div>';
        } else {
            if ($quote->user_zip) {
                echo '<div>' . $quote->user_zip . '</div>';
            }
            if ($quote->user_zip) {
                echo '<div>' . $quote->user_zip . '</div>';
            }
        }

Are the client_zip and user_zip duplicates supposed to be client_city and user_city?

Also, in the settings menu (and on the Invoice Archive page) I’m assuming “Invoice archive” should have a capital A like the rest of the menu?

Cheers


Error in pdf templates city/zip?
#2

https://development.invoiceplane.com/browse/IP-373

Status: fixed :white_check_mark:


#3

Kia ora Kovah,

Not sure if this is helpful to implement for IP-373, but within my own templates I have replaced this code (and the following code for client_state) with the following for both client & user (adjusting the values accordingly of course).

if ( $invoice->client_city || $invoice->client_state || $invoice->client_zip ) {
	    echo '<div>';
	    if ( $invoice->client_city ) {
	        echo $invoice->client_city  . ' ';
	    }
	    if ( $invoice->client_state ) {
	        echo $invoice->client_state . ' ';
	    }
	    if ( $invoice->client_zip ) {
	        echo $invoice->client_zip  . ' ';
	    }
	    echo '</div>';
	}

It helps keep City/State/Zip on the one line which not only saves space but also is the most common way of formatting addresses. Also, if one those values doesn’t exist in the database it won’t output them on individual lines as it does currently.

Cheers
Toherangi


closed #4