Jual Beli Produk Digital - Cepat, Aman, Dan Terpercaya Sejak 2012 (Ada 70698 Members, 832 Products, 4745 Topic, 13114 Comments)

MANGGALEH - Point of Sales dengan Codeigniter 3.x dan MySQL

Dibuat
Login Terakhir 5 Tahun lalu,
Telah Dilihat 1884 Kali
Teguh iman budhi Mengatakan : Sultan Account
A Database Error Occurred

Error Number: 1054

Unknown column 'a.ppn' in 'field list'

SELECT a.kode_transaksi, a.waktu_proses, x.kode_barang, x.nama_barang, z.jumlah_jual, z.kode_satuan, z.harga_jual, z.diskon_jual, a.ppn/100*(z.jumlah_jual*z.harga_jual) as ppn, ((z.jumlah_jual*z.harga_jual-z.diskon_jual)-a.ppn/100*(z.jumlah_jual*z.harga_jual)) as total FROM mu_transaksi_detail z JOIN `mu_transaksi` a ON z.id_transaksi=a.id_transaksi JOIN mu_barang x ON z.id_barang=x.id_barang LEFT JOIN mu_pelanggan b ON a.id_pelanggan=b.id_pelanggan LEFT JOIN mu_type_bayar c ON a.id_type_bayar=c.id_type_bayar JOIN mu_karyawan d ON a.id_karyawan=d.id_karyawan where a.status='selesai'

Filename: I:/xampp/htdocs/manggaleh/application/models/Model_laporan.php

Line Number: 58

Itu kenapa ya, ada yang bisa bantu

Ada 3 Jawaban

PHPMU.COM Support
commented on 13 Des 2017 06:49:31
Assalam, untuk PPN nya hitung diluar saja mas, ubah querynya jadi begini saja,..
SELECT a.kode_transaksi, a.waktu_proses, x.kode_barang, x.nama_barang, z.jumlah_jual, z.kode_satuan, z.harga_jual, z.diskon_jual, (z.jumlah_jual*z.harga_jual-z.diskon_jual) as total FROM mu_transaksi_detail z JOIN `mu_transaksi` a ON z.id_transaksi=a.id_transaksi JOIN mu_barang x ON z.id_barang=x.id_barang LEFT JOIN mu_pelanggan b ON a.id_pelanggan=b.id_pelanggan LEFT JOIN mu_type_bayar c ON a.id_type_bayar=c.id_type_bayar JOIN mu_karyawan d ON a.id_karyawan=d.id_karyawan where a.status='selesai'

lalu cek pajak config penjualan aktif atau non aktif,..
jika pajak (PPN) aktif maka ambil 10% jika tidak maka abaikan,..
SELECT  * FROM mu_conf_penjualan where terapkan_pajak='visible'
jika num_rows >=1 maka :
$pajak = 10/100*$row[total];
else
$pajak = 0;
Teguh iman budhi
commented on 14 Des 2017 08:45:27
Assalamulaikum, setelah saya rubah sesuai arahan muncul tulisan


A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once


Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once 


A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once



A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once



A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once



A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once



A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once



A PHP Error was encountered

Severity: Notice

Message: Undefined index: ppn

Filename: mod_laporan/view_penjualan_perbarang.php

Line Number: 36

Backtrace:

File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Line: 36
Function: _error_handler

File: I:\xampp\htdocs\manggaleh\application\libraries\Template.php
Line: 16
Function: view

File: I:\xampp\htdocs\manggaleh\application\controllers\Laporan.php
Line: 61
Function: load

File: I:\xampp\htdocs\manggaleh\index.php
Line: 294
Function: require_once
PHPMU.COM Support
commented on 14 Des 2017 22:27:38
Dari pesan error di atas sudah dikasih tau masalahnya dimana, tinggal ditelusuri :
File: I:\xampp\htdocs\manggaleh\application\views\app\mod_laporan\view_penjualan_perbarang.php
Buka file yang disebutkan di atas,..
Message: Undefined index: ppn Line Number: 36
lihat baris 36, ppn tidak ditemukan/tedeteksi,..
hapus saja baris itu, karena dari query yang saya buat di atas memang tidak ada select ppn,..


lalu mulailah masukkan query yang saya infokan di atas ke dalam looping data laporanpenjualannya,..
SELECT  * FROM mu_conf_penjualan where terapkan_pajak='visible'
jika num_rows >=1 maka :
$pajak = 10/100*$row[total];
else
$pajak = 0;

echo variable $pajak pada ppn yang di hapus tadi, pada baris 36,...
selesai,..
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online