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
frappe.ui.keys.add_shortcut({ | |
shortcut: 'alt+p', | |
action: (e) => { | |
this.$item.find('.print-btn').trigger('click'); | |
e.preventDefault(); | |
return false; | |
}, | |
condition: () => this.$component.is(':visible') && this.$summary_container.find('.print-btn').is(":visible"), //optional | |
description: __("Print Receipt"), | |
page: cur_page.page.page //optional |
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
//Para sumar un rango dinamicamente tomando en cuenta la fecha de analisis con encabezados de fecha | |
=SUMA(INDIRECTO("F"&FILA()&"C2:F"&FILA()&"C"&COINCIDIR(BUSCARH($L$2,$4:$4,1,1),$4:$4,0),FALSO)) | |
//Validar letra de cédula Nicaragüense | |
= SI(B2<>"", | |
SI(LARGO(B2)=14, | |
SI( IGUAL( |
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
* Calcular la letra al final de la cédula nicaragüense. | |
* La letra se calcula con el siguiente algoritmo (SQL). | |
* | |
* declare @cedula varchar(20), | |
* @val numeric(13, 0), | |
* @letra char(1), | |
* @Letras varchar(20) | |
* | |
* select @Letras = 'ABCDEFGHJKLMNPQRSTUVWXY' | |
* select @cedula = '0012510750012' --PARTE NUMERICA DE LA CEDULA SIN GUIONES |
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
function dialog_promise (title, fields, primary_action_label) { | |
// Return a function that returns a promise | |
// The promise resolves when the dialog is submitted and rejects when the dialog is closed | |
// On resolve, the promise returns the values from the dialog. | |
return () => new Promise((resolve, reject) => { | |
const dialog = new frappe.ui.Dialog({ | |
title: title, | |
fields: fields, | |
onhide: () => reject(), | |
primary_action_label: primary_action_label, |
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
frappe.ui.form.on('Issue', { | |
refresh: function(frm) { | |
frm.fields_dict['sb_details'].wrapper.css('background-color', 'lightblue'); | |
frm.fields_dict['section_break_19'].wrapper.css('background-color', 'gold'); | |
} |
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
frappe.ui.keys.add_shortcut({ | |
shortcut: "shift+ctrl+d", | |
action: function () { | |
// navigate to ask doppio bot page | |
frappe.set_route("doppio-bot"); | |
}, | |
description: __("Ask DoppioBot"), | |
}); |
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
@frappe.whitelist() | |
def import_coa_job(file_name, company): | |
# delete existing data for accounts | |
unset_existing_data(company) | |
# create accounts | |
file_doc, extension = get_file(file_name) | |
if extension == "csv": | |
data = generate_data_from_csv(file_doc) |
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
SELECT | |
a.asset_category AS "Category:Data", | |
a.asset_name AS "Asset Name:Data", | |
a.name AS "Asset No.:Link/Asset", | |
a.purchase_date AS "Purchase Date:Date", | |
ROUND(a.gross_purchase_amount + IFNULL(ava.total_difference, 0), 2) AS "Gross Asset Amount:Float", | |
SUM(CASE WHEN MONTH(ds.schedule_date) = 1 AND YEAR(ds.schedule_date) = YEAR(%(cutoff_date)s) THEN ds.depreciation_amount ELSE 0 END) AS "January:Float", | |
SUM(CASE WHEN MONTH(ds.schedule_date) = 2 AND YEAR(ds.schedule_date) = YEAR(%(cutoff_date)s) THEN ds.depreciation_amount ELSE 0 END) AS "February:Float", |
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
SELECT | |
'Income' AS `Type`, | |
gl.voucher_type AS `Document Type`, | |
gl.voucher_no AS `Document Number`, | |
gl.account AS `Account`, | |
SUM(gl.credit - gl.debit) AS `Amount`, -- Adjusted to show credit as positive | |
gl.remarks AS `Remarks`, | |
1 AS `Order` | |
FROM | |
`tabGL Entry` AS gl |
OlderNewer