documents.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const { Integer, Checkbox, Text, Decimal, DateTime, Uuid, Relationship } = require('@keystonejs/fields');
  2. module.exports = {
  3. fields: {
  4. documents_id: { type: Uuid, isRequired: true, label: 'documents' },
  5. docnumber: { type: Integer, isRequired: true, label: 'Numer dokumentu' },
  6. accepted: { type: Checkbox, isRequired: true, label: 'Zatwierdzono' },
  7. canceled: { type: Checkbox, isRequired: true, label: 'Anulowano' },
  8. symbol: { type: Text, label: 'Symbol' },
  9. proofsymbol: { type: Text, label: 'proofsymbol' },
  10. dtype: { type: Text, isRequired: true, label: 'dtype' },
  11. bprices: { type: Checkbox, isRequired: true, label: 'bprices' },
  12. value_netto: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc netto' },
  13. value_vat: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc VAT' },
  14. value_purchase: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Wartosc zakupu' },
  15. date_w: { type: DateTime, isRequired: true, label: 'date_w' },
  16. date_s: { type: DateTime, label: 'date_s' },
  17. date_c: { type: DateTime, label: 'date_c' },
  18. currency_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Kurs wymiany' },
  19. currency_material_rate: { type: Decimal, knexOptions: { precision: 12, scale: 4 }, label: 'Kurs wymiany za surowiec' },
  20. printed: { type: Checkbox, isRequired: true, label: 'Wydrukowano?' },
  21. print_memo_text: { type: Text, label: 'Notatka' },
  22. convinfo: { type: Text, label: 'convinfo' },
  23. convtype: { type: Text, label: 'convtype' },
  24. barcode: { type: Text, label: 'Kod Kreskowy' },
  25. exp: { type: Text, label: 'exp' },
  26. purchase_costs: { type: Decimal, knexOptions: { precision: 12, scale: 2 }, label: 'Koszt zakupu' },
  27. origin: { type: Text, label: 'Pochodzenie' },
  28. // target_shops_id: { type: Relationship, ref: 'target_shops.target_shops_id', many: true, label: 'target_shops' }, todo: spr. czy potrzebne?
  29. suppliers_id: { type: Relationship, ref: 'suppliers', many: true, label: 'Dostawca' },
  30. shops_id: { type: Relationship, ref: 'shops', many: true, isRequired: true, label: 'Magazyn' },
  31. currency_id: { type: Relationship, ref: 'currency', many: false, label: 'Waluta' },
  32. operators_id: { type: Relationship, ref: 'operators', many: true, label: 'Uzytkownik' },
  33. comment: { type: Text, label: 'Komentarz' },
  34. return_symbol: { type: Text, label: 'return_symbol' },
  35. return_date_issue: { type: DateTime, label: 'return_date_issue' },
  36. return_date_receipt: { type: DateTime, label: 'return_date_receipt' },
  37. //document_groups_id: { type: Relationship, ref: 'document_groups.document_groups_id', many: true, label: 'document_groups' }, todo: spr. czy istotne
  38. custom_vat: { type: Integer, label: 'custom_vat' },
  39. nip: { type: Text, label: 'NIP' },
  40. }, label: 'Document'//, plural: 'Documentss'
  41. };