<?php

namespace App\PartnerBalance;

class Supplier extends GeneralAbstract
{

	/**
	 * The db table column name for the entity id.
	 * @var String
	 */
	protected $tableColumnIdEntity = 'idSupplier';


	/**
	 * (non-PHPdoc)
	 * @see \App\PartnerBalance\GeneralAbstract::setTableDetails()
	 */
	protected function setTableDetails()
	{
		global $DBTSuppliersBalance;
		$this->tableName = $DBTSuppliersBalance;
	}



	public function updateBalance_confirmInvoice($currency, $value)
	{
		$this->updateBalance($currency, $value);
	}


	public function updateBalance_unconfirmInvoice($currency, $value)
	{
		$this->updateBalance($currency, -$value);
	}

	public function updateBalance_addPaymentDoc($currency, $value)
	{
		$this->updateBalance($currency, -$value);
	}

	public function updateBalance_deletePaymentDoc($currency, $value)
	{
		$this->updateBalance($currency, $value);
	}

	public function updateBalance_updatePaymentDoc($currency, $initialValue, $finalValue)
	{
		$this->updateBalance($currency, -($finalValue-$initialValue));
	}



}

