123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- /*
- * eLaRP: A small ERP utility program
- * Copyright (C) 2024 Wu Yiming
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #include "la_5.h"
- #include "pdfgen.h"
- extern LA MAIN;
- STRUCTURE(ERPCustomer){
- laListItem Item;
- laSafeString* Nickname;
- laSafeString* Name;
- laSafeString* Country;
- laSafeString* State;
- laSafeString* City;
- laSafeString* Address;
- laSafeString* PostalCode;
- laSafeString* Tel;
- laSafeString* EMail;
- };
- STRUCTURE(ERPProduct){
- laListItem Item;
- laSafeString* Name;
- laListHandle AvailableOptions;
- laSafeString* HSCode;
- int Price;
- int DiscountedPrice;
- };
- STRUCTURE(ERPProductOption){
- laListItem Item;
- ERPProduct* Parent;
- laSafeString* Name;
- laListHandle Values;
- };
- STRUCTURE(ERPProductOptionValue){
- laListItem Item;
- ERPProductOption* Parent;
- laSafeString* Name;
- int PriceOffset;
- };
- STRUCTURE(ERPOrder){
- laListItem Item;
- ERPCustomer* Customer;
- laListHandle ProductEntries;
- laListHandle Packages;
- laSafeString* Comments;
- laSafeString* AdminComments;
- laListHandle Messages;
- int State;
- int Paid;
- int OrderDiscount;
- int OrderPrice;
- };
- STRUCTURE(ERPProductEntry){
- laListItem Item;
- ERPOrder* Parent;
- ERPProduct* Product;
- laListHandle Options;
- int Amount;
- int EntryPrice;
- };
- STRUCTURE(ERPProductEntryOption){
- laListItem Item;
- ERPProductEntry* Parent;
- ERPProductOption* Option;
- ERPProductOptionValue* Value;
- int OptionPriceOffset;
- };
- STRUCTURE(ERPPackage){
- laListItem Item;
- ERPOrder* Parent;
- laSafeString* Tracking;
- laListHandle IncludedProducts;
- };
- STRUCTURE(ERPPackageProduct){
- laListItem Item;
- ERPPackage* Parent;
- ERPProductEntry* Product;
- };
- STRUCTURE(ERPMessage){
- laListItem Item;
- laSafeString* Description;
- laSafeString* Message;
- int IsHeader;
- };
- STRUCTURE(ERPMessageEntry){
- laListItem Item;
- ERPOrder* Parent;
- ERPMessage* Message;
- };
- #define ERP_ORDER_STATE_PENDING_PACKAGING 0
- #define ERP_ORDER_STATE_PENDING_LABEL 1
- #define ERP_ORDER_STATE_PENDING_SHIPPING 2
- #define ERP_ORDER_STATE_SHIPPED 3
- #define ERP_ORDER_STATE_ARRIVED 4
- #define ERP_ORDER_STATE_IN_PERSON 5
- #define ERP_ORDER_STATE_NEED_INFO 127
- STRUCTURE(ERPMain){
- void* _PAD;
- ERPOrder* CurrentOrder;
- ERPProduct* CurrentProduct;
- ERPCustomer* CurrentCustomer;
- ERPMessage* CurrentMessage;
- laListHandle Orders;
- laListHandle Products;
- laListHandle Customers;
- laListHandle PinnedOrders;
- laListHandle Messages;
- };
- extern ERPMain* erp;
- void erpRegisterEverything();
- void erpInit();
|