# V1W2-3 # Python & Django & Finance ###### tags: `OneLeap v1` # Django main components * Models * Account: * Create: (code, full_code) -> Parent * Update: * Parent (code, full_code) * Children (code, full_code) * Transaction: * TIS * Leg * Should be assiciated with Account (Reference) * Should be assiciated with Transaction (Container) * Should not have zero amount * Movable (Customer, Supplier, Inventory, Stock Activity, Project, ) * Inventory * StockActivity * Should be assiciated with and Inventory (Reference) * Should be assiciated with a Stock Item * Forms * Tables # ERP TIS ## General Considerations * Approval System * Each TIS should have an approval template (dynamic template with multiple levels) * There should be a flag (True, False) approved or not * Both are optional operations, a global setting should indicate the mandate for this process ### Approval System General Considerations - TASK build an approval system using the considerations below * Dynamic * Multiple Steps * Organization -> Department -> Unit * Transaction (approver, approved) <-> Approval System * ApprovalSystem (state (approver_pk (Employee), approved_flag)) * FSM - current_state, next_state, previous_state, state * Ex: Invoice 1. step: 1 * previous_state: None * current_state: unit_manager * next_state: department_manager * state: unapproved -> approved 2. step: 2 * previous_state: unit_manager * current_state: department_manager * next_state: None * state: unapproved Hint: use FSM * Inventory Committing System * Inventory warden, Packing supervisor should have the permission to commit inventory activities * Write down Loading and Unloading staff and cost * Write down Shipping Freight and cost * Ledger Transaction Posting System * global option (auto posting or not) * Fianance: * Accountant * Inventory: * By the same inventory committing system operator ## Finance * PaymentRecord * customer * date * currency * total * project * cost_center * invoices m2m * legs m2m * description * account - associative with the accountant * ExpenseRecord * date * currency * total * description * attachment * reference * project * cost_center * account * CreditMemo * date * currency * total * description * attachment * reference * customer * account * employee * supplier * SalaryRecord * DeprciationRecord * LedgerRecord * account * cost_center * project * currency * credit * debit * date * description * CurrencyExchangeRecord ## Inventory * SalesOrder * currency * reference * date * due_date * address * status * fx_rate * income_account * cogs_account * refund_account * note * packing_note * total * total_paid * total_due * customer * project * cost_center * Quotation * currency * reference * date * due_date * address * status * fx_rate * income_account * cogs_account * refund_account * note * packing_note * total * total_paid * total_due * customer * project * cost_center * Invoice * currency * reference * date * due_date * address * status * fx_rate * income_account * cogs_account * refund_account * note * packing_note * total * total_paid * total_due * customer * project * cost_center * -- * ReuqustForQuotation * PurchaseOrder * Bill * supplier * inventory * project * cost_center * date * due_date * currency * reference * total * total_paid * total_due * status * fx_rate * -- * InventoryTakein * supplier * inventory * project * cost_center * reference * attachment * total * date * InventoryTakeout * customer * inventory * project * cost_center * reference * attachment * total * date * InventoryDamage * inventory * project * cost_center * reference * attachment * total * date * InventoryTransfer * inventory_from * inventory_to * project * cost_center * reference * attachment * total * date * InventoryIncreaseStocktaking * inventory * project * cost_center * reference * attachment * total * date * InventoryDecreaseWriteOff * inventory * project * cost_center * reference * attachment * total * date