Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions rmax_custom/fixtures/custom_field.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,4 @@
[
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": "eval:doc.is_internal_customer && doc.represents_company",
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "Sales Invoice",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "custom_inter_company_branch",
"fieldtype": "Link",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "company_tax_id",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Inter Company Branch",
"length": 0,
"link_filters": null,
"mandatory_depends_on": null,
"modified": "2026-03-07 23:10:01.661809",
"module": null,
"name": "Sales Invoice-custom_inter_company_branch",
"no_copy": 0,
"non_negative": 0,
"options": "Inter Company Branch",
"permlevel": 0,
"placeholder": null,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
Expand Down
22 changes: 22 additions & 0 deletions rmax_custom/inter_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ def sales_invoice_on_submit(doc, method=None):
# Fetch Supplier Invoice No & Date from source Sales Invoice (built-in does not set these)
pi.bill_no = doc.name
pi.bill_date = doc.posting_date
if doc.is_return:
original_pi = frappe.db.get_value(
"Purchase Invoice",
{"inter_company_invoice_reference": doc.return_against},
"name"
)
if original_pi:
pi.is_return = 1
pi.return_against = original_pi
if not pi.items:
for si_item in doc.items:
pi.append("items", {
"item_code": si_item.item_code,
"item_name": si_item.item_name,
"description": si_item.description,
"qty": si_item.qty,
"rate": si_item.rate,
"amount": si_item.amount,
"uom": si_item.uom,
"stock_uom": si_item.stock_uom,
"conversion_factor": si_item.conversion_factor,
})
# Cost center & warehouse: from Inter Company Branch if selected, else company default
branch_data = _get_branch_data(doc, pi.company)
frappe.flags._inter_company_pi_branch_data = branch_data
Expand Down
16 changes: 8 additions & 8 deletions rmax_custom/public/js/create_customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
frappe.ui.form.on("Sales Invoice", {
refresh: function (frm) {
add_create_customer_button(frm);

console.log("Sales Invoice Custom Script Loaded");
}
});

Expand Down Expand Up @@ -76,13 +76,13 @@ function open_create_customer_dialog(frm) {
label: "Address Type",
options: "Billing\nShipping",
default: "Billing",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},
{
fieldname: "address_line1",
fieldtype: "Data",
label: "Address Line 1",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},
{
fieldname: "address_line2",
Expand All @@ -93,33 +93,33 @@ function open_create_customer_dialog(frm) {
fieldname: "custom_building_number",
fieldtype: "Data",
label: "Building Number",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},
{
fieldname: "custom_area",
fieldtype: "Data",
label: "Area/District",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number ",
},
{
fieldname: "city",
fieldtype: "Data",
label: "City/Town",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},
{
fieldname: "country",
fieldtype: "Link",
options: "Country",
label: "Country",
default: country,
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},
{
fieldname: "pincode",
fieldtype: "Data",
label: "Postal Code",
reqd: 1
mandatory_depends_on: "eval:doc.custom_vat_registration_number",
},

],
Expand Down
16 changes: 8 additions & 8 deletions rmax_custom/rmax_custom/custom/sales_invoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"creation": "2026-03-07 23:10:01.661809",
"creation": "2026-03-11 10:10:28.430666",
"default": null,
"depends_on": "eval:doc.is_internal_customer && doc.represents_company",
"depends_on": "eval: doc.is_internal_customer && doc.represents_company",
"description": null,
"docstatus": 0,
"dt": "Sales Invoice",
Expand All @@ -38,8 +38,8 @@
"label": "Inter Company Branch",
"length": 0,
"link_filters": null,
"mandatory_depends_on": null,
"modified": "2026-03-07 23:10:01.661809",
"mandatory_depends_on": "eval: doc.is_internal_customer && doc.represents_company",
"modified": "2026-03-11 10:10:28.430666",
"modified_by": "Administrator",
"module": null,
"name": "Sales Invoice-custom_inter_company_branch",
Expand All @@ -56,7 +56,7 @@
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
Expand All @@ -75,7 +75,7 @@
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"creation": "2026-03-07 16:50:18.832354",
"creation": "2026-03-10 23:18:11.539766",
"default": null,
"depends_on": null,
"description": null,
Expand Down Expand Up @@ -320,15 +320,15 @@
"_comments": null,
"_liked_by": null,
"_user_tags": null,
"creation": "2026-03-07 23:10:01.561453",
"creation": "2026-03-11 10:10:28.326730",
"default_value": null,
"doc_type": "Sales Invoice",
"docstatus": 0,
"doctype_or_field": "DocType",
"field_name": null,
"idx": 0,
"is_system_generated": 0,
"modified": "2026-03-07 23:10:01.561453",
"modified": "2026-03-11 10:10:28.326730",
"modified_by": "Administrator",
"module": null,
"name": "Sales Invoice-main-field_order",
Expand Down
3 changes: 0 additions & 3 deletions rmax_custom/rmax_custom/custom_scripts/quotation/quotation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
frappe.ui.form.on('Quotation', {
refresh(frm) {
setTimeout(() => {
frm.remove_custom_button(__('Sales Order'), __('Create'));
}, 10);
if (frm.doc.docstatus === 1) {
frm.add_custom_button('Sales Invoice', () => {
frappe.model.open_mapped_doc({
Expand Down
Loading
Loading