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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

Problem with creating FI documents
Hi, Experts!

when i create Fi doc. with standart transaction, i ve been had such problem

How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
But w

import table with dependency
Hi

What is the best way to import table back which has dependency?

SQL> cre

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

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