-
Notifications
You must be signed in to change notification settings - Fork 0
/
invoice_bill.php
65 lines (48 loc) · 1.83 KB
/
invoice_bill.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
include_once("../fpdf/fpdf.php");
if ($_GET["order_date"] && $_GET["invoice_no"]) {
$pdf = new FPDF();
$pdf->AddPage();
$pdf->setFont("Arial","B",20);
$pdf->Cell(190,10,"Indian Pharmaceuticals",0,1,"C");
$pdf->setFont("Arial",null,12);
$pdf->Cell(50,10,"Date",0,0);
$pdf->Cell(50,10,": ".$_GET["order_date"],0,1);
$pdf->Cell(50,10,"Invoice Bill No",0,0);
$pdf->Cell(50,10,": PS/2018/0".$_GET["invoice_no"],0,1);
$pdf->Cell(50,10,"Customer Name",0,0);
$pdf->Cell(50,10,": ".$_GET["cust_name"],0,1);
$pdf->Cell(50,10,"",0,1);
$pdf->Cell(10,10,"#",1,0,"C");
$pdf->Cell(70,10,"Product Name",1,0,"C");
$pdf->Cell(30,10,"Quantity",1,0,"C");
$pdf->Cell(40,10,"Price",1,0,"C");
$pdf->Cell(40,10,"Total (Rs)",1,1,"C");
for ($i=0; $i < count($_GET["pid"]) ; $i++) {
$pdf->Cell(10,10, ($i+1) ,1,0,"C");
$pdf->Cell(70,10, $_GET["pro_name"][$i],1,0,"C");
$pdf->Cell(30,10, $_GET["qty"][$i],1,0,"C");
$pdf->Cell(40,10, $_GET["price"][$i],1,0,"C");
$pdf->Cell(40,10, ($_GET["qty"][$i] * $_GET["price"][$i]) ,1,1,"C");
}
$pdf->Cell(50,10,"",0,1);
$pdf->Cell(50,10,"Sub Total",0,0);
$pdf->Cell(50,10,": ".$_GET["sub_total"],0,1);
$pdf->Cell(50,10,"Gst Tax",0,0);
$pdf->Cell(50,10,": ".$_GET["gst"],0,1);
$pdf->Cell(50,10,"Discount",0,0);
$pdf->Cell(50,10,": ".$_GET["discount"],0,1);
$pdf->Cell(50,10,"Net Total",0,0);
$pdf->Cell(50,10,": ".$_GET["net_total"],0,1);
$pdf->Cell(50,10,"Paid",0,0);
$pdf->Cell(50,10,": ".$_GET["paid"],0,1);
$pdf->Cell(50,10,"Due Amount",0,0);
$pdf->Cell(50,10,": ".$_GET["due"],0,1);
$pdf->Cell(50,10,"Payment Type",0,0);
$pdf->Cell(50,10,": ".$_GET["payment_type"],0,1);
$pdf->Cell(180,10,"Signature",0,0,"R");
$pdf->Output("../PDF_INVOICE/PDF_INVOICE_".$_GET["invoice_no"].".pdf","F");
$pdf->Output();
}
?>