mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
order.js
This commit is contained in:
parent
00f012311d
commit
50b54f0966
@ -1,6 +1,33 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load inventree_extras %}
|
{% load inventree_extras %}
|
||||||
|
|
||||||
|
/* globals
|
||||||
|
companyFormFields,
|
||||||
|
constructForm,
|
||||||
|
createSupplierPart,
|
||||||
|
global_settings,
|
||||||
|
imageHoverIcon,
|
||||||
|
inventreeGet,
|
||||||
|
launchModalForm,
|
||||||
|
loadTableFilters,
|
||||||
|
makeIconBadge,
|
||||||
|
purchaseOrderStatusDisplay,
|
||||||
|
renderLink,
|
||||||
|
salesOrderStatusDisplay,
|
||||||
|
setupFilterList,
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* exported
|
||||||
|
createSalesOrder,
|
||||||
|
editPurchaseOrderLineItem,
|
||||||
|
loadPurchaseOrderTable,
|
||||||
|
loadSalesOrderAllocationTable,
|
||||||
|
loadSalesOrderTable,
|
||||||
|
newPurchaseOrderFromOrderWizard,
|
||||||
|
newSupplierPartFromOrderWizard,
|
||||||
|
removeOrderRowFromOrderWizard,
|
||||||
|
removePurchaseOrderLineItem,
|
||||||
|
*/
|
||||||
|
|
||||||
// Create a new SalesOrder
|
// Create a new SalesOrder
|
||||||
function createSalesOrder(options={}) {
|
function createSalesOrder(options={}) {
|
||||||
@ -15,7 +42,7 @@ function createSalesOrder(options={}) {
|
|||||||
value: options.customer,
|
value: options.customer,
|
||||||
secondary: {
|
secondary: {
|
||||||
title: '{% trans "Add Customer" %}',
|
title: '{% trans "Add Customer" %}',
|
||||||
fields: function(data) {
|
fields: function() {
|
||||||
var fields = companyFormFields();
|
var fields = companyFormFields();
|
||||||
|
|
||||||
fields.is_customer.value = true;
|
fields.is_customer.value = true;
|
||||||
@ -56,7 +83,7 @@ function createPurchaseOrder(options={}) {
|
|||||||
value: options.supplier,
|
value: options.supplier,
|
||||||
secondary: {
|
secondary: {
|
||||||
title: '{% trans "Add Supplier" %}',
|
title: '{% trans "Add Supplier" %}',
|
||||||
fields: function(data) {
|
fields: function() {
|
||||||
var fields = companyFormFields();
|
var fields = companyFormFields();
|
||||||
|
|
||||||
fields.is_supplier.value = true;
|
fields.is_supplier.value = true;
|
||||||
@ -278,7 +305,7 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
title: '{% trans "Purchase Order" %}',
|
title: '{% trans "Purchase Order" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: false,
|
switchable: false,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
|
|
||||||
var prefix = global_settings.PURCHASEORDER_REFERENCE_PREFIX;
|
var prefix = global_settings.PURCHASEORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
@ -300,7 +327,7 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
title: '{% trans "Supplier" %}',
|
title: '{% trans "Supplier" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
sortName: 'supplier__name',
|
sortName: 'supplier__name',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`);
|
return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -316,7 +343,7 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
field: 'status',
|
field: 'status',
|
||||||
title: '{% trans "Status" %}',
|
title: '{% trans "Status" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
return purchaseOrderStatusDisplay(row.status, row.status_text);
|
return purchaseOrderStatusDisplay(row.status, row.status_text);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -373,7 +400,7 @@ function loadSalesOrderTable(table, options) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'reference',
|
field: 'reference',
|
||||||
title: '{% trans "Sales Order" %}',
|
title: '{% trans "Sales Order" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
|
|
||||||
var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
|
var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
@ -395,7 +422,7 @@ function loadSalesOrderTable(table, options) {
|
|||||||
sortName: 'customer__name',
|
sortName: 'customer__name',
|
||||||
field: 'customer_detail',
|
field: 'customer_detail',
|
||||||
title: '{% trans "Customer" %}',
|
title: '{% trans "Customer" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
|
|
||||||
if (!row.customer_detail) {
|
if (!row.customer_detail) {
|
||||||
return '{% trans "Invalid Customer" %}';
|
return '{% trans "Invalid Customer" %}';
|
||||||
@ -418,7 +445,7 @@ function loadSalesOrderTable(table, options) {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '{% trans "Status" %}',
|
title: '{% trans "Status" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row) {
|
||||||
return salesOrderStatusDisplay(row.status, row.status_text);
|
return salesOrderStatusDisplay(row.status, row.status_text);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -486,7 +513,6 @@ function loadSalesOrderAllocationTable(table, options={}) {
|
|||||||
field: 'order',
|
field: 'order',
|
||||||
switchable: false,
|
switchable: false,
|
||||||
title: '{% trans "Order" %}',
|
title: '{% trans "Order" %}',
|
||||||
switchable: false,
|
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
|
|
||||||
var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
|
var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
|
||||||
|
Loading…
Reference in New Issue
Block a user