Introduces a new 'cost_price_gbp' field to the stock items schema and database migration. Updates stock item forms to support both ZAR and GBP cost prices. Purchase order forms and PDF generation now use GBP pricing, with enhanced supplier and order metadata. Adds a searchable stock item selector for purchase orders and improves type definitions and UI labels for clarity.
27 lines
665 B
JavaScript
27 lines
665 B
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((app) => {
|
|
const collection = app.findCollectionByNameOrId("pbc_2382354120");
|
|
|
|
// Add cost_price_gbp field
|
|
collection.fields.addAt(6, new Field({
|
|
"hidden": false,
|
|
"id": "",
|
|
"max": null,
|
|
"min": 0,
|
|
"name": "cost_price_gbp",
|
|
"onlyInt": false,
|
|
"presentable": false,
|
|
"required": false,
|
|
"system": false,
|
|
"type": "number"
|
|
}));
|
|
|
|
return app.save(collection);
|
|
}, (app) => {
|
|
const collection = app.findCollectionByNameOrId("pbc_2382354120");
|
|
|
|
// Remove cost_price_gbp field
|
|
collection.fields.removeById("number_cost_price_gbp");
|
|
|
|
return app.save(collection);
|
|
});
|