FacturaScripts

PresupuestoCliente extends SalesDocument Uses ModelTrait

Customer estimation.

Table of Contents

$finoferta Date on which the validity of the estimation ends. string
$idpresupuesto Primary key. int
$fields List of fields in the table. array
$apartado Mail box of the client. string
$ciudad Customer's city string
$codagente Agent who created this document. Agente model. string
$codcliente Customer of this document. string
$codigoenv Shipping tracking code. string
$codpais Customer's country. string
$codpostal Customer's postal code. string
$codtrans Shipping code for the shipment. string
$direccion Customer's address string
$idcontactoenv ID of contact for shippment. int
$idcontactofact ID of contact for invoice. int
$nombrecliente Customer name. string
$numero2 Optional number available to the user. string
$provincia Customer's province. string
$totalcomision % commission of the agent. float|int
$documentGeneration bool
$editable Indicates whether the document can be modified bool
$estados \FacturaScripts\Dinamic\Model\EstadoDocumento[]
$idestado Document status, from EstadoDocumento model. int
$cifnif VAT number of the customer or supplier. string
$codalmacen Warehouse in which the merchandise enters. string
$codigo Unique identifier for humans. string
$dtopor1 Percentage of discount. float
$dtopor2 Percentage of discount. float
$fecha Date of the document. string
$femail Date on which the document was sent by email. string
$hora Document time. string
$irpf Default retention for this document. Each line can have a different retention. float|int
$neto Sum of the pvptotal of lines. Total of the document before taxes. float|int
$netosindto Sum of the pvptotal of lines. Total of the document before taxes and global discounts. float|int
$nick User who created this document. User model. string
$numero Number of the document. Unique within the series. string
$observaciones Notes of the document. string
$total Total sum of the document, with taxes. float|int
$totaliva Sum of the VAT of the lines. float|int
$totaleuros Total expressed in euros, if it were not the currency of the document. float|int
$totalirpf Total sum of the IRPF withholdings of the lines. float|int
$totalrecargo Total sum of the equivalence surcharge of the lines. float|int
$totalsuplidos Total sum of supplied lines. float|int
$idempresa int
$coddivisa Currency of the document. string
$divisas \FacturaScripts\Dinamic\Model\Divisa[]
$tasaconv Rate of conversion to Euros of the selected currency. float|int
$codejercicio Exercise code. string
$ejercicios All exercises. \FacturaScripts\Dinamic\Model\Ejercicio[]
$codpago Payment method code. string
$codserie string
$previousData Previous data array. array
$checkedTables List of already tested tables. array
$dataBase It provides direct access to the database. DataBase
clear() Reset the values of all model properties. mixed
getLines() Returns the lines associated with the estimation. \FacturaScripts\Dinamic\Model\LineaPresupuestoCliente[]
getNewLine() Returns a new line for this document. LineaPresupuestoCliente
primaryColumn() Returns the name of the column that is the model's primary key. string
tableName() Returns the name of the table that uses this model. string
test() Returns True if there is no errors on properties values. bool
getModelFields() Returns the list of fields in the table. array
modelClassName() Returns the name of the class of the model. string
modelName() Returns the name of the model. string
loadModelFields() Loads table fields if is necessary. mixed
clear() Reset the values of all model properties. mixed
country() string
delete() Remove the model data from the database. bool
getNewProductLine() Returns a new line for this business document completed with the product data. mixed
getRate() Tarifa
getSubject() Returns the subject of this document. mixed
install() This function is called when creating the model table. Returns the SQL that will be executed after the creation of the table. Useful to insert values default. string
save() Stores the model data in the database. bool
setAuthor() Sets the author for this document. mixed
setSubject() Sets subject for this document. mixed
subjectColumn() Returns the name of the column for subject. mixed
test() Returns true if there are no errors in the values of the model properties. bool
updateSubject() Updates subjects data in this document. mixed
onChange() This methos is called before save (update) when some field has changed. bool
onChangeAgent() bool
setContact() bool
setCustomer() bool
setPreviousData() Saves previous values. mixed
childrenDocuments() Returns all children documents of this one. \FacturaScripts\Core\Model\Base\TransformerDocument[]
getAvaliableStatus() Returns all avaliable status for this type of document. \FacturaScripts\Dinamic\Model\EstadoDocumento[]
getStatus() Returns the EstadoDocumento model for this document. EstadoDocumento
parentDocuments() Returns all parent document of this one. \FacturaScripts\Core\Model\Base\TransformerDocument[]
setDocumentGeneration() mixed
getLines() Returns the lines associated with the document. mixed
getNewLine() Returns a new line for this business document. mixed
getEUDiscount() Returns the Equivalent Unified Discount. float
paid() bool
primaryDescriptionColumn() Returns the name of the column that describes the model, such as name, description. string
setDate() Assign the date and find an accounting exercise. bool
subjectColumnValue() string
setWarehouse() Sets warehouse and company for this document. bool
getCompany() Empresa
setCurrency() mixed
clearExerciseCache() mixed
getExercise() Returns the current exercise or the default one. Ejercicio
getPaymentMethod() FormaPago
getSerie() Serie
__construct() ModelClass constructor. mixed
loadFromCode() Fill the class with the registry values whose primary column corresponds to the value $cod, or according to the condition where indicated, if value is not reported in $cod. bool
onDelete() This method is called after a record is removed from the database. mixed
onInsert() This method is called after a new record is saved on the database (saveInsert). mixed
onUpdate() This method is called after a record is updated on the database (saveUpdate). mixed
saveInsert() Insert the model data in the database. bool
saveUpdate() Update the model data in the database. bool
all() Returns all models that correspond to the selected filters. static[]
codeModelAll() Allows to use this model as source in CodeModel special model. \FacturaScripts\Dinamic\Model\CodeModel[]
codeModelSearch() Allows to use this model as source in CodeModel special model. \FacturaScripts\Dinamic\Model\CodeModel[]
count() Returns the number of records in the model that meet the condition. int
exists() Returns true if the model data is stored in the database. bool
get() Returns the model whose primary column corresponds to the value $cod static|bool
newCode() Returns the following code for the reported field or the primary key of the model. int
primaryDescription() Descriptive identifier for humans of the data record string
url() Returns the url where to see / modify the data. string
getOrderBy() Convert an array of filters order by in string. string
getRecord() Read the record whose primary column corresponds to the value $cod or the first that meets the indicated condition. array
addExtension() Adds an extension to this model. mixed
pipe() Executes all $name methods added from the extensions. mixed
primaryColumn() Returns the name of the column that is the model's primary key. string
tableName() Returns the name of the table that uses this model. string
changePrimaryColumnValue() Change the value of the primary column in the model and the database. bool
loadFromData() Assign the values of the $data array to the model properties. mixed
primaryColumnValue() Returns the current value of the main column of the model. mixed
toArray() Returns an array with the model fields values. array
checkTable() Checks and updates the structure of the table if necessary. bool
getBoolValueForField() Returns the boolean value for the field. bool|null
getFloatValueForField() Returns the float value for the field. float|null
getIntergerValueForField() Returns the integer value by controlling special cases for the PK and FK. int|null
toolBox() ToolBox

Properties

$finoferta

Date on which the validity of the estimation ends.

public string $finoferta

$fields

List of fields in the table.

protected static array $fields = []

$codagente

Agent who created this document. Agente model.

public string $codagente

$codcliente

Customer of this document.

public string $codcliente

$codtrans

Shipping code for the shipment.

public string $codtrans

$idcontactoenv

ID of contact for shippment.

public int $idcontactoenv

$idcontactofact

ID of contact for invoice.

public int $idcontactofact

$numero2

Optional number available to the user.

public string $numero2

$totalcomision

% commission of the agent.

public float|int $totalcomision

$codalmacen

Warehouse in which the merchandise enters.

public string $codalmacen

$femail

Date on which the document was sent by email.

public string $femail

$irpf

Default retention for this document. Each line can have a different retention.

public float|int $irpf

$neto

Sum of the pvptotal of lines. Total of the document before taxes.

public float|int $neto

$netosindto

Sum of the pvptotal of lines. Total of the document before taxes and global discounts.

public float|int $netosindto

$numero

Number of the document. Unique within the series.

public string $numero

$totaleuros

Total expressed in euros, if it were not the currency of the document.

public float|int $totaleuros
totaleuros = total / tasaconv It is not necessary to fill it, when doing save() the value is calculated.

$totalirpf

Total sum of the IRPF withholdings of the lines.

public float|int $totalirpf

$totalrecargo

Total sum of the equivalence surcharge of the lines.

public float|int $totalrecargo

$totalsuplidos

Total sum of supplied lines.

public float|int $totalsuplidos

$ejercicios

All exercises.

private static \FacturaScripts\Dinamic\Model\Ejercicio[] $ejercicios

$checkedTables

List of already tested tables.

private static array $checkedTables = []

$dataBase

It provides direct access to the database.

protected static DataBase $dataBase

Methods

clear()

Reset the values of all model properties.

public clear( ) : mixed
Return values
mixed

getLines()

Returns the lines associated with the estimation.

public getLines( ) : \FacturaScripts\Dinamic\Model\LineaPresupuestoCliente[]
Return values
\FacturaScripts\Dinamic\Model\LineaPresupuestoCliente[]

getNewLine()

Returns a new line for this document.

public getNewLine( [ $data : array = [] ] [, $exclude : array = ['actualizastock', 'idlinea', 'idpresupuesto', 'servido'] ] ) : LineaPresupuestoCliente
Parameters
$data : array = []
$exclude : array = ['actualizastock', 'idlinea', 'idpresupuesto', 'servido']
Return values
LineaPresupuestoCliente

primaryColumn()

Returns the name of the column that is the model's primary key.

public static primaryColumn( ) : string
Return values
string

tableName()

Returns the name of the table that uses this model.

public static tableName( ) : string
Return values
string

test()

Returns True if there is no errors on properties values.

public test( ) : bool
Return values
bool

getModelFields()

Returns the list of fields in the table.

public abstract getModelFields( ) : array
Return values
array

modelClassName()

Returns the name of the class of the model.

public abstract modelClassName( ) : string
Return values
string

modelName()

Returns the name of the model.

protected abstract modelName( ) : string
Return values
string

loadModelFields()

Loads table fields if is necessary.

protected abstract loadModelFields( &$dataBase : DataBase , $tableName : string ) : mixed
Parameters
$dataBase : DataBase
$tableName : string
Return values
mixed

clear()

Reset the values of all model properties.

public clear( ) : mixed
Return values
mixed

delete()

Remove the model data from the database.

public delete( ) : bool
Return values
bool

getNewProductLine()

Returns a new line for this business document completed with the product data.

public abstract getNewProductLine( $reference : mixed ) : mixed
Parameters
$reference : mixed
Return values
mixed

getSubject()

Returns the subject of this document.

public abstract getSubject( ) : mixed
Return values
mixed

install()

This function is called when creating the model table. Returns the SQL that will be executed after the creation of the table. Useful to insert values default.

public install( ) : string
Return values
string

save()

Stores the model data in the database.

public save( ) : bool
Return values
bool

setAuthor()

Sets the author for this document.

public abstract setAuthor( $author : mixed ) : mixed
Parameters
$author : mixed
Return values
mixed

setSubject()

Sets subject for this document.

public abstract setSubject( $subject : mixed ) : mixed
Parameters
$subject : mixed
Return values
mixed

subjectColumn()

Returns the name of the column for subject.

public abstract subjectColumn( ) : mixed
Return values
mixed

test()

Returns true if there are no errors in the values of the model properties.

public test( ) : bool

It runs inside the save method.

Return values
bool

updateSubject()

Updates subjects data in this document.

public abstract updateSubject( ) : mixed
Return values
mixed

onChange()

This methos is called before save (update) when some field has changed.

protected onChange( $field : string ) : bool
Parameters
$field : string
Return values
bool

onChangeAgent()

protected onChangeAgent( ) : bool
Return values
bool

setPreviousData()

Saves previous values.

protected setPreviousData( [ $fields : array = [] ] ) : mixed
Parameters
$fields : array = []
Return values
mixed

childrenDocuments()

Returns all children documents of this one.

public childrenDocuments( ) : \FacturaScripts\Core\Model\Base\TransformerDocument[]
Return values
\FacturaScripts\Core\Model\Base\TransformerDocument[]

getAvaliableStatus()

Returns all avaliable status for this type of document.

public getAvaliableStatus( ) : \FacturaScripts\Dinamic\Model\EstadoDocumento[]
Return values
\FacturaScripts\Dinamic\Model\EstadoDocumento[]

parentDocuments()

Returns all parent document of this one.

public parentDocuments( ) : \FacturaScripts\Core\Model\Base\TransformerDocument[]
Return values
\FacturaScripts\Core\Model\Base\TransformerDocument[]

setDocumentGeneration()

public setDocumentGeneration( $value : bool ) : mixed
Parameters
$value : bool
Return values
mixed

getLines()

Returns the lines associated with the document.

public abstract getLines( ) : mixed
Return values
mixed

getNewLine()

Returns a new line for this business document.

public abstract getNewLine( [ $data : array = [] ] [, $exclude : array = [] ] ) : mixed
Parameters
$data : array = []
$exclude : array = []
Return values
mixed

getEUDiscount()

Returns the Equivalent Unified Discount.

public getEUDiscount( ) : float
Return values
float

primaryDescriptionColumn()

Returns the name of the column that describes the model, such as name, description.

public primaryDescriptionColumn( ) : string

..

Return values
string

setDate()

Assign the date and find an accounting exercise.

public setDate( $date : string , $hour : string ) : bool
Parameters
$date : string
$hour : string
Return values
bool

subjectColumnValue()

public subjectColumnValue( ) : string
Return values
string

setWarehouse()

Sets warehouse and company for this document.

protected setWarehouse( $codalmacen : string ) : bool
Parameters
$codalmacen : string
Return values
bool

setCurrency()

public setCurrency( $coddivisa : string [, $purchase : bool = false ] ) : mixed
Parameters
$coddivisa : string
$purchase : bool = false
Return values
mixed

__construct()

ModelClass constructor.

public __construct( [ $data : array = [] ] ) : mixed
Parameters
$data : array = []
Return values
mixed

loadFromCode()

Fill the class with the registry values whose primary column corresponds to the value $cod, or according to the condition where indicated, if value is not reported in $cod.

public loadFromCode( $code : string [, $where : array = [] ] [, $orderby : array = [] ] ) : bool

Initializes the values of the class if there is no record that meet the above conditions. Returns True if the record exists and False otherwise.

Parameters
$code : string
$where : array = []
$orderby : array = []
Return values
bool

onDelete()

This method is called after a record is removed from the database.

protected onDelete( ) : mixed
Return values
mixed

onInsert()

This method is called after a new record is saved on the database (saveInsert).

protected onInsert( ) : mixed
Return values
mixed

onUpdate()

This method is called after a record is updated on the database (saveUpdate).

protected onUpdate( ) : mixed
Return values
mixed

saveInsert()

Insert the model data in the database.

protected saveInsert( [ $values : array = [] ] ) : bool
Parameters
$values : array = []
Return values
bool

saveUpdate()

Update the model data in the database.

protected saveUpdate( [ $values : array = [] ] ) : bool
Parameters
$values : array = []
Return values
bool

all()

Returns all models that correspond to the selected filters.

public all( [ $where : array = [] ] [, $order : array = [] ] , $offset : int [, $limit : int = 50 ] ) : static[]
Parameters
$where : array = []

filters to apply to model records.

$order : array = []

fields to use in the sorting. For example ['code' => 'ASC']

$offset : int
$limit : int = 50
Return values
static[]

codeModelAll()

Allows to use this model as source in CodeModel special model.

public codeModelAll( [ $fieldCode : string = '' ] ) : \FacturaScripts\Dinamic\Model\CodeModel[]
Parameters
$fieldCode : string = ''
Return values
\FacturaScripts\Dinamic\Model\CodeModel[]

codeModelSearch()

Allows to use this model as source in CodeModel special model.

public codeModelSearch( $query : string [, $fieldCode : string = '' ] [, $where : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[] = [] ] ) : \FacturaScripts\Dinamic\Model\CodeModel[]
Parameters
$query : string
$fieldCode : string = ''
$where : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[] = []
Return values
\FacturaScripts\Dinamic\Model\CodeModel[]

count()

Returns the number of records in the model that meet the condition.

public count( [ $where : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[] = [] ] ) : int
Parameters
$where : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[] = []

filters to apply to model records.

Return values
int

exists()

Returns true if the model data is stored in the database.

public exists( ) : bool
Return values
bool

get()

Returns the model whose primary column corresponds to the value $cod

public get( $code : string ) : static|bool
Parameters
$code : string
Return values
static|bool

newCode()

Returns the following code for the reported field or the primary key of the model.

public newCode( [ $field : string = '' ] [, $where : array = [] ] ) : int
Parameters
$field : string = ''
$where : array = []
Return values
int

primaryDescription()

Descriptive identifier for humans of the data record

public primaryDescription( ) : string
Return values
string

url()

Returns the url where to see / modify the data.

public url( [ $type : string = 'auto' ] [, $list : string = 'List' ] ) : string
Parameters
$type : string = 'auto'
$list : string = 'List'
Return values
string

getOrderBy()

Convert an array of filters order by in string.

private getOrderBy( $order : array ) : string
Parameters
$order : array
Return values
string

getRecord()

Read the record whose primary column corresponds to the value $cod or the first that meets the indicated condition.

private getRecord( $code : string [, $where : array = [] ] [, $orderby : array = [] ] ) : array
Parameters
$code : string
$where : array = []
$orderby : array = []
Return values
array

addExtension()

Adds an extension to this model.

public abstract static addExtension( $extension : mixed ) : mixed
Parameters
$extension : mixed
Return values
mixed

pipe()

Executes all $name methods added from the extensions.

public abstract pipe( $name : string , ...$arguments : array ) : mixed
Parameters
$name : string
$arguments : array
Return values
mixed

primaryColumn()

Returns the name of the column that is the model's primary key.

public abstract static primaryColumn( ) : string
Return values
string

tableName()

Returns the name of the table that uses this model.

public abstract static tableName( ) : string
Return values
string

changePrimaryColumnValue()

Change the value of the primary column in the model and the database.

public changePrimaryColumnValue( $newValue : mixed ) : bool
Parameters
$newValue : mixed
Return values
bool

loadFromData()

Assign the values of the $data array to the model properties.

public loadFromData( [ $data : array = [] ] [, $exclude : array = [] ] ) : mixed
Parameters
$data : array = []
$exclude : array = []
Return values
mixed

primaryColumnValue()

Returns the current value of the main column of the model.

public primaryColumnValue( ) : mixed
Return values
mixed

toArray()

Returns an array with the model fields values.

public toArray( ) : array
Return values
array

checkTable()

Checks and updates the structure of the table if necessary.

private checkTable( ) : bool
Return values
bool

getBoolValueForField()

Returns the boolean value for the field.

private getBoolValueForField( $field : array , $value : string ) : bool|null
Parameters
$field : array
$value : string
Return values
bool|null

getFloatValueForField()

Returns the float value for the field.

private getFloatValueForField( $field : array , $value : string ) : float|null
Parameters
$field : array
$value : string
Return values
float|null

getIntergerValueForField()

Returns the integer value by controlling special cases for the PK and FK.

private getIntergerValueForField( $field : array , $value : string ) : int|null
Parameters
$field : array
$value : string
Return values
int|null

Search results