*/}}

elarp.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * eLaRP: A small ERP utility program
  3. * Copyright (C) 2024 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "la_5.h"
  19. extern LA MAIN;
  20. STRUCTURE(ERPCustomer){
  21. laListItem Item;
  22. laSafeString* Nickname;
  23. laSafeString* Name;
  24. laSafeString* Country;
  25. laSafeString* State;
  26. laSafeString* City;
  27. laSafeString* Address;
  28. laSafeString* PostalCode;
  29. laSafeString* Tel;
  30. laSafeString* EMail;
  31. };
  32. STRUCTURE(ERPProduct){
  33. laListItem Item;
  34. laSafeString* Name;
  35. laListHandle AvailableOptions;
  36. int Price;
  37. };
  38. STRUCTURE(ERPProductOption){
  39. laListItem Item;
  40. ERPProduct* Parent;
  41. laSafeString* Name;
  42. laListHandle Values;
  43. };
  44. STRUCTURE(ERPProductOptionValue){
  45. laListItem Item;
  46. ERPProductOption* Parent;
  47. laSafeString* Name;
  48. int PriceOffset;
  49. };
  50. STRUCTURE(ERPOrder){
  51. laListItem Item;
  52. ERPCustomer* Customer;
  53. laListHandle ProductEntries;
  54. laListHandle Packages;
  55. laSafeString* Comments;
  56. laSafeString* AdminComments;
  57. int State;
  58. int Paid;
  59. int Discount;
  60. };
  61. STRUCTURE(ERPProductEntry){
  62. laListItem Item;
  63. ERPOrder* Parent;
  64. ERPProduct* Product;
  65. laListHandle Options;
  66. int Amount;
  67. };
  68. STRUCTURE(ERPProductEntryOption){
  69. laListItem Item;
  70. ERPProductEntry* Parent;
  71. ERPProductOption* Option;
  72. ERPProductOptionValue* Value;
  73. };
  74. STRUCTURE(ERPPackage){
  75. laListItem Item;
  76. laSafeString* Tracking;
  77. laListHandle IncludedProducts;
  78. };
  79. #define ERP_ORDER_STATE_PENDING_PACKAGING 0
  80. #define ERP_ORDER_STATE_PENDING_LABEL 1
  81. #define ERP_ORDER_STATE_PENDING_SHIPPING 2
  82. #define ERP_ORDER_STATE_SHIPPED 3
  83. #define ERP_ORDER_STATE_ARRIVED 4
  84. #define ERP_ORDER_STATE_IN_PERSON 5
  85. #define ERP_ORDER_STATE_NEED_INFO 127
  86. STRUCTURE(ERPMain){
  87. void* _PAD;
  88. ERPOrder* CurrentOrder;
  89. ERPOrder* CurrentProduct;
  90. ERPOrder* CurrentCustomer;
  91. laListHandle Orders;
  92. laListHandle Products;
  93. laListHandle Customers;
  94. laListHandle PinnedOrders;
  95. };
  96. extern ERPMain* erp;
  97. void erpRegisterEverything();
  98. void erpInit();