*/}}

elarp.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. int State;
  61. int Paid;
  62. int OrderDiscount;
  63. int OrderPrice;
  64. };
  65. STRUCTURE(ERPProductEntry){
  66. laListItem Item;
  67. ERPOrder* Parent;
  68. ERPProduct* Product;
  69. laListHandle Options;
  70. int Amount;
  71. int EntryPrice;
  72. };
  73. STRUCTURE(ERPProductEntryOption){
  74. laListItem Item;
  75. ERPProductEntry* Parent;
  76. ERPProductOption* Option;
  77. ERPProductOptionValue* Value;
  78. int OptionPriceOffset;
  79. };
  80. STRUCTURE(ERPPackage){
  81. laListItem Item;
  82. ERPOrder* Parent;
  83. laSafeString* Tracking;
  84. laListHandle IncludedProducts;
  85. };
  86. STRUCTURE(ERPPackageProduct){
  87. laListItem Item;
  88. ERPPackage* Parent;
  89. ERPProductEntry* Product;
  90. };
  91. #define ERP_ORDER_STATE_PENDING_PACKAGING 0
  92. #define ERP_ORDER_STATE_PENDING_LABEL 1
  93. #define ERP_ORDER_STATE_PENDING_SHIPPING 2
  94. #define ERP_ORDER_STATE_SHIPPED 3
  95. #define ERP_ORDER_STATE_ARRIVED 4
  96. #define ERP_ORDER_STATE_IN_PERSON 5
  97. #define ERP_ORDER_STATE_NEED_INFO 127
  98. STRUCTURE(ERPMain){
  99. void* _PAD;
  100. ERPOrder* CurrentOrder;
  101. ERPOrder* CurrentProduct;
  102. ERPOrder* CurrentCustomer;
  103. laListHandle Orders;
  104. laListHandle Products;
  105. laListHandle Customers;
  106. laListHandle PinnedOrders;
  107. };
  108. extern ERPMain* erp;
  109. void erpRegisterEverything();
  110. void erpInit();