@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.44 → 2.3.7-dev.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Customer.js +2 -2
- package/src/parts/fieldDefinitions.js +1 -1
- package/src/utils/CutoffDate.js +14 -14
package/package.json
CHANGED
package/src/Customer.js
CHANGED
|
@@ -41,7 +41,7 @@ const classProps = {
|
|
|
41
41
|
}),
|
|
42
42
|
paymentDate: defField("select", {
|
|
43
43
|
label: "入金サイト(日付)",
|
|
44
|
-
default: CutoffDate.VALUES.
|
|
44
|
+
default: CutoffDate.VALUES[0].value,
|
|
45
45
|
required: true,
|
|
46
46
|
component: {
|
|
47
47
|
attrs: {
|
|
@@ -135,7 +135,7 @@ export default class Customer extends FireModel {
|
|
|
135
135
|
const finalMonth = targetMonth % 12;
|
|
136
136
|
|
|
137
137
|
let dueDate;
|
|
138
|
-
if (this.paymentDate === CutoffDate.VALUES.
|
|
138
|
+
if (this.paymentDate === CutoffDate.VALUES[0].value) {
|
|
139
139
|
// 月末の場合
|
|
140
140
|
dueDate = new Date(Date.UTC(targetYear, finalMonth + 1, 0));
|
|
141
141
|
} else {
|
|
@@ -540,7 +540,7 @@ export const fieldDefinitions = {
|
|
|
540
540
|
},
|
|
541
541
|
cutoffDate: {
|
|
542
542
|
...generalDefinitions.select,
|
|
543
|
-
default: CutoffDate.VALUES.
|
|
543
|
+
default: CutoffDate.VALUES[0].value,
|
|
544
544
|
label: "締日",
|
|
545
545
|
component: {
|
|
546
546
|
name: generalDefinitions.select.component.name,
|
package/src/utils/CutoffDate.js
CHANGED
|
@@ -22,24 +22,24 @@ export default class CutoffDate {
|
|
|
22
22
|
* Cutoff date constant values
|
|
23
23
|
*/
|
|
24
24
|
static VALUES = Object.freeze({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
5: { value: 5, title: "5日" },
|
|
26
|
+
10: { value: 10, title: "10日" },
|
|
27
|
+
15: { value: 15, title: "15日" },
|
|
28
|
+
20: { value: 20, title: "20日" },
|
|
29
|
+
25: { value: 25, title: "25日" },
|
|
30
|
+
0: { value: 0, title: "月末" },
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Options for selection components
|
|
35
35
|
*/
|
|
36
36
|
static OPTIONS = [
|
|
37
|
-
{ title: "5日", value: CutoffDate.VALUES.
|
|
38
|
-
{ title: "10日", value: CutoffDate.VALUES.
|
|
39
|
-
{ title: "15日", value: CutoffDate.VALUES.
|
|
40
|
-
{ title: "20日", value: CutoffDate.VALUES.
|
|
41
|
-
{ title: "25日", value: CutoffDate.VALUES.
|
|
42
|
-
{ title: "月末", value: CutoffDate.VALUES.
|
|
37
|
+
{ title: "5日", value: CutoffDate.VALUES[5].value },
|
|
38
|
+
{ title: "10日", value: CutoffDate.VALUES[10].value },
|
|
39
|
+
{ title: "15日", value: CutoffDate.VALUES[15].value },
|
|
40
|
+
{ title: "20日", value: CutoffDate.VALUES[20].value },
|
|
41
|
+
{ title: "25日", value: CutoffDate.VALUES[25].value },
|
|
42
|
+
{ title: "月末", value: CutoffDate.VALUES[0].value },
|
|
43
43
|
];
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -50,11 +50,11 @@ export default class CutoffDate {
|
|
|
50
50
|
* @returns {number} Actual cutoff day
|
|
51
51
|
* @example
|
|
52
52
|
* // Get cutoff day for February 2024 with month-end setting
|
|
53
|
-
* const cutoffDay = CutoffDate.calculateActualCutoffDay(2024, 1, CutoffDate.VALUES.
|
|
53
|
+
* const cutoffDay = CutoffDate.calculateActualCutoffDay(2024, 1, CutoffDate.VALUES[0].value);
|
|
54
54
|
* // Returns 29 (leap year)
|
|
55
55
|
*/
|
|
56
56
|
static calculateActualCutoffDay(year, month, cutoffDateValue) {
|
|
57
|
-
if (cutoffDateValue === CutoffDate.VALUES.
|
|
57
|
+
if (cutoffDateValue === CutoffDate.VALUES[0].value) {
|
|
58
58
|
// Get last day of the month using UTC
|
|
59
59
|
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
|
|
60
60
|
}
|