<?php

/*

	TODO: rewrite the balances on the following operations: supplier (add/edit/delete supplier invoice, add/edit/void payment docs)

	- OPERATIUNI PE FCT FURN:
		- adaugare/modificare/stergere factura furnizor - se sterge incepand cu data fct (inclusiv)
			- la modificare se ia data cea mai mica dintre data initiala si cea finala
		- adaugare/modificare/stergere plata - se sterge incepand cu data doc plata
			- la modificare document - se ia data cea mai mica dintre cele doua date (intiala si finala)
*/

namespace App\PartnerBalance\History;

class Supplier extends GeneralAbstract
{

	/**
	 *
	 * {@inheritDoc}
	 * @see \App\PartnerBalance\History\GeneralAbstract::setTableDetails()
	 */
	protected function setTableDetails()
	{
		global $DBTSuppliersBalanceHistory;
		$this->tableName = $DBTSuppliersBalanceHistory;
		$this->tableColumnIdEntity = 'idSupplier';
	}


	/**
	 * (non-PHPdoc)
	 * @see \App\PartnerBalance\History\GeneralAbstract::getDailyBalances()
	 */
	protected function getTransactions($initialDate, $finalDate, $selectForUpdate)
	{

		// gets the transactions for the chosen interval
		$transListObj = new \App\PartnerBalance\History\Transactions\Supplier($this->idEntity, $this->currency, $initialDate, $finalDate);

		$transListObj->setForUpdate($selectForUpdate);
		$transListObj->populateTransactions();
		$transList = $transListObj->getTransactionsList();

		return $transList;

	}



}