Kundenhoheit

This commit is contained in:
Kevin Adametz 2020-05-06 15:43:53 +02:00
parent d8b5206031
commit dc63fa9fb2
52 changed files with 2436 additions and 557 deletions

140
.idea/workspace.xml generated
View file

@ -2,75 +2,57 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/User/ShopSalesController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/User/TeamController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/lang/de/navigation.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/sales/customer_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/sales/user_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/shop/sales/orders.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/team/members.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.env" beforeDir="false" afterPath="$PROJECT_DIR$/.env" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/deployment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/deployment.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/CustomerController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/ModalController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Repositories/CustomerRepository.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Services/CustomerPriority.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Services/Payment.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Services/Shop.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/customer/_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/customer/detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/customer/index.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/modal/is_like_member.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/modal/member.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/sales/_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/sys/admin/customers.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/shop/sales/order_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/AdminUserController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/AdminUserController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Api/PayoneController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Api/PayoneController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/CronController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/CronController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/DataTableController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/DataTableController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/LeadController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/LeadController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/ProductController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/ProductController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/SalesController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/SalesController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/RegisterController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/RegisterController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/WizardController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/WizardController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Sys/AdminToolsController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Sys/AdminToolsController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/ShopSalesController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/ShopSalesController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/TeamController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/TeamController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Mail/MailCheckout.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Mail/MailCheckout.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/Product.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Product.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Mail/MailInfo.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Mail/MailInfo.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingPayment.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingPayment.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingUser.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingUser.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/UserAccount.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/UserAccount.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/UserShop.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/UserShop.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Repositories/ContractPDFRepository.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Repositories/ContractPDFRepository.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/HTMLHelper.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/HTMLHelper.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/UserService.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/UserService.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/User.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/User.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/helpers.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/helpers.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/app.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/app.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/mivita.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/mivita.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2014_10_12_000000_create_users_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2014_10_12_000000_create_users_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_29_170559_create_user_accounts_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_29_170559_create_user_accounts_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/archiv.tar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/css/application.css" beforeDir="false" afterPath="$PROJECT_DIR$/public/css/application.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de.json" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/email.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/email.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/lead.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/lead.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/register.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/register.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/validation.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/validation.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/lead/edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/lead/edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/js/custom.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/custom.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form_edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/lead/m_register_data.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/lead/m_register_data.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/product/index.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/product/index.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/customer_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/customer_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/customers.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/customers.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/_auth.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/_auth.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/auth.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/auth.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/user_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/user_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/users.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/users.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/checkout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/checkout.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/checkout_status.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/checkout_status.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/contact.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/contact.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/custom.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/custom.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/info.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/info.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/includes/layout-sidenav.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/includes/layout-sidenav.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/components/user_shop_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/components/user_shop_edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/components/user_shop_register.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/components/user_shop_register.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/membership/index.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/membership/index.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/shop.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/shop.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/user_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/user_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/user_new_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/user_new_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/wizard/_payment.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/wizard/_payment.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/wizard/create.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/wizard/create.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/wizard/register.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/wizard/register.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/wizard/register_payment.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/wizard/register_payment.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/kontakt.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/kontakt.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/produkte-item.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/produkte-item.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/produkte-show.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/produkte-show.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/registrierung.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/registrierung.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/registrierung_finish.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/registrierung_finish.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/user/layouts/includes/footer.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/user/layouts/includes/footer.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/user/start.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/user/start.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/sys/admin/shopping-orders.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/sys/admin/shopping-orders.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/shop/sales/orders.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/shop/sales/orders.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -286,7 +268,7 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/views/user/shop/sales" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/app/Services" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" />
@ -294,11 +276,11 @@
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/user/shop/sales" />
<recent name="$PROJECT_DIR$/resources/views/admin/sales" />
<recent name="$PROJECT_DIR$/resources/views/user/team" />
<recent name="$PROJECT_DIR$/app/Http/Controllers/User" />
<recent name="$PROJECT_DIR$/resources/lang/de" />
<recent name="$PROJECT_DIR$/app/Services" />
<recent name="$PROJECT_DIR$/resources/views/admin/modal" />
<recent name="$PROJECT_DIR$/resources/views/sys/admin" />
<recent name="$PROJECT_DIR$/resources/views/admin/customer" />
<recent name="$PROJECT_DIR$/app/Repositories" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/public/vendor/libs/dropzone" />
@ -470,6 +452,23 @@
<workItem from="1588146697363" duration="6072000" />
<workItem from="1588153881658" duration="6306000" />
<workItem from="1588167994966" duration="10515000" />
<workItem from="1588231371983" duration="3000" />
<workItem from="1588233321074" duration="6060000" />
<workItem from="1588244040497" duration="547000" />
<workItem from="1588244809449" duration="10424000" />
<workItem from="1588267918069" duration="1856000" />
<workItem from="1588410019835" duration="194000" />
<workItem from="1588411442653" duration="11498000" />
<workItem from="1588427157422" duration="5582000" />
<workItem from="1588577728345" duration="8457000" />
<workItem from="1588597117898" duration="3955000" />
<workItem from="1588604782047" duration="6478000" />
<workItem from="1588667412409" duration="3521000" />
<workItem from="1588753513112" duration="331000" />
<workItem from="1588754727146" duration="6339000" />
<workItem from="1588761249067" duration="27000" />
<workItem from="1588761617312" duration="1790000" />
<workItem from="1588771915210" duration="5000" />
</task>
<servers />
</component>
@ -514,10 +513,10 @@
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="968" y="472" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1581691507125" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1587109063136">
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1588762863647">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1584797806264" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588762863647" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585733837456" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587109063136" />
<state width="239" height="457" key="HiddenNamespacesPopup" timestamp="1583573337041">
@ -528,20 +527,21 @@
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1143" y="547" key="com.intellij.database.view.ui.DbObjectDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1583573350583" />
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1585748173200">
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1588577892504">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588577892504" />
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585748173200" />
<state x="805" y="444" width="1115" height="793" key="find.popup" timestamp="1588182686967">
<state x="805" y="444" width="1115" height="793" key="find.popup" timestamp="1588762308736">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="805" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588182686967" />
<state x="805" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588762308736" />
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585758694219" />
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587109016568" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup" timestamp="1588159426101">
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup" timestamp="1588673694658">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588159426101" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1588673694658" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585408665805" />
</component>
<component name="XDebuggerManager">
@ -552,6 +552,16 @@
<line>15</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/resources/views/web/templates/card.blade.php</url>
<line>135</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
<line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/resources/views/emails/checkout.blade.php</url>
<line>360</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>

View file

@ -8,6 +8,7 @@ use App\Mail\MailCheckout;
use App\Models\PaymentTransaction;
use App\Models\ShoppingOrder;
use App\Models\ShoppingPayment;
use App\Services\Shop;
use App\Services\Util;
use App\User;
use Illuminate\Support\Facades\Mail;
@ -129,10 +130,12 @@ class PayoneController extends Controller
}
if($data['txaction'] === 'appointed'){
$shopping_order->setUserHistoryValue(['status' => 7]);
Shop::userOrders();
}
if($data['txaction'] === 'paid'){
$shopping_order->setUserHistoryValue(['status' => 8]);
Shop::userOrders();
$shopping_order->paid = true;
$shopping_order->save();
@ -150,7 +153,6 @@ class PayoneController extends Controller
if($user->payment_account && $user->daysActiveAccount()>0){
$date = \Carbon::parse($user->payment_account)->modify('1 year');
}
foreach ($shopping_order_item->product->action as $do){
if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){
$user->payment_order_id = $shopping_order_item->product->id; //34
@ -183,9 +185,8 @@ class PayoneController extends Controller
}
}
}
$bcc = [];
$billing_email = $shopping_order->shopping_user->billing_email;
$user_shop_email = $shopping_order->user_shop->user->email;
if(!$billing_email){
if($data['mode'] === 'test'){
$billing_email = config('app.checkout_test_mail');
@ -194,17 +195,15 @@ class PayoneController extends Controller
}
}
if($data['mode'] === 'test'){
$checkout_mail = config('app.checkout_test_mail');
$bcc[] = config('app.checkout_test_mail');
}else{
$checkout_mail = config('app.checkout_mail');
$bcc[] = config('app.checkout_mail');
}
if($user_shop_email){
Mail::to($billing_email)->bcc([$user_shop_email, $checkout_mail])->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link, $data['mode']));
}else{
Mail::to($billing_email)->bcc($checkout_mail)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link, $data['mode']));
if(!$shopping_order->shopping_user->is_like && $shopping_order->shopping_user->member){
$bcc[] = $shopping_order->shopping_user->member->email;
}
Mail::to($billing_email)->bcc($bcc)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link, $data['mode']));
print("TSOK");
exit;
}

View file

@ -0,0 +1,135 @@
<?php
namespace App\Http\Controllers;
use App\Models\ShoppingUser;
use App\Repositories\CustomerRepository;
use App\Services\CustomerPriority;
use App\Services\HTMLHelper;
use Request;
class CustomerController extends Controller
{
protected $customerRepository;
public function __construct(CustomerRepository $customerRepository)
{
$this->middleware('admin');
$this->customerRepository = $customerRepository;
}
public function index()
{
if(Request::get('reset') === 'filter'){
set_user_attr('filter_member_id', null);
set_user_attr('filter_customer_member', null);
return redirect(route('admin_customers'));
}
$filter_members = ShoppingUser::join('users', 'member_id', '=', 'users.id')->groupBy('member_id')->join('user_accounts', 'account_id', '=', 'user_accounts.id')->select('users.id', 'users.email', 'user_accounts.first_name', 'user_accounts.last_name')->get(); //->pluck('email', 'id')->unique()->toArray();
$data = [
'filter_members' => $filter_members,
];
return view('admin.customer.index', $data);
}
public function edit($id)
{
if($id === "new"){
$shopping_user = new ShoppingUser();
$shopping_user->id = "new";
}else{
$shopping_user = ShoppingUser::findOrFail($id);
}
$data = [
'shopping_user' => $shopping_user,
'isAdmin' => true,
'isView' => 'customer',
];
return view('admin.customer.detail', $data);
}
public function store($id)
{
$data = Request::all();
$change_member_error = false;
if($data['action']==='shopping-user-change-member'){
if(!isset($data['change_member_key']) || $data['change_member_key'] !== config('mivita.edit_data_pass')){
$change_member_error = "Das Passwort ist falsch.";
}else{
//change
$shopping_user = ShoppingUser::findOrFail($data['id']);
CustomerPriority::newMemberForCustomer($shopping_user, $data['change_member_id'], $data['customer_set_member_for']);
\Session()->flash('alert-save', true);
return redirect(route('admin_customer_edit', [$shopping_user->id]));
}
}
$data = [
'change_member_error' => $change_member_error,
'shopping_user' => ShoppingUser::find($id),
'isAdmin' => true,
'isView' => 'customer',
];
return view('admin.customer.detail', $data);
}
public function getCustomers()
{
$query = ShoppingUser::select('shopping_users.*')->where('auth_user_id', '=', NULL);
set_user_attr('filter_member_id', Request::get('filter_member_id'));
if(Request::get('filter_member_id') != ""){
$query->where('member_id', '=', Request::get('filter_member_id'));
}
/* set_user_attr('filter_customer_member', Request::get('filter_customer_member'));
if(Request::get('filter_customer_member') != ""){
if(Request::get('filter_customer_member') === 'customers'){
$query->where('auth_user_id', '=', NULL);
}
if(Request::get('filter_customer_member') === 'members'){
$query->where('auth_user_id', '!=', NULL);
}
}*/
return \DataTables::eloquent($query)
->addColumn('id', function (ShoppingUser $ShoppingUser) {
return '<a href="' . route('admin_customer_edit', [$ShoppingUser->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far fa-edit"></span></a>';
})
->addColumn('billing_salutation', function (ShoppingUser $ShoppingUser) {
return HTMLHelper::getSalutationLang($ShoppingUser->billing_salutation);
})
->addColumn('billing_country_id', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->billing_country ? $ShoppingUser->billing_country->getLocated() : '';
})
->addColumn('isMember', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->auth_user_id ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('member_id', function (ShoppingUser $ShoppingUser) {
if($ShoppingUser->member_id){
return '<a href="'.route('admin_lead_edit', [$ShoppingUser->member_id]).'">'.$ShoppingUser->member->getFullName().'</a>';
}
if($ShoppingUser->is_like){
return '<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
data-id="'.$ShoppingUser->id.'"
data-action="shopping-user-is-like-member"
data-back="'.route('admin_customers').'"
data-modal="modal-xl"
data-route="'.route('modal_load').'"><span class="fa fa-edit"></span> Berater zuordnen</button>';
}
return '';
})
->addColumn('created_at', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->created_at->format('d.m.Y');
})
->orderColumn('id', 'id $1')
->orderColumn('billing_country_id', 'billing_country_id $1')
->orderColumn('billing_salutation', 'billing_salutation $1')
->orderColumn('created_at', 'created_at $1')
->orderColumn('isMember', 'auth_user_id $1')
->orderColumn('member_id', 'member_id $1')
->rawColumns(['id', 'isMember', 'member_id'])
->make(true);
}
}

View file

@ -15,7 +15,7 @@ class DataTableController extends Controller
public function getUsers()
{
$query = User::with('account')->where('users.deleted_at', '=', null);
$query = User::with('account')->select('users.*')->where('users.deleted_at', '=', null);
return \DataTables::eloquent($query)
->addColumn('first_name', function (User $user) {

View file

@ -81,8 +81,8 @@ class LeadController extends Controller
{
$m_data_load = false;
$m_data_error = false;
$data = Input::all();
if(!isset($data['edit_m_data_key']) && $data['edit_m_data_key'] !== config('mivita.edit_data_pass')){
$data = Request::all();
if(!isset($data['edit_m_data_key']) || $data['edit_m_data_key'] !== config('mivita.edit_data_pass')){
$m_data_error = "Das Passwort ist falsch.";
}else{
$m_data_load = true;
@ -340,7 +340,7 @@ class LeadController extends Controller
public function getLeads()
{
$query = User::with('account')->where('users.deleted_at', '=', null);
$query = User::with('account')->select('users.*')->where('users.deleted_at', '=', null);
return \DataTables::eloquent($query)
->addColumn('first_name', function (User $user) {

View file

@ -0,0 +1,63 @@
<?php
namespace App\Http\Controllers;
use App\Models\ShoppingOrder;
use App\Models\ShoppingUser;
use App\User;
use Request;
class ModalController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function load(){
$data = Request::all();
$ret = "";
$status = false;
if(Request::ajax()){
if($data['action'] === 'shopping-order-change-member'){
$value = ShoppingOrder::find($data['id']);
$route = route('admin_sales_customers_detail', [$value->id]);
$ret = view("admin.modal.member", compact('value', 'data', 'route'))->render();
}
if($data['action'] === 'shopping-user-change-member'){
$value = ShoppingUser::find($data['id']);
$route = route('admin_customer_edit', [$value->id]);
$ret = view("admin.modal.member", compact('value', 'data', 'route'))->render();
}
if($data['action'] === 'shopping-user-is-like-member'){
$current = ShoppingUser::find($data['id']); //current user form order
$possibles = [];
if($current->is_like){
$likes = $current->getNotice('like');
foreach ($likes as $like_id=>$number){
$possibles[] = ShoppingUser::find($like_id);
}
}
$ret = view("admin.modal.is_like_member", compact('current', 'possibles', 'data'))->render();
}
}
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
}
}
/* <button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
data-target="#modals-load-content"
data-id="{{ $value->id }}"
data-model="emailTemplate"
data-action="modal-email-template"
data-url=""
data-redirect="back"
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>*/

View file

@ -25,11 +25,10 @@ class ProductController extends Controller
public function index()
{
if(Request::get('show_active_products')){
\Auth::user()->setSetting(['show_active_products' => Request::get('show_active_products')]);
set_user_attr('show_active_products', Request::get('show_active_products'));
}
if(\Auth::user()->getSetting('show_active_products') === "true"){
if(get_user_attr('show_active_products') === "true"){
$values = Product::where('active', true)->orderBy('pos', 'DESC')->orderBy('id', 'DESC')->get();
}else{
$values = Product::orderBy('pos', 'DESC')->orderBy('id', 'DESC')->get();

View file

@ -2,61 +2,68 @@
namespace App\Http\Controllers;
use App\Models\Country;
use App\Models\ShoppingOrder;
use App\Models\ShoppingUser;
use App\Models\UserShop;
use App\Services\CustomerPriority;
use App\Services\Payment;
use App\User;
use Input;
use Request;
class SalesController extends Controller
{
public function __construct()
{
public function __construct(){
$this->middleware('admin');
}
public function users()
{
public function users(){
if(Request::get('reset') === 'filter'){
return redirect(route('admin_sales_users'));
}
$data = [
//'values' => ShoppingOrder::all(),
];
return view('admin.sales.users', $data);
}
public function usersDetail()
public function usersDetail($id)
{
$data = [
// 'values' => Country::all(),
'shopping_order' => ShoppingOrder::find($id),
'isAdmin' => true,
'isView' => 'sales_user',
];
return view('admin.sales.user_detail', $data);
}
public function usersStore($id)
{
die("keine funktion");
$data = [
'shopping_order' => ShoppingOrder::find($id),
'isAdmin' => true,
];
return view('admin.sales.user_detail', $data);
}
public function usersDatatable(){
$query = ShoppingOrder::with('shopping_user', 'user_shop')->where('shopping_orders.auth_user_id', '!=', NULL);
$query = ShoppingOrder::with('shopping_user', 'user_shop')->select('shopping_orders.*')->where('shopping_orders.auth_user_id', '!=', NULL);
return \DataTables::eloquent($query)
->addColumn('billing_firstname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_firstname : '';
})
->addColumn('billing_lastname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_lastname : '';
})
->addColumn('billing_email', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_email : '';
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('admin_sales_users_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->created_at->format("d.m.Y");
})
->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->mode === 'test'){
return '<span class="badge badge-pill badge-default">TEST - '.$ShoppingOrder->getFormattedTxaction().'</span>';
}
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getFormattedTxactionColor().'">'.$ShoppingOrder->getFormattedTxaction().'</span>';
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping();
@ -69,26 +76,8 @@ class SalesController extends Controller
})
->addColumn('auth_user_shop', function (ShoppingOrder $ShoppingOrder) {
$auth_user_shop = UserShop::whereUserId($ShoppingOrder->auth_user_id)->first();
return $auth_user_shop ? '<a href="'.$auth_user_shop->getSubdomain(false).'" target="_blank">'.$auth_user_shop->getSubdomain(false).'</span>' : '-';
})
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('admin_sales_users_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
/* ->addColumn('confirmed', function (User $user) {
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('active', function (User $user) {
return $user->active ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('agreement', function (User $user) {
return $user->agreement ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->orderColumn('confirmed', 'confirmed $1')
->orderColumn('active', 'active $1')
->orderColumn('agreement', 'agreement $1')
*/
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('user_shop_id', 'user_shop_id $1')
@ -99,72 +88,132 @@ class SalesController extends Controller
public function customers()
{
if(Request::get('reset') === 'filter'){
set_user_attr('filter_user_shop_id', null);
set_user_attr('filter_txaction', null);
set_user_attr('filter_member_id', null);
return redirect(route('admin_sales_customers'));
}
$filter_user_shops = ShoppingOrder::join('user_shops', 'user_shop_id', '=', 'user_shops.id')->get()->pluck('slug', 'id')->unique()->toArray();
$filter_members = ShoppingOrder::join('users', 'member_id', '=', 'users.id')->groupBy('member_id')->join('user_accounts', 'account_id', '=', 'user_accounts.id')->select('users.id', 'users.email', 'user_accounts.first_name', 'user_accounts.last_name')->get(); //->pluck('email', 'id')->unique()->toArray();
$data = [
// 'values' => ShoppingOrder::all(),
'filter_user_shops' => $filter_user_shops,
'filter_members' => $filter_members,
];
return view('admin.sales.customers', $data);
}
public function customersDetail()
public function customersDetail($id)
{
$data = [
// 'values' => Country::all(),
'shopping_order' => ShoppingOrder::find($id),
'isAdmin' => true,
'isView' => 'sales_customer',
];
return view('admin.sales.customer_detail', $data);
}
public function customersStore($id)
{
$data = Request::all();
$change_member_error = false;
if($data['action']==='shopping-order-change-member'){
if(!isset($data['change_member_key']) || $data['change_member_key'] !== config('mivita.edit_data_pass')){
$change_member_error = "Das Passwort ist falsch.";
}else{
//change
$shopping_order = ShoppingOrder::findOrFail($data['id']);
CustomerPriority::newMemberForOrder($shopping_order, $data['change_member_id'], $data['customer_set_member_for']);
\Session()->flash('alert-save', true);
return redirect(route('admin_sales_customers_detail', [$shopping_order->id]));
}
}
if($data['action']==='shopping-user-is-like-member'){
if(!isset($data['change_member_key']) || $data['change_member_key'] !== config('mivita.edit_data_pass')){
\Session()->flash('alert-error', 'Das Passwort ist falsch.');
return redirect($data['back']);
}else{
if(!isset($data['is_like_shopping_user_id'])){
\Session()->flash('alert-error', 'Keine Änderung ausgewählt');
return redirect($data['back']);
}
$shopping_user = ShoppingUser::findOrFail($data['id']);
$set_like_shopping_user = ShoppingUser::findOrFail($data['is_like_shopping_user_id']);
$send_member_mail = isset($data['send_member_mail']) ? true : false;
//Mail send in setIsLike
CustomerPriority::setIsLike($shopping_user, $set_like_shopping_user, $send_member_mail);
\Session()->flash('alert-save', true);
return redirect($data['back']);
}
}
$data = [
'change_member_error' => $change_member_error,
'shopping_order' => ShoppingOrder::find($id),
'isAdmin' => true,
'isView' => 'sales_customer',
];
return view('admin.sales.customer_detail', $data);
}
public function customersDatatable(){
$query = ShoppingOrder::with('shopping_user')->where('shopping_orders.auth_user_id', NULL);
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('shopping_orders.auth_user_id', NULL);
set_user_attr('filter_user_shop_id', Request::get('filter_user_shop_id'));
if(Request::get('filter_user_shop_id') != ""){
$query->where('user_shop_id', '=', Request::get('filter_user_shop_id'));
}
set_user_attr('filter_txaction', Request::get('filter_txaction'));
if(Request::get('filter_txaction') != ""){
if(Request::get('filter_txaction') === 'NULL'){
$query->where('txaction', '=', NULL);
}else{
$query->where('txaction', '=', Request::get('filter_txaction'));
}
}
set_user_attr('filter_member_id', Request::get('filter_member_id'));
if(Request::get('filter_member_id') != ""){
$query->where('member_id', '=', Request::get('filter_member_id'));
}
return \DataTables::eloquent($query)
->addColumn('billing_firstname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_firstname : '';
})
->addColumn('billing_lastname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_lastname : '';
})
->addColumn('billing_email', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_email : '';
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('admin_sales_customers_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->created_at->format("d.m.Y");
})
->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->mode === 'test'){
return '<span class="badge badge-pill badge-default">TEST - '.$ShoppingOrder->getFormattedTxaction().'</span>';
}
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getFormattedTxactionColor().'">'.$ShoppingOrder->getFormattedTxaction().'</span>';
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping();
})
->addColumn('orders', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : '';
->addColumn('member_id', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->member_id) {
return $ShoppingOrder->member_id ? '<a href="' . route('admin_lead_edit', [$ShoppingOrder->member_id]) . '">' . $ShoppingOrder->member->getFullName() . '</a>' : '';
}
if($ShoppingOrder->shopping_user && $ShoppingOrder->shopping_user->is_like){
return '<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
data-id="'.$ShoppingOrder->shopping_user->id.'"
data-action="shopping-user-is-like-member"
data-back="'.route('admin_sales_customers').'"
data-modal="modal-xl"
data-route="'.route('modal_load').'"><span class="fa fa-edit"></span> Berater zuordnen</button>';
}
return '';
})
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
})
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('admin_sales_users_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
/* ->addColumn('confirmed', function (User $user) {
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('active', function (User $user) {
return $user->active ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('agreement', function (User $user) {
return $user->agreement ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->orderColumn('confirmed', 'confirmed $1')
->orderColumn('active', 'active $1')
->orderColumn('agreement', 'agreement $1')
*/
->orderColumn('id', 'id $1')
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('user_shop_id', 'user_shop_id $1')
->rawColumns(['id', 'txaction', 'user_shop_id'])
->orderColumn('member_id', 'member_id $1')
->rawColumns(['id', 'member_id', 'txaction', 'user_shop_id'])
->make(true);
}

View file

@ -7,9 +7,13 @@ namespace App\Http\Controllers\Sys;
use App\Http\Controllers\Api\KasController;
use App\Http\Controllers\Api\KasSLLController;
use App\Http\Controllers\Controller;
use App\Mail\MailInfo;
use App\Models\ShoppingUser;
use App\Models\UserShop;
use App\Services\CustomerPriority;
use App\Services\Shop;
use Auth;
use Illuminate\Support\Facades\Mail;
use Input;
use Illuminate\Http\Request;
@ -32,9 +36,27 @@ class AdminToolsController extends Controller
dd('index');
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function customers()
{
$shopping_users = CustomerPriority::checkForAll();
$data = [
'values' => $shopping_users,
'text' => '',
];
return view('sys.admin.customers', $data);
}
public function customerStore()
{
$data = Input::all();
\Session()->flash('alert-save', true);
return back();
}
public function cronjobs()
{
//$user_shops = UserShop::all();
@ -48,25 +70,15 @@ class AdminToolsController extends Controller
];
return view('sys.admin.cronjobs', $data);
}
/**
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*/
public function cronjobsStore()
{
$data = Input::all();
\Session()->flash('alert-save', true);
return back();
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function domainSSL()
{
$user_shops = UserShop::all();
@ -100,10 +112,6 @@ class AdminToolsController extends Controller
}
/**
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*/
public function domainSSLStore()
{
$data = Input::all();
@ -111,10 +119,6 @@ class AdminToolsController extends Controller
return back();
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function shoppingOrders()
{
$shopping_users = ShoppingUser::all();
@ -125,34 +129,37 @@ class AdminToolsController extends Controller
return view('sys.admin.shopping-orders', $data);
}
/**
* @return \Illuminate\Http\RedirectResponse
*/
public function shoppingOrdersStore()
{
//first run
$data = Input::all();
$orders = [];
$shopping_users = ShoppingUser::all();
foreach ($shopping_users as $shopping_user){
if(!isset($shopping_user->shopping_order)){
$shopping_user->orders = NULL;
if($data['action'] === 'first_run'){
$shopping_users = ShoppingUser::whereHas('shopping_order', function($q) {
$q->where('txaction', 'paid')->OrWhere('txaction', 'appointed');
})->get();
}else{
if($shopping_user->shopping_order->txaction === "paid" || $shopping_user->shopping_order->txaction === "appointed") {
$orders[$shopping_user->billing_email] = isset($orders[$shopping_user->billing_email]) ? $orders[$shopping_user->billing_email] + 1 : 1;
$shopping_user->orders = $orders[$shopping_user->billing_email];
}else{
$shopping_user->orders = NULL;
$order_email = [];
$order_number = [];
foreach ($shopping_users as $shopping_user){
$order_email[$shopping_user->billing_email] = isset($order_email[$shopping_user->billing_email]) ? $order_email[$shopping_user->billing_email] + 1 : 1;
if($shopping_user->number) {
$order_number[$shopping_user->number] = isset($order_number[$shopping_user->number]) ? $order_number[$shopping_user->number] + 1 : 1;
$shopping_user->orders = $order_number[$shopping_user->number];
}else {
$shopping_user->orders = $order_email[$shopping_user->billing_email];
}
}
$shopping_user->save();
$shopping_user->save();
}
\Session()->flash('alert-save', true);
}
\Session()->flash('alert-save', true);
if($data['action'] === 'next_run'){
Shop::userOrders();
\Session()->flash('alert-save', true);
}
return back();
}

View file

@ -4,6 +4,7 @@
namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Models\ShoppingOrder;
use App\Services\Payment;
use App\User;
@ -22,37 +23,37 @@ class ShopSalesController extends Controller
return view('user.shop.sales.orders', $data);
}
public function orderDetail()
public function orderDetail($id)
{
$user = User::find(\Auth::user()->id);
$shopping_order = ShoppingOrder::find($id);
if(!$shopping_order){
abort(404);
}
if($shopping_order->user_shop_id !== $user->shop->id){
abort(404);
}
$data = [
// 'values' => Country::all(),
'shopping_order' => $shopping_order,
'isAdmin' => false,
];
return view('admin.sales.customer_detail', $data);
return view('user.shop.sales.order_detail', $data);
}
public function ordersDatatable(){
$user = User::find(\Auth::user()->id);
$query = ShoppingOrder::with('shopping_user')->where('user_shop_id', $user->shop->id);
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('user_shop_id', $user->shop->id);
return \DataTables::eloquent($query)
->addColumn('billing_firstname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_firstname : '';
})
->addColumn('billing_lastname', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_lastname : '';
})
->addColumn('billing_email', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->billing_email : '';
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('user_shop_order_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->created_at->format("d.m.Y");
})
->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->mode === 'test'){
return '<span class="badge badge-pill badge-default">TEST - '.$ShoppingOrder->getFormattedTxaction().'</span>';
}
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getFormattedTxactionColor().'">'.$ShoppingOrder->getFormattedTxaction().'</span>';
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping();
@ -63,22 +64,7 @@ class ShopSalesController extends Controller
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
})
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('admin_sales_users_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
/* ->addColumn('confirmed', function (User $user) {
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('active', function (User $user) {
return $user->active ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('agreement', function (User $user) {
return $user->agreement ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->orderColumn('confirmed', 'confirmed $1')
->orderColumn('active', 'active $1')
->orderColumn('agreement', 'agreement $1')
*/
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('user_shop_id', 'user_shop_id $1')

View file

@ -11,7 +11,7 @@ class TeamController extends Controller
public function __construct()
{
$this->middleware('active.shop');
$this->middleware('active.account');
}
public function members()

View file

@ -10,6 +10,7 @@ use App\Models\ShoppingOrder;
use App\Models\ShoppingOrderItem;
use App\Models\ShoppingPayment;
use App\Models\ShoppingUser;
use App\Services\CustomerPriority;
use App\User;
use Illuminate\Session\SessionManager;
use Illuminate\Support\Collection;
@ -310,6 +311,8 @@ class CheckoutController extends Controller
if(!$shopping_user){
$shopping_user = ShoppingUser::create($data);
}
//CustomerPriority
CustomerPriority::checkOne($shopping_user, true);
$this->putPayments('shopping_user_id', $shopping_user->id);
return $shopping_user;

View file

@ -52,10 +52,6 @@ class MailCheckout extends Mailable
//make Adresse
}
if($this->txaction === 'paid'){
if($this->send_link){
}
return $this->view('emails.checkout')->with([
'salutation' => $salutation,
'copy1line' => __('email.checkout_copy1line'),

View file

@ -16,46 +16,66 @@ class MailInfo extends Mailable
public $subject;
public function __construct(User $user, $action)
public function __construct($user, $action)
{
$this->user = $user;
$this->action = $action;
if($action === "delete_membership"){
if($this->action === "delete_membership"){
$this->subject = 'Mitgliedschaft beenden - beantragt';
}
if($this->action === "check_is_like_customer"){
$this->subject = 'Kunden überprüfen - Kundenhoheit';
}
}
public function build()
{
$content = __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
if($this->user->account->phone){
$content .= "Telefon: ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone." " : " ";
$content .= $this->user->account->phone;
}
if($this->user->account->mobil){
$content .= "Mobil: ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone." " : " ";
$content .= $this->user->account->mobil;
}
$content .= "E-Mail: ".$this->user->email;
$content = "";
if($this->action === "delete_membership"){
$content .= __(strtoupper($this->user->account->salutation))." ";
$content .= $this->user->account->first_name." ".$this->user->account->last_name."\n";
$content .= $this->user->account->address."\n";
$content .= $this->user->account->zipcode." ".$this->user->account->city."\n";
$content .= $this->user->account->country_id ? $this->user->account->country->de."\n\n" : "\n\n";
if($this->user->account->phone){
$content .= "Telefon: ";
$content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone." " : " ";
$content .= $this->user->account->phone;
}
if($this->user->account->mobil){
$content .= "Mobil: ";
$content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone." " : " ";
$content .= $this->user->account->mobil;
}
$content .= "E-Mail: ".$this->user->email;
$copy1line = "Infos zum Berater:"."\n";
$button = "zum Berater";
$title = "Ein Berater möchte seine Mitgliedschaft beenden.";
$url = route('admin_lead_edit', $this->user->id).'?show=check_lead';
}
if($this->action === "check_is_like_customer") {
$copy1line = "Hier geht es zum Kunden:"."\n";
$button = "zum Kunden";
$title = "Ein Kunden muss überprüfen werden und einem Berater zugeordnet werden, da die Adresse nicht eindeutig ist.";
$url = route('admin_customer_edit', $this->user->id);
$content .= $this->user ? 'Firma: '.$this->user->billing_company."\n" : '';
$content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation)." ";
$content .= $this->user->billing_firstname." ";
$content .= $this->user->billing_lastname."\n";
$content .= $this->user->billing_address;
$content .= $this->user->billing_address_2 ? '/ '.$this->user->billing_address_2."\n" : "\n";
$content .= $this->user->billing_zipcode." ";
$content .= $this->user->billing_city."\n";
$content .= $this->user->billing_email."\n";
$content .= $this->user->billing_phone."\n";
$content .= $this->user->billing_country->getLocated();
}
return $this->view('emails.info')->with([
'url' => route('admin_lead_edit', $this->user->id).'?show=check_lead',
'url' => $url,
'title' => $title,
'button' => $button,
'copy1line' => $copy1line,

View file

@ -61,6 +61,7 @@ class ShoppingOrder extends Model
protected $fillable = [
'shopping_user_id',
'auth_user_id',
'member_id',
'country_id',
'user_shop_id',
'total',
@ -73,18 +74,6 @@ class ShoppingOrder extends Model
'mode',
];
protected $txaction_text = [
'paid' => "bezahlt",
'appointed' => "offen",
'failed' => "abbruch",
];
protected $txaction_color = [
'paid' => "success",
'appointed' => "warning",
'failed' => "danger",
];
public function shopping_user()
{
@ -101,6 +90,11 @@ class ShoppingOrder extends Model
return $this->belongsTo('App\Models\UserShop','user_shop_id');
}
//can null
public function member()
{
return $this->belongsTo('App\User','member_id');
}
//can null
public function auth_user()
{
@ -162,18 +156,15 @@ class ShoppingOrder extends Model
}
public function getFormattedTxaction(){
if($this->txaction && isset($this->txaction_text[$this->txaction])){
return $this->txaction_text[$this->txaction];
public function getItemsCount(){
$count = 0;
if($this->shopping_order_items){
foreach ($this->shopping_order_items as $shopping_order_item){
$count += $shopping_order_item->qty;
}
}
return "not";
}
public function getFormattedTxactionColor(){
if($this->txaction && isset($this->txaction_color[$this->txaction])){
return $this->txaction_color[$this->txaction];
}
return "danger";
return $count;
}

View file

@ -2,6 +2,7 @@
namespace App\Models;
use App\Services\Util;
use Illuminate\Database\Eloquent\Model;
/**
@ -88,4 +89,7 @@ class ShoppingPayment extends Model
}
}
public function getPaymentAmount(){
return Util::formatNumber($this->amount/100)." ".$this->currency;
}
}

View file

@ -80,7 +80,13 @@ class ShoppingUser extends Model
{
protected $table = 'shopping_users';
protected $fillable = [
'auth_user_id',
'member_id',
'number',
'is_like',
'billing_salutation',
'billing_company',
'billing_firstname',
@ -104,10 +110,25 @@ class ShoppingUser extends Model
'shipping_city',
'shipping_country_id',
'shipping_phone',
'notice',
];
protected $casts = [
'notice' => 'array',
'is_like' => 'bool',
'accepted_data_checkbox' => 'bool',
'same_as_billing' => 'bool',
];
//can null
public function member()
{
return $this->belongsTo('App\User','member_id');
}
public function auth_user()
{
return $this->belongsTo('App\User','auth_user_id');
}
public function billing_country()
{
return $this->belongsTo('App\Models\Country','billing_country_id');
@ -128,4 +149,23 @@ class ShoppingUser extends Model
return $this->hasOne('App\Models\ShoppingOrder','shopping_user_id');
}
public function setNotice($key, $value){
$notice = $this->notice;
$notice[$key] = $value;
$this->notice = $notice;
$this->save();
}
public function getNotice($key){
return isset($this->notice[$key]) ? $this->notice[$key] : false;
}
public function removeNotice($key){
$notice = $this->notice;
if(isset($notice[$key])){
unset($notice[$key]);
}
$this->notice = $notice;
$this->save();
}
}

View file

@ -129,7 +129,6 @@ class UserAccount extends Model
protected $casts = [
'payment_data' => 'array',
'notice' => 'array',
];
use SoftDeletes;

View file

@ -0,0 +1,71 @@
<?php
namespace App\Repositories;
class CustomerRepository extends BaseRepository {
public function __construct()
{
//$this->model = $model;
}
public function update($data)
{
/*if($data['user_id'] === "new" || $data['user_id'] == 0){
$this->model = User::create([
'email' => $data['email'],
'password' => env('APP_KEY'),
]);
}
else{
$this->model = $this->getById($data['user_id']);
}
if(!$this->model->account_id){
$account = new UserAccount();
}else{
$account = $this->model->account;
}
$data['same_as_billing'] = !isset($data['same_as_billing']) ? 0 : 1;
$account->fill($data)->save();
if(!$this->model->account_id){
$this->model->account_id = $account->id;
$this->model->save();
}*/
return true;
}
public function create($data){
/* $this->model = User::create([
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
$account = UserAccount::create([
'm_salutation' => $data['salutation'],
'm_first_name' => $data['first_name'],
'm_last_name' => $data['last_name'],
'salutation' => $data['salutation'],
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
]);
$this->model->account_id = $account->id;
$this->model->save();
return $this->model;*/
}
}

View file

@ -0,0 +1,201 @@
<?php
namespace App\Services;
use App\Mail\MailCheckout;
use App\Mail\MailInfo;
use App\Models\ShoppingUser;
use App\Services\Shop;
use App\User;
use Auth;
use Illuminate\Support\Facades\Mail;
class CustomerPriority
{
protected static $start_number = 1000;
protected static $user_notice_key = 'like';
public static function checkForAll(){
//only extern no members with no numbers
$shopping_users = ShoppingUser::where('auth_user_id', '=', NULL)->where('number', '=', NULL)->orderBy('created_at', 'ASC')->get();
foreach ($shopping_users as $shopping_user){
if($shopping_user->shopping_order && $shopping_user->shopping_order->user_shop){
self::checkOne($shopping_user);
}
}
return $shopping_users;
}
public static function checkOne($shopping_user, $mail=false){
//look for entry
if(self::entryExists($shopping_user)){
return 'exists';
}
if(self::entryLike($shopping_user)){
if($mail){ //send mail
Mail::to(config('app.info_mail'))->send(new MailInfo($shopping_user, 'check_is_like_customer'));
}
return 'like';
}
self::newCustomer($shopping_user);
return 'update';
}
public static function setIsLike($shopping_user, $set_like_shopping_user, $send_member_mail)
{
if ($shopping_user->id === $set_like_shopping_user->id) {
//set new customer for shopping_user
self::newCustomer($shopping_user);
} else {
//set existing customer for shopping_user
self::existingCustomer($shopping_user, $set_like_shopping_user);
}
self::clearIsLike($shopping_user);
//SEND MAIL TO MEMBER
if ($send_member_mail){
if ($shopping_user->shopping_order && $shopping_user->shopping_order->shopping_payments) {
Mail::to($shopping_user->member->email)->send(new MailCheckout($shopping_user->shopping_order->txaction, $shopping_user->shopping_order, $shopping_user->shopping_order->shopping_payments->last(), false, $shopping_user->shopping_order->mode));
}
}
return true;
}
public static function newMemberForOrder($shopping_order, $member_id, Bool $all = false){
if($all){
if($shopping_order->shopping_user && $shopping_order->shopping_user->number){
$shopping_users = ShoppingUser::where('number', '=', $shopping_order->shopping_user->number)->get();
$new_number = self::nextNumber();
foreach ($shopping_users as $shopping_user) {
self::changeCustomer($shopping_user, $member_id, $new_number);
}
}
}else{
$shopping_order->member_id = $member_id;
$shopping_order->save();
if($shopping_order->shopping_user){
$shopping_order->shopping_user->member_id = $member_id;
$shopping_order->shopping_user->number = self::nextNumber();
$shopping_order->shopping_user->save();
}
}
}
public static function newMemberForCustomer($shopping_user, $member_id, Bool $all = false){
if($all){
if($shopping_user && $shopping_user->number){
$shopping_users = ShoppingUser::where('number', '=', $shopping_user->number)->get();
$new_number = self::nextNumber();
foreach ($shopping_users as $s_user) {
self::changeCustomer($s_user, $member_id, $new_number);
}
}
}else{
$shopping_user->member_id = $member_id;
$shopping_user->number = self::nextNumber();
$shopping_user->save();
if($shopping_user->shopping_order){
$shopping_user->shopping_order->member_id = $member_id;
$shopping_user->shopping_order->save();
}
}
}
private static function entryExists($shopping_user){
//check same email
$matches = ShoppingUser::where('auth_user_id', '=', NULL)
->where('number', '!=', NULL) //has number
->where('id', '!=', $shopping_user->id)
->where('billing_email', '=', $shopping_user->billing_email)->get();
if($matches && count($matches)){
$match = $matches->last();
$shopping_user->member_id = $match->member_id;
$shopping_user->number = $match->number;
$shopping_user->save();
//has order
if($shopping_user->shopping_order){
$shopping_user->shopping_order->member_id = $match->member_id;
$shopping_user->shopping_order->save();
}
return true;
}
return false;
}
private static function entryLike($shopping_user){
//check same last name und PLZ
$matches = ShoppingUser::select('*')
->where('auth_user_id', '=', NULL)
->where('number', '!=', NULL) //has number
->where('id', '!=', $shopping_user->id)
->where('billing_lastname', '=', $shopping_user->billing_lastname)
->where('billing_zipcode', '=', $shopping_user->billing_zipcode)
->get()->pluck('number', 'id')->unique()->toArray();
if($matches && count($matches)){
$shopping_user->is_like = true;
$shopping_user->setNotice(self::$user_notice_key, $matches);
$shopping_user->save();
return true;
}
return false;
}
private static function newCustomer($shopping_user){
if($shopping_user->shopping_order && $shopping_user->shopping_order->user_shop) {
$member_id = $shopping_user->shopping_order->user_shop->user_id;
$shopping_user->member_id = $member_id;
$shopping_user->number = self::nextNumber();
$shopping_user->save();
$shopping_user->shopping_order->member_id = $member_id;
$shopping_user->shopping_order->save();
}
}
private static function changeCustomer($shopping_user, $member_id, $number){
$old_number = $shopping_user->number;
$shopping_user->member_id = $member_id;
$shopping_user->number = $number;
$shopping_user->save();
if($shopping_user->shopping_order) {
$shopping_user->shopping_order->member_id = $member_id;
$shopping_user->shopping_order->save();
}
\App\Services\Shop::newUserOrder($old_number);
\App\Services\Shop::newUserOrder($number);
}
private static function existingCustomer($shopping_user, $set_like_shopping_user){
$old_number = $shopping_user->number;
$shopping_user->member_id = $set_like_shopping_user->member_id;
$shopping_user->number = $set_like_shopping_user->number;
$shopping_user->save();
if($shopping_user->shopping_order) {
$shopping_user->shopping_order->member_id = $set_like_shopping_user->member_id;
$shopping_user->shopping_order->save();
}
\App\Services\Shop::newUserOrder($old_number);
\App\Services\Shop::newUserOrder($set_like_shopping_user->number);
}
private static function clearIsLike($shopping_user){
$shopping_user->is_like = false;
$shopping_user->removeNotice(self::$user_notice_key);
$shopping_user->save();
}
private static function nextNumber (){
if(!$number = ShoppingUser::max('number')){
$number = self::$start_number;
}
return $number+1;
}
}

View file

@ -282,8 +282,8 @@ class HTMLHelper
return $ret;
}
public static function getSponsorOptions($id, $all=false){
$values = User::all();
public static function getMembersOptions($id, $all=false){
$values = User::where('active', '=', true)->where('blocked', '=', false)->where('payment_account', '>=', now())->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('please select').'</option>\n';
@ -294,36 +294,9 @@ class HTMLHelper
if($value->account){
$to = $value->account->first_name." ".$value->account->last_name." | ";
}
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$to.$value->email.'</option>\n';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$to.$value->email.' #'.$value->number.'</option>\n';
}
return $ret;
}
/*public static function getIndustrySectorsWithoutParents($id = false, $sameId = false, $all = true){
$values = IndustrySector::where('parent_id', null)->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('no').'</option>\n';
}
foreach ($values as $value){
if($sameId == $value->id){
continue;
}
$attr = ($value->id == $id) ? 'selected="selected"' : '';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
}
return $ret;
}
*/
}

55
app/Services/Payment.php Normal file
View file

@ -0,0 +1,55 @@
<?php
namespace App\Services;
use App\Models\ShoppingOrder;
use App\Models\ShoppingPayment;
use App\User;
class Payment
{
public static $txaction_text = [
'paid' => "bezahlt",
'appointed' => "offen",
'failed' => "abbruch",
'NULL' => 'keine Zahlung',
];
public static $txaction_color = [
'paid' => "success",
'appointed' => "warning",
'failed' => "danger",
];
public static function getFormattedTxaction($txaction){
if($txaction && isset(self::$txaction_text[$txaction])){
return self::$txaction_text[$txaction];
}
return self::$txaction_text['NULL'];
}
public static function getFormattedTxactionColor($txaction){
if($txaction && isset(self::$txaction_color[$txaction])){
return self::$txaction_color[$txaction];
}
return "warning";
}
public static function getShoppingOrderBadge(ShoppingOrder $shopping_order){
if($shopping_order->mode === 'test'){
return '<span class="badge badge-pill badge-default">'.strtoupper($shopping_order->mode).' - '.self::getFormattedTxaction($shopping_order->txaction).'</span>';
}
return '<span class="badge badge-pill badge-'.self::getFormattedTxactionColor($shopping_order->txaction).'">'.self::getFormattedTxaction($shopping_order->txaction).'</span>';
}
public static function getShoppingPaymentBadge(ShoppingPayment $shopping_payment){
if($shopping_payment->mode === 'test'){
return '<span class="badge badge-pill badge-default">'.strtoupper($shopping_payment->mode).' - '.self::getFormattedTxaction($shopping_payment->txaction).'</span>';
}
return '<span class="badge badge-pill badge-'.self::getFormattedTxactionColor($shopping_payment->txaction).'">'.self::getFormattedTxaction($shopping_payment->txaction).'</span>';
}
}

40
app/Services/Shop.php Normal file
View file

@ -0,0 +1,40 @@
<?php
namespace App\Services;
use App\Models\ShoppingUser;
class Shop
{
public static function userOrders() {
$shopping_users = ShoppingUser::whereHas('shopping_order', function($q) {
$q->where('txaction', 'paid')->OrWhere('txaction', 'appointed');
})->where('orders', '=', NULL)->get();
foreach ($shopping_users as $shopping_user) {
if ($shopping_user->number) {
$orders = ShoppingUser::where('number', '=', $shopping_user->number)->max('orders');
$orders = $orders + 1;
} else {
$orders = ShoppingUser::where('billing_email', '=', $shopping_user->billing_email)->max('orders');
$orders = $orders + 1;
}
$shopping_user->orders = $orders;
$shopping_user->save();
}
}
public static function newUserOrder($number){
$shopping_users = ShoppingUser::where('number', '=', $number)->get();
$orders = 1;
foreach ($shopping_users as $shopping_user) {
if($shopping_user->shopping_order && ($shopping_user->shopping_order->txaction === 'paid' || $shopping_user->shopping_order->txaction === 'appointed')){
$shopping_user->orders = $orders++;
}else{
$shopping_user->orders = NULL;
}
$shopping_user->save();
}
}
}

View file

@ -6,7 +6,6 @@ use App\User;
class UserService
{
public static function createConfirmationCode() {
$unique = false;
do{

View file

@ -167,18 +167,38 @@ class User extends Authenticatable
return $this->hasOne('App\Models\UserShop', 'user_id', 'id');
}
public function user_update_email()
{
return $this->hasMany('App\Models\UserUpdateEmail', 'user_id', 'id');
}
public function member_shopping_orders()
{
return $this->hasMany('App\Models\ShoppingOrder', 'member_id', 'id');
}
public function member_shopping_users()
{
return $this->hasMany('App\Models\ShoppingUser', 'member_id', 'id');
}
public function getMUserSponsor(){
if($this->user_sponsor && $this->user_sponsor->account){
return $this->user_sponsor->account->first_name." ".$this->user_sponsor->account->last_name." | ".$this->user_sponsor->email;
}
}
public function getFullName($email=true){
$ret = "";
if($this->account){
$ret = $this->account->first_name." ".$this->account->last_name;
}
if($email && $this->id > 1){
$ret .= " | ".$this->email;
}
return $ret;
}
/**
* @return bool
*/
@ -259,8 +279,7 @@ class User extends Authenticatable
return $this->payment_shop ? Carbon::parse($this->payment_shop)->gt(Carbon::now()) : false;
}
public function isRenewalAccount()
{
public function isRenewalAccount(){
if ($this->payment_account) {
return Carbon::parse($this->payment_account)->modify('-'.(config('mivita.renewal_days')+1).' days')->lt(Carbon::now());
}

View file

@ -14,3 +14,31 @@ if (! function_exists('make_old_url')) {
return config('app.old_url').$path;
}
}
if (! function_exists('get_file_last_time')) {
function get_file_last_time($value)
{
if (file_exists($value)) {
return filemtime($value);
}
return date("Ymd-i", time());
}
}
if (! function_exists('get_user_attr')) {
function get_user_attr($key){
if ($user = Auth::user()) {
return $user->getSetting($key);
}
return null;
}
}
if (! function_exists('set_user_attr')) {
function set_user_attr($key, $value){
if ($user = Auth::user()) {
return $user->setSetting([$key => $value]);
}
return null;
}
}

Binary file not shown.

View file

@ -17,6 +17,10 @@ class CreateShoppingUsersTable extends Migration
$table->increments('id');
$table->unsignedInteger('auth_user_id');
$table->unsignedInteger('member_id')->nullable();
$table->unsignedInteger('number')->index()->nullable();
$table->boolean('is_like')->default(false);
$table->char('billing_salutation', 2)->nullable();
$table->string('billing_company')->nullable();
@ -49,6 +53,7 @@ class CreateShoppingUsersTable extends Migration
$table->boolean('abo_options')->default(false);
$table->text('notice')->default(false);
$table->timestamps();
@ -60,6 +65,14 @@ class CreateShoppingUsersTable extends Migration
->references('id')
->on('countries');
$table->foreign('auth_user_id')
->references('id')
->on('users');
$table->foreign('member_id')
->references('id')
->on('users');
});
}

View file

@ -22,6 +22,8 @@ class CreateShoppingOrdersTable extends Migration
$table->unsignedInteger('country_id');
$table->unsignedInteger('user_shop_id');
$table->unsignedInteger('member_id')->nullable();
$table->unsignedTinyInteger('payment_for');
$table->decimal('total', 13, 2)->nullable();
@ -53,6 +55,10 @@ class CreateShoppingOrdersTable extends Migration
$table->foreign('user_shop_id')
->references('id')
->on('user_shops');
$table->foreign('member_id')
->references('id')
->on('users');
});
}

View file

@ -30,4 +30,25 @@ a[aria-expanded='true'] > .fa-caret-expand:before {
.custom-control-label::before {
border: 1px solid rgba(182, 117, 16, 0.8);
}
.text-muted {
color: #868686 !important;
}
@media (min-width: 992px){
.modal-lg {
max-width: 55rem;
}
}
@media (min-width: 768px) {
.modal-xl {
width: 90%;
max-width:75rem;
}
}
.text-match{
color:#295B28;
}

View file

@ -1,6 +1,6 @@
$(function () {
// $('.selectpicker').selectpicker();
// $('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').tooltip();
});
@ -89,171 +89,102 @@ function _scrollTo(to, offset) {
$('html,body').animate({scrollTop: $(to).offset().top - offset}, 800);
}
/*
$(function() {
$('.select2-main').each(function() {
$(this)
.wrap('<div class="position-relative"></div>')
.select2({
placeholder: 'Bitte wählen',
dropdownParent: $(this).parent(),
});
})
$('.select2-sub').each(function() {
$(this)
.wrap('<div class="position-relative"></div>')
.select2({
placeholder: 'Bitte wählen',
dropdownParent: $(this).parent(),
closeOnSelect: false
});
})
});
*/
/*
jQuery(document).ready(function() {
$(function () {
$('.main-branch').on('change', function () {
target = $(this).data('target');
if ($(this).is(':checked')) {
$(target).stop().show('slow');
} else {
$(target).stop().hide('slow');
$(target).find('.custom-control-input').prop('checked', false);
$('#modals-load-content').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
if (!button.data('id')) {
return;
}
var data = {};
$.each(button.data(), function(index, value){
data[index] = value;
});
//console.log(data);
loadModalInner(this, data);
});
var $form = $('#lead-form-validation');
if($form.find('#company_country_id').length){
$form.find('#company_country_id').on('change', function(){
$form.find('#company_pre_phone_id').val($(this).val());
$form.find('#company_pre_phone_id').selectpicker('refresh');
});
}
if($form.find('#country_id').length){
$form.find('#country_id').on('change', function(){
$form.find('#pre_phone_id').val($(this).val());
$form.find('#pre_phone_id').selectpicker('refresh');
$form.find('#pre_mobil_id').val($(this).val());
$form.find('#pre_mobil_id').selectpicker('refresh');
});
}
});
*/
/*
function trigger_company($ele, $speed){
if($ele.val() == 1){
$('.show_company_holder').show($speed);
$('.show_company_holder').find('#company_name').prop('required', true);
$('.show_company_holder').find('#company_country_id').prop('required', true);
}else{
$('.show_company_holder').hide($speed);
$('.show_company_holder').find('#company_name').prop('required', false);
$('.show_company_holder').find('#company_country_id').prop('required', false);
}
}
$( document ).ready(function() {
// With validation
var $form = $('#lead-form-validation');
$form.find('#company').on('change', function () {
trigger_company($(this), 'slow');
});
trigger_company($form.find('#company'), 0);
// Set up validator
$form.validate({
rules: {
'email': {
required: true,
email: true,
remote:
{
url: "{{ route('user_check_mail') }}",
type: "post",
data:
{
user_id: function()
{
return $('#lead-form-validation :input[name="user_id"]').val();
},
email: function()
{
return $('#lead-form-validation :input[name="email"]').val();
}
},
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
}
},
'email-confirm': {
required: true,
equalTo: "#email"
},
'accepted_data_protection': {
required: true
},
},
errorPlacement: function errorPlacement(error, element) {
$(element).parents('.form-group').append(
error.addClass('invalid-feedback small d-block')
)
},
highlight: function (element) {
if ($(element).hasClass('selectpicker')) {
$(element).parent().addClass('is-invalid');
}
$(element).addClass('is-invalid');
},
unhighlight: function (element) {
$(element).removeClass('is-invalid');
$(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
},
messages : {
required: "{{__('This field is required.')}}",
company_country_id : {
required: "{{__('This field is required.')}}",
},
accepted_data_protection : {
required: "{{__('This field is required.')}}",
},
salutation : {
required: "{{__('This field is required.')}}",
},
company_name : {
required: "{{__('This field is required.')}}",
},
last_name : {
required: "{{__('This field is required.')}}",
},
equalTo : "{{__('Please enter the same value again.')}}",
'email-confirm' : {
equalTo : "{{__('Please enter the same value again.')}}",
required: "{{__('This field is required.')}}",
},
email: {
required : "{{__('This field is required.')}}",
email: "{{ __('Please enter a valid email address.') }}",
remote : "{{ __('This E-mail is already in use.') }}"
},
},
onkeyup: false
function initModalInner() {
$('[data-toggle="reloadModal"]').off().on('click', function(event) {
event.preventDefault();
button = $(this);
var data = {};
$.each(button.data(), function(index, value){
data[index] = value;
});
//console.log(data);
loadModalInner(this, data);
});
}
function loadModalInner(self, data){
var url = data.route,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
//console.log(data);
if(data.response.modal){
$(data.response.target).find('.modal-dialog').addClass(data.response.modal);
}
$(data.response.target).find('.modal-dialog').html(data.html);
$(data.response.target).find('.selectpicker').selectpicker('refresh');
initModalInner();
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
});
*/
function ajax_object_action(event, object, callback) {
event.preventDefault();
var data = {};
$.each(object.data(), function(index, value){
if(typeof value !== 'object'){
data[index] = value;
}
});
var url = data['url'];
console.log(data);
console.log(url);
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
//data will send data to callback function
callback(data);
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(status);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
});

View file

@ -0,0 +1,326 @@
<div class="card">
<!-- Info -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-4 mb-3">
<div class="text-muted small">Datum</div>
{{$shopping_user->created_at->format("d.m.Y H:i")}}
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Kundennummer</div>
{{$shopping_user->number}}
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">ist Berater</div>
@if($shopping_user->auth_user)
<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
<a class="btn btn-xs btn-outline-primary" href="{{route('admin_lead_edit', [$shopping_user->auth_user->id])}}"><i class="ion ion-ios-contacts"></i></a>
{{$shopping_user->auth_user->getFullName()}} <span class="text-muted">#{{$shopping_user->auth_user->number}}</span>
@else
<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
@endif
</div>
</div>
</div>
<hr class="m-0">
<!-- / Info -->
@if($isAdmin)
<!-- Member -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-8 mb-3">
@if(isset($change_member_error) && $change_member_error)
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger p-2">
<ul>
<li>{{ $change_member_error }}</li>
</ul>
</div>
</div>
</div>
@endif
<div class="text-muted small">Zugewiesener Berater</div>
@if($shopping_user->is_like)
<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
data-id="{{$shopping_user->id}}"
data-action="shopping-user-is-like-member"
data-back="{{route('admin_customer_edit', [$shopping_user->id])}}"
data-modal="modal-xl"
data-route="{{route('modal_load')}}"><span class="fa fa-edit"></span> Berater zuordnen</button>
@else
@if($shopping_user->member)
<a class="btn btn-xs btn-outline-primary" href="{{route('admin_lead_edit', [$shopping_user->member->id])}}"><i class="ion ion-ios-contacts"></i></a>
{{$shopping_user->member->getFullName()}} <span class="text-muted">#{{$shopping_user->member->number}}</span>
@endif
<button type="button" class="btn btn-xs btn-outline-secondary" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $shopping_user->id }}"
data-action="shopping-user-change-member"
data-view="customer"
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>
@endif
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Über Shop</div>
@if($shopping_user->shopping_order)
@if($shopping_user->shopping_order->user_shop->user->isActive() && $shopping_user->shopping_order->user_shop->user->isActiveShop())
<a href="{{$shopping_user->shopping_order->user_shop->getSubdomain(false)}}" class="badge badge-success" target="_blank">{{$shopping_user->shopping_order->user_shop->getSubdomain(false)}}</a>
@else
<span class="badge badge-danger" target="_blank">{{$shopping_user->shopping_order->user_shop->getSubdomain(false)}}</span>
@endif
@endif
</div>
</div>
</div>
<hr class="m-0">
<!-- / Member -->
@endif
<!-- Billing -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Rechnungsadresse
</h6>
<div class="row">
@if($shopping_user->billing_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_user->billing_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_user->billing_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_user->billing_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_user->billing_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_user->billing_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_user->billing_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_user->billing_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_user->billing_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_user->billing_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_user->billing_country->getLocated() }}
</div>
</div>
</div>
<hr class="m-0">
<!-- / Billing -->
<!-- Shipping -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Lieferadresse
</h6>
@if($shopping_user->same_as_billing)
{{__('email.checkout_mail_same_address')}}
@else
<div class="row">
@if($shopping_user->shipping_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_user->shipping_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->shipping_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_user->shipping_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_user->shipping_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_user->shipping_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_user->shipping_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_user->shipping_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_user->shipping_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_user->shipping_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_user->shipping_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_user->shipping_country->getLocated() }}
</div>
</div>
@endif
</div>
<hr class="m-0">
<!-- / Shipping -->
<!-- Order -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Bestellung
</h6>
<div class="table-responsive">
<table class="table table-bordered m-0" style="min-width:550px;">
<tbody>
<tr>
<th>Produkt</th>
<th>Anzahl</th>
<th>Preis</th>
</tr>
@if($shopping_user->shopping_order)
@foreach($shopping_user->shopping_order->shopping_order_items as $shopping_order_item)
<tr>
<td class="px-3 py-2">
<div class="media align-items-center">
@if($shopping_order_item->product->images)
@if($image = $shopping_order_item->product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="d-block ui-w-80 mr-4" alt>
@endif
@endif
<div class="media-body">
<a href="{{route('admin_product_edit', [$shopping_order_item->product->id])}}" class="d-block">{{ $shopping_order_item->product->name }}
<span class="text-muted">#{{ $shopping_order_item->product->number }}</span></a>
<small>
<span class="text-muted">Inhalt: </span> {{ $shopping_order_item->product->contents }}<br>
<span class="text-muted">Gewicht: </span> {{ $shopping_order_item->product->weight }} g<br>
<span class="text-muted">Points: </span> {{ $shopping_order_item->product->points }}
</small>
</div>
</div>
</td>
<!-- Set column width -->
<td class="align-middle px-3 py-2" style="width: 66px;">
{{ $shopping_order_item->qty }}
</td>
<!-- Set column width -->
<td class="text-right font-weight-semibold align-middle px-3 py-2" style="width: 100px;">
{{ $shopping_order_item->getFormattedPrice() }} &euro;
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
<hr class="m-0">
<!-- / Payment -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Zahlung
</h6>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="min-width: 60px">#</th>
<th>Zahlungsart</th>
@if($isAdmin)<th>Referenznummer</th>@endif
<th>Gesamt</th>
<th>Status</th>
<th>Datum</th>
</tr>
</thead>
<tbody>
@php($count=0)
@if($shopping_user->shopping_order)
@foreach($shopping_user->shopping_order->shopping_payments as $shopping_payment)
<tr>
<th scope="row">{{++$count}}</th>
<td>{{$shopping_payment->getPaymentType()}}</td>
@if($isAdmin)<td>{{$shopping_payment->reference}}</td>@endif
<td>{{$shopping_payment->getPaymentAmount()}}</td>
<td>{!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!}</td>
<td>{{$shopping_payment->created_at->format("d.m.Y H:i")}}</td>
</tr>
@if($isAdmin && $shopping_payment->payment_transactions)
@php($ccount=0)
<tr>
<th scope="row" class="m-0">{{$count}}.{{++$ccount}}</th>
<td colspan="5" class="m-0 p-0">
<table class="table table-info table-borderless mb-0 small">
<thead>
<tr>
<th style="min-width: 80px">Request</th>
<th style="min-width: 80px">Status</th>
<th style="min-width: 200px">TX-Action</th>
<th style="min-width: 120px">Datum</th>
</tr>
</thead>
<tbody>
@foreach($shopping_payment->payment_transactions as $payment_transaction)
<tr>
<td>{{$payment_transaction->request}}</td>
<td>{{$payment_transaction->status}}</td>
<td>{{$payment_transaction->txaction}} {{$payment_transaction->errormessage}}</td>
<td>{{$payment_transaction->created_at->format("d.m.Y H:i")}}</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
@endif
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>

View file

@ -0,0 +1,12 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
<a href="{{route('admin_customers')}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Kunden Details') }} <span class="text-muted">#{{$shopping_user->id}}</span>
</h4>
@include('admin.customer._detail')
<a href="{{route('admin_customers')}}" class="btn btn-sm btn-default mt-2 float-right">zurück</a>
@endsection

View file

@ -0,0 +1,120 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Kunden') }}
</h4>
<div class="card">
<div class="card-header">
<div class="form-row align-items-center">
{{-- <div class="col-sm-5 mb-2">
<label class="form-label" for="filter_user_shop_id">Filter Kunden/Berater</label>
<select class="custom-select" name="filter_customer_member" id="filter_customer_member">
<option value="">Filter aus</option>
<option value="customers" @if(get_user_attr('filter_customer_member') === 'customers') selected @endif>Kunden</option>
<option value="members" @if(get_user_attr('filter_customer_member') === 'members') selected @endif>Berater</option>
</select>
</div>--}}
<div class="col-sm-10 mb-2">
<label class="form-label" for="filter_user_shop_id">Filter zugewiesener Berater</label>
<select class="custom-select" name="filter_member_id" id="filter_member_id">
<option value="">Filter aus</option>
@foreach($filter_members as $member)
<option value="{{$member->id}}" @if(get_user_attr('filter_member_id') == $member->id) selected @endif>{{$member->first_name}} {{$member->last_name}} |{{$member->email}}</option>
@endforeach
</select>
</div>
<div class="col-2 col-sm-2 mb-2 mt-4">
<a href="{{ route('admin_customers') }}?reset=filter" data-toggle="tooltip" data-placement="top" title="Reset Filter" class="btn icon-btn btn-sm btn-outline-dark float-right">
<span class="fa fa-sync"></span>
</a>
</div>
</div>
</div>
<div class="card-datatable table-responsive">
<div class="ml-4">
<!--<a href="{{ route('admin_lead_edit', ['new']) }}" class="btn btn-sm btn-primary">{{__('Neuen Berater erstellen')}}</a> -->
</div>
<table class="datatables-customers table table-striped table-bordered" id="datatables-customers">
<thead>
<tr>
<th>#</th>
<th>{{__('Nummer')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('ist Berater')}}</th>
<th>{{__('Anrede')}}</th>
<th>{{__('Firma')}}</th>
<th>{{__('Vorname')}}</th>
<th>{{__('Nachname')}}</th>
<th>{{__('PLZ')}}</th>
<th>{{__('Stadt')}}</th>
<th>{{__('Land')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('zugewiesener Berater')}}</th>
<th>{{__('Datum')}}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="mt-4 ml-4">
<!-- <a href="{{ route('admin_lead_edit', ['new']) }}" class="btn btn-sm btn-primary">{{__('Neuen Berater erstellen')}}</a> -->
</div>
</div>
</div>
<script>
$( document ).ready(function() {
var oTable = $('#datatables-customers').DataTable({
"processing": true,
"serverSide": true,
ajax: {
url: '{!! route( 'admin_customer_datatable') !!}',
data: function(d) {
d.filter_member_id = $('select[name=filter_member_id]').val();
d.filter_customer_member = $('select[name=filter_customer_member]').val();
}
},
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', searchable: false},
{ data: 'number', name: 'number'},
{ data: 'billing_email', name: 'billing_email' },
{ data: 'isMember', name: 'isMember' },
{ data: 'billing_salutation', name: 'billing_salutation' },
{ data: 'billing_company', name: 'billing_company' },
{ data: 'billing_firstname', name: 'billing_firstname' },
{ data: 'billing_lastname', name: 'billing_lastname' },
{ data: 'billing_zipcode', name: 'billing_zipcode' },
{ data: 'billing_city', name: 'billing_city' },
{ data: 'billing_country_id', name: 'billing_country_id' },
{ data: 'orders', name: 'orders' },
{ data: 'member_id', name: 'member_id', searchable: false, orderable: false },
{ data: 'created_at', name: 'created_at' },
],
"bLengthChange": false,
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
}
});
$('#filter_member_id').on('change', function(){
oTable.draw();
});
$('#filter_customer_member').on('change', function(){
oTable.draw();
});
});
</script>
@endsection

View file

@ -16,7 +16,7 @@
<div class="form-group col-md-4">
<label class="form-label">{{ __('Sponsor') }}</label>
<select class="selectpicker" data-style="btn-light" name="m_sponsor" id="m_sponsor" data-live-search="true">
{!! HTMLHelper::getSponsorOptions($user->m_sponsor, true) !!}
{!! HTMLHelper::getMembersOptions($user->m_sponsor, true) !!}
</select>
</div>
</div>

View file

@ -0,0 +1,214 @@
{!! Form::open(['url' => route('admin_sales_customers_detail', [$current->id]), 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
<input type="hidden" name="action" value="{{$data['action']}}">
<input type="hidden" name="id" value="{{$data['id']}}">
<input type="hidden" name="back" value="{{$data['back']}}">
<div class="modal-header">
<h5 class="modal-title">
Der Kunde hat ggf. unter einer anderen Email-Adresse bestellt als sonst.
<span class="font-weight-light"> Bitte vor der Bearbeitung prüfen und dem richtigen Berater zuordnen.</span>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<p class="font-weight-bold">Die aktuelle Bestellung wurde getätigt von:</p>
<div class="bg-light p-3" style="border-radius: 6px">
<div class="row">
<div class="col-sm-6">
<p class="font-weight-bold">Rechnungsadresse:</p>
<p>
@if($current->billing_company)
Firma: {{ $current->billing_company }}<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($current->billing_salutation) }}
{{ $current->billing_firstname }}
<strong class="text-match">{{ $current->billing_lastname }}</strong><br>
{{ $current->billing_address }}
@if($current->billing_address_2)
/ {{ $current->billing_address_2 }}<br>
@else
<br>
@endif
<strong class="text-match">{{ $current->billing_zipcode }}</strong>
{{ $current->billing_city }}<br>
{{ $current->billing_email }}<br>
{{ $current->billing_phone }}<br>
{{ $current->billing_country->getLocated() }}
</p>
</div>
<div class="col-sm-6">
<p class="font-weight-bold">Lieferadresse:</p>
<p>
@if($current->same_as_billing)
{{__('email.checkout_mail_same_address')}}
@else
@if($current->shipping_company)
Firma: {{ $current->shipping_company }}<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($current->shipping_salutation) }}
{{ $current->shipping_firstname }}
{{ $current->shipping_lastname }}<br>
{{ $current->shipping_address }}
@if($current->shipping_address_2)
/ {{ $current->shipping_address_2 }}<br>
@else
<br>
@endif
{{ $current->shipping_zipcode }}
{{ $current->shipping_city }}<br>
{{ $current->shipping_email }}<br>
{{ $current->shipping_phone }}<br>
{{ $current->shipping_country->getLocated() }}
@endif
</p>
</div>
<div class="col-sm-12">
<hr>
<p class="font-weight-bold">Bestellt im Shop:</p>
<p>
@if($current->shopping_order && $current->shopping_order->user_shop)
<span class="text-muted">#{{$current->shopping_order->user_shop->user->number}}</span><br>
{{$current->shopping_order->user_shop->user->getFullName()}}<br>
{{$current->shopping_order->user_shop->user->account->zipcode}} {{$current->shopping_order->user_shop->user->account->city}}<br>
@if($current->shopping_order->user_shop)
@if($current->shopping_order->user_shop->user->isActive() && $current->shopping_order->user_shop->user->isActiveShop())
<a href="{{$current->shopping_order->user_shop->getSubdomain(false)}}" class="badge badge-success" target="_blank">{{$current->shopping_order->user_shop->getSubdomain(false)}}</a>
@else
<span class="badge badge-danger" target="_blank">{{$current->shopping_order->user_shop->getSubdomain(false)}}</span>
@endif
@endif
<label class="custom-control custom-radio mt-3">
<input type="radio" class="custom-control-input" name="is_like_shopping_user_id" value="{{$current->id}}">
<span class="custom-control-label">Nein, das ist ein neuer Kunde, Berater <span class="text-muted">#{{$current->shopping_order->user_shop->user->number}}</span> zuordnen</span>
</label>
@else
Keiner Bestellung / Shop zugeordnet
@endif
</p>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<p class="font-weight-bold">Ist das vielleicht dieser Kunde?</p>
@foreach($possibles as $possible)
@if(isset($possible[0]))
@php($possible = $possible[0])
@endif
<div class="bg-light p-3 mb-3" style="border-radius: 6px">
<div class="row">
<div class="col-sm-6">
<p class="font-weight-bold">Rechnungsadresse:</p>
<p>
@if($possible->billing_company)
Firma: {{ $possible->billing_company }}<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($possible->billing_salutation) }}
{{ $possible->billing_firstname }}
<strong class="text-match">{{ $possible->billing_lastname }}</strong> <span class="text-muted">#{{$possible->number}}</span> <br>
{{ $possible->billing_address }}
@if($possible->billing_address_2)
/ {{ $possible->billing_address_2 }}<br>
@else
<br>
@endif
<strong class="text-match">{{ $possible->billing_zipcode }}</strong>
{{ $possible->billing_city }}<br>
<strong class="text-danger">{{ $possible->billing_email }}</strong><br>
{{ $possible->billing_phone }}<br>
{{ $possible->billing_country->getLocated() }}
</p>
</div>
<div class="col-sm-6">
<p class="font-weight-bold">Lieferadresse:</p>
<p>
@if($possible->same_as_billing)
{{__('email.checkout_mail_same_address')}}
@else
@if($possible->shipping_company)
Firma: {{ $possible->shipping_company }}<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($possible->shipping_salutation) }}
{{ $possible->shipping_firstname }}
{{ $possible->shipping_lastname }}<br>
{{ $possible->shipping_address }}
@if($possible->shipping_address_2)
/ {{ $possible->shipping_address_2 }}<br>
@else
<br>
@endif
{{ $possible->shipping_zipcode }}
{{ $possible->shipping_city }}<br>
{{ $possible->shipping_email }}<br>
{{ $possible->shipping_phone }}<br>
{{ $possible->shipping_country->getLocated() }}
@endif
</p>
</div>
<div class="col-sm-12">
<hr>
<p class="font-weight-bold">Zugeordneter Berater:</p>
<p>
@if($possible->member_id)
<span class="text-muted">#{{$possible->member->number}}</span><br>
{{$possible->member->getFullName()}}<br>
{{$possible->member->account->zipcode}} {{$possible->member->account->city}}<br>
@if($possible->member->shop)
@if($possible->member->isActive() && $possible->member->isActiveShop())
<a href="{{$possible->member->shop->getSubdomain(false)}}" class="badge badge-success" target="_blank">{{$possible->member->shop->getSubdomain(false)}}</a>
@else
<span class="badge badge-danger" target="_blank">{{$possible->member->shop->getSubdomain(false)}}</span>
@endif
@else
Keinen Shop eingerichtet
@endif
<label class="custom-control custom-radio mt-3">
<input type="radio" class="custom-control-input" name="is_like_shopping_user_id" value="{{$possible->id}}">
<span class="custom-control-label">Stimmt, das ist der gleiche Kunde, Berater <span class="text-muted">#{{$possible->member->number}}</span> zuordnen</span>
</label>
@else
Keinem Berater zugeordnet
@endif
</p>
</div>
</div>
</div>
@endforeach
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col">
<label for="change_member_key" class="form-label">{{__('Passwort eingeben')}}*</label>
<input type="text" class="form-control" name="change_member_key" id="change_member_key" placeholder="mivita" required>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="custom-control custom-checkbox mt-3">
<input type="checkbox" class="custom-control-input" name="send_member_mail" value="send" checked>
<span class="custom-control-label">zugeordneten Berater die Bestellung als E-Mail zusenden</span>
</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
<button type="submit" class="btn btn-primary">{{__('übernehmen')}}</button>
</div>
{!! Form::close() !!}
<script type="text/javascript">
$( document ).ready(function() {
});
</script>

View file

@ -0,0 +1,73 @@
{!! Form::open(['url' => $route, 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
<div class="modal-header">
<h5 class="modal-title">
{{ __('Berater') }}
<span class="font-weight-light">zuweisen/ändern</span>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<input type="hidden" name="action" value="{{$data['action']}}">
<input type="hidden" name="id" value="{{$data['id']}}">
<input type="hidden" name="view" value="{{$data['view']}}">
<div class="form-row">
<div class="form-group col">
<label for="change_member_key" class="form-label">{{__('Passwort eingeben')}}*</label>
<input type="text" class="form-control" name="change_member_key" id="change_member_key" placeholder="mivita" required>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="change_member_id" class="form-label">{{ __('Berater zuweisen') }}*</label>
<select class="selectpicker" name="change_member_id" id="change_member_id" data-style="btn-light" data-live-search="true" required>
{!! HTMLHelper::getMembersOptions($value->member_id, true) !!}
</select>
<p class="text-muted">Es werden nur aktive Berater mit aktiven Accounts angezeigt.</p>
</div>
</div>
<input type="hidden" name="customer_set_member_for" value="0">
@if($data['view'] === 'sales_customer')
@if($value->member_id && $value->shopping_user && $value->shopping_user->number)
<div class="custom-controls-stacked">
<label class="custom-control custom-radio">
<input name="customer_set_member_for" value="0" type="radio" class="custom-control-input" checked="">
<span class="custom-control-label">Nur dieser Bestellung einen neuen Berater zuweisen</span>
</label>
<label class="custom-control custom-radio">
<input name="customer_set_member_for" value="1" type="radio" class="custom-control-input">
<span class="custom-control-label">Jeder Bestellung vom Kunden #{{$value->shopping_user->number}} einen neuen Berater zuweisen</span>
</label>
</div>
@endif
@endif
@if($data['view'] === 'customer')
@if($value->member_id && $value->number)
<div class="custom-controls-stacked">
<label class="custom-control custom-radio">
<input name="customer_set_member_for" value="0" type="radio" class="custom-control-input" checked="">
<span class="custom-control-label">Nur diesen Kunden Bestellung einen neuen Berater zuweisen</span>
</label>
<label class="custom-control custom-radio">
<input name="customer_set_member_for" value="1" type="radio" class="custom-control-input">
<span class="custom-control-label">Jeder Bestellung diesen Kunden #{{$value->number}} einen neuen Berater zuweisen</span>
</label>
</div>
@endif
@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
<button type="submit" class="btn btn-primary">{{__('übernehmen')}}</button>
</div>
{!! Form::close() !!}
<script type="text/javascript">
$( document ).ready(function() {
});
</script>

View file

@ -6,7 +6,7 @@
<h6 class="card-header">
{{__('Produkte')}}
<label class="custom-control custom-checkbox float-right mb-0">
<input type="checkbox" class="custom-control-input show-active-products" name="show_active_products" @if(Auth::user()->getSetting('show_active_products') === "true") checked @endif>
<input type="checkbox" class="custom-control-input show-active-products" name="show_active_products" @if(get_user_attr('show_active_products') === "true") checked @endif>
<span class="custom-control-label font-style-normal font-weight-normal">nur aktive anzeigen</span>
</label>
</h6>

View file

@ -0,0 +1,333 @@
<div class="card">
<!-- Status -->
<div class="card-body">
<strong class="mr-2">Status:</strong>
<span class="text-big">
{!! \App\Services\Payment::getShoppingOrderBadge($shopping_order); !!}
</span>
<span class="text-muted ml-1">{{$shopping_order->created_at->format("d.m.Y")}}</span>
</div>
<hr class="m-0">
<!-- / Status -->
<!-- Info -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-4 mb-3">
<div class="text-muted small">Bestelldatum</div>
{{$shopping_order->created_at->format("d.m.Y H:i")}}
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Anzahl Artikel</div>
{{$shopping_order->getItemsCount()}}
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Preis gesamt</div>
{{$shopping_order->getFormattedTotalShipping()}} &euro;
</div>
</div>
</div>
<hr class="m-0">
<!-- / Info -->
@if($isAdmin)
<!-- Member -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-8 mb-3">
@if(isset($change_member_error) && $change_member_error)
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger p-2">
<ul>
<li>{{ $change_member_error }}</li>
</ul>
</div>
</div>
</div>
@endif
<div class="text-muted small">Zugewiesener Berater</div>
@if($isView === 'sales_user')
@if($shopping_order->user_shop)
{{$shopping_order->user_shop->title}}
@endif
@endif
@if($isView === 'sales_customer')
@if($shopping_order->shopping_user && $shopping_order->shopping_user->is_like)
<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
data-id="{{$shopping_order->shopping_user->id}}"
data-action="shopping-user-is-like-member"
data-back="{{route('admin_sales_customers_detail', [$shopping_order->id])}}"
data-modal="modal-xl"
data-route="{{route('modal_load')}}"><span class="fa fa-edit"></span> Berater zuordnen</button>
@else
@if($shopping_order->member)
<a class="btn btn-xs btn-outline-primary" href="{{route('admin_lead_edit', [$shopping_order->member->id])}}"><i class="ion ion-ios-contacts"></i></a>
{{$shopping_order->member->getFullName()}} <span class="text-muted">#{{$shopping_order->member->number}}</span>
@endif
<button type="button" class="btn btn-xs btn-outline-secondary" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $shopping_order->id }}"
data-action="shopping-order-change-member"
data-view="{{$isView}}"
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>
@endif
@endif
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Gekauft im Shop</div>
@if($shopping_order->user_shop->user->isActive() && $shopping_order->user_shop->user->isActiveShop())
<a href="{{$shopping_order->user_shop->getSubdomain(false)}}" class="badge badge-success" target="_blank">{{$shopping_order->user_shop->getSubdomain(false)}}</a>
@else
<span class="badge badge-danger" target="_blank">{{$shopping_order->user_shop->getSubdomain(false)}}</span>
@endif
</div>
</div>
</div>
<hr class="m-0">
<!-- / Member -->
@endif
<!-- Billing -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Rechnungsadresse
</h6>
<div class="row">
@if($shopping_order->shopping_user->billing_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_order->shopping_user->billing_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_order->shopping_user->billing_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_order->shopping_user->billing_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_order->shopping_user->billing_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_order->shopping_user->billing_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_order->shopping_user->billing_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_order->shopping_user->billing_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_order->shopping_user->billing_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_order->shopping_user->billing_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_order->shopping_user->billing_country->getLocated() }}
</div>
</div>
</div>
<hr class="m-0">
<!-- / Billing -->
<!-- Shipping -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Lieferadresse
</h6>
@if($shopping_order->shopping_user->same_as_billing)
{{__('email.checkout_mail_same_address')}}
@else
<div class="row">
@if($shopping_order->shopping_user->shipping_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_order->shopping_user->shipping_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->shipping_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_order->shopping_user->shipping_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_order->shopping_user->shipping_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_order->shopping_user->shipping_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_order->shopping_user->shipping_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_order->shopping_user->shipping_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_order->shopping_user->shipping_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_order->shopping_user->shipping_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_order->shopping_user->shipping_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_order->shopping_user->shipping_country->getLocated() }}
</div>
</div>
@endif
</div>
<hr class="m-0">
<!-- / Shipping -->
<!-- Items -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Artikel
</h6>
<div class="table-responsive">
<table class="table table-bordered m-0" style="min-width:550px;">
<tbody>
<tr>
<th>Produkt</th>
<th>Anzahl</th>
<th>Preis</th>
</tr>
@foreach($shopping_order->shopping_order_items as $shopping_order_item)
<tr>
<td class="px-3 py-2">
<div class="media align-items-center">
@if($shopping_order_item->product->images)
@if($image = $shopping_order_item->product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="d-block ui-w-80 mr-4" alt>
@endif
@endif
<div class="media-body">
<a href="{{route('admin_product_edit', [$shopping_order_item->product->id])}}" class="d-block">{{ $shopping_order_item->product->name }}
<span class="text-muted">#{{ $shopping_order_item->product->number }}</span></a>
<small>
<span class="text-muted">Inhalt: </span> {{ $shopping_order_item->product->contents }}<br>
<span class="text-muted">Gewicht: </span> {{ $shopping_order_item->product->weight }} g<br>
<span class="text-muted">Points: </span> {{ $shopping_order_item->product->points }}
</small>
</div>
</div>
</td>
<!-- Set column width -->
<td class="align-middle px-3 py-2" style="width: 66px;">
{{ $shopping_order_item->qty }}
</td>
<!-- Set column width -->
<td class="text-right font-weight-semibold align-middle px-3 py-2" style="width: 100px;">
{{ $shopping_order_item->getFormattedPrice() }} &euro;
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<hr class="m-0">
<!-- / Payment -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Zahlung
</h6>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="min-width: 60px">#</th>
<th>Zahlungsart</th>
@if($isAdmin)<th>Referenznummer</th>@endif
<th>Gesamt</th>
<th>Status</th>
<th>Datum</th>
</tr>
</thead>
<tbody>
@php($count=0)
@foreach($shopping_order->shopping_payments as $shopping_payment)
<tr>
<th scope="row">{{++$count}}</th>
<td>{{$shopping_payment->getPaymentType()}}</td>
@if($isAdmin)<td>{{$shopping_payment->reference}}</td>@endif
<td>{{$shopping_payment->getPaymentAmount()}}</td>
<td>{!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!}</td>
<td>{{$shopping_payment->created_at->format("d.m.Y H:i")}}</td>
</tr>
@if($isAdmin && $shopping_payment->payment_transactions)
@php($ccount=0)
<tr>
<th scope="row" class="m-0">{{$count}}.{{++$ccount}}</th>
<td colspan="5" class="m-0 p-0">
<table class="table table-info table-borderless mb-0 small">
<thead>
<tr>
<th style="min-width: 80px">Request</th>
<th style="min-width: 80px">Status</th>
<th style="min-width: 200px">TX-Action</th>
<th style="min-width: 120px">Datum</th>
</tr>
</thead>
<tbody>
@foreach($shopping_payment->payment_transactions as $payment_transaction)
<tr>
<td>{{$payment_transaction->request}}</td>
<td>{{$payment_transaction->status}}</td>
<td>{{$payment_transaction->txaction}} {{$payment_transaction->errormessage}}</td>
<td>{{$payment_transaction->created_at->format("d.m.Y H:i")}}</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>

View file

@ -1,15 +1,11 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Bestellung Kunde') }}
<a href="{{route('admin_sales_customers')}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h4>
@include('admin.sales._detail')
<a href="{{route('admin_sales_customers')}}" class="btn btn-sm btn-default mt-2 float-right">zurück</a>
<div class="card">
<p>Ansicht Bestellung</p>
</div>
@endsection

View file

@ -6,12 +6,46 @@
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Bestellungen Kunden') }}
</h4>
<div class="card">
<div class="card-datatable table-responsive">
<table class="datatable-customers table table-striped table-bordered">
<div class="card-header">
<div class="form-row align-items-center">
<div class="col-sm-4 mb-2">
<label class="form-label" for="filter_user_shop_id">Filter zugewiesener Berater</label>
<select class="custom-select" name="filter_member_id" id="filter_member_id">
<option value="">Filter aus</option>
@foreach($filter_members as $member)
<option value="{{$member->id}}" @if(get_user_attr('filter_member_id') == $member->id) selected @endif>{{$member->first_name}} {{$member->last_name}} |{{$member->email}}</option>
@endforeach
</select>
</div>
<div class="col-sm-4 mb-2">
<label class="form-label" for="filter_user_shop_id">Filter Gekauft im Shop</label>
<select class="custom-select" name="filter_user_shop_id" id="filter_user_shop_id">
<option value="">Filter aus</option>
@foreach($filter_user_shops as $id=>$name)
<option value="{{$id}}" @if(get_user_attr('filter_user_shop_id') == $id) selected @endif>{{$name}}.{{config('app.domain').config('app.tld_care')}}</option>
@endforeach
</select>
</div>
<div class="col-10 col-sm-3 mb-2">
<label class="form-label" for="filter_txaction">Filter Status</label>
<select class="custom-select" name="filter_txaction" id="filter_txaction">
<option value="">Filter aus</option>
@foreach(\App\Services\Payment::$txaction_text as $id=>$name)
<option value="{{$id}}" @if(get_user_attr('filter_txaction') == $id) selected @endif>{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-2 col-sm-1 mb-2 mt-4">
<a href="{{ route('admin_sales_customers') }}?reset=filter" data-toggle="tooltip" data-placement="top" title="Reset Filter" class="btn icon-btn btn-sm btn-outline-dark float-right">
<span class="fa fa-sync"></span>
</a>
</div>
</div>
</div>
<div class="card-datatable table-responsive">
<table class="datatable-customers table table-striped table-bordered" id="datatable-customers">
<thead>
<tr>
<th>#</th>
@ -22,7 +56,8 @@
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('Shop')}}</th>
<th>{{__('zugewiesener Berater')}}</th>
<th>{{__('Gekauft im Shop')}}</th>
</tr>
</thead>
</table>
@ -30,29 +65,45 @@
</div>
<script>
$( document ).ready(function() {
$('.datatable-customers').dataTable({
"processing": true,
"serverSide": true,
"ajax": '{!! route('admin_sales_customers_datatable') !!}',
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', searchable: false },
{ data: 'billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'shopping_orders.created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'shopping_orders.total_shipping' },
{ data: 'orders', name: 'shopping_user.orders' },
{ data: 'user_shop_id', name: 'user_shop_id' },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
}
var oTable = $('#datatable-customers').DataTable({
"processing": true,
"serverSide": true,
ajax: {
url: '{!! route( 'admin_sales_customers_datatable') !!}',
data: function(d) {
d.filter_member_id = $('select[name=filter_member_id]').val();
d.filter_user_shop_id = $('select[name=filter_user_shop_id]').val();
d.filter_txaction = $('select[name=filter_txaction]').val();
}
},
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', name: 'id', searchable: false },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'shopping_user.orders', name: 'shopping_user.orders' },
{ data: 'member_id', name: 'member_id', searchable: false, orderable: false },
{ data: 'user_shop_id', name: 'user_shop_id', searchable: false, orderable: true },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
}
});
$('#filter_member_id').on('change', function(){
oTable.draw();
});
$('#filter_user_shop_id').on('change', function(){
oTable.draw();
});
$('#filter_txaction').on('change', function(){
oTable.draw();
});
});
</script>
@endsection

View file

@ -2,13 +2,11 @@
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Bestellung Berater') }}
<a href="{{route('admin_sales_users')}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Bestellung Berater') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h4>
@include('admin.sales._detail')
<a href="{{route('admin_sales_users')}}" class="btn btn-sm btn-default mt-2 float-right">zurück</a>
<div class="card">
<p>Ansicht Bestellung</p>
</div>
@endsection

View file

@ -22,7 +22,7 @@
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('User-Shop')}}</th>
<th>{{__('Berater-Shop')}}</th>
</tr>
</thead>
</table>
@ -37,13 +37,13 @@
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', searchable: false },
{ data: 'billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'billing_email', name: 'shopping_user.billing_email' },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'shopping_orders.created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'shopping_orders.total_shipping' },
{ data: 'orders', name: 'shopping_user.orders' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'shopping_user.orders', name: 'shopping_user.orders' },
{ data: 'auth_user_shop', name: 'auth_user_shop' },
],
"bLengthChange": false,

View file

@ -361,15 +361,18 @@
<td style="color:#37302d;line-height:1.6em;">
{{ $copy3line }}
<br>
@if($shopping_order->user_shop)
@if($shopping_order->user_shop->title)
<b>{{ $shopping_order->user_shop->title }}</b><br>
@if($shopping_order->member)
@if($shopping_order->member->shop && $shopping_order->member->isActiveShop())
@if($shopping_order->member->shop->title)
<b>{{ $shopping_order->member->shop->title }}</b><br>
@endif
@if($shopping_order->member->shop->contact)
{!! nl2br($shopping_order->member->shop->contact) !!}<br>
@endif
<a href="{{ $shopping_order->member->shop->getSubdomain(true) }}">{{ $shopping_order->member->shop->getSubdomain(true) }}</a>
@else
Dein Berater: {{$shopping_order->member->getFullName()}}
@endif
@if($shopping_order->user_shop->contact)
{!! nl2br($shopping_order->user_shop->contact) !!}<br>
@endif
<a href="{{ $shopping_order->user_shop->getSubdomain(true) }}">{{ $shopping_order->user_shop->getSubdomain(true) }}</a>
@endif
<hr><br>
{{ $greetings }} <br><b>{{ $sender }}</b>

View file

@ -349,16 +349,18 @@
<td style="color:#37302d;line-height:1.6em;">
{{ $copy3line }}
<br>
@if($shopping_order->user_shop)
@if($shopping_order->user_shop->title)
<b>{{ $shopping_order->user_shop->title }}</b><br>
@if($shopping_order->member)
@if($shopping_order->member->shop && $shopping_order->member->isActiveShop())
@if($shopping_order->member->shop->title)
<b>{{ $shopping_order->member->shop->title }}</b><br>
@endif
@if($shopping_order->member->shop->contact)
{!! nl2br($shopping_order->member->shop->contact) !!}<br>
@endif
<a href="{{ $shopping_order->member->shop->getSubdomain(true) }}">{{ $shopping_order->member->shop->getSubdomain(true) }}</a>
@else
Dein Berater: {{$shopping_order->member->getFullName()}}
@endif
@if($shopping_order->user_shop->contact)
{!! nl2br($shopping_order->user_shop->contact) !!}<br>
@endif
<a href="{{ $shopping_order->user_shop->getSubdomain(true) }}">{{ $shopping_order->user_shop->getSubdomain(true) }}</a>
@endif
<hr><br>
{{ $greetings }} <br><b>{{ $sender }}</b>

View file

@ -53,7 +53,7 @@
@yield('styles')
<!-- Application stylesheets -->
<link rel="stylesheet" href="{{ mix('/css/application.css') }}">
<link rel="stylesheet" href="{{ mix('/css/application.css') }}?v=1{{ get_file_last_time('js/application.css') }}">
<script src="{{ asset('/js/jquery.min.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('/css/cookieconsent.min.css') }}" />
@ -97,6 +97,12 @@
@yield('layout-content')
<div class="modal fade" id="modals-load-content">
<div class="modal-dialog modal-lg">
</div>
</div>
<!-- Core scripts -->
<script src="{{ mix('/vendor/libs/popper/popper.js') }}"></script>
<script src="{{ mix('/vendor/js/bootstrap.js') }}"></script>
@ -133,7 +139,7 @@
<!-- Application javascripts -->
<script src="{{ mix('/js/application.js') }}"></script>
<script src="{{ asset('/js/custom.js') }}?v=1"></script>
<script src="{{ asset('/js/custom.js') }}?v=1{{ get_file_last_time('/js/custom.js') }}"></script>
@yield('scripts')

View file

@ -27,7 +27,7 @@
<li class="sidenav-item{{ Request::is('user/shop') ? ' active' : '' }}">
<a href="{{ route('user_shop') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-cog"></i><div>{{ __('navigation.settings') }}</div></a>
</li>
<li class="sidenav-item{{ Request::is('user/shop/orders') ? ' active' : '' }}">
<li class="sidenav-item{{ Request::is('user/shop/orders', 'user/shop/order/*') ? ' active' : '' }}">
<a href="{{ route('user_shop_orders') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-cart"></i><div>{{ __('navigation.orders') }}</div></a>
</li>
</ul>
@ -56,6 +56,10 @@
<a href="{{ route('admin_leads') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-contacts"></i><div>{{ __('navigation.member') }}</div></a>
</li>
<li class="sidenav-item{{ Request::is('admin/customers') ? ' active' : '' }} {{ Request::is('admin/customer/edit/*') ? ' active' : '' }}">
<a href="{{ route('admin_customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-contacts"></i><div>{{ __('navigation.clients') }}</div></a>
</li>
<li class="sidenav-item @if(Request::is('admin/sales/*')) open @endif">
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
<i class="sidenav-icon ion ion-ios-cart"></i>
@ -147,6 +151,9 @@
<div>Tools</div>
</a>
<ul class="sidenav-menu">
<li class="sidenav-item{{ Request::is('sysadmin/tools/customers') ? ' active' : '' }}">
<a href="{{ route('sysadmin_tools_customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-contact"></i><div>Kunden</div></a>
</li>
<li class="sidenav-item{{ Request::is('sysadmin/tools/cronjobs') ? ' active' : '' }}">
<a href="{{ route('sysadmin_tools_cronjobs') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>Cron Jobs</div></a>
</li>

View file

@ -0,0 +1,51 @@
@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<h4 class="font-weight-bold mb-4">
Kunden
</h4>
<div class="card mb-4">
{{-- <div class="card-body">
<!-- Controls -->
{!! Form::open(['url' => url()->current(), 'class' => '']) !!}
<div class="form-group mb-1">
<label class="form-label" for="description">Description</label>
{{ Form::textarea('text', $text, array('class'=>'form-control', 'rows'=>20)) }}
</div>
<button type="submit" class="btn btn-primary"><i class="ion"></i> action</button>
{!! Form::close() !!}
</div>--}}
@if(count($values)>0)
<div class="card-body">
<!-- Controls -->
@foreach($values as $shopping_user)
<pre>{{$shopping_user->billing_email}} |
@if($shopping_user->shopping_order && $shopping_user->shopping_order->user_shop) {{ $shopping_user->shopping_order->user_shop->user_id}} @endif {{$shopping_user->orders}}</pre>
@endforeach
</div>
@endif
</div>
@endsection

View file

@ -31,7 +31,8 @@
<label class="form-label" for="description">Description</label>
{{ Form::textarea('text', $text, array('class'=>'form-control', 'rows'=>1)) }}
</div>
<button type="submit" class="btn btn-primary"><i class="ion"></i> action</button>
<button type="submit" name="action" value="first_run" class="btn btn-primary"><i class="ion"></i> first run</button>
<button type="submit" name="action" value="next_run" class="btn btn-primary"><i class="ion"></i> next run</button>
{!! Form::close() !!}
</div>

View file

@ -0,0 +1,11 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
<a href="{{route('user_shop_orders')}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h4>
@include('admin.sales._detail')
<a href="{{route('user_shop_orders')}}" class="btn btn-sm btn-default mt-2 float-right">zurück</a>
@endsection

View file

@ -14,12 +14,14 @@
<thead>
<tr>
<th>#</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<!--<th>{{__('Käufe')}}</th-->
</tr>
</thead>
</table>
@ -33,13 +35,14 @@
"ajax": '{!! route('user_shop_orders_datatable') !!}',
"order": [[0, "desc" ]],
"columns": [
// { data: 'id', searchable: false },
{ data: 'billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'shopping_orders.created_at' },
{ data: 'id', searchable: false },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'shopping_orders.total_shipping' },
{ data: 'total_shipping', name: 'total_shipping' },
// { data: 'shopping_user.orders', name: 'shopping_user.orders' },
],
"bLengthChange": false,
"iDisplayLength": 100,

View file

@ -192,6 +192,8 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::get('/home', 'HomeController@show')->name('home');
Route::post('/modal/load', 'ModalController@load')->name('modal_load');
/* Route::get('/user/edit', 'UserController@userEdit')->name('user_edit');
*/
@ -227,7 +229,7 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
//user shop Sales
Route::get('/user/shop/orders', 'User\ShopSalesController@orders')->name('user_shop_orders');
Route::get('/user/shop/order/detail', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail');
Route::get('/user/shop/order/detail/{id}', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail');
Route::get('/user/shop/orders/datatable', 'User\ShopSalesController@ordersDatatable')->name('user_shop_orders_datatable');
@ -296,6 +298,13 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::get('/admin/lead/edit/{id}', 'LeadController@edit')->name('admin_lead_edit');
Route::post('/admin/lead/edit/{id}', 'LeadController@editPost')->name('admin_lead_edit');
//leads
Route::get('/admin/customers', 'CustomerController@index')->name('admin_customers');
Route::get('/admin/customer/edit/{id}', 'CustomerController@edit')->name('admin_customer_edit');
Route::post('/admin/customer/edit/{id}', 'CustomerController@store')->name('admin_customer_edit');
Route::get('/admin/customer/datatable', 'CustomerController@getCustomers')->name('admin_customer_datatable');
Route::get('/admin/lead/change_mail/{id}', 'UserUpdateEmailController@adminChangeMail')->name('admin_lead_change_mail');
Route::post('/admin/lead/change_mail/{id}', 'UserUpdateEmailController@adminUpdateMail')->name('admin_lead_change_mail');
@ -312,11 +321,13 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
//sales
Route::get('/admin/sales/users', 'SalesController@users')->name('admin_sales_users');
Route::get('/admin/sales/users/detail/{id}', 'SalesController@usersDetail')->name('admin_sales_users_detail');
Route::post('/admin/sales/users/detail/{id}', 'SalesController@usersStore')->name('admin_sales_users_detail');
Route::get('/admin/sales/users/datatable', 'SalesController@usersDatatable')->name('admin_sales_users_datatable');
Route::get('/admin/sales/customers', 'SalesController@customers')->name('admin_sales_customers');
Route::get('/admin/sales/customers/detail/{id}', 'SalesController@customersDetail')->name('admin_sales_customers_detail');
Route::post('/admin/sales/customers/detail/{id}', 'SalesController@customersStore')->name('admin_sales_customers_detail');
Route::get('/admin/sales/customers/datatable', 'SalesController@customersDatatable')->name('admin_sales_customers_datatable');
});
@ -353,6 +364,9 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
//login pages for sysadmin
Route::group(['middleware' => ['sysadmin']], function() {
Route::get('/sysadmin/tools/customers', 'SyS\AdminToolsController@customers')->name('sysadmin_tools_customers');
Route::post('/sysadmin/tools/customers', 'SyS\AdminToolsController@customerStore')->name('sysadmin_tools_customers');
Route::get('/sysadmin/tools/domainssl', 'SyS\AdminToolsController@domainSSL')->name('sysadmin_tools_domainssl');
Route::post('/sysadmin/tools/domainssl', 'SyS\AdminToolsController@domainSSLStore')->name('sysadmin_tools_domainssl');