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

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

onClick='location.href=index.htm'> not working
Below is my code:

echo "<input type='button' value='redirect' onClick='location.h

image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image

Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav

SQl num_rows problem
when i try to count rows from an SQL select i get an warning

Code: [Select]$countviews = mysq

Multi-image upload problems
Lets see if I can get some help on this one. Can anyone show me what I am doing wrong here. I'm just

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

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

Two fgetcsv related questions ;D
First of im trying to get a file from a merchants server but the directory is protected, I know the

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