mirror of
https://github.com/Karaka-Management/oms-Accounting.git
synced 2026-02-06 08:08:40 +00:00
update
This commit is contained in:
parent
aba9bba8cb
commit
93c4ab93f2
1615
Admin/Install/Coa/skr03.csv
Normal file
1615
Admin/Install/Coa/skr03.csv
Normal file
File diff suppressed because it is too large
Load Diff
0
Admin/Install/Structures/hgb_balance.json → Admin/Install/Coa/skr03_balance_de_gaap.json
Executable file → Normal file
0
Admin/Install/Structures/hgb_balance.json → Admin/Install/Coa/skr03_balance_de_gaap.json
Executable file → Normal file
0
Admin/Install/Structures/hgb_income_statement.json → Admin/Install/Coa/skr03_balance_ifrs.json
Executable file → Normal file
0
Admin/Install/Structures/hgb_income_statement.json → Admin/Install/Coa/skr03_balance_ifrs.json
Executable file → Normal file
0
Admin/Install/Structures/skr04_balance.json → Admin/Install/Coa/skr03_pl_de_gaap_salescost.json
Executable file → Normal file
0
Admin/Install/Structures/skr04_balance.json → Admin/Install/Coa/skr03_pl_de_gaap_salescost.json
Executable file → Normal file
370
Admin/Install/Coa/skr03_pl_de_gaap_totalcost.json
Normal file
370
Admin/Install/Coa/skr03_pl_de_gaap_totalcost.json
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
[
|
||||
{
|
||||
"name": "1",
|
||||
"l11n": {
|
||||
"en": "Turnorver",
|
||||
"de": "Umsatzerlöse"
|
||||
},
|
||||
"account": [2750,2751,2752,2753,2754,2764],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "2",
|
||||
"l11n": {
|
||||
"en": "Increase or reduction of stocks of finished goods and work in progress",
|
||||
"de": "Erhöhung oder Verminderung des Bestands an fertigen und unfertigen Erzeugnissen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "3",
|
||||
"l11n": {
|
||||
"en": "Work performed by the undertaking for its own purposes and carried as an asset",
|
||||
"de": "Andere aktivierte Eigenleistungen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "4",
|
||||
"l11n": {
|
||||
"en": "Other operating earnings",
|
||||
"de": "Sonstige betriebliche Erträge"
|
||||
},
|
||||
"account": [2315,2316,2317,2318,2500,2501,2504,2508,2510,2520,2590,2594,2660,2661,2666,2700,2705,2707,2709,2710,2711,2712,2713,2714,2715,2716,2720,2723,2725,2726,2727,2728,2729,2730,2731,2732,2735,2736,2737,2740,2741,2742,2743,2744,2746,2747,2749,2760,2762,2790,2745,2746,2747,2749],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "5",
|
||||
"l11n": {
|
||||
"en": "Expenditures on materials",
|
||||
"de": "Materialaufwand"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "5a",
|
||||
"l11n": {
|
||||
"en": "Expenditures for raw materials, auxiliary supplies and consumables and for purchased goods",
|
||||
"de": "Aufwendungen für Roh-, Hilfs- und Betriebsstoffe und für bezogene Waren"
|
||||
},
|
||||
"account": [3000,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3200,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "5b",
|
||||
"l11n": {
|
||||
"en": "Expenditures for purchased services",
|
||||
"de": "Aufwendungen für bezogene Leistungen"
|
||||
},
|
||||
"account": [3100,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3165,3170,3175,3180,3185],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GP",
|
||||
"l11n": {
|
||||
"en": "Gross profit",
|
||||
"de": "Rohertrag"
|
||||
},
|
||||
"account": [],
|
||||
"type": "formula",
|
||||
"formula": "1+2+3+4+5",
|
||||
"style": "subtotal",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "GPratio",
|
||||
"l11n": {
|
||||
"en": "Gross profit ratio",
|
||||
"de": "Rohertragsmarge"
|
||||
},
|
||||
"account": [],
|
||||
"type": "formula",
|
||||
"formula": "GP/(1+2+3+4)",
|
||||
"style": "ratio",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "6",
|
||||
"l11n": {
|
||||
"en": "Staff costs",
|
||||
"de": "Personalaufwand"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "6a",
|
||||
"l11n": {
|
||||
"en": "Wages and salaries",
|
||||
"de": "Löhne und Gehälter"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "6b",
|
||||
"l11n": {
|
||||
"en": "Social security contributions and expenditures for old-age pension schemes and for support",
|
||||
"de": "soziale Abgaben und Aufwendungen für Altersversorgung und für Unterstützung"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "6bthereof",
|
||||
"l11n": {
|
||||
"en": "thereof relating to the old-age pension scheme",
|
||||
"de": "davon für Altersversorgung"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "7",
|
||||
"l11n": {
|
||||
"en": "Amortisations / depreciations",
|
||||
"de": "Abschreibungen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "7a",
|
||||
"l11n": {
|
||||
"en": "Intangible assets forming part of the fixed assets and of tangible fixed assets",
|
||||
"de": "auf immaterielle Vermögensgegenstände des Anlagevermögens und Sachanlage"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "7b",
|
||||
"l11n": {
|
||||
"en": "Assets reported as part of the current assets, to the extent that they exceed the depreciations customarily stated for the share capital company",
|
||||
"de": "auf Vermögensgegenstände des Umlaufvermögens, soweit diese die in der Kapitalgesellschaft üblichen Abschreibungen überschreiten"
|
||||
},
|
||||
"account": [2430,2431,2432,2433,2434,2345,2436,2437,2438,2440,2441],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "8",
|
||||
"l11n": {
|
||||
"en": "Other operating expenses",
|
||||
"de": "Sonstige betriebliche Aufwendungen"
|
||||
},
|
||||
"account": [2150,2151,2166,2170,2171,2174,2175,2176,2300,2307,2308,2309,2310,2311,2312,2313,2320,2323,2325,2326,2327,2328,2339,2342,2343,2344,2345,2347,2350,2380,2381,2382,2383,2384,2385,2386,2387,2389,2390,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2450,2451,2490,2890,2891,2892,2893,2894,2895,2900],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "9",
|
||||
"l11n": {
|
||||
"en": "Income from participating interests",
|
||||
"de": "Erträge aus Beteiligungen"
|
||||
},
|
||||
"account": [2480,2491,2492,2493,2494,2495,2496,2497,2498,2499,2600,2603,2613,2614,2615,2616,2618,2619,2792,2794],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "9thereof",
|
||||
"l11n": {
|
||||
"en": "thereof derived from affiliated undertakings",
|
||||
"de": "davon aus verbundenen Unternehmen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "10",
|
||||
"l11n": {
|
||||
"en": "Income from other investments and loans forming part of the financial assets",
|
||||
"de": "Erträge aus anderen Wertpapieren und Ausleihungen des Finanzanlagevermögens"
|
||||
},
|
||||
"account": [2620,2621,2622,2623,2625,2626,2640,2641,2646,2647,2648,2649],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "10thereof",
|
||||
"l11n": {
|
||||
"en": "thereof derived from affiliated undertakings",
|
||||
"de": "davon aus verbundenen Unternehmen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "11",
|
||||
"l11n": {
|
||||
"en": "Other interest receivable and similar income",
|
||||
"de": "Sonstige Zinsen und ähnliche Erträge"
|
||||
},
|
||||
"account": [2650,2653,2654,2655,2656,2657,2658,2659,2670,2679,2680,2682,2683,2684,2685,2686,2687,2688,2689],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "11thereof",
|
||||
"l11n": {
|
||||
"en": "thereof derived from affiliated undertakings",
|
||||
"de": "davon aus verbundenen Unternehmen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "12",
|
||||
"l11n": {
|
||||
"en": "Depreciations of financial assets and of investment securities forming part of the current assets",
|
||||
"de": "Abschreibungen auf Finanzanlagen und auf Wertpapiere des Umlaufvermögens"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "13",
|
||||
"l11n": {
|
||||
"en": "Interest payable and similar expenses",
|
||||
"de": "Zinsen und ähnliche Aufwendungen,"
|
||||
},
|
||||
"account": [2105,2106,2107,2108,2109,2110,2111,2113,2114,2115,2116,2117,2118,2119,2120,2123,2124,2125,2126,2127,2128,2129,2130,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": [
|
||||
{
|
||||
"name": "13thereof",
|
||||
"l11n": {
|
||||
"en": "thereof derived from affiliated undertakings",
|
||||
"de": "davon aus verbundenen Unternehmen"
|
||||
},
|
||||
"account": [],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "14",
|
||||
"l11n": {
|
||||
"en": "Taxes on income and earnings",
|
||||
"de": "Steuern vom Einkommen und vom Ertrag"
|
||||
},
|
||||
"account": [2200,2203,2204,2208,2209,2210,2213,2216,2218,2219,2250,2255,2260,2265,2281,2283],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "15",
|
||||
"l11n": {
|
||||
"en": "Profit or loss after taxes",
|
||||
"de": "Ergebnis nach Steuern"
|
||||
},
|
||||
"account": [],
|
||||
"type": "formula",
|
||||
"formula": "1+2+3+4+5+6+7+8+9+10+11+12+13+14",
|
||||
"style": "subtotal",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "16",
|
||||
"l11n": {
|
||||
"en": "Other taxes",
|
||||
"de": "Sonstige Steuern"
|
||||
},
|
||||
"account": [2285,2287,2289,2375],
|
||||
"type": "category",
|
||||
"formula": "",
|
||||
"style": "category",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "17",
|
||||
"l11n": {
|
||||
"en": "Net income for the year / net loss for the year",
|
||||
"de": "Jahresüberschuss/Jahresfehlbetrag"
|
||||
},
|
||||
"account": [],
|
||||
"type": "formula",
|
||||
"formula": "15+16",
|
||||
"style": "total",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
0
Admin/Install/Structures/skr04_income_statement.json → Admin/Install/Coa/skr03_pl_ifrs_salescost.json
Executable file → Normal file
0
Admin/Install/Structures/skr04_income_statement.json → Admin/Install/Coa/skr03_pl_ifrs_salescost.json
Executable file → Normal file
0
Admin/Install/Coa/skr03_pl_ifrs_totalcost.json
Normal file
0
Admin/Install/Coa/skr03_pl_ifrs_totalcost.json
Normal file
|
|
@ -111,7 +111,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Accounts",
|
||||
"uri": "{/base}/accounting/gl/list",
|
||||
"uri": "{/base}/accounting/coa/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/accounting/gl/list",
|
||||
"uri": "{/base}/accounting/coa/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/accounting/gl/create?{?}",
|
||||
"uri": "{/base}/accounting/coa/create?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
];
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'0100' => '',
|
||||
];
|
||||
|
|
@ -1,627 +0,0 @@
|
|||
[
|
||||
{
|
||||
"number": "0110",
|
||||
"name": "Konzessionen",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0120",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0128",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0129",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0130",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0134",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0135",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0140",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0143",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0144",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0145",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0146",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0147",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0148",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0149",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0150",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0160",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0170",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0179",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0200",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0210",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0215",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0220",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0225",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0229",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0230",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0235",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0240",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0250",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0260",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0270",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0280",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0285",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0290",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0300",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0305",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0310",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0320",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0329",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0330",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0340",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0350",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0360",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0370",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0380",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0390",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0395",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0398",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0400",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0420",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0440",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0450",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0460",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0470",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0500",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0510",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0520",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0540",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0560",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0570",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0580",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0620",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0630",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0635",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0640",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0650",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0660",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0670",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0675",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0680",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0695",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0696",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0697",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0698",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0699",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0700",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0705",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0710",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0720",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0725",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0735",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0740",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0750",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0755",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0765",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0770",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0780",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0785",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0795",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0800",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0803",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0804",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0805",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0806",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0807",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0808",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0809",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0810",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0813",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0814",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0815",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0820",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0829",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0830",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0840",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0850",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0860",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0880",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0883",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0885",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0900",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0910",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0920",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0930",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0940",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0960",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0961",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0962",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0963",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0964",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0970",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0980",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0990",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0995",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
},
|
||||
{
|
||||
"number": "0997",
|
||||
"name": "",
|
||||
"type": "asset",
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -9,16 +9,11 @@
|
|||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"accounting_account_name": {
|
||||
"name": "accounting_account_name",
|
||||
"accounting_account_account": {
|
||||
"name": "accounting_account_account",
|
||||
"type": "VARCHAR(50)",
|
||||
"null": false
|
||||
},
|
||||
"accounting_account_description": {
|
||||
"name": "accounting_account_description",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"accounting_account_type": {
|
||||
"name": "accounting_account_type",
|
||||
"type": "TINYINT",
|
||||
|
|
@ -32,6 +27,37 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"accounting_account_l11n": {
|
||||
"name": "accounting_account_l11n",
|
||||
"fields": {
|
||||
"accounting_account_l11n_id": {
|
||||
"name": "accounting_account_l11n_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"accounting_account_l11n_title": {
|
||||
"name": "accounting_account_l11n_title",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"accounting_account_l11n_account": {
|
||||
"name": "accounting_account_l11n_account",
|
||||
"type": "INT(11)",
|
||||
"null": false,
|
||||
"foreignTable": "accounting_account",
|
||||
"foreignKey": "accounting_account_id"
|
||||
},
|
||||
"accounting_account_l11n_lang": {
|
||||
"name": "accounting_account_l11n_lang",
|
||||
"type": "VARCHAR(2)",
|
||||
"null": false,
|
||||
"foreignTable": "language",
|
||||
"foreignKey": "language_639_1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"accounting_costcenter": {
|
||||
"name": "accounting_costcenter",
|
||||
"fields": {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Accounting\Admin;
|
||||
|
||||
use phpOMS\Application\ApplicationAbstract;
|
||||
use phpOMS\Config\SettingsInterface;
|
||||
use phpOMS\Message\Http\HttpRequest;
|
||||
use phpOMS\Message\Http\HttpResponse;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
use phpOMS\Module\ModuleInfo;
|
||||
use phpOMS\Uri\HttpUri;
|
||||
|
||||
/**
|
||||
* Installer class.
|
||||
|
|
@ -33,4 +39,71 @@ final class Installer extends InstallerAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
||||
{
|
||||
parent::install($app, $info, $cfgHandler);
|
||||
|
||||
self::importAccounts($app);
|
||||
}
|
||||
|
||||
private static function importAccounts(ApplicationAbstract $app)
|
||||
{
|
||||
/** @var \Modules\Accounting\Controller\ApiController $module */
|
||||
$module = $app->moduleManager->getModuleInstance('Accounting', 'Api');
|
||||
|
||||
$fp = \fopen(__DIR__ . '/Install/Coa/skr03.csv', 'r');
|
||||
if ($fp === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
$c = 0;
|
||||
$definitions = [];
|
||||
$languages = 0;
|
||||
|
||||
while (($line = \fgetcsv($fp)) !== false) {
|
||||
++$c;
|
||||
|
||||
if ($c === 2) {
|
||||
$definitions = $line;
|
||||
$languages = \count($definitions) - 19;
|
||||
}
|
||||
|
||||
if ($c < 3) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('account', $line[0]);
|
||||
$request->setData('content', \trim($line[19]));
|
||||
$request->setData('language', $definitions[19]);
|
||||
$module->apiAccountCreate($request, $response);
|
||||
|
||||
$responseData = $response->get('');
|
||||
if (!\is_array($responseData)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$accountId = $responseData['response']->id;
|
||||
|
||||
for ($i = 1; $i < $languages; ++$i) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('ref', $accountId);
|
||||
$request->setData('content', \trim($line[19 + $i]));
|
||||
$request->setData('language', $definitions[19 + $i]);
|
||||
$module->apiAccountL11nCreate($request, $response);
|
||||
}
|
||||
}
|
||||
|
||||
\fclose($fp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/accounting/gl/list.*$' => [
|
||||
'^.*/accounting/coa/list.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Accounting\Controller\BackendController:viewGLList',
|
||||
'dest' => '\Modules\Accounting\Controller\BackendController:viewCOAList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
|
|
@ -128,9 +128,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/accounting/gl/create.*$' => [
|
||||
'^.*/accounting/coa/create.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Accounting\Controller\BackendController:viewGLCreate',
|
||||
'dest' => '\Modules\Accounting\Controller\BackendController:viewCOACreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ use phpOMS\Message\Http\RequestStatusCode;
|
|||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Model\Message\FormValidation;
|
||||
use Modules\Accounting\Models\AccountAbstract;
|
||||
use Modules\Accounting\Models\AccountAbstractMapper;
|
||||
use Modules\Accounting\Models\AccountL11nMapper;
|
||||
use phpOMS\Localization\BaseStringL11n;
|
||||
use phpOMS\Localization\ISO639x1Enum;
|
||||
|
||||
/**
|
||||
* Accounting controller class.
|
||||
|
|
@ -52,6 +57,10 @@ final class ApiController extends Controller
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
$account = $this->createAccountFromRequest($request);
|
||||
$this->createModel($request->header->account, $account, AccountAbstractMapper::class, 'account', $request->getOrigin());
|
||||
$this->createStandardCreateResponse($request, $response, $account);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +75,8 @@ final class ApiController extends Controller
|
|||
private function validateAccountCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['name'] = !$request->hasData('name'))
|
||||
if (($val['account'] = !$request->hasData('account'))
|
||||
|| ($val['content'] = !$request->hasData('content'))
|
||||
) {
|
||||
return $val;
|
||||
}
|
||||
|
|
@ -79,13 +89,86 @@ final class ApiController extends Controller
|
|||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return mixed
|
||||
* @return AccountAbstract
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createAccountFromRequest(RequestAbstract $request) : mixed
|
||||
private function createAccountFromRequest(RequestAbstract $request) : AccountAbstract
|
||||
{
|
||||
return null;
|
||||
$account = new AccountAbstract();
|
||||
$account->account = $request->getDataString('account') ?? '';
|
||||
$account->setL11n($request->getDataString('content') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Api method to create item attribute l11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiAccountL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateAccountL11nCreate($request))) {
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
$this->createInvalidCreateResponse($request, $response, $val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$contractTypeL11n = $this->createAccountL11nFromRequest($request);
|
||||
$this->createModel($request->header->account, $contractTypeL11n, AccountL11nMapper::class, 'contract_type_l11n', $request->getOrigin());
|
||||
$this->createStandardCreateResponse($request, $response, $contractTypeL11n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute l11n from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return BaseStringL11n
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createAccountL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||
{
|
||||
$contractTypeL11n = new BaseStringL11n();
|
||||
$contractTypeL11n->ref = $request->getDataInt('ref') ?? 0;
|
||||
$contractTypeL11n->setLanguage(
|
||||
$request->getDataString('language') ?? $request->header->l11n->language
|
||||
);
|
||||
$contractTypeL11n->content = $request->getDataString('content') ?? '';
|
||||
|
||||
return $contractTypeL11n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute l11n create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function validateAccountL11nCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['content'] = !$request->hasData('content'))
|
||||
|| ($val['ref'] = !$request->hasData('ref'))
|
||||
) {
|
||||
return $val;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Accounting\Controller;
|
||||
|
||||
use Modules\Accounting\Models\AccountAbstractMapper;
|
||||
use Modules\Accounting\Models\CostCenterMapper;
|
||||
use Modules\Accounting\Models\CostObjectMapper;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
|
|
@ -191,12 +192,17 @@ final class BackendController extends Controller
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewGLList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
public function viewCOAList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Accounting/Theme/Backend/gl-list');
|
||||
$view->setTemplate('/Modules/Accounting/Theme/Backend/coa-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
|
||||
|
||||
$view->data['accounts'] = AccountAbstractMapper::getAll()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
@ -212,10 +218,10 @@ final class BackendController extends Controller
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewGLCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
public function viewCOACreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Accounting/Theme/Backend/gl-create');
|
||||
$view->setTemplate('/Modules/Accounting/Theme/Backend/coa-create');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use phpOMS\Localization\BaseStringL11n;
|
||||
use phpOMS\Localization\ISO639x1Enum;
|
||||
|
||||
/**
|
||||
* Account abstraction class.
|
||||
*
|
||||
|
|
@ -22,7 +25,7 @@ namespace Modules\Accounting\Models;
|
|||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class AccountAbstract
|
||||
class AccountAbstract
|
||||
{
|
||||
/**
|
||||
* Account ID.
|
||||
|
|
@ -32,6 +35,16 @@ abstract class AccountAbstract
|
|||
*/
|
||||
public int $id = 0;
|
||||
|
||||
public string $account = '';
|
||||
|
||||
/*
|
||||
* String l11n
|
||||
*
|
||||
* @var string | BaseStringL11n
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string | BaseStringL11n $l11n = '';
|
||||
|
||||
/**
|
||||
* Summary account.
|
||||
*
|
||||
|
|
@ -48,6 +61,8 @@ abstract class AccountAbstract
|
|||
*/
|
||||
public int $type = AccountType::IMPERSONAL;
|
||||
|
||||
public ?int $parent = null;
|
||||
|
||||
/**
|
||||
* Entry list.
|
||||
*
|
||||
|
|
@ -82,6 +97,44 @@ abstract class AccountAbstract
|
|||
return $this->entries[$id] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set l11n
|
||||
*
|
||||
* @param string|BaseStringL11n $l11n Tag article l11n
|
||||
* @param string $lang Language
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setL11n(string | BaseStringL11n $l11n, string $lang = ISO639x1Enum::_EN) : void
|
||||
{
|
||||
if ($l11n instanceof BaseStringL11n) {
|
||||
$this->l11n = $l11n;
|
||||
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
|
||||
$this->l11n->content = $l11n;
|
||||
$this->l11n->setLanguage($lang);
|
||||
} else {
|
||||
$this->l11n = new BaseStringL11n();
|
||||
$this->l11n->content = $l11n;
|
||||
$this->l11n->setLanguage($lang);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getL11n() : string
|
||||
{
|
||||
if (!isset($this->l11n)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->l11n instanceof BaseStringL11n ? $this->l11n->content : $this->l11n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get entry.
|
||||
*
|
||||
|
|
|
|||
84
Models/AccountAbstractMapper.php
Normal file
84
Models/AccountAbstractMapper.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Account mapper class.
|
||||
*
|
||||
* @package Modules\Accounting\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @template T of AccountAbstract
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
class AccountAbstractMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'accounting_account_id' => ['name' => 'accounting_account_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'accounting_account_account' => ['name' => 'accounting_account_account', 'type' => 'string', 'internal' => 'account', 'autocomplete' => true],
|
||||
'accounting_account_type' => ['name' => 'accounting_account_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'accounting_account_parent' => ['name' => 'accounting_account_parent', 'type' => 'string', 'internal' => 'parent'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
'l11n' => [
|
||||
'mapper' => AccountL11nMapper::class,
|
||||
'table' => 'accounting_account_l11n',
|
||||
'self' => 'accounting_account_l11n_account',
|
||||
'column' => 'content',
|
||||
'external' => null,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Model to use by the mapper.
|
||||
*
|
||||
* @var class-string<T>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODEL = AccountAbstract::class;
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const TABLE = 'accounting_account';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PRIMARYFIELD = 'accounting_account_id';
|
||||
}
|
||||
69
Models/AccountL11nMapper.php
Normal file
69
Models/AccountL11nMapper.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* Contract type l11n mapper class.
|
||||
*
|
||||
* @package Modules\Accounting\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @template T of BaseStringL11n
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
final class AccountL11nMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'accounting_account_l11n_id' => ['name' => 'accounting_account_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'accounting_account_l11n_title' => ['name' => 'accounting_account_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'accounting_account_l11n_account' => ['name' => 'accounting_account_l11n_account', 'type' => 'int', 'internal' => 'ref'],
|
||||
'accounting_account_l11n_lang' => ['name' => 'accounting_account_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const TABLE = 'accounting_account_l11n';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PRIMARYFIELD = 'accounting_account_l11n_id';
|
||||
|
||||
/**
|
||||
* Model to use by the mapper.
|
||||
*
|
||||
* @var class-string<T>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODEL = BaseStringL11n::class;
|
||||
}
|
||||
46
Theme/Backend/coa-list.tpl.php
Normal file
46
Theme/Backend/coa-list.tpl.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$accounts = $this->data['accounts'];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Chart of Accounts (COA)'); ?><i class="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Account'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Description'); ?>
|
||||
<tbody>
|
||||
<?php $c = 0;
|
||||
foreach ($accounts as $key => $value) : ++$c;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/admin/group/settings?{?}&id=' . $value->id); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->account); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
|
||||
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
|
||||
|
||||
$footerView->setPages(25);
|
||||
$footerView->setPage(1);
|
||||
$footerView->setResults(1);
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box wf-100">
|
||||
<table class="default sticky">
|
||||
<caption><?= $this->getHtml('GL'); ?><i class="fa fa-download end-xs download btn"></i></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ([] as $key => $value) : ++$c;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/admin/group/settings?{?}&id=' . $value->id); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||
<td>
|
||||
<td>
|
||||
<td>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -71,14 +71,12 @@ final class Autoloader
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws AutoloadException Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function defaultAutoloader(string $class) : void
|
||||
{
|
||||
$class = \ltrim($class, '\\');
|
||||
$class = \str_replace(['_', '\\'], '/', $class);
|
||||
$class = \strtr($class, '_\\', '//');
|
||||
|
||||
foreach (self::$paths as $path) {
|
||||
$file = $path . $class . '.php';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user