} if ($this->current_page > 0) { $this->SetY(-14); $this->SetFont('Arial', 'B', 8); $this->Cell(0, 4, $this->printed_po . " page " . $this->current_page . ' ', 0, 1, 'C'); } } function OrderBarcode($barcode, $barcode_xpos, $barcode_ypos, $barcode_width) { $barcode_code39_no = $barcode; $barcode_code39 = DIR_FS_BARCODES . drawBarcode('CODE39', 'AMVDPO', $barcode_code39_no, false, false); $this->Image($barcode_code39, $barcode_xpos, $barcode_ypos, $barcode_width); } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Amazon Packing Slip'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); //$pdf->AddPage(); $margin = 10; $ypos = $margin; $box_width = 190; $box_shipping_width = 80; $box_billing_width = $box_width - $box_shipping_width; $gap_between_boxes = 5; $box1_height = 20; $box2_height = 24; $box3_height = 14;
/** * * @global array $DIAMOND_BRAND_IDS * @global string $server * @global jng_sp $class_sp * @global products_minierp $class_pm * @global logger $logger * @global string $icon_diamond * @global string $icon_gold_585_w * @global string $icon_gold_585_g * @param string $timestamp * @param int $jng_sp_id * @return boolean */ function generateReports($timestamp, $jng_sp_id) { global $DIAMOND_BRAND_IDS, $server, $class_sp, $class_pm, $logger, $icon_diamond, $icon_gold_585_w, $icon_gold_585_g; $log_date = strtotime($timestamp); $sp_detail = $jng_sp_id > 0 ? $class_sp->retrieveDetail($jng_sp_id) : array('package_prefix' => 'JG.DE'); $filter_sold = 1; $filter_age = 56; $logger->write("GENERATING REPORT {$sp_detail['package_prefix']}"); /* * Query get new products which: * 1) age <= 8 weeks (56 days) * 2) total sold >= 1 */ $q = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.material_expenses, p.stars "; $q .= " , ptc.categories_id AS catid, cd.categories_name"; $q .= " , IFNULL(plps.sold_monthly_1, 0) AS sold_monthly_1, IFNULL(plps.sold_monthly_2, 0) AS sold_monthly_2"; if ($jng_sp_id > 0) { $q .= " , ((jc.total_returned / jc.total_sold) * 100) AS returned_rate, jc.active_age"; } else { $q .= " , 'N/A' AS returned_rate, DATEDIFF(NOW(), p.products_date_added) AS active_age"; } $q .= " FROM products p"; if ($jng_sp_id > 0) { $q .= " INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id = {$jng_sp_id} AND jc.products_id = p.products_id"; } else { $q .= " INNER JOIN orders_products op ON op.products_id = p.products_id"; } $q .= " LEFT JOIN products_log_per_sp plps ON plps.products_id = p.products_id AND plps.jng_sp_id = {$jng_sp_id}"; $q .= " LEFT JOIN products_to_categories ptc ON ptc.products_id = p.products_id"; $q .= " LEFT JOIN categories_description cd ON cd.categories_id = ptc.categories_id AND cd.language_id = 1"; $q .= " WHERE"; if ($jng_sp_id > 0) { $q .= " jc.active_age <= {$filter_age}"; $q .= " AND jc.active_status = 1"; $q .= " AND total_sold >= {$filter_sold}"; } else { //$q .= " p.products_date_added >= '2013-01-01 00:00:00'"; $q .= " DATEDIFF(NOW(), p.products_date_added) <= {$filter_age}"; $q .= " AND p.products_status = 1"; $q .= " AND op.status NOT IN (10, 12)"; $q .= " GROUP BY p.products_id"; $q .= " HAVING SUM(op.products_quantity) >= {$filter_sold}"; } //$q .= " LIMIT 5"; $dbq = tep_db_query($q); $products = array(); while ($row = tep_db_fetch_array($dbq)) { $row['margin'] = $class_pm->calculateMargin($row['products_price'], $row['material_expenses'], 1); $products[$row['catid']][$row['products_id']] = $row; } if (count($products) == 0) { $logger->write("NO DATA RETRIEVED"); return false; } //Start Creating PDF Reports $margin = 20; $ypos = 10; $col_width = 48; $col_height = 77; $line_height = 5; $cell_text_width = $col_width - 3; $no = 0; $row = 1; $icon_w = 4; $icon_h = 4; $first_page = true; $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('New Comer Report'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT NEWCOMER PRODUCT ' . $sp_detail['package_prefix'] . ' (' . date('d.m.Y', $log_date) . ')', 0, 0, 'C'); $pdf->setFont('Arial', '', '10'); $ypos += 15; $pdf->setXY($margin, $ypos); $catids = load_config('products-categories-sorting'); foreach ($catids as $catid) { $xpos = $margin; if (is_array($products[$catid])) { foreach ($products[$catid] as $pid => $p) { $obj_product = new product($pid); $no++; if ($ypos >= 150 || $no == 1 && !$first_page) { //Reset vars to new page state $xpos = $margin; $ypos = 25; $row = 1; $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); } //Draw product box $pdf->Cell($col_width, $col_height, '', 1, 0); //Start drawing contents $pdf->drawProductsImage($xpos + 10, $ypos + 1, $p['products_image']); if (is_object($obj_product) && in_array($obj_product->brand_id, $DIAMOND_BRAND_IDS)) { $ypos_icon = $ypos + 3; $pdf->drawIcon($icon_diamond, $xpos + 39.5, $ypos_icon, $icon_w, $icon_h); } if (is_object($obj_product) && ($obj_product->metal_stamp_code > 0 && $obj_product->metal_stamp_code != 925)) { $icon_gold_selected = "icon_gold_" . $obj_product->metal_stamp_code . '_' . strtolower(substr($obj_product->metal_stamp_info, 0, 1)); $icon_gold = ${$icon_gold_selected}; $ypos_icon += $icon_h; //gold icon dimension is 21 x 16 $icon_gold_w = 21 / 16 * $icon_h; $pdf->drawIcon($icon_gold, $xpos + 38, $ypos_icon, $icon_gold_w, $icon_h); } $pdf->setXY($xpos + 2, $ypos + 3); $pdf->setFont('Arial', 'B', '10'); $pdf->Cell($col_width, $line_height, $no . ". " . ($no == 1 ? $p['categories_name'] : '')); $pdf->setFont('Arial', '', '10'); $pdf->drawStar($p['stars'], $xpos + 15, $ypos + 29); $pdf->setXY($xpos + 2, $ypos + 35); $link = "http://{$server}/?open=product-detail&products_id=" . $pid; $pdf->SetFont('Arial', 'U'); $pdf->SetTextColor(0, 0, 255); $pdf->Cell($cell_text_width, $line_height, $pid . ' / ' . $p['products_model'], 0, 0, 'C', 0, $link); $pdf->SetFont('Arial', ''); $pdf->SetTextColor(0, 0, 0); $pdf->setXY($xpos + 2, $ypos + 40); $pdf->Cell($cell_text_width, $line_height, 'Price: ' . displayCurrency('EUR', $p['products_price'], false) . ' EUR', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 45); $pdf->Cell($cell_text_width, $line_height, 'Margin: ' . number_format($p['margin'], 1) . '%', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 50); $pdf->Cell($cell_text_width, $line_height, 'Return Rate: ' . ($jng_sp_id > 0 ? number_format($p['returned_rate'], 1) . '%' : $p['returned_rate']), 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 60); $pdf->Cell($cell_text_width, $line_height, 'Age in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['active_age'] . ' days', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 65); $pdf->Cell($cell_text_width, $line_height, 'Sold L30D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_1'], 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 70); $pdf->Cell($cell_text_width, $line_height, 'Sold L60D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_2'], 0, 0, 'C'); if ($no % 5 == 0) { $row++; $xpos = $margin; $ypos += $col_height * ($row - 1) + 5; } else { $xpos += $col_width + 5; } $pdf->setXY($xpos, $ypos); } $first_page = false; } $no = 0; } $filepath = 'sales-report-newcomer-products/'; $yeardir = $filepath . date('Y/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $yeardir) || !is_dir(DIR_FS_ARCHIVES . $yeardir)) { mkdir(DIR_FS_ARCHIVES . $yeardir); } $monthdir = $yeardir . date('m/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $monthdir) || !is_dir(DIR_FS_ARCHIVES . $monthdir)) { mkdir(DIR_FS_ARCHIVES . $monthdir); } $path_location = DIR_FS_ARCHIVES . $monthdir; $filename = date('YmdHi', strtotime($timestamp)) . '-sales-report-newcomer-products-' . $sp_detail['package_prefix'] . '.pdf'; $pdf->Output($path_location . $filename, 'F'); $logger->write("PDF CREATED: {$filename}"); //$pdf->Output($filename, 'D'); return true; }
//End ifelse:Line26 } //End if:Line 24 } //End if:Line 9 } //End if:Line 8 $pdf = new PDF($orientacion, 'mm', 'Letter'); $pdf->SetPathLogo($cfg_rpt['logo_imagen']); $pdf->Setancho_imagen($cfg_rpt['alto_imagen']); $pdf->Setalto_imagen($cfg_rpt['ancho_imagen']); $pdf->Setimagen_position_x($cfg_rpt['position_x']); $pdf->Setimagen_position_y($cfg_rpt['position_y']); $pdf->setAuthor($cfg_rpt['autor']); $pdf->setDisplayMode('real'); $pdf->setTitle("Reporte de Fiscalizacion"); $pdf->SetMargins(3, 2, 3); $pdf->AliasNbPages('Total_page'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 11.5); $pdf->Cell(0, 0, $Title_Principal . $desc_solicitud, 0, 0, 'C'); $pdf->Ln(3); if (isset($orientacion)) { if ($orientacion == 'P') { $new_line = 6; $pdf->Cell(150); $pdf->Cell(0, 0, 'Solicitud N: ' . str_pad($obj_solicitud->getId_solicitud(), 10, "0", STR_PAD_LEFT), 0, 1, 'L'); $pdf->Ln(10); $pdf->Cell(10); // $pdf->Cell(0,0,'Estatus: '.$obj_solicitud->getStatus(),0,0,'L'); $pdf->Cell(21, 6, "Estatus: ", 0, 0, 'L');
$str = ' Utilisateur normal'; } elseif ($access == 'P') { $str = ' Extension uniquement'; } if ($SecUser->admin == 1) { $str = ' Super Admin'; $admin = 1; } //----------------------------------------------------- // Print result $pdf = new PDF($cn); $pdf->setDossierInfo(dossier::name() . ' Sécurité'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->setTitle("Sécurité", true); $str_user = sprintf("( %d ) %s %s [ %s ] - %s", $SecUser->id, $SecUser->first_name, $SecUser->name, $SecUser->login, $str); $pdf->SetFont('DejaVu', 'B', 9); $pdf->Cell(0, 7, $str_user, 'B', 0, 'C'); $pdf->Ln(); if ($SecUser->active == 0) { $pdf->SetTextColor(255, 0, 34); $pdf->Cell(0, 7, 'Bloqué', 0, 0, 'R'); $pdf->Ln(); } if ($SecUser->admin == 1) { $pdf->SetTextColor(0, 0, 0); $pdf->setFillColor(239, 251, 255); $pdf->Cell(40, 7, 'Administrateur', 1, 1, 'R'); $pdf->Ln(); }
if ($this->doc_type == 'return-note') { $this->SetY(-15); $this->SetFont('Arial', '', 8); //page numbers start counting from page #2 $this->Cell(0, 10, 'Seite ' . $this->PageNo() . ' von {nb}', 0, 0, 'C'); } } function OrderBarcode($joi_id, $barcode_xpos, $barcode_ypos, $barcode_width) { $barcode_code39_no = 'JR-' . $joi_id; $barcode_code39 = DIR_FS_BARCODES . drawBarcode('CODE39', 'M', $barcode_code39_no, false, false); $this->Image($barcode_code39, $barcode_xpos, $barcode_ypos, $barcode_width); } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Retail Invoice'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 20); $margin = 10; $address_width = 60; $address_height = 30; $address_height2 = 33; $gray = 160; $fontsize_big = '9'; $fontsize_med = '8'; $fontsize_sml = '7'; $fontsize_sml_med = '6'; $fontsize_tny = '5'; $order_counter = 0;
} function OrderBarcode($barcode, $barcode_xpos, $barcode_ypos, $barcode_width) { $barcode_code39_no = $barcode; $barcode_code39 = DIR_FS_BARCODES . drawBarcode('CODE39', 'M', $barcode_code39_no, false, false); $this->Image($barcode_code39, $barcode_xpos, $barcode_ypos, $barcode_width); } function AcceptPageBreak() { $this->ean_ypos = $this->margin; $this->total_ean_lines = 0; return true; } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('HH Pick List'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 20); $pdf->AliasNbPages(); PrintPickingList($pick_from_racks, $trolley, $bin_location_qty_collection, $need_repackage); PrintOrdersList($orders_barcode, $orders, $trolley, $need_repackage); //PRINT PICKING LIST function PrintPickingList($pick_from_racks, $trolley, $bin_location_qty_collection, $need_repackage = false) { global $pdf; $pdf->AddPage(); $margin = $pdf->margin; $pdf->ean_ypos = $margin; $counter_size = 10;
{ var $left_margin; var $page_width; var $page_height; var $font_size; //Page header function Header() { } //Page footer function Footer() { } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Invoice'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->left_margin = 10; $pdf->top_margin = 20; $pdf->page_width = 210; $pdf->page_height = 297; $pdf->font_size = 11; $pdf->line_height = 6; $pdf->AddPage(); $pdf->setFont('Arial', '', $pdf->font_size); //PAGING SETTING $firstpagecount = 41; $nextpagecount = 54; //HEADER RIGHT
{ //Posición: a 1,5 cm del final $this->SetY(-20); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Número de página $this->Cell(0, 10, 'Sistema IMAUD ' . $this->PageNo() . '/{nb}', 0, 0, 'R'); $this->Ln(3); $this->Cell(0, 10, 'Coop. Programación Web S.R.L.', 0, 0, 'R'); } } //Creación del objeto de la clase heredada $pdf = new PDF('Portrait', 'mm', 'Letter'); $pdf->setAuthor('Sistema Imaud - Modulo de Fiscalizacion'); $pdf->setDisplayMode('real', 'continuous'); $pdf->setTitle('Fiscalizacion' . $registro[0]); $pdf->SetMargins(3, 3, 3); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 11.5); $pdf->Cell(0, 0, 'F I S C A L I Z A C I O N ', 0, 0, 'C'); $pdf->Ln(5); $pdf->Cell(150); $pdf->Cell(0, 0, 'N° ' . $registro[0], 0, 1, 'L'); $pdf->Ln(10); ///////////////////////////////////////////////// $pdf->Cell(30); $pdf->Cell(0, 0, 'Fecha de Solicitud: ', 0, 1, 'L'); $pdf->SetFont('Arial', '', ''); $pdf->Cell(85); $pdf->Cell(0, 0, $fecha, 0, 1, 'L');
$cond_poste .= ' pcm_val >= upper (\'' . Database::escape_string($from_poste) . '\')'; } if ($to_poste != '') { if ($cond_poste == '') { $cond_poste = ' where pcm_val <= upper (\'' . Database::escape_string($to_poste) . '\')'; } else { $cond_poste .= ' and pcm_val <= upper (\'' . Database::escape_string($to_poste) . '\')'; } } $sql = $sql . $cond_poste . ' order by pcm_val::text'; $a_poste = $cn->get_array($sql); $pdf = new PDF($cn); $pdf->setDossierInfo(" Periode : " . $from_periode . " - " . $to_periode); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->setTitle("Grand Livre", true); $pdf->SetAuthor('NOALYSS'); if (count($a_poste) == 0) { $pdf->Output(); return; } // Header $header = array("Date", "Référence", "Libellé", "Pièce", "Let", "Débit", "Crédit", "Solde"); // Left or Right aligned $lor = array("L", "L", "L", "L", "R", "R", "R", "R"); // Column widths (in mm) $width = array(13, 20, 60, 15, 12, 20, 20, 20); $l = isset($_REQUEST['letter']) ? 2 : 0; $s = isset($_REQUEST['solded']) ? 1 : 0; foreach ($a_poste as $poste) { $Poste = new Acc_Account_Ledger($cn, $poste['pcm_val']);
$this->SetFont('Arial', 'B', 8); $this->Cell(0, 4, 'Printed on ' . date('d.m.Y H:i') . ' ', 0, 1, 'C'); $this->SetFont('Arial', '', 8); $this->Cell(0, 4, 'Page ' . $this->PageNo() . ' of {nb}', 0, 1, 'C'); } } $margin_top = 30; $margin_left = 10; $spacing = 10; $line_height = 5; $label_width = 20; $value_width = 80; $img_size = 18; $img_path = DIR_WS_IMAGES . 'imagecache/'; $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Bonofactum Purchase Order'); $pdf->SetAuthor('Manobo'); $pdf->SetCreator('Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false, 1); $pdf->AliasNbPages(); $pdf->SetFillColor(200, 200, 200); $pdf->po_id = $pocode; $pdf->po_date = $order_date; if ($mode == '2col') { //PDF 2COLS Format for Silver Dragon $img_boxpad = 2; $product_per_col = 8; $product_per_page = $product_per_col * 2; $counter = 0; foreach ($items2print as $e) {
/* Security */ $cn = new Database($gDossier); extract($_GET); if (isset($poste_fille)) { //choisit de voir tous les postes $a_poste = $cn->get_array("select pcm_val from tmp_pcmn where pcm_val::text like '{$poste_id}%' order by pcm_val"); } else { $a_poste = $cn->get_array("select pcm_val from tmp_pcmn where pcm_val::text = '{$poste_id}'"); } $ret = ""; $pdf = new PDF($cn); $pdf->setDossierInfo(" Periode : " . $_GET['from_periode'] . " - " . $_GET['to_periode']); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->setTitle("Détail poste comptable", true); if (count($a_poste) == 0) { $pdf->Output('poste.pdf', 'D'); exit; } $size = array(13, 25, 13, 65, 12, 20, 20, 20); $align = array('L', 'C', 'C', 'L', 'R', 'R', 'R', 'R'); foreach ($a_poste as $poste) { $Poste = new Acc_Account_Ledger($cn, $poste['pcm_val']); list($array, $tot_deb, $tot_cred) = $Poste->get_row_date($from_periode, $to_periode, $_GET['ople']); // don't print empty account if (count($array) == 0) { continue; } $Libelle = sprintf("(%s) %s ", $Poste->id, $Poste->get_name()); $pdf->SetFont('DejaVuCond', '', 10);
} $pPeriode = new Periode($cn); $a = $pPeriode->get_date_limit($from_periode); $b = $pPeriode->get_date_limit($to_periode); $per_text = " du " . $a['p_start'] . " au " . $b['p_end']; if ($previous == 1) { $pdf = new PDFLand($cn); } else { $pdf = new PDF($cn); } $pdf->setDossierInfo(" Balance " . $per_text); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->SetFont('DejaVuCond', '', 7); $pdf->setTitle("Balance comptable", true); $pdf->Cell(30, 6, 'poste'); $pdf->LongLine(60, 6, 'Libellé'); if ($previous == 1) { $pdf->Cell(20, 6, 'Débit N-1', 0, 0, 'R'); $pdf->Cell(20, 6, 'Crédit N-1', 0, 0, 'R'); $pdf->Cell(20, 6, 'Débiteur N-1', 0, 0, 'R'); $pdf->Cell(20, 6, 'Créditeur N-1', 0, 0, 'R'); } $pdf->Cell(25, 6, 'Total Débit', 0, 0, 'R'); $pdf->Cell(25, 6, 'Total Crédit', 0, 0, 'R'); $pdf->Cell(25, 6, 'Solde Débiteur', 0, 0, 'R'); $pdf->Cell(25, 6, 'Solde Créditeur', 0, 0, 'R'); $pdf->Ln(); $pdf->SetFont('DejaVuCond', '', 8); $tp_deb = 0;
} function ChapterBody($file) { // Read text file $txt = file_get_contents($file); // Font $this->setFont('Times', '', 12); // Output text in a 6 cm width column $this->MultiCell(60, 5, $txt); $this->ln(); // Mention $this->setFont('', 'I'); $this->cell(0, 5, '(end of excerpt)'); // Go back to first column $this->setCol(0); } function PrintChapter($num, $title, $file) { // Add chapter $this->addPage(); $this->ChapterTitle($num, $title); $this->ChapterBody($file); } } $pdf = new PDF(); $title = '20000 Leagues Under the Seas'; $pdf->setTitle($title); $pdf->setAuthor('Jules Verne'); $pdf->PrintChapter(1, 'A RUNAWAY REEF', '20k_c1.txt'); $pdf->PrintChapter(2, 'THE PROS AND CONS', '20k_c2.txt'); $pdf->output();
$rightpos = $this->left_margin + 50; $this->SetXY($rightpos, $ypos); if (strpos($text, "\n") === false) { $this->Cell($label_width, $this->line_height, $text, 0, 0); } else { $textlines = explode("\n", $text); $this->MultiCell($label_width, $this->line_height, $text); } } //Page footer function Footer() { } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Commercial Invoice'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->left_margin = 10; $pdf->top_margin = 10; $pdf->page_width = 210; $pdf->page_height = 297; $pdf->font_size = 11; $pdf->line_height = 6; $pdf->AddPage(); $pdf->setFont('Arial', '', $pdf->font_size); //HEADER $ypos = 25; $line_height = $pdf->line_height; $pdf->LabelLeft($ypos, 'Date');
$zipper = new zip_file($zip_file); $zipper->set_options(array('storepaths' => 0)); $pdf_temp_path = '../temp/pdfs/'; $pdf_files = array(); $margin_top = 40; $margin_left = 10; $spacing = 10; $img_size = 18; $line_height = 5; $label_width = 20; $value_width = 80; $product_per_col = 8; $product_per_page = $product_per_col * 2; foreach ($supplier_list as $sup_id => $sl) { $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('J&G Elements Picking List'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false, 1); $counter = 0; foreach ($sl as $e) { $pdf->currentSupplier = $suppliers[$sup_id]; if ($counter % $product_per_page == 0) { $pdf->AddPage(); $pdf->setFont('Arial', '', '10'); $ypos = $margin_top; } if ($counter % $product_per_col == 0) { $ypos = $margin_top; }
$datoslevcatastral->SolicitudObject->SetIdSolicit($obj_solicitud->GetIdSolicit()); $datoslevcatastral->ExistsLevantamientoCatastral(); break; } } } $obje_usuario = new Usuario(); $pdf = new PDF($orientacion, 'mm', 'Letter'); $pdf->SetPathLogo("../view/images/logo.jpg"); $pdf->Setancho_imagen(40); $pdf->Setalto_imagen(40); $pdf->Setimagen_position_x($eje_x); $pdf->Setimagen_position_y($eje_y); $pdf->setAuthor('SISTEMA IMAUD'); $pdf->setDisplayMode('real'); $pdf->setTitle('Reporte de Fiscalizacion'); $pdf->SetMargins(3, 2, 3); $pdf->AliasNbPages('Total_page'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 11.5); $pdf->Cell(0, 0, $Title_Principal, 0, 0, 'C'); $pdf->Ln(3); if ($orientacion == "P") { $new_line = 6; $pdf->Cell(150); $pdf->Cell(0, 0, 'Solicitud N: ' . str_pad($obj_solicitud->GetIdSolicit(), 10, "0", STR_PAD_LEFT), 0, 1, 'L'); $pdf->Ln(10); $pdf->Cell(10); $pdf->Cell(0, 0, 'Estatus: ' . $obj_solicitud->GetStatusSolicit(), 0, 0, 'L'); if (trim($obj_solicitud->GetStatusSolicit()) != "EN PROCESO") { $numerolcorf = $des_solicitud == 'Fiscalizacion' ? $datosfiscalizados->GetNFiscalizacion() : $datoslevcatastral->GetLevCatast();
function display_pdf() { $array = $this->load(); if (empty($array)) { return; } $pdf = new PDF($this->db); $pdf->Setdossierinfo(dossier::name()); $pdf->setTitle("Balance analytique", true); $pdf->SetAuthor('NOALYSS'); $pdf->AliasNbPages(); $pdf->AddPage(); $pa = new Anc_Plan($this->db, $this->pa_id); $pa->get(); $pb = new Anc_Plan($this->db, $this->pa_id2); $pb->get(); $pdf->SetFont('DejaVu', 'B', 9); $pdf->Cell(0, 7, sprintf("Balance croise plan %s %s ", $pa->name, $pb->name), 1, 0, 'C'); $filtre_date = ""; $filtre_pa = ""; $filtre_pb = ""; if ($this->from != "" || $this->to != "") { $filtre_date = sprintf("Filtre date %s %s", $this->from, $this->to); } if ($this->from_poste != "" || $this->to_poste != "") { $filtre_pa = sprintf("Filtre poste plan1 %s %s", $this->from_poste != "" ? "de " . $this->from_poste : " ", $this->to_poste != "" ? "jusque " . $this->to_poste : ""); } if ($this->from_poste2 != "" || $this->to_poste2 != "") { $filtre_pb = sprintf("Filtre poste plan2 %s %s", $this->from_poste2 != "" ? "de " . $this->from_poste2 : " ", $this->to_poste2 != "" ? "jusque " . $this->to_poste2 : ""); } $pdf->SetFont('DejaVu', '', 8); $pdf->Cell(50, 7, $filtre_date); $pdf->Cell(50, 7, $filtre_pa); $pdf->Cell(50, 7, $filtre_pb); $pdf->Ln(); $pdf->SetFont('DejaVu', '', 6); $pdf->Cell(20, 7, 'id', 'B'); $pdf->Cell(100, 7, 'Poste Comptable', 'B'); $pdf->Cell(20, 7, 'Débit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Crédit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Solde', 'B', 0, 'L'); $pdf->Cell(20, 7, 'D/C', 'B', 0, 'L'); $pdf->Ln(); for ($i = 0; $i < count($array); $i++) { $row = $array[$i]; $pdf->Cell(20, 6, $row['a_po_name'], 0, 0, 'L'); $pdf->Cell(40, 6, mb_substr($row['a_po_description'], 0, 31), 0, 0, 'L'); $pdf->Cell(20, 6, $row['b_po_name'], 0, 0, 'L'); $pdf->Cell(40, 6, mb_substr($row['b_po_description'], 0, 31), 0, 0, 'L'); $pdf->Cell(20, 6, $row['a_d'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_c'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_solde'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_debit'], 0, 0, 'C'); $pdf->Ln(); } $sum = $this->show_sum($array); $pdf->SetFont('DejaVu', 'B', 8); $pdf->Cell(70, 6, 'Somme', 1, 0, 'C'); $pdf->Ln(5); $pdf->SetFont('DejaVu', '', 6); $pdf->Cell(20, 7, 'Poste'); $pdf->Cell(60, 7, 'Description', 'B'); $pdf->Cell(20, 7, 'Débit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Crédit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Solde', 'B', 0, 'L'); $pdf->Cell(20, 7, 'D/C', 'B', 0, 'L'); $pdf->Ln(); for ($i = 0; $i < count($sum); $i++) { $row = $sum[$i]; $pdf->Cell(20, 6, $row['poste'], 0, 0, 'L'); $pdf->Cell(60, 6, $row['desc'], 0, 0, 'L'); $pdf->Cell(20, 6, sprintf('%.2f', $row['debit']), 0, 0, 'R'); $pdf->Cell(20, 6, sprintf('%.2f', $row['credit']), 0, 0, 'R'); $pdf->Cell(20, 6, sprintf('%.2f', $row['solde']), 0, 0, 'R'); $pdf->Cell(20, 6, $row['dc'], 0, 0, 'R'); $pdf->Ln(); } $fDate = date('dmy-Hi'); $pdf->output('crossbalance-' . $fDate . '.pdf', 'D'); }
$this->Image($barcode_code39, $barcode_xpos, $barcode_ypos, $barcode_width); } function eanBarcode($ean, $barcode_xpos, $barcode_ypos, $barcode_width) { $ean_img = DIR_FS_BARCODES . drawBarcode('ean13', 'M', $ean, true, false); $this->Image($ean_img, $barcode_xpos, $barcode_ypos, $barcode_width); } function AcceptPageBreak() { $this->ypos = $this->margin; return true; } } $pdf = new PDF('L', 'mm', 'A4'); $pdf->initPDF(); $pdf->setTitle('Price List'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 20); $pdf->AliasNbPages(); $gray = 160; $black = 0; $order_counter = 0; $fontsize_big = '9'; $fontsize_med = '8'; $fontsize_sml = '7'; $fontsize_sml_med = '6'; $fontsize_tny = '5'; $margin = $pdf->margin; $pdf->ypos = $margin;
$this->Line($xstart, $ypos, $xend, $ypos); } $ystart = $this->top_margin; $yend = $this->page_height - $this->top_margin; for ($x = 1; $x < $this->label_per_width; $x++) { $xpos = $x * $this->label_width; $this->Line($xpos, $ystart, $xpos, $yend); } } //Page footer function Footer() { } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('J&G Package Labels'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false, 1); $pdf->left_margin = 2; $pdf->top_margin = 2; $pdf->page_width = 210; $pdf->page_height = 297; $pdf->label_per_width = 1; $pdf->label_width = ($pdf->page_width - 2 * $pdf->left_margin) / $pdf->label_per_width; $pdf->label_per_height = 5; $pdf->label_height = ($pdf->page_height - 2 * $pdf->top_margin) / $pdf->label_per_height; $pdf->label_per_page = $pdf->label_per_width * $pdf->label_per_height; $order_counter = 0; //$labelpad = 4;
function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true) { /* OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS */ global $class_jo, $class_o, $class_do; $pi_printed_jg = array(); $pi_printed_sp = array(); $pi_printed_dp = array(); if ($output == 'D') { //PRODUCE SINGLE PDF FILE $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Production Instruction'); $pdf->SetAuthor('JULIE GRACE / Bonofactum'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false); $pdf->AliasNbPages(); $pdf->SetFillColor(191, 191, 191); } $item_printed = 0; $oiid_last_printed = ''; /* Moved this on function constructPIContent and replace using below $print_per_orders, * so eventhough we use $output='F' we still could create pi which consists of collection of orders */ //foreach($this->orders as $order) { // $o = $order['detail']; // foreach($order['items'] as $oiid=>$i) { // if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid; // //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid; // $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders); // $item_printed++; // $oiid_last_printed = $oiid; // } //} if ($print_per_orders) { foreach ($this->orders as $order) { $this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true); $item_printed++; } } else { $this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false); } #PI Print Counter if (count($this->pi_printed['sp']) > 0) { $class_jo->printCountAdd($this->pi_printed['sp']); } if (count($this->pi_printed['jg']) > 0) { $class_o->printCountAdd($this->pi_printed['jg']); } if (count($this->pi_printed['dp']) > 0) { $class_do->printCountAdd($this->pi_printed['dp']); } /* D: Download; F: Save File on Server */ if ($output == 'D') { $infix = ''; //$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-'; //if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-'; if ($item_printed == 1) { $infix = array_keys($this->orders); $infix = $infix[0] . '-'; } $filename = 'PI-' . $infix . date('YmdHi'); $pdf->Output($filename . '.pdf', $output); //$pdf->Output($filename.'.pdf','D'); } if ($add_to_daily_statistic) { $pt = new production_target(); $timestamp = date('Y-m-d H:i:s'); if ($this->qty_total_first_printed > 0) { $pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed); } } }
$result = tep_db_query($query); $products_total = tep_db_num_rows($result); $logger->write('Found ' . $products_total . ' products >1 star'); while ($row = tep_db_fetch_array($result)) { $row['fmargin'] = number_format($row['margin'], 1) . '%'; $row['weekly'] = array(); $row['total_sold_L4W'] = 0; foreach ($weekly_name as $wkey => $wn) { $row['weekly'][$wkey] = getOrderWeekly($row['products_id'], $wkey, $filter_date, $sp_list); $row['total_sold_L4W'] += $row['weekly'][$wkey]['total_sold']; } $products[$row['catid']][$row['products_id']] = $row; } $logger->write('Creating PDF File'); $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Sales Report Weekly Products'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $margin = 30; $ypos = 10; $cellstart = $margin; $cellsize = 48; $cellsize_half = $cellsize / 2; $cellsizecollweek = $cellsize + $margin; $cell_height_col = 55; $cell_height = 5; $pdf->setXY($margin, $ypos);
} function OrderBarcode($barcode, $barcode_xpos, $barcode_ypos, $barcode_width) { $barcode_code39_no = $barcode; $barcode_code39 = DIR_FS_BARCODES . drawBarcode('CODE39', 'M', $barcode_code39_no, false, false); $this->Image($barcode_code39, $barcode_xpos, $barcode_ypos, $barcode_width); } function AcceptPageBreak() { $this->ean_ypos = $this->margin; $this->total_ean_lines = 0; return true; } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('HH AM.VD & BuyVIP Pick List'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); PrintPickingList($pick_from_racks, $trolley, $bin_location_qty_collection, $need_repackage); PrintOrdersList($orders_barcode, $orders, $trolley, $need_repackage); //PRINT PICKING LIST function PrintPickingList($pick_from_racks, $trolley, $bin_location_qty_collection, $need_repackage = false) { global $pdf; $pdf->AddPage(); $margin = $pdf->margin; $pdf->ean_ypos = $margin; $counter_size = 10;
require_once NOALYSS_INCLUDE . '/header_print.php'; require_once NOALYSS_INCLUDE . '/class_dossier.php'; require_once NOALYSS_INCLUDE . '/class_acc_report.php'; require_once NOALYSS_INCLUDE . '/class_pdf.php'; $gDossier = dossier::id(); $cn = new Database($gDossier); extract($_GET); $ret = ""; $Form = new Acc_Report($cn, $form_id); $Libelle = sprintf("%s ", $Form->get_name()); $pdf = new PDF($cn); $pdf->setDossierInfo($Libelle); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->setTitle("Rapport " . $Libelle, true); // Step ?? //-- $step = HtmlInput::default_value_get("p_step", 0); if ($step == 0) { // No step asked //-- if ($_GET['type_periode'] == 0) { $array = $Form->get_row($_GET['from_periode'], $_GET['to_periode'], $_GET['type_periode']); } else { $array = $Form->get_row($_GET['from_date'], $_GET['to_date'], $_GET['type_periode']); } } else { // yes with step //-- for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) {
require_once NOALYSS_INCLUDE . '/class_database.php'; include_once "class_impress.php"; require_once NOALYSS_INCLUDE . '/class_fiche.php'; require_once NOALYSS_INCLUDE . '/header_print.php'; require_once NOALYSS_INCLUDE . '/class_dossier.php'; require_once NOALYSS_INCLUDE . '/class_pdf.php'; $gDossier = dossier::id(); $cn = new Database($gDossier); extract($_GET); $ret = ""; $pdf = new PDF($cn); $pdf->setDossierInfo(" Periode : " . $_GET['from_periode'] . " - " . $_GET['to_periode']); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->setTitle("Détail fiche", true); $Fiche = new Fiche($cn, $f_id); list($array, $tot_deb, $tot_cred) = $Fiche->get_row_date($from_periode, $to_periode, $_GET['ople']); // don't print empty account if (count($array) == 0) { exit; } $size = array(13, 25, 20, 60, 12, 20, 20, 20); $align = array('L', 'C', 'C', 'L', 'R', 'R', 'R', 'R'); $Libelle = sprintf("(%s) %s [ %s ]", $Fiche->id, $Fiche->getName(), $Fiche->get_quick_code()); $pdf->SetFont('DejaVu', '', 10); $pdf->Cell(0, 8, $Libelle, 1, 0, 'C'); $pdf->Ln(); $pdf->SetFont('DejaVuCond', '', 8); $l = 0; $pdf->Cell($size[$l], 6, 'Date', 0, 0, 'L');