Changes to text css
This commit is contained in:
Binary file not shown.
36
rangeldigital/fixtures/customer_custom_fields.json
Normal file
36
rangeldigital/fixtures/customer_custom_fields.json
Normal file
@ -0,0 +1,36 @@
|
||||
[
|
||||
{
|
||||
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Customer",
|
||||
"fieldname": "sb_401",
|
||||
"fieldtype": "Section Break",
|
||||
"insert_after": "account_manager",
|
||||
"label": "Customer Assets",
|
||||
"name": "customer_sb_401",
|
||||
"collapsible": 1
|
||||
},
|
||||
{
|
||||
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Customer",
|
||||
"fieldname": "customer_assets",
|
||||
"fieldtype": "Table",
|
||||
"insert_after": "sb_401",
|
||||
"label": "Customer Assets",
|
||||
"name": "customer_customer_assets",
|
||||
"options": "Customer Asset"
|
||||
},
|
||||
{
|
||||
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Customer",
|
||||
"fieldname": "customer_generate_assets_csv",
|
||||
"fieldtype": "HTML",
|
||||
"insert_after": "customer_assets",
|
||||
"label": "Generate Assets CSV",
|
||||
"name": "customer_generate_customer_assets_csv",
|
||||
"options": "<button class=\"btn btn-primary\" data-generate-customer-assets-csv> Generate Assets CSV</button>"
|
||||
}
|
||||
|
||||
]
|
||||
@ -8,5 +8,16 @@
|
||||
"insert_after": "stock_uom",
|
||||
"label": "Manufacturer Item Code",
|
||||
"name": "item_manuf_item_code"
|
||||
},
|
||||
{
|
||||
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Item",
|
||||
"fieldname": "manuf_product_url",
|
||||
"fieldtype": "Data",
|
||||
"insert_after": "manuf_item_code",
|
||||
"label": "Manufacturer URL",
|
||||
"name": "item_manuf_url",
|
||||
"options": "URL"
|
||||
}
|
||||
]
|
||||
@ -185,7 +185,7 @@
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "auto_creation_of_contact",
|
||||
"insert_after": "__section_8",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Last Touch Date",
|
||||
|
||||
@ -15,7 +15,8 @@ override_doctype_class = {
|
||||
|
||||
# Lead: Add javascript to add "Add to Email Campaign to Action Dropdown"
|
||||
doctype_js = {
|
||||
"Lead": "public/js/lead.js"
|
||||
"Lead": "public/js/lead.js",
|
||||
"Customer": "public/js/customer.js"
|
||||
}
|
||||
# Add cron scheduler for email campaign sending
|
||||
# Send email at 08:15 AM every day
|
||||
|
||||
@ -42,6 +42,10 @@ input.form-control {
|
||||
border-radius:0;
|
||||
}
|
||||
|
||||
/* Text */
|
||||
a {color:white}
|
||||
.from-markdown b, .from-markdown strong {color:white}
|
||||
|
||||
/* ------- FRAPPE ELEMENTS ------- */
|
||||
/* Text */
|
||||
body .text-muted {color:#cccccc!important}
|
||||
|
||||
51
rangeldigital/public/js/customer.js
Normal file
51
rangeldigital/public/js/customer.js
Normal file
@ -0,0 +1,51 @@
|
||||
frappe.ui.form.on('Customer', {
|
||||
refresh: function(frm) {
|
||||
// Wait for the form and its custom HTML fields to render
|
||||
frappe.after_ajax(() => {
|
||||
// Look for a button with the data attribute
|
||||
const $btn = frm.$wrapper.find('[data-generate-customer-assets-csv]');
|
||||
|
||||
if ($btn.length) {
|
||||
// Prevent double-binding
|
||||
$btn.off('click').on('click', function () {
|
||||
const assets = frm.doc.customer_assets || [];
|
||||
|
||||
if (!assets.length) {
|
||||
frappe.msgprint('No customer assets found.');
|
||||
return;
|
||||
}
|
||||
|
||||
const excludedFields = [
|
||||
'owner', 'creation', 'modified', 'modified_by', 'docstatus', 'idx'
|
||||
];
|
||||
|
||||
const fields = Object.keys(assets[0]).filter(
|
||||
field => !excludedFields.includes(field)
|
||||
);
|
||||
|
||||
const csvRows = [];
|
||||
csvRows.push(fields.join(','));
|
||||
|
||||
assets.forEach(row => {
|
||||
const csvRow = fields.map(field => {
|
||||
let val = row[field] || '';
|
||||
return `"${String(val).replace(/"/g, '""')}"`;
|
||||
});
|
||||
csvRows.push(csvRow.join(','));
|
||||
});
|
||||
|
||||
const csvContent = csvRows.join('\n');
|
||||
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `CustomerAssets-${frm.doc.name}.csv`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
1
rangeldigital/rangel_digital/doctype/__init__.py
Normal file
1
rangeldigital/rangel_digital/doctype/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
__version__ = "0.0.1"
|
||||
Binary file not shown.
@ -0,0 +1 @@
|
||||
__version__ = "0.0.1"
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,103 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2013-02-22 01:27:51",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "item",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Item",
|
||||
"options": "Item"
|
||||
},
|
||||
{
|
||||
"fieldname": "item_brand",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 0,
|
||||
"read_only":1,
|
||||
"label": "Item Brand",
|
||||
"fetch_from": "item.brand"
|
||||
},
|
||||
{
|
||||
"fieldname": "brand",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Brand"
|
||||
},
|
||||
{
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"options": "\nIn Service\nStored\nReserved"
|
||||
},
|
||||
{
|
||||
"fieldname": "serial_no",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Serial Number"
|
||||
},
|
||||
{
|
||||
"fieldname": "location_address",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Location Address",
|
||||
"options": "Address"
|
||||
},
|
||||
{
|
||||
"fieldname": "acquired_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Acquired Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "eol_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 0,
|
||||
"label": "End Of Life Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "warranty_start_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 0,
|
||||
"label": "Warranty Start Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "warranty_end_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 0,
|
||||
"label": "Warranty End Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "ownership_type",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Ownership Type",
|
||||
"options": "Owned\nOperating Lease\nCapital Lease\nOther"
|
||||
},
|
||||
{
|
||||
"fieldname": "notes",
|
||||
"fieldtype": "Text",
|
||||
"in_list_view": 0,
|
||||
"label": "Notes"
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2023-11-14 18:35:30.887278",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Rangel Digital",
|
||||
"name": "Customer Asset",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class CustomerAsset(Document):
|
||||
pass
|
||||
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
{
|
||||
"creation": "2025-06-25 10:11:15.922486",
|
||||
"docstatus": 0,
|
||||
"doctype": "Number Card",
|
||||
"document_type": "Opportunity",
|
||||
"method": "rangeldigital.rangel_digital.number_card.my_open_tasks.my_open_tasks.get_number_card_data",
|
||||
"idx": 0,
|
||||
"is_public": 1,
|
||||
"is_standard": 1,
|
||||
"label": "My Open Tasks",
|
||||
"modified": "2025-06-25 12:19:53.088837",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "My Open Tasks",
|
||||
"owner": "Administrator",
|
||||
"show_percentage_stats": 0,
|
||||
"stats_time_interval": "",
|
||||
"type": "Custom"
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_number_card_data():
|
||||
current_user = frappe.session.user
|
||||
|
||||
count = frappe.db.count(
|
||||
"Task",
|
||||
filters={
|
||||
"status": ["not in", ["Template", "Completed", "Cancelled"]],
|
||||
"_assign": ["like", f"%{current_user}%"]
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
"value": count,
|
||||
"fieldtype": "Int",
|
||||
"label": _("My Open Tasks")
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
{
|
||||
"aggregate_function_based_on": "base_total",
|
||||
"creation": "2025-06-21 20:17:15.922486",
|
||||
"docstatus": 0,
|
||||
"doctype": "Number Card",
|
||||
"document_type": "Quotation",
|
||||
"dynamic_filters_json": "[[\"Opportunity\",\"company\",\"=\",\"frappe.defaults.get_user_default(\\\"Company\\\")\"]]",
|
||||
"filters_json": "[[\"Quotation\",\"status\",\"not in\",[\"Draft\",\"Lost\"],false]]",
|
||||
"function": "Sum",
|
||||
"idx": 0,
|
||||
"is_public": 1,
|
||||
"is_standard": 1,
|
||||
"label": "Pipeline Total",
|
||||
"modified": "2025-06-21 12:15:53.088837",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Quotation Total",
|
||||
"owner": "Administrator",
|
||||
"show_percentage_stats": 0,
|
||||
"stats_time_interval": "",
|
||||
"type": "Document Type"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user