mirror of
https://github.com/frappe/books.git
synced 2024-11-12 16:36:27 +00:00
Add models
- Fulfillment - PurchaseOrder - PurchaseReceipt - SalesOrder
This commit is contained in:
parent
cfbaf157a0
commit
9fed2fbb19
@ -15,8 +15,12 @@ module.exports = {
|
||||
frappe.desk.menu.addItem('Items', '#list/Item');
|
||||
frappe.desk.menu.addItem('Customers', '#list/Customer');
|
||||
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('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('Address', "#list/Address");
|
||||
frappe.desk.menu.addItem('Contact', "#list/Contact");
|
||||
|
14
models/doctype/Fulfillment/Fulfillment.js
Normal file
14
models/doctype/Fulfillment/Fulfillment.js
Normal 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"
|
||||
}
|
||||
]
|
||||
});
|
6
models/doctype/FulfillmentItem/FulfillmentItem.js
Normal file
6
models/doctype/FulfillmentItem/FulfillmentItem.js
Normal file
@ -0,0 +1,6 @@
|
||||
const model = require('frappejs/model');
|
||||
const QuotationItem = require('../QuotationItem/QuotationItem');
|
||||
|
||||
module.exports = model.extend(QuotationItem, {
|
||||
name: "FulfillmentItem"
|
||||
});
|
13
models/doctype/FulfillmentSettings/FulfillmentSettings.js
Normal file
13
models/doctype/FulfillmentSettings/FulfillmentSettings.js
Normal 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"
|
||||
}
|
||||
]
|
||||
});
|
16
models/doctype/PurchaseOrder/PurchaseOrder.js
Normal file
16
models/doctype/PurchaseOrder/PurchaseOrder.js
Normal 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']
|
||||
});
|
6
models/doctype/PurchaseOrderItem/PurchaseOrderItem.js
Normal file
6
models/doctype/PurchaseOrderItem/PurchaseOrderItem.js
Normal file
@ -0,0 +1,6 @@
|
||||
const model = require('frappejs/model');
|
||||
const BillItem = require('../BillItem/BillItem');
|
||||
|
||||
module.exports = model.extend(BillItem, {
|
||||
name: "PurchaseOrderItem"
|
||||
});
|
@ -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"
|
||||
}
|
||||
]
|
||||
});
|
14
models/doctype/PurchaseReceipt/PurchaseReceipt.js
Normal file
14
models/doctype/PurchaseReceipt/PurchaseReceipt.js
Normal 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"
|
||||
}
|
||||
]
|
||||
});
|
16
models/doctype/PurchaseReceiptItem/PurchaseReceiptItem.js
Normal file
16
models/doctype/PurchaseReceiptItem/PurchaseReceiptItem.js
Normal 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']
|
||||
});
|
@ -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"
|
||||
}
|
||||
]
|
||||
});
|
14
models/doctype/SalesOrder/SalesOrder.js
Normal file
14
models/doctype/SalesOrder/SalesOrder.js
Normal 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"
|
||||
}
|
||||
]
|
||||
});
|
6
models/doctype/SalesOrderItem/SalesOrderItem.js
Normal file
6
models/doctype/SalesOrderItem/SalesOrderItem.js
Normal file
@ -0,0 +1,6 @@
|
||||
const model = require('frappejs/model');
|
||||
const QuotationItem = require('../QuotationItem/QuotationItem');
|
||||
|
||||
module.exports = model.extend(QuotationItem, {
|
||||
name: "SalesOrderItem"
|
||||
});
|
13
models/doctype/SalesOrderSettings/SalesOrderSettings.js
Normal file
13
models/doctype/SalesOrderSettings/SalesOrderSettings.js
Normal 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"
|
||||
}
|
||||
]
|
||||
});
|
@ -33,5 +33,21 @@ module.exports = {
|
||||
Quotation: require('./doctype/Quotation/Quotation.js'),
|
||||
QuotationItem: require('./doctype/QuotationItem/QuotationItem.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'),
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,10 @@ module.exports = {
|
||||
await naming.createNumberSeries('PAY-', 'PaymentSettings');
|
||||
await naming.createNumberSeries('JV-', 'JournalEntrySettings');
|
||||
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();
|
||||
}
|
||||
|
10
yarn.lock
10
yarn.lock
@ -2046,6 +2046,14 @@ frappe-datatable@../datatable:
|
||||
lodash "^4.17.5"
|
||||
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:
|
||||
version "0.0.5"
|
||||
dependencies:
|
||||
@ -2060,7 +2068,7 @@ frappejs@../frappejs:
|
||||
eslint "^4.19.1"
|
||||
express "^4.16.2"
|
||||
flatpickr "^4.3.2"
|
||||
frappe-datatable "../datatable"
|
||||
frappe-datatable frappe/datatable
|
||||
frappejs "../frappejs"
|
||||
jquery "^3.3.1"
|
||||
luxon "^1.0.0"
|
||||
|
Loading…
Reference in New Issue
Block a user