articles.js_bak 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const { Integer, Checkbox, Text, Decimal, DateTime, Uuid, Relationship } = require('@keystonejs/fields');
  2. module.exports = {
  3. fields: {
  4. items_id: { type: Uuid, isRequired: true, label: 'Egzemplarz' },
  5. article_id: { type: Uuid, many: false, label: 'article' },
  6. productsguid_id: { type: Uuid, many: false, label: 'productsguid' },
  7. itype: { type: Integer, isRequired: true, label: 'itype' },
  8. sold: { type: Checkbox, isRequired: true, label: 'sold' },
  9. deficiency: { type: Checkbox, isRequired: true, label: 'deficiency' },
  10. catnum: { type: Text, label: 'catnum' },
  11. description: { type: Text, label: 'description' },
  12. price_delivery: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_delivery' },
  13. price_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_purchase' },
  14. price_detal: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'price_detal' },
  15. price_detal_brutto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena detaliczna brutto' },
  16. price_eshop: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena esklep' },
  17. profit_margin: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Marża' },
  18. isize: { type: Text, isRequired: true, label: 'isize' },
  19. mass: { type: Decimal, knexOptions: { precision: 10, scale: 2 }, label: 'Masa' },
  20. quantity: { type: Decimal, knexOptions: { precision: 14, scale: 3 }, label: 'Ilość' },
  21. barcode: { type: Text, label: 'Kod kreskowy' },
  22. tagged: { type: Checkbox, isRequired: true, label: 'tagged' },
  23. currency_id: { type: Relationship, ref: 'currency.currency_id', many: false, label: 'Waluta' },
  24. producer: { type: Text, label: 'Producent' },
  25. symbol_prod: { type: Text, label: 'Symbol producenta' },
  26. silver_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt srebra' },
  27. gold_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt złota' },
  28. platin_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt platyny' },
  29. purchase_date: { type: DateTime, label: 'Data zakupu' },
  30. promo: { type: Checkbox, isRequired: true, label: 'promo' },
  31. news: { type: Checkbox, isRequired: true, label: 'news' },
  32. best: { type: Checkbox, isRequired: true, label: 'best' },
  33. name: { type: Text, label: 'Nazwa' },
  34. desctxt: { type: Text, label: 'desctxt' },
  35. seotxt: { type: Text, label: 'seotxt' },
  36. eshop: { type: Checkbox, isRequired: true, label: 'E-sklep' },
  37. created_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Utworzono' },
  38. modified_at: { type: DateTime, format: 'DD.MM.YYYY h:mm', isRequired: true, label: 'Zmieniono' },
  39. sup_id: { type: Relationship, ref: 'suppliers.suppliers_id', many: false, label: 'suppliers_id' },
  40. pzdoc_id: { type: Uuid, many: false, label: 'pzdoc' },
  41. kinds_id: { type: Relationship, ref: 'kinds.kinds_id', many: true, label: 'kinds' },
  42. uom_id: { type: Relationship, ref: 'uom.uom_id', many: false, label: 'uom' },
  43. materials_id: { type: Relationship, ref: 'materials.materials_id', many: true, label: 'materials' },
  44. vat_id: { type: Relationship, ref: 'vat.vat_id', many: false, isRequired: true, label: 'VAT' },
  45. locations_id: { type: Relationship, ref: 'locations.locations_id', many: true, label: 'locations' },
  46. deliveryitems_id: { type: Relationship, ref: 'deliveryitems.deliveryitems_id', many: true, label: 'deliveryitems' },
  47. shops_id: { type: Relationship, ref: 'shops.shops_id', many: true, isRequired: true, label: 'Magazyn' },
  48. tagsoper_id: { type: Relationship, ref: 'operators.operators_id', many: false, label: 'tagsoper' }, // todo: spr. czy o to chodziło w foreign keys oryginalnej bazy
  49. price_delivery_before_discount: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt dostawy przed rabatem' },
  50. fifo_value: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'fifo_value' },
  51. fifo: { type: Checkbox, label: 'fifo' },
  52. fifo_last_price: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'fifo_last_price' },
  53. transit: { type: Checkbox, isRequired: true, label: 'Transport' },
  54. transit_symbol: { type: Text, label: 'Symbol transportu' },
  55. transit_proofsymbol: { type: Text, label: 'transit_proofsymbol' },
  56. transit_currency_id: { type: Relationship, ref: 'currency.currency_id', many: false, label: 'Waluta transportu' },
  57. transit_currency_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'transit_currency_rate' },
  58. transit_purchase_costs: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'transit_purchase_costs' },
  59. transit_currency_material_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'transit_currency_material_rate' },
  60. quantity_precision: { type: Integer, isRequired: true, label: 'quantity_precision' },
  61. }, label: 'Article'//, plural: 'Articles'
  62. };