ACCOUNTING PATTERNS potx

72 377 0
ACCOUNTING PATTERNS potx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

#EEQWPVKPI2CVVGTPU System Events Accounting Entries Event process(Event) Processor Accounting Entry reads creates process() findAgreement(Event) Event Accounting Entry creates process(Event) Agreement find process() findAgreement(Event) Event Accounting Entry creates getRule(EventType) Agreement find Event Type ✻ 1 process(Event) Posting Rule ✻ 1 ✻ 1 process() findAgreement(Event) Event Accounting Entry creates getRule(EventType, Date) Agreement find Event Type ✻ 1 process(Event) effectivity: Date Range Posting Rule ✻ 1 ✻ 1 Accounting Event replacement adjusted event 0 1 0 1 Adjustment Accounting Event old events ✻ 0 1 old events ✻ 0 1 Event Accounting Entry ✻ 1 source [...]... G H Q J Y M [ P C O Q U F G U W T G O Q V U W E   PostingRule AccountingEvent process(AccountingEvent) calculateAmount(AccountingEvent) UsageEvent amount : Quantity {type = USAGE} MultiplyByRatePR calculateAmount(AccountingEvent) G ICU W IP KVCN WENCE G JV TQH FGF GGP GN WT I PKVU QR FPC V PGX G HQ UGU UCNEDW 5  GTWI K( class AccountingEvent { public void process() { findRule().process(this);...    G T W IK ( 1 Accounting Event ✻ ✻ Customer Entry 1 1 1 ✻ ✻ ´ createsª Event Type Service Agreement event type date ✻ Posting Rule 1 host event type accounting entry posting rule Posting Rule   class AccountingEvent { private EventType _type; private MfDate _whenOccurred; private MfDate _whenNoticed; private Customer _customer; private Set resultingEntries = new HashSet(); AccountingEvent (EventType... type) { this.type = type; } private void makeEntry(AccountingEvent evt, Money amount) { Entry newEntry = new Entry (amount, evt.getWhenNoticed(), type); evt.getCustomer().addEntry(newEntry); evt.addResultingEntry(newEntry); } public void process (AccountingEvent evt) { makeEntry(evt, calculateAmount(evt)); } abstract protected Money calculateAmount(AccountingEvent evt); } GXCJGD UGUUCNE GJV YQ* C U... G J E [ O O Q T H    Y C T F J VK Y +  G N R O C Z ' when booked : DateTime amount: Money ✻ ✻ descriptor Accounting Entry [G PQO HQ OW U C HQ P QKVCEQ NNC P# #EEQWPVKPI 'PVT[  UTQVRKTEUGF UC GR[V VUQE FPC VEGLQT2  GTWI K( 1 Project ✻ Entry Cost Type 1 ✻ accounting entry descriptors Accounting Entry     G T W I K ( PK U C U R K JU P Q KV C N GT GV CT C R GU U C GU G J V Y Q JU F N W Q... P Q E G J V PK P QK V TGU U C G JV Q U PQ KUT WE GT U UG NFP G P C [ D VJ IW CE V GI Q V N WH PK CR FP C [U C G [T CN WE K VTC R U•V + class TaxEvent extends MonetaryEvent { private AccountingEvent base; public TaxEvent(AccountingEvent base, Money taxableAmount) { super (taxableAmount, EventType.TAX, base.getWhenOccurred(), base.getWhenNoticed(), base.getCustomer()); this.base = base; Assert.isFalse("Probable... W T I P KV U Q R G J V F P C V P G X G G J V G X C J G Y Y Q P Q 5 class MultiplyByRatePR extends PostingRule{ public MultiplyByRatePR (EntryType type) { super(type); } protected Money calculateAmount(AccountingEvent evt) { Usage usageEvent = (Usage) evt; return Money.dollars(usageEvent.getAmount().getAmount() * usageEvent.getRate()); } }  G V C T [ D U GK N R K V N W O V C J V G N W T I P K V U Q... P K H G F G Y Q F G Y P G J Y V W D U U C N E D W U C F G G P U [ C YN C V• P Q F G 9  C V C F NCPQKVKFFC FGGP GY PGJY PQOOQE GVKWS UK VPGX' IPKVPWQEE# HQ UGUUCNEDWU IPKMC/ public class Usage extends AccountingEvent { private Quantity amount; public Usage(Quantity amount, MfDate whenOccurred, MfDate whenNoticed, Customer customer) { super(EventType.USAGE, whenOccurred, whenNoticed, customer); this.amount... G O QU P K GI PC JE J EC G FT Q EGT Q V FG GP W Q [ T G XG P GJ Y U G KT V P G GU W F N WQ JU W Q ;  VPGXG TCNWEKVTCR C [D FGVCGTE GTGY UGKTVPG JEKJY NNGV PCE WQ[ VCJV IPKTWUP'  GTWIK( 1 ✻ Event Accounting Entry source  U G U Q R T W R I PK V T Q R G T V U W L P C J V G T Q O T Q H M P K N H Q F P K M U K J V F G G P N N • W Q [  VPGOVUWLF# NCUTGXG4 IPKUW GTC WQ[ H+ FGFFC [TVPG UKJV UCY [JY... multiply by rate posting rule   VP GXG [ T CV G P Q O C Q V C N W O T QH G N R OK U C U GK N R R C V C J V G P Q EK T G P G I C U K G N W T I P K V U Q R G J V [ N T CN K OK 5 public void testService() { AccountingEvent evt = new MonetaryEvent( Money.dollars(40), EventType.SERVICE_CALL, new MfDate(1999, 10, 5), new MfDate(1999, 10, 5), acm); evt.process(); Entry resultingEntry = (Entry) acm.getEntries().get(0);... D F N W Q E U U C N E UK J 6  [ G P Q O H Q V P W Q O C P C U F T Q E G T V U WL V C J V V P G X G [ T C V G P Q O GN R OK U C U K U U CN E D W U V P G X G G JV G EK V Q 0 class MonetaryEvent extends AccountingEvent { Money amount; MonetaryEvent(Money amount, EventType type, mf.MfDate whenOccurred, mf.MfDate whenNoticed, Customer customer) { super(type, whenOccurred, whenNoticed, customer); this.amount . #EEQWPVKPI2CVVGTPU System Events Accounting Entries Event process(Event) Processor Accounting Entry reads creates process() findAgreement(Event) Event Accounting Entry creates process(Event) Agreement find process() findAgreement(Event) Event Accounting. Range Posting Rule ✻ 1 ✻ 1 Accounting Event replacement adjusted event 0 1 0 1 Adjustment Accounting Event old events ✻ 0 1 old events ✻ 0 1 Event Accounting Entry ✻ 1 source

Ngày đăng: 23/03/2014, 03:20

Mục lục

  • Procedural Decomposition and Object Structures

  • Correcting mistakes

    • Finding the Entries Affected by an Adjustment

    • Ways of Adjusting the entries

    • When to use it

    • Accounting Entry

      • Making it work

      • When to use it

      • Posting Rule

        • Making it work

        • When to use it

          • Setting up the structure

          • How the classes behave

          • A Second Event Type

          • Handling a Rule Change

          • Secondary Posting Rule

            • Making it work

            • When to use it

            • Maintaining the Event Trace

            • When to use it

            • Accounting Transaction

              • Making it work

              • When to use it

                • Two Legged or Multi-Legged?

                • Reversal Adjustment

                  • Making it work

                  • When to use it

                  • Difference Adjustment

                    • Making it work

Tài liệu cùng người dùng

Tài liệu liên quan