mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-01-28 07:18:41 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
ec8b455bdd
commit
155d684128
|
|
@ -53,8 +53,7 @@ class Media
|
|||
SettingsEnum::PREVIEW_MEDIA_TYPE,
|
||||
(string) $preivewType,
|
||||
'\\d+',
|
||||
null,
|
||||
'Billing'
|
||||
module: 'Billing'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
@ -65,8 +64,7 @@ class Media
|
|||
SettingsEnum::ORIGINAL_MEDIA_TYPE,
|
||||
(string) $originalType,
|
||||
'\\d+',
|
||||
null,
|
||||
'Billing'
|
||||
module: 'Billing'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
151
Admin/Install/Workflow.install.json
Normal file
151
Admin/Install/Workflow.install.json
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
"triggers": [
|
||||
"PRE:Module:Billing:bill-create",
|
||||
"POST:Module:Billing:bill-create",
|
||||
"PRE:Module:Billing:bill-update",
|
||||
"POST:Module:Billing:bill-update",
|
||||
"PRE:Module:Billing:bill-delete",
|
||||
"POST:Module:Billing:bill-delete",
|
||||
|
||||
"PRE:Module:Billing:bill_element-create",
|
||||
"POST:Module:Billing:bill_element-create",
|
||||
"PRE:Module:Billing:bill_element-update",
|
||||
"POST:Module:Billing:bill_element-update",
|
||||
"PRE:Module:Billing:bill_element-delete",
|
||||
"POST:Module:Billing:bill_element-delete",
|
||||
|
||||
"PRE:Module:Billing:bill_media-create",
|
||||
"POST:Module:Billing:bill_media-create",
|
||||
"PRE:Module:Billing:bill_media-update",
|
||||
"POST:Module:Billing:bill_media-update",
|
||||
"PRE:Module:Billing:bill_media-delete",
|
||||
"POST:Module:Billing:bill_media-delete",
|
||||
|
||||
"PRE:Module:Billing:bill_note-create",
|
||||
"POST:Module:Billing:bill_note-create",
|
||||
"PRE:Module:Billing:bill_note-update",
|
||||
"POST:Module:Billing:bill_note-update",
|
||||
"PRE:Module:Billing:bill_note-delete",
|
||||
"POST:Module:Billing:bill_note-delete"
|
||||
],
|
||||
"actions": {
|
||||
"1005100001": {
|
||||
"name": "Find Subscripctions",
|
||||
"description": {
|
||||
"en": "Finds subscriptions",
|
||||
"de": "Findet Abonnements"
|
||||
},
|
||||
"function_type": "API",
|
||||
"function": "apiSubscriptionFind",
|
||||
"inputs": [
|
||||
"date_start",
|
||||
"date_end",
|
||||
"client[]",
|
||||
"payment_type",
|
||||
"{*}"
|
||||
],
|
||||
"outputs": [
|
||||
"subscription[]",
|
||||
"{*}"
|
||||
],
|
||||
"settings": {
|
||||
"date_start": {
|
||||
"type": "input",
|
||||
"subtype": "datetime",
|
||||
"default": "now",
|
||||
"required": true,
|
||||
"title": {
|
||||
"en": "Start",
|
||||
"de": "Start"
|
||||
}
|
||||
},
|
||||
"date_end": {
|
||||
"type": "input",
|
||||
"subtype": "datetime",
|
||||
"default": null,
|
||||
"required": false,
|
||||
"title": {
|
||||
"en": "End",
|
||||
"de": "End"
|
||||
}
|
||||
},
|
||||
"client": {
|
||||
"type": "input",
|
||||
"subtype": "text",
|
||||
"default": "*",
|
||||
"pattern": "/(^\\*$)|(^(\\d+)(,\\s*\\d+)*$)/",
|
||||
"examples": [
|
||||
"*",
|
||||
"12,654,789"
|
||||
],
|
||||
"required": true,
|
||||
"title": {
|
||||
"en": "Client ID",
|
||||
"de": "Kundennummer"
|
||||
},
|
||||
"description": {
|
||||
"en": "The client IDs of the clients. Use * to get all clients or a comma separated list to specify specific clients.",
|
||||
"de": "Die Kundennummern. Benutzen Sie * um alle Kunden auszuwählen oder eine durch Kommas getrennte Liste von mehreren Kundennummern."
|
||||
}
|
||||
},
|
||||
"payment_type": {
|
||||
"type": "select",
|
||||
"subtype": null,
|
||||
"default": "cc",
|
||||
"required": true,
|
||||
"title": {
|
||||
"en": "Payment type",
|
||||
"de": "Zahlungsart"
|
||||
},
|
||||
"options": [
|
||||
{
|
||||
"value": "cc",
|
||||
"text": {
|
||||
"en": "Credit Card",
|
||||
"de": "Kreditkarte"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"1005100002": {
|
||||
"name": "Invoice for Subscription",
|
||||
"description": {
|
||||
"en": "Creates invoices for subscriptions",
|
||||
"de": "Erstellt Rechnungen für Abonnements"
|
||||
},
|
||||
"function_type": "API",
|
||||
"function": "apiInvoiceFromSubscriptionCreate",
|
||||
"inputs": [
|
||||
"subscription[]",
|
||||
"{*}"
|
||||
],
|
||||
"outputs": [
|
||||
"invoice[]",
|
||||
"{*}"
|
||||
],
|
||||
"settings": {
|
||||
"subscription": {
|
||||
"type": "input",
|
||||
"subtype": "text",
|
||||
"default": "*",
|
||||
"pattern": "/(^\\*$)|(^(\\d+)(,\\s*\\d+)*$)/",
|
||||
"examples": [
|
||||
"*",
|
||||
"12,654,789"
|
||||
],
|
||||
"required": true,
|
||||
"title": {
|
||||
"en": "Subscription ID",
|
||||
"de": "Abonnement ID"
|
||||
},
|
||||
"description": {
|
||||
"en": "The subscription IDs of the subscriptions. Use * to get all subscriptions or a comma separated list to specify specific subscriptions.",
|
||||
"de": "Die Abonnement ID. Benutzen Sie * um alle Abonnements auszuwählen oder eine durch Kommas getrennte Liste von mehreren Abonnement IDs."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Admin/Install/Workflow.php
Normal file
43
Admin/Install/Workflow.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Billing\Admin\Install;
|
||||
|
||||
use phpOMS\Application\ApplicationAbstract;
|
||||
|
||||
/**
|
||||
* Workflow class.
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @license OMS License 1.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Workflow
|
||||
{
|
||||
/**
|
||||
* Install workflow providing
|
||||
*
|
||||
* @param ApplicationAbstract $app Application
|
||||
* @param string $path Module path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function install(ApplicationAbstract $app, string $path) : void
|
||||
{
|
||||
\Modules\Workflow\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Workflow.install.json']);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,12 @@
|
|||
"name": "billing_type_transfer_stock",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_type_is_template": {
|
||||
"description": "What kind of bill is it?",
|
||||
"name": "billing_type_is_template",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -95,8 +101,7 @@
|
|||
"billing_bill_info": {
|
||||
"name": "billing_bill_info",
|
||||
"type": "TEXT",
|
||||
"default": null,
|
||||
"null": true
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_status": {
|
||||
"name": "billing_bill_status",
|
||||
|
|
@ -126,6 +131,16 @@
|
|||
"foreignTable": "clientmgmt_client",
|
||||
"foreignKey": "clientmgmt_client_id"
|
||||
},
|
||||
"billing_bill_header": {
|
||||
"name": "billing_bill_header",
|
||||
"type": "TEXT",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_footer": {
|
||||
"name": "billing_bill_footer",
|
||||
"type": "TEXT",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_stock_from": {
|
||||
"name": "billing_bill_stock_from",
|
||||
"type": "INT",
|
||||
|
|
@ -635,55 +650,20 @@
|
|||
"foreignTable": "billing_bill",
|
||||
"foreignKey": "billing_bill_id"
|
||||
},
|
||||
"billing_bill_subscription_start": {
|
||||
"name": "billing_bill_subscription_start",
|
||||
"type": "DATETIME",
|
||||
"null": false
|
||||
"billing_bill_subscription_schedule": {
|
||||
"name": "billing_bill_subscription_schedule",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"foreignTable": "schedule",
|
||||
"foreignKey": "schedule_id"
|
||||
},
|
||||
"billing_bill_subscription_end": {
|
||||
"name": "billing_bill_subscription_end",
|
||||
"type": "DATETIME",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_numberofoccurrences": {
|
||||
"name": "billing_bill_subscription_numberofoccurrences",
|
||||
"billing_bill_subscription_account": {
|
||||
"name": "billing_bill_subscription_account",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_numberofoccurrences": {
|
||||
"name": "billing_bill_subscription_pattern_numberofoccurrences",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_type": {
|
||||
"name": "billing_bill_subscription_pattern_type",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_pattern_interval": {
|
||||
"name": "billing_bill_subscription_pattern_pattern_interval",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_dayofmonth": {
|
||||
"name": "billing_bill_subscription_pattern_dayofmonth",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_daysofweek": {
|
||||
"name": "billing_bill_subscription_pattern_daysofweek",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_index": {
|
||||
"name": "billing_bill_subscription_pattern_index",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"billing_bill_subscription_pattern_month": {
|
||||
"name": "billing_bill_subscription_pattern_month",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
"null": true,
|
||||
"default": null,
|
||||
"foreignTable": "account",
|
||||
"foreignKey": "account_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ use Modules\Media\Models\UploadStatus;
|
|||
use Modules\SupplierManagement\Models\NullSupplier;
|
||||
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||
use phpOMS\Autoloader;
|
||||
use phpOMS\Localization\ISO639x1Enum;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Message\Http\HttpRequest;
|
||||
use phpOMS\Message\Http\HttpResponse;
|
||||
|
|
@ -293,7 +294,7 @@ final class ApiController extends Controller
|
|||
$bill->getId(),
|
||||
$media->getId(),
|
||||
BillMapper::class,
|
||||
'media',
|
||||
'bill_media',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -321,7 +322,7 @@ final class ApiController extends Controller
|
|||
$bill->getId(),
|
||||
$media,
|
||||
BillMapper::class,
|
||||
'media',
|
||||
'bill_media',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -581,7 +582,7 @@ final class ApiController extends Controller
|
|||
$bill->getId(),
|
||||
$media->getId(),
|
||||
BillMapper::class,
|
||||
'media',
|
||||
'bill_media',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -639,7 +640,7 @@ final class ApiController extends Controller
|
|||
}
|
||||
|
||||
$model = $response->get($request->uri->__toString())['response'];
|
||||
$this->createModelRelation($request->header->account, $request->getData('id'), $model->getId(), BillMapper::class, 'notes', '', $request->getOrigin());
|
||||
$this->createModelRelation($request->header->account, $request->getData('id'), $model->getId(), BillMapper::class, 'bill_note', '', $request->getOrigin());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -312,6 +312,22 @@ class Bill implements \JsonSerializable
|
|||
*/
|
||||
private string $currency = ISO4217CharEnum::_EUR;
|
||||
|
||||
/**
|
||||
* Info text.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $header = '';
|
||||
|
||||
/**
|
||||
* Info text.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $footer = '';
|
||||
|
||||
/**
|
||||
* Info text.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ class BillMapper extends DataMapperFactory
|
|||
'billing_bill_number' => ['name' => 'billing_bill_number', 'type' => 'string', 'internal' => 'number'],
|
||||
'billing_bill_numberformat' => ['name' => 'billing_bill_numberformat', 'type' => 'string', 'internal' => 'numberFormat'],
|
||||
'billing_bill_type' => ['name' => 'billing_bill_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'billing_bill_header' => ['name' => 'billing_bill_header', 'type' => 'string', 'internal' => 'header'],
|
||||
'billing_bill_footer' => ['name' => 'billing_bill_footer', 'type' => 'string', 'internal' => 'footer'],
|
||||
'billing_bill_info' => ['name' => 'billing_bill_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'billing_bill_status' => ['name' => 'billing_bill_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'billing_bill_shipTo' => ['name' => 'billing_bill_shipTo', 'type' => 'string', 'internal' => 'shipTo'],
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@
|
|||
},
|
||||
"providing": {
|
||||
"Navigation": "*",
|
||||
"Media": "*"
|
||||
"Media": "*",
|
||||
"Workflow": "*"
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
};
|
||||
|
||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||
$this->app->orgId = 1;
|
||||
$this->app->unitId = 1;
|
||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||
$this->app->appSettings = new CoreSettings();
|
||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user