const { Integer, Checkbox, Text, Decimal, DateTime, Uuid, Relationship } = require('@keystonejs/fields'); module.exports = { fields: { id: { type: Uuid, isRequired: true, label: 'documents' }, docnumber: { type: Integer, isRequired: true, label: 'Numer dokumentu' }, accepted: { type: Checkbox, isRequired: true, label: 'Zatwierdzono' }, canceled: { type: Checkbox, isRequired: true, label: 'Anulowano' }, symbol: { type: Text, label: 'Symbol' }, proofsymbol: { type: Text, label: 'proofsymbol' }, dtype: { type: Text, isRequired: true, label: 'dtype' }, bprices: { type: Checkbox, isRequired: true, label: 'bprices' }, value_netto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc netto' }, value_vat: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc VAT' }, value_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc zakupu' }, date_w: { type: DateTime, isRequired: true, label: 'date_w' }, date_s: { type: DateTime, label: 'date_s' }, date_c: { type: DateTime, label: 'date_c' }, currency_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Kurs wymiany' }, currency_material_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Kurs wymiany za surowiec' }, printed: { type: Checkbox, isRequired: true, label: 'Wydrukowano?' }, print_memo_text: { type: Text, label: 'Notatka' }, convinfo: { type: Text, label: 'convinfo' }, convtype: { type: Text, label: 'convtype' }, barcode: { type: Text, label: 'Kod Kreskowy' }, exp: { type: Text, label: 'exp' }, purchase_costs: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt zakupu' }, origin: { type: Text, label: 'Pochodzenie' }, // target_shops_id: { type: Relationship, ref: 'target_shops.target_shops_id', many: true, label: 'target_shops' }, todo: spr. czy potrzebne? suppliers_id: { type: Relationship, ref: 'suppliers', many: false, label: 'Dostawca' }, shops_id: { type: Relationship, ref: 'shops', many: false, isRequired: true, label: 'Magazyn' }, currency_id: { type: Relationship, ref: 'currency', many: false, label: 'Waluta' }, operators_id: { type: Relationship, ref: 'operators', many: false, label: 'Uzytkownik' }, comment: { type: Text, label: 'Komentarz' }, return_symbol: { type: Text, label: 'return_symbol' }, return_date_issue: { type: DateTime, label: 'return_date_issue' }, return_date_receipt: { type: DateTime, label: 'return_date_receipt' }, //document_groups_id: { type: Relationship, ref: 'document_groups.document_groups_id', many: true, label: 'document_groups' }, todo: spr. czy istotne custom_vat: { type: Integer, label: 'custom_vat' }, nip: { type: Text, label: 'NIP' }, }, label: 'Document'//, plural: 'Documentss' };