Update besar apk finance

This commit is contained in:
Wian Drs
2026-09-11 16:03:00 +07:00
parent d42483b350
commit 4ef15c22ae
897 changed files with 98056 additions and 15979 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'exceptions/BusinessException.php';
class PostingService
{
private $CI;
public function __construct()
{
$this->CI =& get_instance();
$this->CI->load->library('JournalService');
$this->CI->load->model('JournalModel', 'postingJournalModel');
}
public function post(array $header, array $lines, $manageTransaction = true, $preventDuplicateSource = true)
{
if ($preventDuplicateSource && !empty($header['ref_type']) && isset($header['ref_id'])) {
if ($this->CI->postingJournalModel->sourceExists($header['ref_type'], $header['ref_id'])) {
throw new BusinessException('Transaksi sumber ini sudah pernah diposting ke jurnal.');
}
}
$header['status'] = 'posted';
$header['posted_at'] = isset($header['posted_at']) ? $header['posted_at'] : date('Y-m-d H:i:s');
$header['posted_by'] = isset($header['posted_by']) ? $header['posted_by'] : $header['created_by'];
return $this->CI->journalservice->create($header, $lines, $manageTransaction);
}
}