/** * @return Stage */ public function frontendPayment() { $Stage = new Stage(); $Stage->setTitle('Zahlungen'); $Stage->setDescription('Importierte'); $paymentList = Balance::useService()->entityPaymentAll(); if ($paymentList) { array_walk($paymentList, function (TblPayment &$tblPayment) { $tblInvoice = $tblPayment->getTblBalance()->getServiceBillingInvoice(); if ($tblInvoice) { $tblPayment->InvoiceNumber = $tblInvoice->getNumber(); $tblPayment->InvoiceDate = $tblInvoice->getInvoiceDate(); $tblPayment->DebtorFullName = $tblInvoice->getDebtorFullName(); $tblPayment->DebtorNumber = $tblInvoice->getDebtorNumber(); $tblPayment->ValueString = $tblPayment->getValueString(); } }); } $Stage->setContent(new TableData($paymentList, null, array('InvoiceNumber' => 'Rechnungs-Nr.', 'InvoiceDate' => 'Rechnungsdatum', 'Date' => 'Zahlungseingangsdatum', 'DebtorFullName' => 'Debitor', 'DebtorNumber' => 'Debitorennummer', 'ValueString' => 'Betrag'))); return $Stage; }
/** * @param $tblItemId * @param $tblAccountId * * @return Stage */ public function frontendItemAccountAdd($tblItemId, $tblAccountId) { $Stage = new Stage(); $Stage->setTitle('Artikel'); $Stage->setDescription('FIBU-Konto Hinzufügen'); $tblItem = Item::useService()->entityItemById($tblItemId); $tblAccount = Account::useService()->entityAccountById($tblAccountId); if (!empty($tblItemId) && !empty($tblAccountId)) { $Stage->setContent(Item::useService()->executeAddItemAccount($tblItem, $tblAccount)); } return $Stage; }
/** * @param $Id * * @return Stage */ public function frontendInvoiceItemRemove($Id) { $Stage = new Stage(); $Stage->setTitle('Rechnung'); $Stage->setDescription('Artikel Entfernen'); $tblInvoiceItem = Invoice::useService()->entityInvoiceItemById($Id); $Stage->setContent(Invoice::useService()->executeRemoveInvoiceItem($tblInvoiceItem)); return $Stage; }
/** * @param $Id * * @return Stage */ public function frontendPictureDelete($Id) { $Stage = new Stage(); $Stage->setTitle('Bild'); $Stage->setDescription('entfernen'); $tblTestPicture = Test::useService()->getTestPictureById($Id); $Stage->setContent(Test::useService()->deleteTblTestPicture($tblTestPicture)); return $Stage; }
/** * @param $Id * @param $Date * @param $Data * @param $Save * * @return Stage */ public function frontendBasketDebtorSelect($Id, $Date, $Data, $Save) { $Stage = new Stage(); $Stage->setTitle('Warenkorb'); $Stage->setDescription('Debitoren zuordnen'); $Stage->setMessage('Es konnten im Warenkorb nicht zu alle Personen bei allen Leistungen eindeutig ein Debitor ermittelt werden. Es werden alle nicht automatisch zuordenbaren Kombinationen von Personen und Leistungen angezeigt. Bitte weisen Sie die entsprechenden Debitoren zu'); $Global = $this->getGlobal(); if (!isset($Global->POST['Save'])) { $Global->POST['Save'] = 1; } $Global->savePost(); $tblBasket = Basket::useService()->entityBasketById($Id); $tblBasketCommodityList = Basket::useService()->entityBasketCommodityAllByBasket($tblBasket); /**@var TblBasketCommodity $tblBasketCommodity */ array_walk($tblBasketCommodityList, function (TblBasketCommodity $tblBasketCommodity) { $tblBasketCommodityDebtorList = Basket::useService()->entityBasketCommodityDebtorAllByBasketCommodity($tblBasketCommodity); $tblBasketCommodity->Name = $tblBasketCommodity->getServiceManagementPerson()->getFullName(); $tblBasketCommodity->Commodity = $tblBasketCommodity->getServiceBillingCommodity()->getName(); $tblBasketCommodity->Select = new SelectBox('Data[' . $tblBasketCommodity->getId() . ']', '', array('{{ ServiceBillingDebtor.DebtorNumber }}' . ' - {{ ServiceBillingDebtor.ServiceManagementPerson.FullName }}' . '{% if( ServiceBillingDebtor.Description is not empty) %} - {{ ServiceBillingDebtor.Description }}{% endif %}' => $tblBasketCommodityDebtorList)); }); $Stage->setContent(new Layout(array(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(new Panel('Warenkorb - Nummer', $tblBasket->getId(), Panel::PANEL_TYPE_SUCCESS), 3), new LayoutColumn(new Panel('Warenkorb - Name', $tblBasket->getName(), Panel::PANEL_TYPE_SUCCESS), 6), new LayoutColumn(new Panel('Erstellt am', $tblBasket->getCreateDate(), Panel::PANEL_TYPE_SUCCESS), 3))))), new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(Basket::useService()->executeCheckDebtors(new Form(new FormGroup(array(new FormRow(new FormColumn(new TableData($tblBasketCommodityList, null, array('Name' => 'Person', 'Commodity' => 'Leistung', 'Select' => 'Debitorennummer - Debitor - Beschreibung'), false))), new FormRow(array(new FormColumn(new SelectBox('Save', '', array(1 => 'Nicht speichern', 2 => 'Als Standard speichern')), 3), new FormColumn(new \SPHERE\Common\Frontend\Form\Repository\Button\Primary('Debitoren zuordnen (prüfen)'), 3)))))), $Id, $Date, $Data, $Save))))))))); return $Stage; }
/** * @param $Account * * @return Stage */ public function frontendAccountCreate($Account) { $Stage = new Stage(); $Stage->setTitle('FIBU-Konto'); $Stage->setDescription('Hinzufügen'); $Stage->addButton(new Primary('Zurück', '/Billing/Accounting/Account', new ChevronLeft())); $tblAccountKey = Account::useService()->entityKeyValueAll(); $tblAccountType = Account::useService()->entityTypeValueAll(); $Stage->setContent(Account::useService()->executeAddAccount(new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new TextField('Account[Number]', 'Kennziffer', 'Kennziffer', new BarCode()), 6), new FormColumn(new TextField('Account[Description]', 'Beschreibung', 'Beschreibung', new Conversation()), 6))), new FormRow(array(new FormColumn(new SelectBox('Account[Key]', 'Mehrwertsteuer', array('Value' => $tblAccountKey)), 6), new FormColumn(new SelectBox('Account[Type]', 'Typ', array('Name' => $tblAccountType)), 6)))))), new \SPHERE\Common\Frontend\Form\Repository\Button\Primary('Hinzufügen')), $Account)); return $Stage; }
/** * @param $Id * @param $Item * * @return Stage */ public function frontendItemEdit($Id, $Item) { $Stage = new Stage(); $Stage->setTitle('Artikel'); $Stage->setDescription('Bearbeiten'); $Stage->setMessage('<b>Hinweis:</b> <br> Ist ein Bildungsgang unter der <i>Bedingung Bildungsgang</i> ausgewählt, wird der Artikel nur für Personen (Schüler) berechnet welche diesem Bildungsgang angehören. <br> Ist eine Kind-Reihenfolge unter der <i>Bedingung Kind-Reihenfolge</i> ausgewählt, wird der Artikel nur für Personen (Schüler) berechnet welche dieser Kind-Reihenfolge entsprechen. <br> Beide Bedingungen können einzeln ausgewählt werden, bei der Wahl beider Bedingungen werden diese <b>Und</b> verknüpft. '); $Stage->addButton(new Primary('Zurück', '/Billing/Inventory//Item', new ChevronLeft())); // $tblCourseAll = Management::serviceCourse()->entityCourseAll(); //todo // array_unshift( $tblCourseAll, new TblCourse( '' ) ); // $tblChildRankAll = Management::serviceStudent()->entityChildRankAll(); // array_unshift( $tblChildRankAll, new TblChildRank( '' ) ); if (empty($Id)) { $Stage->setContent(new Warning('Die Daten konnten nicht abgerufen werden')); } else { $tblItem = Item::useService()->entityItemById($Id); if (empty($tblItem)) { $Stage->setContent(new Warning('Der Artikel konnte nicht abgerufen werden')); } else { $Global = $this->getGlobal(); if (!isset($Global->POST['Item'])) { $Global->POST['Item']['Name'] = $tblItem->getName(); $Global->POST['Item']['Description'] = $tblItem->getDescription(); $Global->POST['Item']['Price'] = str_replace('.', ',', $tblItem->getPrice()); $Global->POST['Item']['CostUnit'] = $tblItem->getCostUnit(); // if ( $tblItem->getServiceManagementCourse() ) { // $Global->POST['Item']['Course'] = $tblItem->getServiceManagementCourse()->getId(); // } // if ( $tblItem->getServiceManagementStudentChildRank() ) { // $Global->POST['Item']['ChildRank'] = $tblItem->getServiceManagementStudentChildRank()->getId(); // } $Global->savePost(); } $Stage->setContent(Item::useService()->executeEditItem(new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new TextField('Item[Name]', 'Name', 'Name', new Conversation()), 6), new FormColumn(new TextField('Item[Price]', 'Preis in €', 'Preis', new MoneyEuro()), 6))), new FormRow(array(new FormColumn(new TextField('Item[CostUnit]', 'Kostenstelle', 'Kostenstelle', new Money()), 6))), new FormRow(array(new FormColumn(new TextField('Item[Description]', 'Beschreibung', 'Beschreibung', new Conversation()), 12)))))), new \SPHERE\Common\Frontend\Form\Repository\Button\Primary('Änderungen speichern')), $tblItem, $Item)); } } return $Stage; }
/** * @param $Id * @param $Reference * * @return Stage */ public function frontendBankingDebtorReference($Id, $Reference) { $Stage = new Stage(); $Stage->setTitle('Referenzen'); $Stage->setDescription('bearbeiten'); $Stage->setMessage('Die Referenzen sind eine vom Auftraggeber der Zahlung vergebene Kennzeichnung.<br /> Hier kann z.B. eine Vertrags- oder Rechnungsnummer eingetragen werden.<br /> Referenzen müssen eindeutig sein!'); $Stage->addButton(new Primary('Zurück', '/Billing/Accounting/Banking/Debtor/View', new ChevronLeft(), array('Id' => $Id))); $tblDebtor = Banking::useService()->entityDebtorById($Id); $Person = false; //Todo // $Person = Management::servicePerson()->entityPersonById( $tblDebtor->getServiceManagementPerson() ); //Todo if (!empty($Person)) { $Name = $Person->getFullName(); $tblDebtorList = Banking::useService()->entityDebtorAllByPerson($Person); } else { $Name = 'Person nicht vorhanden'; $tblDebtorList = false; } $DebtorNumber = $tblDebtor->getDebtorNumber(); $ReferenceEntityList = Banking::useService()->entityReferenceByDebtor($tblDebtor); $DebtorArray = array(); $DebtorArray[] = $tblDebtor; if ($tblDebtorList && $DebtorArray) { $tblDebtorList = array_udiff($tblDebtorList, $DebtorArray, function (TblDebtor $invoiceA, TblDebtor $invoiceB) { return $invoiceA->getId() - $invoiceB->getId(); }); /** @var TblDebtor $DebtorOne */ foreach ($tblDebtorList as $DebtorOne) { $DebtorOne->IBANfrontend = $DebtorOne->getIBAN(); } } if ($ReferenceEntityList) { /**@var TblReference $ReferenceEntity */ foreach ($ReferenceEntityList as $ReferenceEntity) { $ReferenceReal = Commodity::useService()->entityCommodityById($ReferenceEntity->getServiceBillingCommodity()); if ($ReferenceReal !== false) { $ReferenceEntity->Commodity = $ReferenceReal->getName(); } else { $ReferenceEntity->Commodity = 'Leistung nicht vorhanden'; } // Todo // $tblComparList = Banking::useService()->entityDebtorCommodityAllByDebtorAndCommodity( $ReferenceEntity->getServiceBillingBanking(), $ReferenceEntity->getServiceBillingCommodity() ); // // if ( $tblComparList ) { // $ReferenceEntity->Usage = new Success( new Enable().' In Verwendung' ); // } else { // $ReferenceEntity->Usage = ''; // } $ReferenceEntity->Option = (new Danger('Deaktivieren', '/Billing/Accounting/Banking/Reference/Deactivate', new Remove(), array('Id' => $ReferenceEntity->getId())))->__toString(); } } $tblCommoditySelectBox = Commodity::useService()->entityCommodityAll(); $tblReferenceList = Banking::useService()->entityReferenceByDebtor($tblDebtor); $tblCommodityUsed = array(); /**@var TblReference $tblReference */ foreach ($tblReferenceList as $tblReference) { $tblCommodityUsedReal = Commodity::useService()->entityCommodityById($tblReference->getServiceBillingCommodity()); if ($tblCommodityUsedReal !== false) { $tblCommodityUsed[] = $tblCommodityUsedReal; } } if ($tblCommoditySelectBox && $tblCommodityUsed) { $tblCommoditySelectBox = array_udiff($tblCommoditySelectBox, $tblCommodityUsed, function (TblCommodity $invoiceA, TblCommodity $invoiceB) { return $invoiceA->getId() - $invoiceB->getId(); }); } $Stage->setContent(new Layout(array(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new Panel(new Person() . ' Person', $Name, Panel::PANEL_TYPE_SUCCESS)), 6), new LayoutColumn(array(new Panel(new BarCode() . ' Debitornummer', $DebtorNumber, Panel::PANEL_TYPE_SUCCESS)), 6))))), !empty($tblCommoditySelectBox) ? new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(Banking::useService()->executeAddReference(new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new TextField('Reference[Reference]', 'Referenz', 'Mandatsreferenz', new BarCode()), 4), new FormColumn(new DatePicker('Reference[ReferenceDate]', 'Datum', 'Erstellungsdatum', new Time()), 4), new FormColumn(new SelectBox('Reference[Commodity]', 'Leistung', array('Name' => $tblCommoditySelectBox), new Time()), 4)))))), new \SPHERE\Common\Frontend\Form\Repository\Button\Primary('Hinzufügen')), $tblDebtor, $Reference, $Id)))))), new Title('Referenz hinzufügen')) : null, !empty($ReferenceEntityList) ? new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new TableData($ReferenceEntityList, null, array('Reference' => 'Mandatsreferenz', 'ReferenceDate' => 'Datum', 'Commodity' => 'Leistung', 'Usage' => 'Benutzung', 'Option' => 'Deaktivieren'))))))), new Title('Mandatsreferenz')) : null, count($tblDebtorList) >= 1 ? new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(array(new TableData($tblDebtorList, null, array('DebtorNumber' => 'Debitorennummer', 'BankName' => 'Name der Bank', 'IBANfrontend' => 'IBAN', 'BIC' => 'BIC', 'Owner' => 'Inhaber'))))))))))), 12)))), new Title('Weitere Debitorennummer(n)')) : null))); return $Stage; }