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

Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaW

AUTONUMBER PROBLEM
Hello Everyone,

My name is Jones and i am new to this forum and to oracle. I am using ora

Struct/union and scope problem!
HI all , I have
Code: in header.h typedef struct Node Link; /* ---------

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

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

constructor ?
i have written this program and made 3 constructors in the class and i want to call them in the main

using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Calling variables
I want to call this to my website but it doesn't display what I want it to,

Code: <h5&

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