public function getItemEarnings(GcrTransactionItem $item)
 {
     $earnings = 0;
     $purchase = $item->getPurchase();
     if ($purchase->isPayoff()) {
         $earnings = $item->getAmount();
     } else {
         $seller = $purchase->getSellerUser();
         if ($seller && $seller->isSameUser($this->user)) {
             $earnings = $item->getDistribution()->getSeller();
         }
     }
     return $earnings;
 }
 public function getItemEarnings(GcrTransactionItem $item)
 {
     $earnings = 0;
     $purchase = $item->getPurchase();
     if ($purchase->isPayoff()) {
         $payoff = GcrPayoffTable::getInstance()->find($purchase->getPurchaseTypeId());
         if ($payoff->isEschoolPayoff()) {
             $earnings = $item->getAmount();
         }
     } else {
         if ($this->isRemoteItem($item)) {
             $earnings = $item->getDistribution()->getCommission();
         } else {
             $earnings = $item->getDistribution()->getOwner();
         }
     }
     return $earnings;
 }