const { Text, Integer, DateTime, Decimal, Checkbox, Uuid, Relationship } = require('@keystonejs/fields'); const { AutoIncrement } = require('@keystonejs/fields-auto-increment'); module.exports = { fields: { id: { type: Uuid, many: false, isRequired: true, label: 'positions' }, dtype: { type: Text, isRequired: true, label: 'dtype' }, pitype: { type: Integer, label: 'pitype' }, pdate: { type: DateTime, label: 'pdate' }, price_netto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena netto' }, price_brutto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena brutto' }, value_netto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc netto' }, value_vat: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc VAT' }, price_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Cena zakupu' }, currency_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Kurs waluty' }, discount: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Upust' }, discount_doc: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'discount_doc' }, docdiscount: { type: Decimal, knexOptions: { precision: 5, scale: 1 }, label: 'docdiscount' }, ord: { type: Integer, label: 'ord' }, quantity: { type: Decimal, knexOptions: { precision: 14, scale: 3 }, label: 'Ilosc' }, kor: { type: Checkbox, isRequired: true, label: 'kor' }, vat_id: { type: Relationship, ref: 'vat', many: false, label: 'VAT' }, documents_id: { type: Relationship, ref: 'documents', many: false, label: 'documents' }, items_id: { type: Relationship, ref: 'items', many: false, isRequired: true, label: 'Egzemplarz' }, shops_id: { type: Relationship, ref: 'shops', many: false, isRequired: true, label: 'Magazyn' }, fifo: { type: Checkbox, label: 'fifo' }, fifogen: { type: Checkbox, label: 'fifogen' }, deliveryitems_id: { type: Relationship, ref: 'deliveryitems', many: false, label: 'deliveryitems' }, fifoposkor_id: { type: Relationship, ref: 'fifopos', many: false, label: 'fifoposkor' }, // todo: spr foreignkey, nie wiadomo czy o to chodzilo custom_name: { type: Text, label: 'custom_name' }, custom_desc: { type: Text, label: 'custom_desc' }, }, label: 'Position'//, plural: 'Positionss' };