/* * 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 . */ #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();