mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-16 16:28:41 +00:00
start drafting template handling
This commit is contained in:
parent
254aba2706
commit
b731522bcd
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Billing\Admin\Install;
|
namespace Modules\Billing\Admin\Install;
|
||||||
|
|
||||||
|
use Model\CoreSettings;
|
||||||
|
use Model\Setting;
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -38,6 +40,11 @@ class Media
|
||||||
*/
|
*/
|
||||||
public static function install(string $path, DatabasePool $dbPool) : void
|
public static function install(string $path, DatabasePool $dbPool) : void
|
||||||
{
|
{
|
||||||
\Modules\Media\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Media.install.json']);
|
$media = \Modules\Media\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Media.install.json']);
|
||||||
|
|
||||||
|
$defaultTemplate = \reset($result['upload']);
|
||||||
|
|
||||||
|
$setting = new Setting();
|
||||||
|
SettingMapper::create($setting->with(0, 'default_template', (string) $defaulTemplate->getId(), 'Billing'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,9 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$bill = BillMapper::get($request->getData('id'));
|
$bill = BillMapper::get($request->getData('id'));
|
||||||
|
|
||||||
|
$defaultTemplate = CoreSettings::get(null, 'default_template', self::MODULE_NAME);
|
||||||
|
$template = CollectionMapper::get((int) $defaultTemplate);
|
||||||
|
|
||||||
// get default template from database OR get template based on provided request template id
|
// get default template from database OR get template based on provided request template id
|
||||||
// create pdf based on template
|
// create pdf based on template
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user