added missing fields
This commit is contained in:
87
extensions/invoices/dist/invoices.js
vendored
87
extensions/invoices/dist/invoices.js
vendored
@@ -1,7 +1,7 @@
|
|||||||
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var _lib = _interopRequireDefault(require("./lib"));
|
var _lib = require("./lib");
|
||||||
|
|
||||||
var _IceDataPipe = _interopRequireDefault(require("../../../../web/api/IceDataPipe"));
|
var _IceDataPipe = _interopRequireDefault(require("../../../../web/api/IceDataPipe"));
|
||||||
|
|
||||||
@@ -9,10 +9,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|||||||
|
|
||||||
function init(data) {
|
function init(data) {
|
||||||
var modJsList = [];
|
var modJsList = [];
|
||||||
modJsList.tabInvoices = new _lib["default"]('Invoices', 'Invoices', '', '');
|
modJsList.tabInvoices = new _lib.InvoiceAdapter('Invoice', 'Invoices', '', '');
|
||||||
modJsList.tabInvoices.setObjectTypeName('Invoices');
|
modJsList.tabInvoices.setObjectTypeName('Invoice');
|
||||||
modJsList.tabInvoices.setDataPipe(new _IceDataPipe["default"](modJsList.tabVInvoices));
|
modJsList.tabInvoices.setDataPipe(new _IceDataPipe["default"](modJsList.tabInvoices));
|
||||||
modJsList.tabInvoices.setAccess(data.permissions.Invoices);
|
modJsList.tabInvoices.setAccess(data.permissions.Invoice);
|
||||||
window.modJs = modJsList.tabInvoices;
|
window.modJs = modJsList.tabInvoices;
|
||||||
window.modJsList = modJsList;
|
window.modJsList = modJsList;
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
this.formOnlyFields = {};
|
this.formOnlyFields = {};
|
||||||
}*/
|
}*/
|
||||||
value: function getDataMapping() {
|
value: function getDataMapping() {
|
||||||
return ['id', 'paymentId', 'invoiceId', 'description', 'buyerName', 'buyerAddress', 'buyerPostalAddress', 'buyerVatId', 'buyerEmail', 'sellerName', 'sellerAddress', 'sellerVatId', 'amount', 'vat', 'vatRate', 'issuedDate', 'paidDate', 'status', 'acceptPayments', 'created', 'updated', 'link', 'paymentLink'];
|
return ['id', 'paymentId', 'invoiceId', 'description', 'buyerName', 'buyerAddress', 'buyerPostalAddress', 'buyerVatId', 'buyerEmail', 'sellerName', 'sellerAddress', 'sellerVatId', 'amount', 'vat', 'vatRate', 'issuedDate', 'dueDate', 'paidDate', 'status', 'acceptPayments', 'created', 'updated', 'link', 'paymentLink'];
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getHeaders",
|
key: "getHeaders",
|
||||||
@@ -129,6 +129,11 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
sTitle: 'Payment Link'
|
sTitle: 'Payment Link'
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: "getCountryList",
|
||||||
|
value: function getCountryList() {
|
||||||
|
return [['DE', 'Germany'], ['LK', 'Sri Lanka']];
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getFormFields",
|
key: "getFormFields",
|
||||||
value: function getFormFields() {
|
value: function getFormFields() {
|
||||||
@@ -159,14 +164,15 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
}], ['buyerCountry', {
|
}], ['buyerCountry', {
|
||||||
"label": "Buyer Country",
|
"label": "Buyer Country",
|
||||||
"type": "select2",
|
"type": "select2",
|
||||||
"source": this.getCountryList()
|
"remote-source": ["Country", "code", "name"]
|
||||||
}], ['buyerVatId', {
|
}], ['buyerVatId', {
|
||||||
"label": "Buyer Vat Id",
|
"label": "Buyer Vat Id",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"validation": "none"
|
"validation": "none"
|
||||||
}], ['buyerEmail', {
|
}], ['buyerEmail', {
|
||||||
"label": "Buyer Email",
|
"label": "Buyer Email",
|
||||||
"type": "text"
|
"type": "text",
|
||||||
|
"validation": "email"
|
||||||
}], ['sellerName', {
|
}], ['sellerName', {
|
||||||
"label": "Seller Name",
|
"label": "Seller Name",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -176,7 +182,7 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
}], ['sellerCountry', {
|
}], ['sellerCountry', {
|
||||||
"label": "Seller Country",
|
"label": "Seller Country",
|
||||||
"type": "select2",
|
"type": "select2",
|
||||||
"source": this.getCountryList()
|
"remote-source": ["Country", "code", "name"]
|
||||||
}], ['sellerVatId', {
|
}], ['sellerVatId', {
|
||||||
"label": "Seller Vat Id",
|
"label": "Seller Vat Id",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
@@ -196,6 +202,10 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
"label": "Issued Date",
|
"label": "Issued Date",
|
||||||
"type": "datetime",
|
"type": "datetime",
|
||||||
"validation": ""
|
"validation": ""
|
||||||
|
}], ['dueDate', {
|
||||||
|
"label": "Due Date",
|
||||||
|
"type": "datetime",
|
||||||
|
"validation": ""
|
||||||
}], ['paidDate', {
|
}], ['paidDate', {
|
||||||
"label": "Paid Date",
|
"label": "Paid Date",
|
||||||
"type": "datetime",
|
"type": "datetime",
|
||||||
@@ -222,19 +232,70 @@ var InvoiceAdapter = /*#__PURE__*/function (_ReactModalAdapterBas) {
|
|||||||
}], ['paymentLink', {
|
}], ['paymentLink', {
|
||||||
"label": "Payment Link",
|
"label": "Payment Link",
|
||||||
"type": "placeholder"
|
"type": "placeholder"
|
||||||
|
}], ['items', {
|
||||||
|
label: 'Items',
|
||||||
|
type: 'datagroup',
|
||||||
|
form: [['description', {
|
||||||
|
label: 'Description',
|
||||||
|
type: 'textarea',
|
||||||
|
validation: ''
|
||||||
|
}], ['rate', {
|
||||||
|
label: 'Rate',
|
||||||
|
type: 'text',
|
||||||
|
validation: ''
|
||||||
|
}], ['qty', {
|
||||||
|
label: 'Quantity',
|
||||||
|
type: 'text',
|
||||||
|
validation: ''
|
||||||
|
}], ['lineTotal', {
|
||||||
|
label: 'Line Total',
|
||||||
|
type: 'text',
|
||||||
|
validation: ''
|
||||||
|
}]],
|
||||||
|
html: '<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">Date: #_date_#</span><hr/>#_note_#</div></div>',
|
||||||
|
validation: 'none',
|
||||||
|
columns: [{
|
||||||
|
title: 'Description',
|
||||||
|
dataIndex: 'description',
|
||||||
|
key: 'description'
|
||||||
|
}, {
|
||||||
|
title: 'Rate',
|
||||||
|
dataIndex: 'rate',
|
||||||
|
key: 'rate'
|
||||||
|
}, {
|
||||||
|
title: 'Quantity',
|
||||||
|
dataIndex: 'qty',
|
||||||
|
key: 'qty'
|
||||||
|
}, {
|
||||||
|
title: 'Line Total',
|
||||||
|
dataIndex: 'lineTotal',
|
||||||
|
key: 'lineTotal'
|
||||||
|
}],
|
||||||
|
'sort-function': function sortFunction(a, b) {
|
||||||
|
var t1 = Date.parse(a.date).getTime();
|
||||||
|
var t2 = Date.parse(b.date).getTime();
|
||||||
|
return t1 < t2;
|
||||||
|
},
|
||||||
|
'custom-validate-function': function customValidateFunction(data) {
|
||||||
|
var res = {};
|
||||||
|
res.valid = true;
|
||||||
|
data.date = new Date().toString('d-MMM-yyyy hh:mm tt');
|
||||||
|
res.params = data;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}]];
|
}]];
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getTableColumns",
|
key: "getTableColumns",
|
||||||
value: function getTableColumns() {
|
value: function getTableColumns() {
|
||||||
return [{
|
return [{
|
||||||
title: 'Payment Id',
|
|
||||||
dataIndex: 'paymentId',
|
|
||||||
sorter: true
|
|
||||||
}, {
|
|
||||||
title: 'Invoice Id',
|
title: 'Invoice Id',
|
||||||
dataIndex: 'invoiceId',
|
dataIndex: 'invoiceId',
|
||||||
sorter: true
|
sorter: true
|
||||||
|
}, {
|
||||||
|
title: 'Description',
|
||||||
|
dataIndex: 'description',
|
||||||
|
sorter: true
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
2
extensions/invoices/dist/invoices.js.map
vendored
2
extensions/invoices/dist/invoices.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Invoices",
|
"label": "Invoices",
|
||||||
"menu": ["Invoices", "fa-file"],
|
"menu": ["Invoices", "fa-file"],
|
||||||
"icon": "fa-files",
|
"icon": "fa-file",
|
||||||
"user_levels": [
|
"user_levels": [
|
||||||
"Admin",
|
"Admin",
|
||||||
"Manager",
|
"Manager",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Extension extends IceExtension
|
|||||||
|
|
||||||
public function setupModuleClassDefinitions()
|
public function setupModuleClassDefinitions()
|
||||||
{
|
{
|
||||||
|
$this->addModelClass('Invoice');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setupRestEndPoints()
|
public function setupRestEndPoints()
|
||||||
|
|||||||
@@ -27,12 +27,14 @@ create table Invoices
|
|||||||
vat decimal(10,2) default 0.00 null,
|
vat decimal(10,2) default 0.00 null,
|
||||||
vatRate decimal(10,2) default 0.00 null,
|
vatRate decimal(10,2) default 0.00 null,
|
||||||
issuedDate datetime null,
|
issuedDate datetime null,
|
||||||
|
dueDate datetime null,
|
||||||
paidDate datetime null,
|
paidDate datetime null,
|
||||||
created datetime null,
|
created datetime null,
|
||||||
updated datetime null,
|
updated datetime null,
|
||||||
status enum('Pending', 'Paid', 'Processing', 'Draft', 'Sent', 'Canceled') collate utf8_unicode_ci default 'Pending' null,
|
status enum('Pending', 'Paid', 'Processing', 'Draft', 'Sent', 'Canceled') collate utf8_unicode_ci default 'Pending' null,
|
||||||
acceptPayments tinyint default 0 null,
|
acceptPayments tinyint default 0 null,
|
||||||
buyerEmail varchar(125) charset utf8 null,
|
buyerEmail varchar(125) charset utf8 null,
|
||||||
|
items text charset utf8 null,
|
||||||
constraint invoiceId
|
constraint invoiceId
|
||||||
unique (invoiceId)
|
unique (invoiceId)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import InvoiceAdapter from './lib';
|
import {InvoiceAdapter} from './lib';
|
||||||
import IceDataPipe from '../../../../web/api/IceDataPipe';
|
import IceDataPipe from '../../../../web/api/IceDataPipe';
|
||||||
|
|
||||||
function init(data) {
|
function init(data) {
|
||||||
const modJsList = [];
|
const modJsList = [];
|
||||||
|
|
||||||
modJsList.tabInvoices =new InvoiceAdapter('Invoices', 'Invoices','','');
|
modJsList.tabInvoices =new InvoiceAdapter('Invoice', 'Invoices','','');
|
||||||
modJsList.tabInvoices.setObjectTypeName('Invoices');
|
modJsList.tabInvoices.setObjectTypeName('Invoice');
|
||||||
modJsList.tabInvoices.setDataPipe(new IceDataPipe(modJsList.tabVInvoices));
|
modJsList.tabInvoices.setDataPipe(new IceDataPipe(modJsList.tabInvoices));
|
||||||
modJsList.tabInvoices.setAccess(data.permissions.Invoices);
|
modJsList.tabInvoices.setAccess(data.permissions.Invoice);
|
||||||
|
|
||||||
window.modJs = modJsList.tabInvoices;
|
window.modJs = modJsList.tabInvoices;
|
||||||
window.modJsList = modJsList;
|
window.modJsList = modJsList;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class InvoiceAdapter extends ReactModalAdapterBase {
|
|||||||
'vat',
|
'vat',
|
||||||
'vatRate',
|
'vatRate',
|
||||||
'issuedDate',
|
'issuedDate',
|
||||||
|
'dueDate',
|
||||||
'paidDate',
|
'paidDate',
|
||||||
'status',
|
'status',
|
||||||
'acceptPayments',
|
'acceptPayments',
|
||||||
@@ -70,6 +71,13 @@ class InvoiceAdapter extends ReactModalAdapterBase {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCountryList() {
|
||||||
|
return [
|
||||||
|
['DE', 'Germany'],
|
||||||
|
['LK', 'Sri Lanka'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
getFormFields() {
|
getFormFields() {
|
||||||
return [
|
return [
|
||||||
[ 'id', {"label":"ID","type":"hidden"}],
|
[ 'id', {"label":"ID","type":"hidden"}],
|
||||||
@@ -79,17 +87,18 @@ class InvoiceAdapter extends ReactModalAdapterBase {
|
|||||||
[ 'buyerName', {"label":"Buyer Name","type":"text"}],
|
[ 'buyerName', {"label":"Buyer Name","type":"text"}],
|
||||||
[ 'buyerAddress', {"label":"Buyer Address","type":"textarea"}],
|
[ 'buyerAddress', {"label":"Buyer Address","type":"textarea"}],
|
||||||
[ 'buyerPostalCode', {"label":"Buyer Postal Code","type":"text"}],
|
[ 'buyerPostalCode', {"label":"Buyer Postal Code","type":"text"}],
|
||||||
[ 'buyerCountry', {"label":"Buyer Country","type":"select2", "source": this.getCountryList()}],
|
[ 'buyerCountry', {"label":"Buyer Country","type":"select2", "remote-source": ["Country", "code", "name"]}],
|
||||||
[ 'buyerVatId', {"label":"Buyer Vat Id","type":"text","validation":"none"}],
|
[ 'buyerVatId', {"label":"Buyer Vat Id","type":"text","validation":"none"}],
|
||||||
[ 'buyerEmail', {"label":"Buyer Email","type":"text"}],
|
[ 'buyerEmail', {"label":"Buyer Email","type":"text","validation":"email"}],
|
||||||
[ 'sellerName', {"label":"Seller Name","type":"text"}],
|
[ 'sellerName', {"label":"Seller Name","type":"text"}],
|
||||||
[ 'sellerAddress', {"label":"Seller Address","type":"text"}],
|
[ 'sellerAddress', {"label":"Seller Address","type":"text"}],
|
||||||
[ 'sellerCountry', {"label":"Seller Country","type":"select2", "source": this.getCountryList()}],
|
[ 'sellerCountry', {"label":"Seller Country","type":"select2", "remote-source": ["Country", "code", "name"]}],
|
||||||
[ 'sellerVatId', {"label":"Seller Vat Id","type":"text"}],
|
[ 'sellerVatId', {"label":"Seller Vat Id","type":"text"}],
|
||||||
[ 'amount', {"label":"Amount with VAT","type":"text", "validation":"float"}],
|
[ 'amount', {"label":"Amount with VAT","type":"text", "validation":"float"}],
|
||||||
[ 'vat', {"label":"Vat","type":"text", "validation":"float"}],
|
[ 'vat', {"label":"Vat","type":"text", "validation":"float"}],
|
||||||
[ 'vatRate', {"label":"Vat Rate","type":"text", "validation":"float"}],
|
[ 'vatRate', {"label":"Vat Rate","type":"text", "validation":"float"}],
|
||||||
[ 'issuedDate', {"label":"Issued Date","type":"datetime", "validation":""}],
|
[ 'issuedDate', {"label":"Issued Date","type":"datetime", "validation":""}],
|
||||||
|
[ 'dueDate', {"label":"Due Date","type":"datetime", "validation":""}],
|
||||||
[ 'paidDate', {"label":"Paid Date","type":"datetime", "validation":""}],
|
[ 'paidDate', {"label":"Paid Date","type":"datetime", "validation":""}],
|
||||||
[ 'status', {"label":"Status","type":"select","source":[["Pending","Pending"],["Paid","Paid"],["Processing","Processing"],["Draft","Draft"],["Sent","Sent"],["Canceled","Canceled"]]}],
|
[ 'status', {"label":"Status","type":"select","source":[["Pending","Pending"],["Paid","Paid"],["Processing","Processing"],["Draft","Draft"],["Sent","Sent"],["Canceled","Canceled"]]}],
|
||||||
[ 'acceptPayments', {"label":"Accept Payments","type":"select","source":[["0","No"],["1","Yes"]]}],
|
[ 'acceptPayments', {"label":"Accept Payments","type":"select","source":[["0","No"],["1","Yes"]]}],
|
||||||
@@ -97,19 +106,67 @@ class InvoiceAdapter extends ReactModalAdapterBase {
|
|||||||
[ 'updated', {"label":"Updated","type":"datetime", "validation":""}],
|
[ 'updated', {"label":"Updated","type":"datetime", "validation":""}],
|
||||||
[ 'link', {"label":"Link","type":"placeholder"}],
|
[ 'link', {"label":"Link","type":"placeholder"}],
|
||||||
[ 'paymentLink', {"label":"Payment Link","type":"placeholder"}],
|
[ 'paymentLink', {"label":"Payment Link","type":"placeholder"}],
|
||||||
|
['items', {
|
||||||
|
label: 'Items',
|
||||||
|
type: 'datagroup',
|
||||||
|
form: [
|
||||||
|
['description', { label: 'Description', type: 'textarea', validation: '' }],
|
||||||
|
['rate', { label: 'Rate', type: 'text', validation: '' }],
|
||||||
|
['qty', { label: 'Quantity', type: 'text', validation: '' }],
|
||||||
|
['lineTotal', { label: 'Line Total', type: 'text', validation: '' }],
|
||||||
|
],
|
||||||
|
html: '<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">Date: #_date_#</span><hr/>#_note_#</div></div>',
|
||||||
|
validation: 'none',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: 'Description',
|
||||||
|
dataIndex: 'description',
|
||||||
|
key: 'description',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Rate',
|
||||||
|
dataIndex: 'rate',
|
||||||
|
key: 'rate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Quantity',
|
||||||
|
dataIndex: 'qty',
|
||||||
|
key: 'qty',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Line Total',
|
||||||
|
dataIndex: 'lineTotal',
|
||||||
|
key: 'lineTotal',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'sort-function': function (a, b) {
|
||||||
|
const t1 = Date.parse(a.date).getTime();
|
||||||
|
const t2 = Date.parse(b.date).getTime();
|
||||||
|
|
||||||
|
return (t1 < t2);
|
||||||
|
},
|
||||||
|
'custom-validate-function': function (data) {
|
||||||
|
const res = {};
|
||||||
|
res.valid = true;
|
||||||
|
data.date = new Date().toString('d-MMM-yyyy hh:mm tt');
|
||||||
|
res.params = data;
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
|
||||||
|
}],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getTableColumns() {
|
getTableColumns() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: 'Payment Id',
|
title: 'Invoice Id',
|
||||||
dataIndex: 'paymentId',
|
dataIndex: 'invoiceId',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Invoice Id',
|
title: 'Description',
|
||||||
dataIndex: 'invoiceId',
|
dataIndex: 'description',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ class UserAdapter extends AdapterBase {
|
|||||||
if (msg == null) {
|
if (msg == null) {
|
||||||
const id = $(`#${this.getTableName()}_submit #id`).val();
|
const id = $(`#${this.getTableName()}_submit #id`).val();
|
||||||
params.csrf = $(`#${this.getTableName()}Form`).data('csrf');
|
params.csrf = $(`#${this.getTableName()}Form`).data('csrf');
|
||||||
|
|
||||||
if (id != null && id !== undefined && id !== '') {
|
if (id != null && id !== undefined && id !== '') {
|
||||||
params.id = id;
|
params.id = id;
|
||||||
this.add(params, []);
|
this.add(params, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user