-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored settings doctype as well as relevant utility function to r…
…eflect new requirements in settings management. Exported fixtures with updated field definitions. Added implementation for pos invoice overrides for server and client.
- Loading branch information
1 parent
54d69ca
commit f101e3b
Showing
15 changed files
with
2,932 additions
and
540 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1,248 changes: 1,144 additions & 104 deletions
1,248
kenya_compliance/fixtures/navari_etims_packaging_unit.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
kenya_compliance/kenya_compliance/overrides/client/pos_invoice.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const doctypeName = "POS Invoice"; | ||
const childDoctypeName = `${doctypeName} Item`; | ||
|
||
frappe.ui.form.on(childDoctype, { | ||
custom_item_classification: async function (frm, cdt, cdn) { | ||
const itemClassificationCode = locals[cdt][cdn].custom_item_classification; | ||
}, | ||
custom_packaging_unit: async function (frm, cdt, cdn) { | ||
const packagingUnit = locals[cdt][cdn].custom_packaging_unit; | ||
|
||
if (packagingUnit) { | ||
const response = await frappe.db.get_value( | ||
packagingUnitDoctypeName, | ||
{ | ||
name: packagingUnit, | ||
}, | ||
["code"] | ||
); | ||
|
||
const code = response.message?.code; | ||
locals[cdt][cdn].custom_packaging_unit_code = code; | ||
frm.refresh_field("custom_packaging_unit_code"); | ||
} | ||
}, | ||
custom_unit_of_quantity: async function (frm, cdt, cdn) { | ||
const unitOfQuantity = locals[cdt][cdn].custom_unit_of_quantity; | ||
|
||
if (unitOfQuantity) { | ||
const response = await frappe.db.get_value( | ||
unitOfQuantityDoctypeName, | ||
{ | ||
name: unitOfQuantity, | ||
}, | ||
["code"] | ||
); | ||
|
||
const code = response.message?.code; | ||
locals[cdt][cdn].custom_unit_of_quantity_code = code; | ||
frm.refresh_field("custom_unit_of_quantity_code"); | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
kenya_compliance/kenya_compliance/overrides/server/pos_invoice.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from frappe.model.document import Document | ||
|
||
from .shared_overrides import generic_invoices_on_submit_override | ||
|
||
|
||
def on_submit(doc: Document, method: str) -> None: | ||
"""Intercepts POS invoice on submit event""" | ||
|
||
generic_invoices_on_submit_override(doc, "POS Invoice") |
Oops, something went wrong.