Reklame.php
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* @Author: irul
* @Date: 2019-09-23 15:20:24
* @Last Modified by: irul
* @Last Modified time: 2019-10-01 23:43:20
*/
namespace Integrasi\Reklame\Base;
use \Illuminate\Database\Eloquent\ModelNotFoundException;
use \JsonRPC\Exception\ServerErrorException;
/**
* Class utama yang digunakan untuk integrasi reklame.
*/
class Reklame extends AbstractClass
{
/**
* Fungsi untuk menyimpan data IPR yang dikirim dari Perizinan
* ke dalam tbl pad_sptpd.
*
* Algoritma secara umum:
* 1. Cek Pajak join PajakTarif
* 2. Get WP
* 3. Get OP (create/update)
* 4. Create SPT/SPTPD
* 5. Create Rincian (depend on)
*/
public static function setIpr($payload)
{
throw new ServerErrorException(
"Silahkan dibuat dan disesuaikan dengan kondisi yang ada disuatu wilayah");
}
// ===================================================================== //
/**
* Mendapatkan informasi reklame menggunakan key ID.
*
* ID di sini merupakan:
* - ID pada tabel pad_spt jika tidak ada table pad_sptpd.
* - ID pada tabel pad_sptpd jika ada table pad_sptpd.
*/
public static function getById($id)
{
$data = Helper::getPendataanById($id);
if (!$data) {
throw new ModelNotFoundException(MSG_NOT_FOUND);
}
return Helper::pajakInfo($data);
}
/**
* Mendapatkan informasi reklame menggunakan key IPR ID.
*
* IPR ID merupkan ID unik milik perizinan yang digunakan
* sebagai key antara perizinan dengan pajak.
*/
public static function getByIprId($iprId)
{
$data = Helper::getPendataanByIprId($iprId);
if (!$data) {
throw new ModelNotFoundException(MSG_NOT_FOUND);
}
return Helper::pajakInfo($data);
}
/**
* Mendapatkan informasi reklame menggunakan
* key Invoice Number (Nomor Bayar/sptno).
* Invoice Number atau biasa dikenal dengan Nomor Bayar atau Nomor SPT.
*/
public static function getByInvoiceNumber($invoiceNumber)
{
$data = Helper::getPendataanByInvoiceNumber($invoiceNumber);
if (!$data) {
throw new ModelNotFoundException(MSG_NOT_FOUND);
}
return Helper::pajakInfo($data);
}
}