Beispiel #1
0
 $textTotalPotongan = "Total Potongan   : " . str_pad(number_format($diskonHargaPerBarangTotal, 0, ',', '.'), 11, ' ', STR_PAD_LEFT);
 $textDiskonCustomer = 'Potongan Spesial : ' . str_pad(number_format($diskonCustomer, 0, ',', '.'), 11, ' ', STR_PAD_LEFT);
 $textTotal = "TOTAL            : " . str_pad(number_format($_POST[tot_pembayaran], 0, ',', '.'), 11, " ", STR_PAD_LEFT);
 $textDibayar = "Dibayar          : " . str_pad(number_format($_POST[uangDibayar], 0, ',', '.'), 11, " ", STR_PAD_LEFT);
 $textKembali = "Kembali          : " . str_pad(number_format($_POST[uangDibayar] - $_POST[tot_pembayaran], 0, ',', '.'), 11, " ", STR_PAD_LEFT);
 $textAndaHemat = "ANDA HEMAT       : " . str_pad(number_format($diskonHargaPerBarangTotal + $diskonCustomer, 0, ',', '.'), 11, " ", STR_PAD_LEFT);
 $struk .= $diskonHargaPerBarangTotal > 0 && $diskonCustomer > 0 ? str_pad($textTotalPotongan, 39, ' ', STR_PAD_LEFT) . " \n" : '';
 $struk .= $diskonCustomer > 0 ? str_pad($textDiskonCustomer, 39, ' ', STR_PAD_LEFT) . "\n" : '';
 $struk .= str_pad($textTotal, 39, ' ', STR_PAD_LEFT) . "\n";
 $struk .= str_pad($textDibayar, 39, ' ', STR_PAD_LEFT) . " \n";
 $struk .= str_pad($textKembali, 39, ' ', STR_PAD_LEFT) . " \n";
 $struk .= $diskonHargaPerBarangTotal > 0 ? str_pad($textAndaHemat, 39, ' ', STR_PAD_LEFT) . "\n" : '';
 $struk .= "----------------------------------------\n";
 $struk .= str_pad($footer1, 40, " ", STR_PAD_BOTH) . "\n" . str_pad($footer2, 40, " ", STR_PAD_BOTH) . "\n\n";
 if ($_SESSION['isMember']) {
     $struk .= 'Jumlah poin terkumpul: ' . getJumlahPoinPeriodeBerjalan($_SESSION['idCustomer']);
 }
 $struk .= "\n\n\n\n\n\n\n\n\n\n\n\n\n";
 // tambahan perintah untuk cutter epson
 if ($jenis_printer === 'rlpr' && $potongKertas) {
     $struk .= chr(27) . "@" . chr(29) . "V" . chr(1);
 }
 if ($jenis_printer == 'pdf') {
     require 'classes/fpdf.php';
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Courier', '', 9);
     $struk_pdf = explode("\n", $struk);
     foreach ($struk_pdf as $baris) {
         $width = 40;
         $length = 1;
Beispiel #2
0
                ?>
 : <?php 
                echo $_SESSION['namaCustomer'];
                ?>
                        <?php 
                if ($_SESSION['customerDiskonP'] > 0) {
                    echo " ({$_SESSION['customerDiskonP']}%)";
                } elseif ($_SESSION['customerDiskonR'] > 0) {
                    echo ' (' . number_format($_SESSION['customerDiskonR'], 0, ',', '.') . ')';
                }
                ?>
                        <?php 
                if ($isMember) {
                    ?>
                           <br />Jumlah Poin Periode Berjalan = <?php 
                    echo getJumlahPoinPeriodeBerjalan($_SESSION['idCustomer']);
                    ?>
                           <?php 
                }
                ?>
                     </div>
                     <!--<h3>Barang yang dijual</h3>-->
                     <?php 
            }
            ?>
                  <form id="entry-barang" method=POST action='js_jual_barang.php?act=caricustomer&action=tambah'>
                     <div class="input-group">
                        <label for="barcode"><span class="u">B</span>arcode</label>
                        <input type="text" name="barcode" accesskey="b" id="barcode" autofocus="autofocus" autocomplete="off">

                     </div>