2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 10:58:59 +00:00
Free desktop accounting software for small-businesses and freelancers.
Go to file
2018-01-01 15:15:01 +05:30
frappe first commit 2018-01-01 15:15:01 +05:30
.eslintrc first commit 2018-01-01 15:15:01 +05:30
.gitignore first commit 2018-01-01 15:15:01 +05:30
package-lock.json first commit 2018-01-01 15:15:01 +05:30
package.json first commit 2018-01-01 15:15:01 +05:30
README.md first commit 2018-01-01 15:15:01 +05:30

Frappe Core

Core libs for Frappe Framework JS

Examples

const frappe = require('frappe-core);

# init database
frappe.init();

# make a new todo
let todo = frappe.get_doc({doctype: 'ToDo', subject: 'something'})
todo.insert()

# get all todos
let total_open = 0;
for (let d of frappe.get_all('ToDo')) {
	todo = frappe.get_doc('ToDo', d.name);
	if (todo.status == 'Open') total_open += 1;
}