*/}}

elarp.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. #include "pdfgen.h"
  20. extern LA MAIN;
  21. STRUCTURE(ERPCustomer){
  22. laListItem Item;
  23. laSafeString* Nickname;
  24. laSafeString* Name;
  25. laSafeString* Country;
  26. laSafeString* State;
  27. laSafeString* City;
  28. laSafeString* Address;
  29. laSafeString* PostalCode;
  30. laSafeString* Tel;
  31. laSafeString* EMail;
  32. };
  33. STRUCTURE(ERPProduct){
  34. laListItem Item;
  35. laSafeString* Name;
  36. laListHandle AvailableOptions;
  37. laSafeString* HSCode;
  38. int Price;
  39. int DiscountedPrice;
  40. };
  41. STRUCTURE(ERPProductOption){
  42. laListItem Item;
  43. ERPProduct* Parent;
  44. laSafeString* Name;
  45. laListHandle Values;
  46. };
  47. STRUCTURE(ERPProductOptionValue){
  48. laListItem Item;
  49. ERPProductOption* Parent;
  50. laSafeString* Name;
  51. int PriceOffset;
  52. };
  53. STRUCTURE(ERPOrder){
  54. laListItem Item;
  55. ERPCustomer* Customer;
  56. laListHandle ProductEntries;
  57. laListHandle Packages;
  58. laSafeString* Comments;
  59. laSafeString* AdminComments;
  60. laListHandle Messages;
  61. int State;
  62. int Paid;
  63. int OrderDiscount;
  64. int OrderPrice;
  65. };
  66. STRUCTURE(ERPProductEntry){
  67. laListItem Item;
  68. ERPOrder* Parent;
  69. ERPProduct* Product;
  70. laListHandle Options;
  71. int Amount;
  72. int EntryPrice;
  73. };
  74. STRUCTURE(ERPProductEntryOption){
  75. laListItem Item;
  76. ERPProductEntry* Parent;
  77. ERPProductOption* Option;
  78. ERPProductOptionValue* Value;
  79. int OptionPriceOffset;
  80. };
  81. STRUCTURE(ERPPackage){
  82. laListItem Item;
  83. ERPOrder* Parent;
  84. laSafeString* Tracking;
  85. laListHandle IncludedProducts;
  86. };
  87. STRUCTURE(ERPPackageProduct){
  88. laListItem Item;
  89. ERPPackage* Parent;
  90. ERPProductEntry* Product;
  91. };
  92. STRUCTURE(ERPMessage){
  93. laListItem Item;
  94. laSafeString* Description;
  95. laSafeString* Message;
  96. int IsHeader;
  97. };
  98. STRUCTURE(ERPMessageEntry){
  99. laListItem Item;
  100. ERPOrder* Parent;
  101. ERPMessage* Message;
  102. };
  103. #define ERP_ORDER_STATE_PENDING_PACKAGING 0
  104. #define ERP_ORDER_STATE_PENDING_LABEL 1
  105. #define ERP_ORDER_STATE_PENDING_SHIPPING 2
  106. #define ERP_ORDER_STATE_SHIPPED 3
  107. #define ERP_ORDER_STATE_ARRIVED 4
  108. #define ERP_ORDER_STATE_IN_PERSON 5
  109. #define ERP_ORDER_STATE_NEED_INFO 127
  110. STRUCTURE(ERPMain){
  111. void* _PAD;
  112. ERPOrder* CurrentOrder;
  113. ERPProduct* CurrentProduct;
  114. ERPCustomer* CurrentCustomer;
  115. ERPMessage* CurrentMessage;
  116. laListHandle Orders;
  117. laListHandle Products;
  118. laListHandle Customers;
  119. laListHandle PinnedOrders;
  120. laListHandle Messages;
  121. };
  122. extern ERPMain* erp;
  123. void erpRegisterEverything();
  124. void erpInit();