2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00

Add models

- Fulfillment
- PurchaseOrder
- PurchaseReceipt
- SalesOrder
This commit is contained in:
Faris Ansari 2018-04-28 19:56:26 +05:30
parent cfbaf157a0
commit 9fed2fbb19
16 changed files with 177 additions and 1 deletions

View File

@ -15,8 +15,12 @@ module.exports = {
frappe.desk.menu.addItem('Items', '#list/Item'); frappe.desk.menu.addItem('Items', '#list/Item');
frappe.desk.menu.addItem('Customers', '#list/Customer'); frappe.desk.menu.addItem('Customers', '#list/Customer');
frappe.desk.menu.addItem('Quotation', '#list/Quotation'); frappe.desk.menu.addItem('Quotation', '#list/Quotation');
frappe.desk.menu.addItem('Sales Order', '#list/SalesOrder');
frappe.desk.menu.addItem('Fulfillment', '#list/Fulfillment');
frappe.desk.menu.addItem('Invoice', '#list/Invoice'); frappe.desk.menu.addItem('Invoice', '#list/Invoice');
frappe.desk.menu.addItem('Bill', '#list/Bill'); frappe.desk.menu.addItem('Bill', '#list/Bill');
frappe.desk.menu.addItem('Purchase Order', '#list/PurchaseOrder');
frappe.desk.menu.addItem('Purchase Receipt', '#list/PurchaseReceipt');
frappe.desk.menu.addItem('Journal Entry', '#list/JournalEntry'); frappe.desk.menu.addItem('Journal Entry', '#list/JournalEntry');
frappe.desk.menu.addItem('Address', "#list/Address"); frappe.desk.menu.addItem('Address', "#list/Address");
frappe.desk.menu.addItem('Contact', "#list/Contact"); frappe.desk.menu.addItem('Contact', "#list/Contact");

View File

@ -0,0 +1,14 @@
const model = require('frappejs/model');
const Quotation = require('../Quotation/Quotation');
module.exports = model.extend(Quotation, {
name: "Fulfillment",
label: "Fulfillment",
settings: "FulfillmentSettings",
fields: [
{
"fieldname": "items",
"childtype": "FulfillmentItem"
}
]
});

View File

@ -0,0 +1,6 @@
const model = require('frappejs/model');
const QuotationItem = require('../QuotationItem/QuotationItem');
module.exports = model.extend(QuotationItem, {
name: "FulfillmentItem"
});

View File

@ -0,0 +1,13 @@
const model = require('frappejs/model');
const QuotationSettings = require('../QuotationSettings/QuotationSettings');
module.exports = model.extend(QuotationSettings, {
"name": "FulfillmentSettings",
"label": "Fulfillment Settings",
"fields": [
{
"fieldname": "numberSeries",
"default": "OF"
}
]
});

View File

@ -0,0 +1,16 @@
const model = require('frappejs/model');
const Bill = require('../Bill/Bill');
module.exports = model.extend(Bill, {
name: "PurchaseOrder",
label: "Purchase Order",
settings: "PurchaseOrderSettings",
fields: [
{
"fieldname": "items",
"childtype": "PurchaseOrderItem"
}
]
}, {
skipFields: ['account']
});

View File

@ -0,0 +1,6 @@
const model = require('frappejs/model');
const BillItem = require('../BillItem/BillItem');
module.exports = model.extend(BillItem, {
name: "PurchaseOrderItem"
});

View File

@ -0,0 +1,13 @@
const model = require('frappejs/model');
const BillSettings = require('../BillSettings/BillSettings');
module.exports = model.extend(BillSettings, {
"name": "PurchaseOrderSettings",
"label": "Purchase Order Settings",
"fields": [
{
"fieldname": "numberSeries",
"default": "PO"
}
]
});

View File

@ -0,0 +1,14 @@
const model = require('frappejs/model');
const PurchaseOrder = require('../PurchaseOrder/PurchaseOrder');
module.exports = model.extend(PurchaseOrder, {
name: "PurchaseReceipt",
label: "Purchase Receipt",
settings: "PurchaseReceiptSettings",
fields: [
{
"fieldname": "items",
"childtype": "PurchaseReceiptItem"
}
]
});

View File

@ -0,0 +1,16 @@
const model = require('frappejs/model');
const PurchaseOrderItem = require('../PurchaseOrderItem/PurchaseOrderItem');
module.exports = model.extend(PurchaseOrderItem, {
name: "PurchaseReceiptItem",
fields: [
{
"fieldname": "acceptedQuantity",
"label": "Accepted Quantity",
"fieldtype": "Float",
"required": 1
}
]
}, {
skipFields: ['expenseAccount']
});

View File

@ -0,0 +1,13 @@
const model = require('frappejs/model');
const PurchaseOrderSettings = require('../PurchaseOrderSettings/PurchaseOrderSettings');
module.exports = model.extend(PurchaseOrderSettings, {
"name": "PurchaseReceiptSettings",
"label": "Purchase Receipt Settings",
"fields": [
{
"fieldname": "numberSeries",
"default": "PREC"
}
]
});

View File

@ -0,0 +1,14 @@
const model = require('frappejs/model');
const Quotation = require('../Quotation/Quotation');
module.exports = model.extend(Quotation, {
name: "SalesOrder",
label: "Sales Order",
settings: "SalesOrderSettings",
fields: [
{
"fieldname": "items",
"childtype": "SalesOrderItem"
}
]
});

View File

@ -0,0 +1,6 @@
const model = require('frappejs/model');
const QuotationItem = require('../QuotationItem/QuotationItem');
module.exports = model.extend(QuotationItem, {
name: "SalesOrderItem"
});

View File

@ -0,0 +1,13 @@
const model = require('frappejs/model');
const QuotationSettings = require('../QuotationSettings/QuotationSettings');
module.exports = model.extend(QuotationSettings, {
"name": "SalesOrderSettings",
"label": "Sales Order Settings",
"fields": [
{
"fieldname": "numberSeries",
"default": "SO"
}
]
});

View File

@ -33,5 +33,21 @@ module.exports = {
Quotation: require('./doctype/Quotation/Quotation.js'), Quotation: require('./doctype/Quotation/Quotation.js'),
QuotationItem: require('./doctype/QuotationItem/QuotationItem.js'), QuotationItem: require('./doctype/QuotationItem/QuotationItem.js'),
QuotationSettings: require('./doctype/QuotationSettings/QuotationSettings.js'), QuotationSettings: require('./doctype/QuotationSettings/QuotationSettings.js'),
SalesOrder: require('./doctype/SalesOrder/SalesOrder.js'),
SalesOrderItem: require('./doctype/SalesOrderItem/SalesOrderItem.js'),
SalesOrderSettings: require('./doctype/SalesOrderSettings/SalesOrderSettings.js'),
Fulfillment: require('./doctype/Fulfillment/Fulfillment.js'),
FulfillmentItem: require('./doctype/FulfillmentItem/FulfillmentItem.js'),
FulfillmentSettings: require('./doctype/FulfillmentSettings/FulfillmentSettings.js'),
PurchaseOrder: require('./doctype/PurchaseOrder/PurchaseOrder.js'),
PurchaseOrderItem: require('./doctype/PurchaseOrderItem/PurchaseOrderItem.js'),
PurchaseOrderSettings: require('./doctype/PurchaseOrderSettings/PurchaseOrderSettings.js'),
PurchaseReceipt: require('./doctype/PurchaseReceipt/PurchaseReceipt.js'),
PurchaseReceiptItem: require('./doctype/PurchaseReceiptItem/PurchaseReceiptItem.js'),
PurchaseReceiptSettings: require('./doctype/PurchaseReceiptSettings/PurchaseReceiptSettings.js'),
} }
} }

View File

@ -36,6 +36,10 @@ module.exports = {
await naming.createNumberSeries('PAY-', 'PaymentSettings'); await naming.createNumberSeries('PAY-', 'PaymentSettings');
await naming.createNumberSeries('JV-', 'JournalEntrySettings'); await naming.createNumberSeries('JV-', 'JournalEntrySettings');
await naming.createNumberSeries('QTN-', 'QuotationSettings'); await naming.createNumberSeries('QTN-', 'QuotationSettings');
await naming.createNumberSeries('SO-', 'SalesOrderSettings');
await naming.createNumberSeries('OF-', 'FulfillmentSettings');
await naming.createNumberSeries('PO-', 'PurchaseOrderSettings');
await naming.createNumberSeries('PREC-', 'PurchaseReceiptSettings');
registerReportMethods(); registerReportMethods();
} }

View File

@ -2046,6 +2046,14 @@ frappe-datatable@../datatable:
lodash "^4.17.5" lodash "^4.17.5"
sortablejs "^1.7.0" sortablejs "^1.7.0"
frappe-datatable@frappe/datatable:
version "0.0.5"
resolved "https://codeload.github.com/frappe/datatable/tar.gz/9151fe2886ebab148d7fbc3340e292bcbba1dce7"
dependencies:
clusterize.js "^0.18.0"
lodash "^4.17.5"
sortablejs "^1.7.0"
frappejs@../frappejs: frappejs@../frappejs:
version "0.0.5" version "0.0.5"
dependencies: dependencies:
@ -2060,7 +2068,7 @@ frappejs@../frappejs:
eslint "^4.19.1" eslint "^4.19.1"
express "^4.16.2" express "^4.16.2"
flatpickr "^4.3.2" flatpickr "^4.3.2"
frappe-datatable "../datatable" frappe-datatable frappe/datatable
frappejs "../frappejs" frappejs "../frappejs"
jquery "^3.3.1" jquery "^3.3.1"
luxon "^1.0.0" luxon "^1.0.0"