_("Fournisseurs"), "C" => _("Clients")];; } /** * @brief return the constant array Limit * @return array */ static function getConstantLimit() :array { return ['P' => _("Prochaines factures"), "R" => _("facture en retard"),'T'=>_("Aujourd'hui")]; } /** * @brief let choice what to display * @return void */ function input_parameter() { $tiers = new \ISelect('tiers'); $aTiers=Invoice::getConstantTiers(); $tiers->value=[]; foreach ($aTiers as $key=>$value) { $tiers->value[]=['value'=>$key,'label'=>$value]; } $time_limit = new \ISelect('time_limit'); $aLimit=Invoice::getConstantLimit(); $time_limit->value=[]; foreach ($aLimit as $key=>$value) { $time_limit->value[]=['value'=>$key,'label'=>$value]; } $input = _("Factures ") . $tiers->input() . " " . _("échéance") . " " . $time_limit->input(); $this->make_form($input); } /** * @brief display the parameter * @return void */ function display_parameter() { $aParam = $this->get_parameter(); $aTiers =Invoice::getConstantTiers(); $aLimit = Invoice::getConstantLimit(); echo ''.$aTiers[$aParam['tiers']] . " " . $aLimit[$aParam["time_limit"]].''; } /** * @brief display the widget * @return void * @throws \Exception */ function display() { $this->open_div(); $aParam = $this->get_parameter(); $aTiers = Invoice::getConstantTiers(); $aLimit = Invoice::getConstantLimit(); $title = $aTiers[$aParam['tiers']] . " " . $aLimit[$aParam["time_limit"]]; $this->title($title); $acc_ledger = new \Acc_Ledger($this->db, 0); $ledger_type = 'ACH'; if ($aParam['tiers'] == 'C') { $ledger_type = 'VEN'; } switch ($aParam['time_limit']) { case 'P': $array = $acc_ledger->get_operation_date(date('d.m.Y'), $ledger_type, '>'); break; case 'R': $array = $acc_ledger->get_operation_date(date('d.m.Y'), $ledger_type, '<'); break; case 'T': $array = $acc_ledger->get_operation_date(date('d.m.Y'), $ledger_type, '='); break; } include "invoice-display.php"; $this->close_div(); } }