255], ]; } /* * Relations */ public function getProducer() { return $this->hasOne(Producer::className(), ['id' => 'id_producer']); } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'id_producer' => 'Producteur', 'date' => 'Date', 'reference' => 'Reference', 'wording' => 'Libellé', 'text' => 'Texte', 'amount_without_tax' => 'Montant Ht', 'paid' => 'Paye', 'date_payment' => 'Date de paiement', 'means_payment' => 'Méthode payment', 'turnover' => 'CA' ]; } /** * Retourne les options de base nécessaires à la fonction de recherche. * * @return array */ public static function defaultOptionsSearch() { return [ 'with' => [], 'join_with' => [], 'orderby' => self::tableName().'.date ASc', 'attribute_id_producer' => self::tableName().'.id_producer' ] ; } /** * Retourne la dernière facture émise. * * @return Facture */ public static function getLastInvoice() { return self::searchOne([],['orderby'=>'reference DESC']) ; } }