You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
5.5 KiB
JavaScript
133 lines
5.5 KiB
JavaScript
import { pos80 } from '{js}module-lap-pos80.js?v={time}';
|
|
|
|
export const show = function(data, filter){
|
|
let dataBaru = data.cond(filter,'kode');
|
|
if(dataBaru.length > 0){
|
|
return dataBaru[0].data;
|
|
}
|
|
return '-';
|
|
};
|
|
|
|
export const print = function (a) {
|
|
console.log(a);
|
|
var _ld = cssLoader();
|
|
AuditDevQuery(`
|
|
SELECT * FROM msimpan WHERE faktur = '${a}'
|
|
[;]
|
|
SELECT * FROM profile
|
|
`, function (s) {
|
|
_ld.remove();
|
|
console.log(s);
|
|
let [a, profile] = s;
|
|
console.log(profile);
|
|
if (a.length > 0) {
|
|
let f = a[0];
|
|
let agt = _master('anggota', 'anggota').cond(f.kode, 'id');
|
|
let pb = f.jumlah.number(2).pembilang();
|
|
|
|
let dataTransaksi = [
|
|
[
|
|
{ text: 'Tgl', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: tanggal(f.tgl).sekarang }
|
|
]
|
|
, [
|
|
{ text: 'Jam', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: f.jam }
|
|
]
|
|
, [
|
|
{ text: 'No Anggota.', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: f.kode }
|
|
]
|
|
, [
|
|
{ text: 'Nama Anggota.', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: agt[0].text }
|
|
]
|
|
, [
|
|
{ text: 'Jumlah (Rp)', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: f.jumlah.number(2).currency(0) }
|
|
]
|
|
, [
|
|
{ text: 'Terbilang', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: pb + ' Rupiah' }
|
|
]
|
|
];
|
|
|
|
if(f.faktur.toLowerCase().indexOf('bkk') != -1){
|
|
dataTransaksi.push([
|
|
{ text: 'Sudah terima dari', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: 'KPRI Warpeka Gresik' }
|
|
]);
|
|
}
|
|
|
|
dataTransaksi = dataTransaksi.concat([
|
|
[
|
|
{ text: 'Keterangan.', css: { maxWidth: '95px', width: '95px' } }
|
|
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
|
|
, { text: f.keterangan }
|
|
]
|
|
, [
|
|
{ text: 'Mengetahui.', colspan: 3, css: {} }
|
|
]
|
|
, [
|
|
{ text: 'Piket. '+tanggal(f.userlog).sekarang, colspan: 3, css: {} }
|
|
]
|
|
, [
|
|
{ text: '', colspan: 3, css: { height: '40px' } }
|
|
]
|
|
, [
|
|
{ text: '(TTD)', colspan: 3, css: {} }
|
|
]
|
|
, [
|
|
{ text: 'Kasir : ' + f.username, colspan: 3, css: {} }
|
|
]
|
|
]);
|
|
|
|
let txt = 'KWITANSI SETORAN';
|
|
|
|
if (f.faktur.toLowerCase().indexOf('bkk') != -1) {
|
|
txt = 'KWITANSI PENARIKAN';
|
|
dataTransaksi = dataTransaksi.concat([
|
|
[
|
|
{ text: 'Penerima', colspan: 3, css: {} }
|
|
]
|
|
, [
|
|
{ text: '', colspan: 3, css: { height: '40px' } }
|
|
]
|
|
, [
|
|
{ text: agt[0].text, colspan: 3, css: {} }
|
|
]
|
|
, [
|
|
{ text: '', colspan: 3, css: { height: '30px' } }
|
|
]
|
|
]);
|
|
}
|
|
|
|
dataTransaksi.push([
|
|
{ text: '', colspan: 3, css: { borderBottom: '1.5px dashed #333' } }
|
|
]);
|
|
|
|
pos80().content([
|
|
{ type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: 'KPRI WARPEKA' }
|
|
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: 'JL. AR. HAKIM' }
|
|
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: 'GRESIK' }
|
|
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: txt }
|
|
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: 'SIMPANAN' }
|
|
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '14px', margin: 0, textAlign: 'center' }, text: 'No. ' + f.faktur }
|
|
, { type: 'text', css: { borderBottom: '1.5px dashed #333' }, text: '' }
|
|
, {
|
|
type: 'table', css: { width: '100%' }, data: dataTransaksi
|
|
}
|
|
]).print();
|
|
} else {
|
|
_ld.remove();
|
|
Swal('Info', 'Faktur tidak tersedia', 'info');
|
|
}
|
|
})
|
|
} |