Skip to content

Commit 353c184

Browse files
authored
Merge pull request #1699 from frappe/version-15-hotfix
chore: release v15
2 parents 77dcf83 + 2407fc9 commit 353c184

File tree

13 files changed

+268
-74
lines changed

13 files changed

+268
-74
lines changed

.github/workflows/ci.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
timeout-minutes: 60
2525
env:
2626
NODE_ENV: "production"
27+
WITH_COVERAGE: ${{ github.event_name != 'pull_request' }}
2728

2829
strategy:
2930
fail-fast: false
@@ -108,14 +109,14 @@ jobs:
108109
BRANCH_TO_CLONE: ${{ env.HR_BRANCH }}
109110

110111
- name: Run Tests
111-
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app hrms --with-coverage --total-builds 2 --build-number ${{ matrix.container }}
112+
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app hrms --total-builds 2 --build-number ${{ matrix.container }}
112113
env:
113114
TYPE: server
114-
CI_BUILD_ID: ${{ github.run_id }}
115-
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
115+
CAPTURE_COVERAGE: ${{ github.event_name != 'pull_request' }}
116116

117117
- name: Upload coverage data
118118
uses: actions/upload-artifact@v3
119+
if: github.event_name != 'pull_request'
119120
with:
120121
name: coverage-${{ matrix.container }}
121122
path: /home/runner/frappe-bench/sites/coverage.xml
@@ -124,6 +125,7 @@ jobs:
124125
name: Coverage Wrap Up
125126
needs: tests
126127
runs-on: ubuntu-latest
128+
if: ${{ github.event_name != 'pull_request' }}
127129
steps:
128130
- name: Clone
129131
uses: actions/checkout@v2

frontend/src/components/ExpenseTaxesTable.vue

-8
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,6 @@ const taxesTableFields = createResource({
191191
params: { doctype: "Expense Taxes and Charges" },
192192
transform(data) {
193193
const excludeFields = ["description_sb"]
194-
const dimensionFields = [
195-
"cost_center",
196-
"project",
197-
"accounting_dimensions_section",
198-
]
199-
200-
if (!props.id) excludeFields.push(...dimensionFields)
201-
202194
return data
203195
.map((field) => {
204196
if (field.fieldname === "account_head") {

frontend/src/components/ExpensesTable.vue

-9
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,6 @@ const expensesTableFields = createResource({
197197
params: { doctype: "Expense Claim Detail" },
198198
transform(data) {
199199
const excludeFields = ["description_sb", "amounts_sb"]
200-
const dimensionFields = [
201-
"cost_center",
202-
"project",
203-
"branch",
204-
"accounting_dimensions_section",
205-
]
206-
207-
if (!props.id) excludeFields.push(...dimensionFields)
208-
209200
return data.filter((field) => !excludeFields.includes(field.fieldname))
210201
},
211202
})

hrms/hr/doctype/full_and_final_asset/full_and_final_asset.json

+51-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88
"reference",
99
"asset_name",
1010
"date",
11+
"actual_cost",
12+
"cost",
13+
"column_break_xezj",
14+
"account",
15+
"action",
1116
"status",
17+
"section_break_hudu",
1218
"description"
1319
],
1420
"fields": [
1521
{
22+
"columns": 2,
1623
"fieldname": "reference",
1724
"fieldtype": "Link",
1825
"in_list_view": 1,
@@ -22,6 +29,7 @@
2229
"reqd": 1
2330
},
2431
{
32+
"columns": 1,
2533
"fieldname": "status",
2634
"fieldtype": "Select",
2735
"in_list_view": 1,
@@ -35,6 +43,7 @@
3543
"label": "Description"
3644
},
3745
{
46+
"columns": 2,
3847
"fieldname": "asset_name",
3948
"fieldtype": "Data",
4049
"in_list_view": 1,
@@ -44,15 +53,55 @@
4453
{
4554
"fieldname": "date",
4655
"fieldtype": "Datetime",
47-
"in_list_view": 1,
4856
"label": "Date",
4957
"read_only": 1
58+
},
59+
{
60+
"fieldname": "column_break_xezj",
61+
"fieldtype": "Column Break"
62+
},
63+
{
64+
"columns": 2,
65+
"default": "Return",
66+
"fieldname": "action",
67+
"fieldtype": "Select",
68+
"in_list_view": 1,
69+
"label": "Action",
70+
"options": "Return\nRecover Cost",
71+
"reqd": 1
72+
},
73+
{
74+
"fieldname": "section_break_hudu",
75+
"fieldtype": "Section Break"
76+
},
77+
{
78+
"columns": 2,
79+
"fieldname": "cost",
80+
"fieldtype": "Currency",
81+
"in_list_view": 1,
82+
"label": "Cost",
83+
"mandatory_depends_on": "eval:doc.action == \"Recover Cost\"",
84+
"read_only_depends_on": "eval:doc.action != \"Recover Cost\""
85+
},
86+
{
87+
"columns": 1,
88+
"fieldname": "account",
89+
"fieldtype": "Link",
90+
"in_list_view": 1,
91+
"label": "Account",
92+
"options": "Account"
93+
},
94+
{
95+
"fieldname": "actual_cost",
96+
"fieldtype": "Currency",
97+
"label": "Actual Cost",
98+
"read_only": 1
5099
}
51100
],
52101
"index_web_pages_for_search": 1,
53102
"istable": 1,
54103
"links": [],
55-
"modified": "2021-07-15 15:17:31.309834",
104+
"modified": "2024-04-19 13:20:41.123440",
56105
"modified_by": "Administrator",
57106
"module": "HR",
58107
"name": "Full and Final Asset",

hrms/hr/doctype/full_and_final_outstanding_statement/full_and_final_outstanding_statement.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"fieldtype": "Column Break"
2222
},
2323
{
24-
"columns": 2,
24+
"columns": 1,
2525
"default": "Unsettled",
2626
"fieldname": "status",
2727
"fieldtype": "Select",
@@ -54,8 +54,10 @@
5454
"reqd": 1
5555
},
5656
{
57+
"columns": 1,
5758
"fieldname": "account",
5859
"fieldtype": "Link",
60+
"in_list_view": 1,
5961
"label": "Account",
6062
"options": "Account"
6163
},
@@ -84,7 +86,7 @@
8486
"index_web_pages_for_search": 1,
8587
"istable": 1,
8688
"links": [],
87-
"modified": "2021-07-20 16:59:34.447934",
89+
"modified": "2024-04-19 15:34:03.923481",
8890
"modified_by": "Administrator",
8991
"module": "HR",
9092
"name": "Full and Final Outstanding Statement",

hrms/hr/doctype/full_and_final_statement/full_and_final_statement.js

+61-16
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ frappe.ui.form.on('Full and Final Statement', {
5454
frm.events.get_outstanding_statements(frm);
5555
},
5656

57-
get_outstanding_statements: function(frm) {
57+
total_asset_recovery_cost: function (frm) {
58+
frm.trigger("calculate_total_receivable_amt");
59+
},
60+
61+
get_outstanding_statements: function (frm) {
5862
if (frm.doc.employee) {
5963
frappe.call({
6064
method: "get_outstanding_statements",
@@ -66,7 +70,46 @@ frappe.ui.form.on('Full and Final Statement', {
6670
}
6771
},
6872

69-
create_journal_entry: function(frm) {
73+
calculate_total_payable_amt: function (frm) {
74+
let total_payable_amount = 0;
75+
76+
frm.doc.payables?.forEach(
77+
(row) => (total_payable_amount += flt(row.amount, precision("amount", row))),
78+
);
79+
frm.set_value(
80+
"total_payable_amount",
81+
flt(total_payable_amount, precision("total_payable_amount")),
82+
);
83+
},
84+
85+
calculate_total_receivable_amt: function (frm) {
86+
let total_asset_recovery_cost = 0;
87+
let total_receivable_amount = 0;
88+
89+
frm.doc.assets_allocated?.forEach((row) => {
90+
if (row.action === "Recover Cost") {
91+
total_asset_recovery_cost += flt(row.cost, precision("cost", row));
92+
}
93+
});
94+
95+
frm.doc.receivables?.forEach(
96+
(row) => (total_receivable_amount += flt(row.amount, precision("amount", row))),
97+
);
98+
99+
frm.set_value(
100+
"total_asset_recovery_cost",
101+
flt(total_asset_recovery_cost, precision("total_asset_recovery_cost")),
102+
);
103+
frm.set_value(
104+
"total_receivable_amount",
105+
flt(
106+
total_asset_recovery_cost + total_receivable_amount,
107+
precision("total_receivable_amount"),
108+
),
109+
);
110+
},
111+
112+
create_journal_entry: function (frm) {
70113
frappe.call({
71114
method: "create_journal_entry",
72115
doc: frm.doc,
@@ -79,8 +122,8 @@ frappe.ui.form.on('Full and Final Statement', {
79122
});
80123

81124
frappe.ui.form.on("Full and Final Outstanding Statement", {
82-
reference_document: function(frm, cdt, cdn) {
83-
var child = locals[cdt][cdn];
125+
reference_document: function (frm, cdt, cdn) {
126+
const child = locals[cdt][cdn];
84127
if (child.reference_document_type && child.reference_document) {
85128
frappe.call({
86129
method: "hrms.hr.doctype.full_and_final_statement.full_and_final_statement.get_account_and_amount",
@@ -98,18 +141,20 @@ frappe.ui.form.on("Full and Final Outstanding Statement", {
98141
}
99142
},
100143

101-
amount: function(frm) {
102-
var total_payable_amount = 0;
103-
var total_receivable_amount = 0;
144+
amount: function (frm, cdt, cdn) {
145+
const child_row = locals[cdt][cdn];
146+
const table = child_row.parentfield;
104147

105-
frm.doc.payables.forEach(element => {
106-
total_payable_amount = total_payable_amount + element.amount;
107-
});
148+
if (table === "payables") {
149+
frm.trigger("calculate_total_payable_amt");
150+
} else {
151+
frm.trigger("calculate_total_receivable_amt");
152+
}
153+
},
154+
});
108155

109-
frm.doc.receivables.forEach(element => {
110-
total_receivable_amount = total_receivable_amount + element.amount;
111-
});
112-
frm.set_value("total_payable_amount", flt(total_payable_amount));
113-
frm.set_value("total_receivable_amount", flt(total_receivable_amount));
114-
}
156+
frappe.ui.form.on("Full and Final Asset", {
157+
cost: function (frm, _cdt, _cdn) {
158+
frm.trigger("calculate_total_receivable_amt");
159+
},
115160
});

hrms/hr/doctype/full_and_final_statement/full_and_final_statement.json

+21-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
"payables",
2424
"section_break_10",
2525
"receivables",
26+
"section_break_15",
27+
"assets_allocated",
28+
"total_asset_recovery_cost",
2629
"totals_section",
2730
"total_payable_amount",
2831
"column_break_21",
29-
"total_receivable_amount",
30-
"section_break_15",
31-
"assets_allocated"
32+
"total_receivable_amount"
3233
],
3334
"fields": [
3435
{
@@ -176,12 +177,26 @@
176177
"in_list_view": 1,
177178
"label": "Total Receivable Amount",
178179
"read_only": 1
180+
},
181+
{
182+
"fieldname": "total_asset_recovery_cost",
183+
"fieldtype": "Currency",
184+
"label": "Total Asset Recovery Cost",
185+
"read_only": 1
179186
}
180187
],
181188
"index_web_pages_for_search": 1,
182189
"is_submittable": 1,
183-
"links": [],
184-
"modified": "2024-01-11 18:06:22.669089",
190+
"links": [
191+
{
192+
"is_child_table": 1,
193+
"link_doctype": "Journal Entry Account",
194+
"link_fieldname": "reference_name",
195+
"parent_doctype": "Journal Entry",
196+
"table_fieldname": "accounts"
197+
}
198+
],
199+
"modified": "2024-04-19 15:45:04.206575",
185200
"modified_by": "Administrator",
186201
"module": "HR",
187202
"name": "Full and Final Statement",
@@ -213,6 +228,7 @@
213228
"write": 1
214229
},
215230
{
231+
"cancel": 1,
216232
"create": 1,
217233
"delete": 1,
218234
"email": 1,

0 commit comments

Comments
 (0)