mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-18 09:18:40 +00:00
phpstan and phpcs fixes
This commit is contained in:
parent
b148909011
commit
3ccdcade6e
|
|
@ -10,7 +10,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1001601001,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005104001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005104001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
"icon": null,
|
||||
"order": 10,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 4, "type": null, "element": null },
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1005104001,
|
||||
"children": []
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1002101001,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005105001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005105001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
"icon": null,
|
||||
"order": 10,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 4, "type": null, "element": null },
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1005105001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
"icon": null,
|
||||
"order": 15,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 4, "type": null, "element": null },
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1005105001,
|
||||
"children": []
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1001301001,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005106001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005106001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 4, "type": null, "element": null },
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1005106001,
|
||||
"children": []
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@
|
|||
"icon": null,
|
||||
"order": 15,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1001602001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -223,7 +223,7 @@
|
|||
"icon": null,
|
||||
"order": 15,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1001602001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -238,7 +238,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1003401001,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005109001,
|
||||
"children": [
|
||||
]
|
||||
|
|
@ -268,7 +268,7 @@
|
|||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005109001,
|
||||
"children": [
|
||||
]
|
||||
|
|
|
|||
|
|
@ -194,7 +194,6 @@ final class ApiController extends Controller
|
|||
$bill = new Bill();
|
||||
$bill->createdBy = new NullAccount($request->header->account);
|
||||
$bill->type = $billType;
|
||||
$bill->setStatus((int) ($request->getData('status') ?? BillStatus::ACTIVE));
|
||||
$bill->numberFormat = $billType->numberFormat;
|
||||
$bill->billTo = $request->getData('billto')
|
||||
?? ($account->profile->account->name1 . (!empty($account->profile->account->name2) ? ', ' . $account->profile->account->name2 : '')); // @todo: use defaultInvoiceAddress or mainAddress. also consider to use billto1, billto2, billto3 (for multiple lines e.g. name2, fao etc.)
|
||||
|
|
@ -205,6 +204,7 @@ final class ApiController extends Controller
|
|||
$bill->client = $request->getData('client') === null ? null : $account;
|
||||
$bill->supplier = $request->getData('supplier') === null ? null : $account;
|
||||
$bill->performanceDate = new \DateTime($request->getData('performancedate') ?? 'now');
|
||||
$bill->setStatus((int) ($request->getData('status') ?? BillStatus::ACTIVE));
|
||||
|
||||
return $bill;
|
||||
}
|
||||
|
|
@ -286,7 +286,6 @@ final class ApiController extends Controller
|
|||
|
||||
if ($collection instanceof NullCollection) {
|
||||
$collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection(
|
||||
'/Modules/Media/Files',
|
||||
$path,
|
||||
$request->header->account,
|
||||
__DIR__ . '/../../../Modules/Media/Files' . $path,
|
||||
|
|
@ -318,6 +317,15 @@ final class ApiController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create media directory path
|
||||
*
|
||||
* @param Bill $bill Bill
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createBillDir(Bill $bill): string
|
||||
{
|
||||
return '/Modules/Billing/Bills/'
|
||||
|
|
@ -495,7 +503,7 @@ final class ApiController extends Controller
|
|||
|
||||
$template = $bill->type->template;
|
||||
|
||||
$path = $this->createBillDir($bill);;
|
||||
$path = $this->createBillDir($bill);
|
||||
$pdfDir = __DIR__ . '/../../../Modules/Media/Files' . $path;
|
||||
|
||||
$status = !\is_dir($pdfDir) ? \mkdir($pdfDir, 0755, true) : true;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class BillType
|
|||
*/
|
||||
public function __construct(string $name = '')
|
||||
{
|
||||
$this->media = new NullCollection();
|
||||
$this->template = new NullCollection();
|
||||
$this->setL11n($name);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,5 +35,4 @@ abstract class PermissionCategory extends Enum
|
|||
public const PRIVATE_DASHBOARD = 5;
|
||||
|
||||
public const PRIVATE_BILL_UPLOAD = 6;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,4 @@ abstract class SettingsEnum extends Enum
|
|||
public const PREVIEW_MEDIA_TYPE = '1005100001_1'; // internally generated preview
|
||||
|
||||
public const ORIGINAL_MEDIA_TYPE = '1005100001_2'; // original document (mostly supplier invoice/delivery note)
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user