anchor.diff:  
   . Let us assume that a `DRAFT` invoice is created corresponding to an `EXTERNAL CHARGE` of `$100`. It will have a single invoice item of type `EXTERNAL_CHARGE` and amount `100`. 
   
  -So, `CHARGED AMOUNT` and `BALANCE` are calculated as follows:
  ++
  +
  +So, `CHARGED AMOUNT` and `BALANCE` are calculated as follows:
  +
  ++
   
   [source,java]
   ----
  
positive.code:                 = 0
  ----             
  
  [start=2]
  . When the account is charged (either due to a recurring subscription or an external charge), any existing previously generated credit will be used (consumed). So, for example, if an external charge is created for `$100`, it will have an invoice item of type `EXTERNAL_CHARGE` and amount `100`. In addition, it will also have an invoice item of type `CBA_ADJ` and amount `-20` automatically generated by the system corresponding to the credit adjustment.
  
  So, `CHARGED AMOUNT` and `BALANCE` are calculated as follows:
  
  [source,java]
  ----
  
negative.code:                
  INVOICE BALANCE = 0  // since invoice is in DRAFT status               
  ----
  
  +                
  
  . Next, when a https://killbill.github.io/slate/#credit-create-credits[credit is added] to the invoice (say `$20`), the invoice is modified.  A new invoice item is added of type `CREDIT_ADJ` and amount `-20`. In this case, an invoice item of type `CBA_ADJ` is NOT added as the credit is directly consumed.
  
  +
  
  So, `CHARGED AMOUNT` and `BALANCE` are calculated as follows:
  
  +
  
  [source,java]
  ----
  