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.

122 lines
4.3 KiB
JavaScript

import { tsroute } from '{js}ts-kasmasuk-route.js?v={time}';
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 cetak = function (a, bb) {
const [anggota,acc,b, profile] = bb;
let ps = pos80();
console.log(b);
let dd = [
[
{ text: 'Tgl', css: { maxWidth: '120px', width: '120px' } }
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
, { text: tanggal(b.singleItem('tgl')).sekarang }
]
, [
{ text: 'Sudah terima dari', css: { maxWidth: '120px', width: '120px' } }
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
, {
text: b.singleItem('kodesc')
}
]
, [
{ text: 'Jumlah (Rp)', css: { maxWidth: '120px', width: '120px' } }
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
, { text: b.sum('jumlah').currency(0) }
]
, [
{ text: 'Terbilang', css: { maxWidth: '120px', width: '120px' } }
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
, { text: b.sum('jumlah').pembilang() + ' Rupiah' }
]
, [
{ text: 'Buat Pembayaran ', css: { maxWidth: '120px', width: '120px' } }
, { text: ':', css: { maxWidth: '5px', width: '5px' } }
, { text: '' }
]
];
var y = [];
b.forEach(function(v){
y.push([
{ text: '-', css: { textAlign: 'right', maxWidth: '10px', width: '10px' } }
, { text: v.ket }
, { text: ':', css: { textAlign: 'right', maxWidth: '5px', width: '5px' } }
, { text: v.jumlah.number(2).currency(0), css: { textAlign: 'right', maxWidth: '100px', width: '100px' } }
]);
});
var xx = [
[
{ text: 'Mengetahui Ketua1.', colspan: 3, css: {} }
]
, [
{ text: '', colspan: 3, css: { height: '40px' } }
]
, [
{ text: show(profile, 'ketua1'), colspan: 3, css: {} }
]
, [
{ text: 'Mengetahui Bendahara.', colspan: 3, css: {} }
]
, [
{ text: '', colspan: 3, css: { height: '40px' } }
]
, [
{ text: show(profile, 'bendahara'), colspan: 3, css: {} }
]
, [
{ text: 'Piket, ' + tanggal(b.singleItem('tgl')).sekarang, colspan: 3, css: {} }
]
, [
{ text: '', colspan: 3, css: { height: '40px' } }
]
, [
{ text: '(TTD)', colspan: 3, css: {} }
]
, [
{ text: 'Kasir : ' + b.singleItem('username'), colspan: 3, css: {} }
]
, [
{ text: 'Penerima', colspan: 3, css: {} }
]
, [
{ text: '', colspan: 3, css: { height: '40px' } }
]
, [
{ text: '', colspan: 3, css: {} }
]
, [
{ text: '', colspan: 3, css: { height: '30px' } }
]
, [
{ text: '', colspan: 3, css: { borderBottom: '1.5px dashed #333' } }
]
];
ps.content([
{ type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '16px', margin: 0, textAlign: 'center' }, text: 'KPRI WARPEKA' }
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '16px', margin: 0, textAlign: 'center' }, text: 'JL. AR. HAKIM' }
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '16px', margin: 0, textAlign: 'center' }, text: 'GRESIK' }
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '16px', margin: 0, textAlign: 'center' }, text: 'KWITANSI ' + tsroute().titlec }
, { type: 'text', css: { paddingBottom: '3px', fontWeight: 'bold', fontSize: '16px', margin: 0, textAlign: 'center' }, text: 'No. '+a.kode }
, { type: 'text', css: { borderBottom: '2px dashed black' }, text: '' }
, {
type: 'table', css: { width: '100%' }, data: dd
}
, {
type: 'table', line: true, css: { width: '100%' }, data: y
}
, {
type: 'table', css: { width: '100%' }, data: xx
}
]).print();
}