Creating an invoice


Posted on 16th Feb 2014 07:03 pm by admin

Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tiers.

I've got it working so it only displays a tier if the quantity is greater than 0 but I end up with a bunch of empty rows in between.

Instead of for example:

1 $20
2 $30
3 $40

I am getting

1 $20

2 $30


3 $40

How can I get it so the row is advanced only if something is output?

Code: for ($j=0; $j<12; $j++)
{
$data = Array();


if($pricearray[$j] > 0){
$data[0]['TEXT'] = $pricearray[$j];


$data[1]['TEXT'] = $_POST['select'];
$data[1]['TEXT'] .= " " . $pricedescriptionarray[$j];
$data[2]['TEXT'] = "Description";
$data[3]['TEXT'] = "20";
$data[4]['TEXT'] = "100";
}


$fsize += 0.5;

if ($fsize > 10) $fsize = 5;

$rgb_b -= 10;
$rgb_g -= 5;
$rgb_b -= 20;

if ($rgb_b < 150) $rgb_b = 255;
if ($rgb_g < 150) $rgb_g = 255;
if ($rgb_b < 150) $rgb_b = 255;

$pdf->tbDrawData($data);
}

No comments posted yet

Your Answer:

Login to answer
124 Like 35 Dislike
Previous forums Next forums
Other forums

Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag

Anti Spam Code Problems
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

mail() problem
Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

need help in dynamic select menu in php
hi i have created a dynamic select menu using php. i have a problem in that which is when the user s

Help with Contact Form
I have this Form on an html page and the associated code on page.php (below).
I keep getting the

Results from Db outputted twice
Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out

Printing issues with xMII 11.5
For some reason, we have one report (and only one) that is giving us fits when trying to print. The

Open/Close Links in Php
Hello, Hoping someone can inform me how I can get PHP to automatically open a set of links in a new

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash