Merge branch 'master' into downloadable-link
This commit is contained in:
commit
f7b145b21a
|
|
@ -13,11 +13,14 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$queryBuilder = DB::table('invoices')
|
||||
->leftJoin('orders as ors', 'invoices.order_id', '=', 'ors.id')
|
||||
->select('invoices.id as id', 'ors.increment_id as order_id', 'invoices.state as state', 'invoices.base_grand_total as base_grand_total', 'invoices.created_at as created_at');
|
||||
->select('invoices.id as id', 'ors.increment_id as order_id', 'invoices.state as state', 'invoices.base_grand_total as base_grand_total', 'invoices.created_at as created_at')
|
||||
->selectRaw("CASE WHEN {$dbPrefix}invoices.increment_id IS NOT NULL THEN {$dbPrefix}invoices.increment_id ELSE {$dbPrefix}invoices.id END AS increment_id");
|
||||
|
||||
$this->addFilter('id', 'invoices.id');
|
||||
$this->addFilter('increment_id', 'invoices.increment_id');
|
||||
$this->addFilter('order_id', 'ors.increment_id');
|
||||
$this->addFilter('base_grand_total', 'invoices.base_grand_total');
|
||||
$this->addFilter('created_at', 'invoices.created_at');
|
||||
|
|
@ -28,9 +31,9 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.invoice-id'),
|
||||
'type' => 'number',
|
||||
'index' => 'increment_id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'type' => 'string',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ class ConfigurationForm extends FormRequest
|
|||
]);
|
||||
}
|
||||
|
||||
if (request()->has('sales.orderSettings.invoice_slip_design.logo')
|
||||
&& ! request()->input('sales.orderSettings.invoice_slip_design.logo.delete')
|
||||
if (request()->has('sales.invoice_setttings.invoice_slip_design.logo')
|
||||
&& ! request()->input('sales.invoice_setttings.invoice_slip_design.logo.delete')
|
||||
) {
|
||||
$this->rules = array_merge($this->rules, [
|
||||
'sales.orderSettings.invoice_slip_design.logo' => 'required|mimes:bmp,jpeg,jpg,png,webp|max:5000',
|
||||
'sales.invoice_setttings.invoice_slip_design.logo' => 'required|mimes:bmp,jpeg,jpg,png,webp|max:5000',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ class ConfigurationForm extends FormRequest
|
|||
return [
|
||||
'general.design.admin_logo.logo_image' => 'Logo Image',
|
||||
'general.design.admin_logo.favicon' => 'Favicon Image',
|
||||
'sales.orderSettings.invoice_slip_design.logo' => 'Invoice Logo'
|
||||
'sales.invoice_setttings.invoice_slip_design.logo' => 'Invoice Logo'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1442,6 +1442,12 @@ return [
|
|||
'order-number-length' => 'طول رقم الطلب',
|
||||
'order-number-suffix' => 'لاحقة رقم الطلب',
|
||||
'order-number-generator-class' => 'مولد رقم الطلب',
|
||||
'invoice-settings' => 'إعدادات الفاتورة',
|
||||
'invoice-number' => 'إعدادات رقم الفاتورة',
|
||||
'invoice-number-prefix' => 'بادئة رقم الفاتورة',
|
||||
'invoice-number-length' => 'طول رقم الفاتورة',
|
||||
'invoice-number-suffix' => 'لاحقة رقم الفاتورة',
|
||||
'invoice-number-generator-class' => 'مولد رقم الفاتورة',
|
||||
'minimum-order' => 'الحد الأدنى من إعدادات الطلب',
|
||||
'minimum-order-amount' => 'الحد الأدنى للطلب',
|
||||
'default' => 'إفتراضي',
|
||||
|
|
|
|||
|
|
@ -1376,114 +1376,120 @@ return [
|
|||
],
|
||||
'system' =>
|
||||
[
|
||||
'catalog' => 'Katalog',
|
||||
'homepage' => 'Homepage configuration',
|
||||
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
|
||||
'catalog' => 'Katalog',
|
||||
'homepage' => 'Homepage configuration',
|
||||
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
|
||||
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
|
||||
'allow-out-of-stock-items' => 'Allow out of stock items',
|
||||
'products' => 'Produkte',
|
||||
'guest-checkout' => 'Gastbestellungen',
|
||||
'allow-guest-checkout' => 'Gastbestellungen erlauben',
|
||||
'allow-guest-checkout-hint' => 'Hinweis: Wenn diese Option aktiviert ist, kann sie für jedes Produkt einzeln konfiguriert werden.',
|
||||
'review' => 'Überprüfen',
|
||||
'allow-guest-review' => 'Gastbewertungen erlauben',
|
||||
'inventory' => 'Inventar',
|
||||
'stock-options' => 'Inventaroptionen',
|
||||
'allow-backorders' => 'Nachbestellungen zulassen',
|
||||
'customer' => 'Kunden',
|
||||
'settings' => 'Einstellungen',
|
||||
'address' => 'Adresse',
|
||||
'street-lines' => 'Adresszeilen (Standard: 1)',
|
||||
'sales' => 'Vertrieb',
|
||||
'shipping-methods' => 'Versand-Methoden',
|
||||
'free-shipping' => 'Kostenloser Versand',
|
||||
'flate-rate-shipping' => 'Pauschale Versandkosten',
|
||||
'shipping' => 'Versand',
|
||||
'origin' => 'Herkunft',
|
||||
'country' => 'Land',
|
||||
'state' => 'Bundesland',
|
||||
'zip' => 'Postleitzahl',
|
||||
'city' => 'Stadt',
|
||||
'street-address' => 'Anschrift',
|
||||
'title' => 'Titel',
|
||||
'description' => 'Beschreibung',
|
||||
'rate' => 'Rate',
|
||||
'status' => 'Status',
|
||||
'calculate-tax' => 'Steuern berechnen',
|
||||
'type' => 'Typ',
|
||||
'payment-methods' => 'Zahlungsmethoden',
|
||||
'cash-on-delivery' => 'Nachnahme',
|
||||
'money-transfer' => 'Überweisung',
|
||||
'paypal-standard' => 'Paypal-Standard',
|
||||
'business-account' => 'Paypal-Geschäftskonto',
|
||||
'newsletter' => 'Newsletter-Abonnement',
|
||||
'newsletter-subscription' => 'Newsletter-Abonnement erlauben',
|
||||
'email' => 'E-Mail-Prüfung',
|
||||
'email-verification' => 'E-Mail-Prüfung erlauben',
|
||||
'sort_order' => 'Sortierreihenfolge',
|
||||
'general' => 'Allgemein',
|
||||
'footer' => 'Fußzeile',
|
||||
'content' => 'Inhalt',
|
||||
'footer-content' => 'Fußzeile Text',
|
||||
'footer-toggle' => 'Fußzeile aktiv',
|
||||
'locale-options' => 'Einheit-Optionen',
|
||||
'weight-unit' => 'Gewichtseinheit',
|
||||
'email-settings' => 'E-Mail Einstellungen',
|
||||
'email-sender-name' => 'E-Mail-Adresse des Absenders',
|
||||
'email-sender-name-tip' => 'This name will be displayed in the customers inbox',
|
||||
'shop-email-from' => 'E-Mail-Adresse des Shops (bei Bestellungen, etc.)',
|
||||
'shop-email-from-tip' => 'The email address of this channel to send emails to your customers',
|
||||
'admin-name' => 'Name des Admins',
|
||||
'admin-name-tip' => 'This name will be displayed in all admin emails',
|
||||
'admin-email' => 'E-Mail-Adresse des Admins',
|
||||
'admin-email-tip' => 'The email address of the admin for this channel to receive emails',
|
||||
'admin-page-limit' => 'Elemente pro Seite (Admin)',
|
||||
'design' => 'Design',
|
||||
'admin-logo' => 'Admin-Logo',
|
||||
'logo-image' => 'Logo-Bild',
|
||||
'credit-max' => 'Kunden Kredit Max',
|
||||
'credit-max-value' => 'Kredit Max-Wert',
|
||||
'use-credit-max' => 'Verwendung von Kredit-Max',
|
||||
'order-settings' => 'Bestelleinstellungen',
|
||||
'orderNumber' => 'Auftragsnummer Einstellungen',
|
||||
'order-number-prefix' => 'Auftragsnummer Präfix',
|
||||
'order-number-length' => 'Auftragsnummer Länge',
|
||||
'order-number-suffix' => 'Auftragsnummer Suffix',
|
||||
'order-number-generator-class' => 'Bestell nummern generator',
|
||||
'minimum-order' => 'Einstellungen für die Mindestbestellmenge',
|
||||
'minimum-order-amount' => 'Mindestbestellmenge',
|
||||
'default' => 'Standard',
|
||||
'sandbox' => 'Sandbox',
|
||||
'all-channels' => 'Alle',
|
||||
'all-locales' => 'Alle',
|
||||
'invoice-slip-design' => 'Rechnungsdesign',
|
||||
'logo' => 'Logo',
|
||||
'store-name' => 'Geschäftsname',
|
||||
'vat-number' => 'Umsatzsteuer-Identifikationsnummer',
|
||||
'contact-number' => 'Kontakt Nummer',
|
||||
'bank-details' => 'Bankdaten',
|
||||
'mailing-address' => 'Send Check to',
|
||||
'instructions' => 'Instructions',
|
||||
'custom-scripts' => 'Custom Scripts',
|
||||
'custom-css' => 'Custom CSS',
|
||||
'custom-javascript' => 'Custom Javascript',
|
||||
'paypal-smart-button' => 'PayPal',
|
||||
'client-id' => 'Client Id',
|
||||
'client-id-info' => 'Use "sb" for testing.',
|
||||
'client-secret' => 'Client Secret',
|
||||
'client-secret-info' => 'Add your secret key here',
|
||||
'accepted-currencies' => 'Accepted currencies',
|
||||
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
|
||||
'buy-now-button-display' => 'Allow customers to directly buy products',
|
||||
'width' => 'Width',
|
||||
'height' => 'Height',
|
||||
'cache-small-image' => 'Small Image',
|
||||
'cache-medium-image' => 'Medium Image',
|
||||
'cache-large-image' => 'Large Image',
|
||||
'generate-invoice' => 'Automatically generate the invoice after placing an order',
|
||||
'set-invoice-status' => 'Set the invoice status after creating the invoice to',
|
||||
'set-order-status' => 'Set the order status after creating the invoice to',
|
||||
'generate-invoice-applicable' => 'Applicable if automatic generate invoice is enabled'
|
||||
'allow-out-of-stock-items' => 'Allow out of stock items',
|
||||
'products' => 'Produkte',
|
||||
'guest-checkout' => 'Gastbestellungen',
|
||||
'allow-guest-checkout' => 'Gastbestellungen erlauben',
|
||||
'allow-guest-checkout-hint' => 'Hinweis: Wenn diese Option aktiviert ist, kann sie für jedes Produkt einzeln konfiguriert werden.',
|
||||
'review' => 'Überprüfen',
|
||||
'allow-guest-review' => 'Gastbewertungen erlauben',
|
||||
'inventory' => 'Inventar',
|
||||
'stock-options' => 'Inventaroptionen',
|
||||
'allow-backorders' => 'Nachbestellungen zulassen',
|
||||
'customer' => 'Kunden',
|
||||
'settings' => 'Einstellungen',
|
||||
'address' => 'Adresse',
|
||||
'street-lines' => 'Adresszeilen (Standard: 1)',
|
||||
'sales' => 'Vertrieb',
|
||||
'shipping-methods' => 'Versand-Methoden',
|
||||
'free-shipping' => 'Kostenloser Versand',
|
||||
'flate-rate-shipping' => 'Pauschale Versandkosten',
|
||||
'shipping' => 'Versand',
|
||||
'origin' => 'Herkunft',
|
||||
'country' => 'Land',
|
||||
'state' => 'Bundesland',
|
||||
'zip' => 'Postleitzahl',
|
||||
'city' => 'Stadt',
|
||||
'street-address' => 'Anschrift',
|
||||
'title' => 'Titel',
|
||||
'description' => 'Beschreibung',
|
||||
'rate' => 'Rate',
|
||||
'status' => 'Status',
|
||||
'calculate-tax' => 'Steuern berechnen',
|
||||
'type' => 'Typ',
|
||||
'payment-methods' => 'Zahlungsmethoden',
|
||||
'cash-on-delivery' => 'Nachnahme',
|
||||
'money-transfer' => 'Überweisung',
|
||||
'paypal-standard' => 'Paypal-Standard',
|
||||
'business-account' => 'Paypal-Geschäftskonto',
|
||||
'newsletter' => 'Newsletter-Abonnement',
|
||||
'newsletter-subscription' => 'Newsletter-Abonnement erlauben',
|
||||
'email' => 'E-Mail-Prüfung',
|
||||
'email-verification' => 'E-Mail-Prüfung erlauben',
|
||||
'sort_order' => 'Sortierreihenfolge',
|
||||
'general' => 'Allgemein',
|
||||
'footer' => 'Fußzeile',
|
||||
'content' => 'Inhalt',
|
||||
'footer-content' => 'Fußzeile Text',
|
||||
'footer-toggle' => 'Fußzeile aktiv',
|
||||
'locale-options' => 'Einheit-Optionen',
|
||||
'weight-unit' => 'Gewichtseinheit',
|
||||
'email-settings' => 'E-Mail Einstellungen',
|
||||
'email-sender-name' => 'E-Mail-Adresse des Absenders',
|
||||
'email-sender-name-tip' => 'This name will be displayed in the customers inbox',
|
||||
'shop-email-from' => 'E-Mail-Adresse des Shops (bei Bestellungen, etc.)',
|
||||
'shop-email-from-tip' => 'The email address of this channel to send emails to your customers',
|
||||
'admin-name' => 'Name des Admins',
|
||||
'admin-name-tip' => 'This name will be displayed in all admin emails',
|
||||
'admin-email' => 'E-Mail-Adresse des Admins',
|
||||
'admin-email-tip' => 'The email address of the admin for this channel to receive emails',
|
||||
'admin-page-limit' => 'Elemente pro Seite (Admin)',
|
||||
'design' => 'Design',
|
||||
'admin-logo' => 'Admin-Logo',
|
||||
'logo-image' => 'Logo-Bild',
|
||||
'credit-max' => 'Kunden Kredit Max',
|
||||
'credit-max-value' => 'Kredit Max-Wert',
|
||||
'use-credit-max' => 'Verwendung von Kredit-Max',
|
||||
'order-settings' => 'Bestelleinstellungen',
|
||||
'orderNumber' => 'Auftragsnummer Einstellungen',
|
||||
'order-number-prefix' => 'Auftragsnummer Präfix',
|
||||
'order-number-length' => 'Auftragsnummer Länge',
|
||||
'order-number-suffix' => 'Auftragsnummer Suffix',
|
||||
'order-number-generator-class' => 'Bestell nummern generator',
|
||||
'invoice-settings' => 'Rechnungseinstellungen',
|
||||
'invoice-number' => 'Rechnungsnummerneinstellungen',
|
||||
'invoice-number-prefix' => 'Rechnungsnummer-Präfix',
|
||||
'invoice-number-length' => 'Länge der Rechnungsnummer',
|
||||
'invoice-number-suffix' => 'Rechnungsnummer-Suffix',
|
||||
'invoice-number-generator-class' => 'Rechnungsnummerngenerator',
|
||||
'minimum-order' => 'Einstellungen für die Mindestbestellmenge',
|
||||
'minimum-order-amount' => 'Mindestbestellmenge',
|
||||
'default' => 'Standard',
|
||||
'sandbox' => 'Sandbox',
|
||||
'all-channels' => 'Alle',
|
||||
'all-locales' => 'Alle',
|
||||
'invoice-slip-design' => 'Rechnungsdesign',
|
||||
'logo' => 'Logo',
|
||||
'store-name' => 'Geschäftsname',
|
||||
'vat-number' => 'Umsatzsteuer-Identifikationsnummer',
|
||||
'contact-number' => 'Kontakt Nummer',
|
||||
'bank-details' => 'Bankdaten',
|
||||
'mailing-address' => 'Send Check to',
|
||||
'instructions' => 'Instructions',
|
||||
'custom-scripts' => 'Custom Scripts',
|
||||
'custom-css' => 'Custom CSS',
|
||||
'custom-javascript' => 'Custom Javascript',
|
||||
'paypal-smart-button' => 'PayPal',
|
||||
'client-id' => 'Client Id',
|
||||
'client-id-info' => 'Use "sb" for testing.',
|
||||
'client-secret' => 'Client Secret',
|
||||
'client-secret-info' => 'Add your secret key here',
|
||||
'accepted-currencies' => 'Accepted currencies',
|
||||
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
|
||||
'buy-now-button-display' => 'Allow customers to directly buy products',
|
||||
'width' => 'Width',
|
||||
'height' => 'Height',
|
||||
'cache-small-image' => 'Small Image',
|
||||
'cache-medium-image' => 'Medium Image',
|
||||
'cache-large-image' => 'Large Image',
|
||||
'generate-invoice' => 'Automatically generate the invoice after placing an order',
|
||||
'set-invoice-status' => 'Set the invoice status after creating the invoice to',
|
||||
'set-order-status' => 'Set the order status after creating the invoice to',
|
||||
'generate-invoice-applicable' => 'Applicable if automatic generate invoice is enabled',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1384,132 +1384,138 @@ return [
|
|||
|
||||
],
|
||||
'system' => [
|
||||
'catalog' => 'Catalog',
|
||||
'homepage' => 'Homepage configuration',
|
||||
'allow-out-of-stock-items' => 'Allow out of stock items',
|
||||
'products' => 'Products',
|
||||
'guest-checkout' => 'Guest Checkout',
|
||||
'allow-guest-checkout' => 'Allow Guest Checkout',
|
||||
'allow-guest-checkout-hint' => 'Hint: If turned on, this option can be configured for each product specifically.',
|
||||
'attribute' => 'Attribute',
|
||||
'image-upload-size' => 'Allowed Image Upload Size (in Kb)',
|
||||
'file-upload-size' => 'Allowed File Upload Size (in Kb)',
|
||||
'review' => 'Review',
|
||||
'allow-guest-review' => 'Allow Guest Review',
|
||||
'inventory' => 'Inventory',
|
||||
'stock-options' => 'Stock Options',
|
||||
'allow-backorders' => 'Allow Backorders',
|
||||
'customer' => 'Customer',
|
||||
'settings' => 'Settings',
|
||||
'address' => 'Address',
|
||||
'street-lines' => 'Lines in a Street Address',
|
||||
'sales' => 'Sales',
|
||||
'shipping-methods' => 'Shipping Methods',
|
||||
'free-shipping' => 'Free Shipping',
|
||||
'flate-rate-shipping' => 'Flat Rate Shipping',
|
||||
'shipping' => 'Shipping',
|
||||
'origin' => 'Origin',
|
||||
'country' => 'Country',
|
||||
'state' => 'State',
|
||||
'zip' => 'Zip',
|
||||
'city' => 'City',
|
||||
'street-address' => 'Street Address',
|
||||
'title' => 'Title',
|
||||
'description' => 'Description',
|
||||
'rate' => 'Rate',
|
||||
'status' => 'Status',
|
||||
'calculate-tax' => 'Calculate Tax',
|
||||
'type' => 'Type',
|
||||
'payment-methods' => 'Payment Methods',
|
||||
'cash-on-delivery' => 'Cash On Delivery',
|
||||
'money-transfer' => 'Money Transfer',
|
||||
'paypal-standard' => 'PayPal Standard',
|
||||
'business-account' => 'Business Account',
|
||||
'newsletter' => 'Newsletter Subscription',
|
||||
'newsletter-subscription' => 'Allow Newsletter Subscription',
|
||||
'email' => 'Email Verification',
|
||||
'email-verification' => 'Allow Email Verification',
|
||||
'sort_order' => 'Sort Order',
|
||||
'general' => 'General',
|
||||
'footer' => 'Footer',
|
||||
'content' => 'Content',
|
||||
'footer-content' => 'Footer Text',
|
||||
'footer-toggle' => 'Toggle footer',
|
||||
'locale-options' => 'Unit Options',
|
||||
'weight-unit' => 'Weight Unit',
|
||||
'email-settings' => 'Email Settings',
|
||||
'email-sender-name' => 'Email Sender Name',
|
||||
'email-sender-name-tip' => 'This name will be displayed in the customers inbox',
|
||||
'shop-email-from' => 'Shop Email Address',
|
||||
'shop-email-from-tip' => 'The email address of this channel to send emails to your customers',
|
||||
'admin-name' => 'Admin Name',
|
||||
'admin-name-tip' => 'This name will be displayed in all admin emails',
|
||||
'admin-email' => 'Admin Email',
|
||||
'admin-email-tip' => 'The email address of the admin for this channel to receive emails',
|
||||
'admin-page-limit' => 'Default Items Per Page (Admin)',
|
||||
'design' => 'Design',
|
||||
'admin-logo' => 'Admin Logo',
|
||||
'logo-image' => 'Logo Image',
|
||||
'credit-max' => 'Customer Credit Max',
|
||||
'credit-max-value' => 'Credit Max Value',
|
||||
'use-credit-max' => 'Use Credit Max',
|
||||
'order-settings' => 'Order Settings',
|
||||
'orderNumber' => 'Order Number Settings',
|
||||
'order-number-prefix' => 'Order Number Prefix',
|
||||
'order-number-length' => 'Order Number Length',
|
||||
'order-number-suffix' => 'Order Number Suffix',
|
||||
'minimum-order' => 'Minimum Order Settings',
|
||||
'minimum-order-amount' => 'Minimum Order Amount',
|
||||
'default' => 'Default',
|
||||
'sandbox' => 'Sandbox',
|
||||
'all-channels' => 'All Channels',
|
||||
'all-locales' => 'All Locales',
|
||||
'all-customer-groups' => 'All Customer groups',
|
||||
'invoice-slip-design' => 'Invoice Slip Design',
|
||||
'logo' => 'Logo',
|
||||
'storefront' => 'Storefront',
|
||||
'default-list-mode' => 'Default List Mode',
|
||||
'grid' => 'Grid',
|
||||
'list' => 'List',
|
||||
'products-per-page' => 'Products Per Page',
|
||||
'sort-by' => 'Sort By',
|
||||
'from-z-a' => 'From Z-A',
|
||||
'from-a-z' => 'From A-Z',
|
||||
'newest-first' => 'Newest First',
|
||||
'oldest-first' => 'Oldest First',
|
||||
'cheapest-first' => 'Cheapest First',
|
||||
'expensive-first' => 'Expensive First',
|
||||
'comma-seperated' => 'Comma Seperated',
|
||||
'favicon' => 'Favicon',
|
||||
'seo' => 'SEO',
|
||||
'rich-snippets' => 'Rich Snippets',
|
||||
'enable' => 'Enable',
|
||||
'show-weight' => 'Show Weight',
|
||||
'show-categories' => 'Show Categories',
|
||||
'show-images' => 'Show Images',
|
||||
'show-reviews' => 'Show Reviews',
|
||||
'show-ratings' => 'Show Ratings',
|
||||
'show-offers' => 'Show Offers',
|
||||
'show-sku' => 'Show SKU',
|
||||
'categories' => 'Categories',
|
||||
'store-name' => 'Store Name',
|
||||
'vat-number' => 'Vat Number',
|
||||
'contact-number' => 'Contact Number',
|
||||
'bank-details' => 'Bank Details',
|
||||
'mailing-address' => 'Send Check to',
|
||||
'instructions' => 'Instructions',
|
||||
'custom-scripts' => 'Custom Scripts',
|
||||
'custom-css' => 'Custom CSS',
|
||||
'custom-javascript' => 'Custom Javascript',
|
||||
'paypal-smart-button' => 'PayPal',
|
||||
'client-id' => 'Client Id',
|
||||
'client-id-info' => 'Use "sb" for testing.',
|
||||
'client-secret' => 'Client Secret',
|
||||
'client-secret-info' => 'Add your secret key here',
|
||||
'accepted-currencies' => 'Accepted currencies',
|
||||
'catalog' => 'Catalog',
|
||||
'homepage' => 'Homepage configuration',
|
||||
'allow-out-of-stock-items' => 'Allow out of stock items',
|
||||
'products' => 'Products',
|
||||
'guest-checkout' => 'Guest Checkout',
|
||||
'allow-guest-checkout' => 'Allow Guest Checkout',
|
||||
'allow-guest-checkout-hint' => 'Hint: If turned on, this option can be configured for each product specifically.',
|
||||
'attribute' => 'Attribute',
|
||||
'image-upload-size' => 'Allowed Image Upload Size (in Kb)',
|
||||
'file-upload-size' => 'Allowed File Upload Size (in Kb)',
|
||||
'review' => 'Review',
|
||||
'allow-guest-review' => 'Allow Guest Review',
|
||||
'inventory' => 'Inventory',
|
||||
'stock-options' => 'Stock Options',
|
||||
'allow-backorders' => 'Allow Backorders',
|
||||
'customer' => 'Customer',
|
||||
'settings' => 'Settings',
|
||||
'address' => 'Address',
|
||||
'street-lines' => 'Lines in a Street Address',
|
||||
'sales' => 'Sales',
|
||||
'shipping-methods' => 'Shipping Methods',
|
||||
'free-shipping' => 'Free Shipping',
|
||||
'flate-rate-shipping' => 'Flat Rate Shipping',
|
||||
'shipping' => 'Shipping',
|
||||
'origin' => 'Origin',
|
||||
'country' => 'Country',
|
||||
'state' => 'State',
|
||||
'zip' => 'Zip',
|
||||
'city' => 'City',
|
||||
'street-address' => 'Street Address',
|
||||
'title' => 'Title',
|
||||
'description' => 'Description',
|
||||
'rate' => 'Rate',
|
||||
'status' => 'Status',
|
||||
'calculate-tax' => 'Calculate Tax',
|
||||
'type' => 'Type',
|
||||
'payment-methods' => 'Payment Methods',
|
||||
'cash-on-delivery' => 'Cash On Delivery',
|
||||
'money-transfer' => 'Money Transfer',
|
||||
'paypal-standard' => 'PayPal Standard',
|
||||
'business-account' => 'Business Account',
|
||||
'newsletter' => 'Newsletter Subscription',
|
||||
'newsletter-subscription' => 'Allow Newsletter Subscription',
|
||||
'email' => 'Email Verification',
|
||||
'email-verification' => 'Allow Email Verification',
|
||||
'sort_order' => 'Sort Order',
|
||||
'general' => 'General',
|
||||
'footer' => 'Footer',
|
||||
'content' => 'Content',
|
||||
'footer-content' => 'Footer Text',
|
||||
'footer-toggle' => 'Toggle footer',
|
||||
'locale-options' => 'Unit Options',
|
||||
'weight-unit' => 'Weight Unit',
|
||||
'email-settings' => 'Email Settings',
|
||||
'email-sender-name' => 'Email Sender Name',
|
||||
'email-sender-name-tip' => 'This name will be displayed in the customers inbox',
|
||||
'shop-email-from' => 'Shop Email Address',
|
||||
'shop-email-from-tip' => 'The email address of this channel to send emails to your customers',
|
||||
'admin-name' => 'Admin Name',
|
||||
'admin-name-tip' => 'This name will be displayed in all admin emails',
|
||||
'admin-email' => 'Admin Email',
|
||||
'admin-email-tip' => 'The email address of the admin for this channel to receive emails',
|
||||
'admin-page-limit' => 'Default Items Per Page (Admin)',
|
||||
'design' => 'Design',
|
||||
'admin-logo' => 'Admin Logo',
|
||||
'logo-image' => 'Logo Image',
|
||||
'credit-max' => 'Customer Credit Max',
|
||||
'credit-max-value' => 'Credit Max Value',
|
||||
'use-credit-max' => 'Use Credit Max',
|
||||
'order-settings' => 'Order Settings',
|
||||
'orderNumber' => 'Order Number Settings',
|
||||
'order-number-prefix' => 'Order Number Prefix',
|
||||
'order-number-length' => 'Order Number Length',
|
||||
'order-number-suffix' => 'Order Number Suffix',
|
||||
'order-number-generator-class' => 'Order Number Generator',
|
||||
'invoice-settings' => 'Invoice Settings',
|
||||
'invoice-number' => 'Invoice Number Settings',
|
||||
'invoice-number-prefix' => 'Invoice Number Prefix',
|
||||
'invoice-number-length' => 'Invoice Number Length',
|
||||
'invoice-number-suffix' => 'Invoice Number Suffix',
|
||||
'invoice-number-generator-class' => 'Invoice Number Generator',
|
||||
'minimum-order' => 'Minimum Order Settings',
|
||||
'minimum-order-amount' => 'Minimum Order Amount',
|
||||
'default' => 'Default',
|
||||
'sandbox' => 'Sandbox',
|
||||
'all-channels' => 'All Channels',
|
||||
'all-locales' => 'All Locales',
|
||||
'all-customer-groups' => 'All Customer groups',
|
||||
'invoice-slip-design' => 'Invoice Slip Design',
|
||||
'logo' => 'Logo',
|
||||
'storefront' => 'Storefront',
|
||||
'default-list-mode' => 'Default List Mode',
|
||||
'grid' => 'Grid',
|
||||
'list' => 'List',
|
||||
'products-per-page' => 'Products Per Page',
|
||||
'sort-by' => 'Sort By',
|
||||
'from-z-a' => 'From Z-A',
|
||||
'from-a-z' => 'From A-Z',
|
||||
'newest-first' => 'Newest First',
|
||||
'oldest-first' => 'Oldest First',
|
||||
'cheapest-first' => 'Cheapest First',
|
||||
'expensive-first' => 'Expensive First',
|
||||
'comma-seperated' => 'Comma Seperated',
|
||||
'favicon' => 'Favicon',
|
||||
'seo' => 'SEO',
|
||||
'rich-snippets' => 'Rich Snippets',
|
||||
'enable' => 'Enable',
|
||||
'show-weight' => 'Show Weight',
|
||||
'show-categories' => 'Show Categories',
|
||||
'show-images' => 'Show Images',
|
||||
'show-reviews' => 'Show Reviews',
|
||||
'show-ratings' => 'Show Ratings',
|
||||
'show-offers' => 'Show Offers',
|
||||
'show-sku' => 'Show SKU',
|
||||
'categories' => 'Categories',
|
||||
'store-name' => 'Store Name',
|
||||
'vat-number' => 'Vat Number',
|
||||
'contact-number' => 'Contact Number',
|
||||
'bank-details' => 'Bank Details',
|
||||
'mailing-address' => 'Send Check to',
|
||||
'instructions' => 'Instructions',
|
||||
'custom-scripts' => 'Custom Scripts',
|
||||
'custom-css' => 'Custom CSS',
|
||||
'custom-javascript' => 'Custom Javascript',
|
||||
'paypal-smart-button' => 'PayPal',
|
||||
'client-id' => 'Client Id',
|
||||
'client-id-info' => 'Use "sb" for testing.',
|
||||
'client-secret' => 'Client Secret',
|
||||
'client-secret-info' => 'Add your secret key here',
|
||||
'accepted-currencies' => 'Accepted currencies',
|
||||
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
|
||||
'buy-now-button-display' => 'Allow customers to directly buy products',
|
||||
'order-number-generator-class' => 'Order Number Generator',
|
||||
'show-search-input-field' => 'Show Search Input Field',
|
||||
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
|
||||
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
|
||||
|
|
|
|||
|
|
@ -1454,6 +1454,12 @@ return [
|
|||
'order-number-length' => 'Largo para Pedido #',
|
||||
'order-number-suffix' => 'Sufijo para Pedido #',
|
||||
'order-number-generator-class' => 'Generado de Números de Pedido',
|
||||
'invoice-settings' => 'Configuración de facturas',
|
||||
'invoice-number' => 'Configuración del número de factura',
|
||||
'invoice-number-prefix' => 'Prefijo de número de factura',
|
||||
'invoice-number-length' => 'Longitud del número de factura',
|
||||
'invoice-number-suffix' => 'Sufijo de número de factura',
|
||||
'invoice-number-generator-class' => 'Generador de números de facturas',
|
||||
'minimum-order' => 'Configuración de Pedido Mínimo',
|
||||
'minimum-order-amount' => 'Cantidad Mínima de Pedido',
|
||||
'default' => 'Predeterminado',
|
||||
|
|
|
|||
|
|
@ -1434,6 +1434,12 @@ return [
|
|||
'order-number-length' => 'طول شماره سفارش',
|
||||
'order-number-suffix' => 'تعداد کافی شماره سفارش',
|
||||
'order-number-generator-class' => 'تولید کننده شماره سفارش',
|
||||
'invoice-settings' => 'تنظیمات فاکتور',
|
||||
'invoice-number' => 'تنظیمات شماره فاکتور',
|
||||
'invoice-number-prefix' => 'پیش شماره شماره فاکتور',
|
||||
'invoice-number-length' => 'طول شماره فاکتور',
|
||||
'invoice-number-suffix' => 'پسوند شماره فاکتور',
|
||||
'invoice-number-generator-class' => 'تولید کننده شماره فاکتور',
|
||||
'minimum-order' => 'حداقل تنظیمات سفارش',
|
||||
'minimum-order-amount' => 'حداقل مقدار سفارش',
|
||||
'default' => 'پیش فرض',
|
||||
|
|
|
|||
|
|
@ -1442,6 +1442,12 @@ return [
|
|||
'order-number-length' => 'Lunghezza Numero Ordine',
|
||||
'order-number-suffix' => 'Suffisso Numero Ordine',
|
||||
'order-number-generator-class' => 'Generatore di numeri dordine',
|
||||
'invoice-settings' => 'Impostazioni fattura',
|
||||
'invoice-number' => 'Impostazioni numero fattura',
|
||||
'invoice-number-prefix' => 'Prefisso numero fattura',
|
||||
'invoice-number-length' => 'Lunghezza numero fattura',
|
||||
'invoice-number-suffix' => 'Suffisso numero fattura',
|
||||
'invoice-number-generator-class' => 'Generatore di numeri di fattura',
|
||||
'minimum-order' => 'Impostazioni dell\'ordine minimo',
|
||||
'minimum-order-amount' => 'Importo minimo dell\'ordine',
|
||||
'default' => 'Default',
|
||||
|
|
|
|||
|
|
@ -1436,6 +1436,12 @@ return [
|
|||
'order-number-length' => 'Bestelnummer Lengte',
|
||||
'order-number-suffix' => 'Achtervoegsel bestelnummer',
|
||||
'order-number-generator-class' => 'Ordernummer Generator',
|
||||
'invoice-settings' => 'Factuurinstellingen',
|
||||
'invoice-number' => 'Instellingen factuurnummer',
|
||||
'invoice-number-prefix' => 'Voorvoegsel factuurnummer',
|
||||
'invoice-number-length' => 'Lengte factuurnummer',
|
||||
'invoice-number-suffix' => 'Achtervoegsel factuurnummer',
|
||||
'invoice-number-generator-class' => 'Factuurnummergenerator',
|
||||
'minimum-order' => 'Minimale bestelling instellen',
|
||||
'minimum-order-amount' => 'Minimaal bedrag van de bestelling',
|
||||
'default' => 'Standaard',
|
||||
|
|
|
|||
|
|
@ -1439,6 +1439,12 @@ return [
|
|||
'order-number-length' => 'Długość numeru zamówienia',
|
||||
'order-number-suffix' => 'Sufiks numeru zamówienia”',
|
||||
'order-number-generator-class' => 'Generator numeru zamówienia',
|
||||
'invoice-settings' => 'Ustawienia faktury',
|
||||
'invoice-number' => 'Ustawienia numeru faktury',
|
||||
'invoice-number-prefix' => 'Prefiks numeru faktury',
|
||||
'invoice-number-length' => 'Długość numeru faktury',
|
||||
'invoice-number-suffix' => 'Sufiks numeru faktury',
|
||||
'invoice-number-generator-class' => 'Generator numerów faktur',
|
||||
'minimum-order' => 'Minimalne ustawienia zamówienia',
|
||||
'minimum-order-amount' => 'Minimalna kwota zamówienia',
|
||||
'default' => 'Domyślna',
|
||||
|
|
|
|||
|
|
@ -1440,6 +1440,12 @@ return [
|
|||
'order-number-length' => 'Tamanho do Número do Pedido',
|
||||
'order-number-suffix' => 'Sufixo do Número de Pedido',
|
||||
'order-number-generator-class' => 'Gerador de número de pedido',
|
||||
'invoice-settings' => 'Configurações de fatura',
|
||||
'invoice-number' => 'Configurações de número de fatura',
|
||||
'invoice-number-prefix' => 'Prefixo do número da fatura',
|
||||
'invoice-number-length' => 'Comprimento do número da fatura',
|
||||
'invoice-number-suffix' => 'Sufixo do número da fatura',
|
||||
'invoice-number-generator-class' => 'Gerador de número de fatura',
|
||||
'minimum-order' => 'Configurações de pedido mínimo ',
|
||||
'minimum-order-amount' => 'Quantidade Mínima do Pedido',
|
||||
'default' => 'Padrão',
|
||||
|
|
|
|||
|
|
@ -1426,6 +1426,12 @@ return [
|
|||
'order-number-length' => 'Numara Uzunluğu',
|
||||
'order-number-suffix' => 'Numara Son Eki',
|
||||
'order-number-generator-class' => 'Sipariş Numarası Üreticisi',
|
||||
'invoice-settings' => 'Fatura Ayarları',
|
||||
'invoice-number' => 'Fatura Numarası Ayarları',
|
||||
'invoice-number-prefix' => 'Fatura Numarası Ön Eki',
|
||||
'invoice-number-length' => 'Fatura Numarası Uzunluğu',
|
||||
'invoice-number-suffix' => 'Fatura Numarası Eki',
|
||||
'invoice-number-generator-class' => 'Fatura Numarası Oluşturucu',
|
||||
'minimum-order' => 'Minimum Sipariş Ayarları',
|
||||
'minimum-order-amount' => 'Minimum Sipariş Tutarı',
|
||||
'default' => 'Varsayılan',
|
||||
|
|
|
|||
|
|
@ -127,9 +127,9 @@
|
|||
<h1 class="text-center">{{ __('admin::app.sales.invoices.invoice') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
@if (core()->getConfigData('sales.orderSettings.invoice_slip_design.logo'))
|
||||
@if (core()->getConfigData('sales.invoice_setttings.invoice_slip_design.logo'))
|
||||
<div class="image">
|
||||
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.orderSettings.invoice_slip_design.logo')) }}"/>
|
||||
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.invoice_setttings.invoice_slip_design.logo')) }}"/>
|
||||
</div>
|
||||
@endif
|
||||
<div class="merchant-details">
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
<div class="invoice-summary">
|
||||
<div class="row">
|
||||
<span class="label">{{ __('admin::app.sales.invoices.invoice-id') }} -</span>
|
||||
<span class="value">#{{ $invoice->id }}</span>
|
||||
<span class="value">#{{ $invoice->increment_id ?? $invoice->id }}</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('admin::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->increment_id ?? $invoice->id]) }}
|
||||
@stop
|
||||
|
||||
@section('content-wrapper')
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = '{{ route('admin.sales.invoices.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
|
||||
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->increment_id ?? $invoice->id]) }}
|
||||
|
||||
{!! view_render_event('sales.invoice.title.after', ['order' => $order]) !!}
|
||||
</h1>
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@
|
|||
<tbody>
|
||||
@foreach ($order->invoices as $invoice)
|
||||
<tr>
|
||||
<td>#{{ $invoice->id }}</td>
|
||||
<td>#{{ $invoice->increment_id ?? $invoice->id }}</td>
|
||||
<td>{{ $invoice->created_at }}</td>
|
||||
<td>#{{ $invoice->order->increment_id }}</td>
|
||||
<td>{{ $invoice->address->name }}</td>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
/**
|
||||
* Order Settings
|
||||
*/
|
||||
[
|
||||
'key' => 'sales.orderSettings',
|
||||
'name' => 'admin::app.admin.system.order-settings',
|
||||
|
|
@ -35,7 +38,7 @@ return [
|
|||
'locale_based' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'order_number_generator-class',
|
||||
'name' => 'order_number_generator_class',
|
||||
'title' => 'admin::app.admin.system.order-number-generator-class',
|
||||
'type' => 'text',
|
||||
'validation' => false,
|
||||
|
|
@ -57,8 +60,55 @@ return [
|
|||
'locale_based' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
/**
|
||||
* Invoice Settings
|
||||
*/
|
||||
[
|
||||
'key' => 'sales.invoice_setttings',
|
||||
'name' => 'admin::app.admin.system.invoice-settings',
|
||||
'sort' => 4,
|
||||
], [
|
||||
'key' => 'sales.orderSettings.invoice_slip_design',
|
||||
'key' => 'sales.invoice_setttings.invoice_number',
|
||||
'name' => 'admin::app.admin.system.invoice-number',
|
||||
'sort' => 0,
|
||||
'fields' => [
|
||||
[
|
||||
'name' => 'invoice_number_prefix',
|
||||
'title' => 'admin::app.admin.system.invoice-number-prefix',
|
||||
'type' => 'text',
|
||||
'validation' => false,
|
||||
'channel_based' => true,
|
||||
'locale_based' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'invoice_number_length',
|
||||
'title' => 'admin::app.admin.system.invoice-number-length',
|
||||
'type' => 'text',
|
||||
'validation' => 'numeric',
|
||||
'channel_based' => true,
|
||||
'locale_based' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'invoice_number_suffix',
|
||||
'title' => 'admin::app.admin.system.invoice-number-suffix',
|
||||
'type' => 'text',
|
||||
'validation' => false,
|
||||
'channel_based' => true,
|
||||
'locale_based' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'invoice_number_generator_class',
|
||||
'title' => 'admin::app.admin.system.invoice-number-generator-class',
|
||||
'type' => 'text',
|
||||
'validation' => false,
|
||||
'channel_based' => true,
|
||||
'locale_based' => true,
|
||||
],
|
||||
]
|
||||
], [
|
||||
'key' => 'sales.invoice_setttings.invoice_slip_design',
|
||||
'name' => 'admin::app.admin.system.invoice-slip-design',
|
||||
'sort' => 2,
|
||||
'fields' => [
|
||||
|
|
@ -70,5 +120,5 @@ return [
|
|||
'channel_based' => true,
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Sales\Contracts;
|
||||
|
||||
interface Sequencer
|
||||
{
|
||||
/**
|
||||
* Create and return the next sequence number for e.g. an order.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generate(): string;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Sales\Generators;
|
||||
|
||||
use Webkul\Sales\Models\Invoice;
|
||||
|
||||
class InvoiceSequencer extends Sequencer
|
||||
{
|
||||
/**
|
||||
* Create invoice sequencer instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setAllConfigs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all configs.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setAllConfigs()
|
||||
{
|
||||
$this->prefix = core()->getConfigData('sales.invoice_setttings.invoice_number.invoice_number_prefix');
|
||||
|
||||
$this->length = core()->getConfigData('sales.invoice_setttings.invoice_number.invoice_number_length');
|
||||
|
||||
$this->suffix = core()->getConfigData('sales.invoice_setttings.invoice_number.invoice_number_suffix');
|
||||
|
||||
$this->generatorClass = core()->getConfigData('sales.invoice_setttings.invoice_number.invoice_number_generator_class');
|
||||
|
||||
$this->lastId = $this->getLastId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLastId()
|
||||
{
|
||||
$lastOrder = Invoice::query()->orderBy('id', 'desc')->limit(1)->first();
|
||||
|
||||
return $lastOrder ? $lastOrder->id : 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Sales\Generators;
|
||||
|
||||
use Webkul\Sales\Models\Order;
|
||||
|
||||
class OrderSequencer extends Sequencer
|
||||
{
|
||||
/**
|
||||
* Create order sequencer instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setAllConfigs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all configs.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setAllConfigs()
|
||||
{
|
||||
$this->prefix = core()->getConfigData('sales.orderSettings.order_number.order_number_prefix');
|
||||
|
||||
$this->length = core()->getConfigData('sales.orderSettings.order_number.order_number_length');
|
||||
|
||||
$this->suffix = core()->getConfigData('sales.orderSettings.order_number.order_number_suffix');
|
||||
|
||||
$this->generatorClass = core()->getConfigData('sales.orderSettings.order_number.order_number_generator_class');
|
||||
|
||||
$this->lastId = $this->getLastId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLastId()
|
||||
{
|
||||
$lastOrder = Order::query()->orderBy('id', 'desc')->limit(1)->first();
|
||||
|
||||
return $lastOrder ? $lastOrder->id : 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Sales\Generators;
|
||||
|
||||
use Webkul\Sales\Contracts\Sequencer as SequencerContract;
|
||||
|
||||
class Sequencer implements SequencerContract
|
||||
{
|
||||
/**
|
||||
* Length.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $length;
|
||||
|
||||
/**
|
||||
* Prefix.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $prefix;
|
||||
|
||||
/**
|
||||
* Suffix.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $suffix;
|
||||
|
||||
/**
|
||||
* Generator class.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $generatorClass;
|
||||
|
||||
/**
|
||||
* Last id.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $lastId = 0;
|
||||
|
||||
/**
|
||||
* Set length from the core config.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setLength($configKey)
|
||||
{
|
||||
$this->length = core()->getConfigData($configKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set prefix from the core config.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setPrefix($configKey)
|
||||
{
|
||||
$this->prefix = core()->getConfigData($configKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set suffix from the core config.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setSuffix($configKey)
|
||||
{
|
||||
$this->suffix = core()->getConfigData($configKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set generator class from the core config.
|
||||
*
|
||||
* @param string $configKey
|
||||
* @return void
|
||||
*/
|
||||
public function setGeneratorClass($configKey)
|
||||
{
|
||||
$this->generatorClass = core()->getConfigData($configKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve generator class.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function resolveGeneratorClass()
|
||||
{
|
||||
if (
|
||||
$this->generatorClass !== ''
|
||||
&& class_exists($this->generatorClass)
|
||||
&& in_array(SequencerContract::class, class_implements($this->generatorClass), true)
|
||||
) {
|
||||
return app($this->generatorClass)->generate();
|
||||
}
|
||||
|
||||
return $this->generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the next sequence number for e.g. an order.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
if ($this->length && ($this->prefix || $this->suffix)) {
|
||||
$number = ($this->prefix) . sprintf(
|
||||
"%0{$this->length}d",
|
||||
0
|
||||
) . ($this->lastId + 1) . ($this->suffix);
|
||||
} else {
|
||||
$number = $this->lastId + 1;
|
||||
}
|
||||
|
||||
return $number;
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Event;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Webkul\Sales\Contracts\Invoice;
|
||||
use Webkul\Sales\Generators\InvoiceSequencer;
|
||||
|
||||
class InvoiceRepository extends Repository
|
||||
{
|
||||
|
|
@ -103,6 +104,7 @@ class InvoiceRepository extends Repository
|
|||
}
|
||||
|
||||
$invoice = $this->model->create([
|
||||
'increment_id' => $this->generateIncrementId(),
|
||||
'order_id' => $order->id,
|
||||
'total_qty' => $totalQty,
|
||||
'state' => $state,
|
||||
|
|
@ -221,6 +223,16 @@ class InvoiceRepository extends Repository
|
|||
return $invoice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate increment id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function generateIncrementId()
|
||||
{
|
||||
return app(InvoiceSequencer::class)->resolveGeneratorClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Webkul\Sales\Contracts\Invoice $invoice
|
||||
* @return \Webkul\Sales\Contracts\Invoice
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@
|
|||
|
||||
namespace Webkul\Sales\Repositories;
|
||||
|
||||
use Webkul\Sales\Contracts\Order;
|
||||
use Illuminate\Container\Container as App;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Shop\Generators\Sequencer;
|
||||
use Illuminate\Container\Container as App;
|
||||
use Webkul\Shop\Generators\OrderNumberIdSequencer;
|
||||
use Webkul\Sales\Contracts\Order;
|
||||
use Webkul\Sales\Generators\OrderSequencer;
|
||||
|
||||
class OrderRepository extends Repository
|
||||
{
|
||||
|
|
@ -213,19 +212,7 @@ class OrderRepository extends Repository
|
|||
*/
|
||||
public function generateIncrementId()
|
||||
{
|
||||
/**
|
||||
* @var $generatorClass Sequencer
|
||||
*/
|
||||
$generatorClass = core()->getConfigData('sales.orderSettings.order_number.order_number_generator-class') ?: false;
|
||||
|
||||
if ($generatorClass !== false
|
||||
&& class_exists($generatorClass)
|
||||
&& in_array(Sequencer::class, class_implements($generatorClass), true)
|
||||
) {
|
||||
return $generatorClass::generate();
|
||||
}
|
||||
|
||||
return OrderNumberIdSequencer::generate();
|
||||
return app(OrderSequencer::class)->resolveGeneratorClass();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Webkul\Shop\Generators;
|
||||
|
||||
|
||||
use Webkul\Sales\Models\Order;
|
||||
|
||||
class OrderNumberIdSequencer implements Sequencer
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function generate(): string
|
||||
{
|
||||
foreach ([
|
||||
'Prefix' => 'prefix',
|
||||
'Length' => 'length',
|
||||
'Suffix' => 'suffix',
|
||||
] as
|
||||
$varSuffix => $confKey) {
|
||||
$var = "invoiceNumber{$varSuffix}";
|
||||
$$var = core()->getConfigData('sales.orderSettings.order_number.order_number_' . $confKey) ?: false;
|
||||
}
|
||||
|
||||
$lastOrder = Order::query()->orderBy('id', 'desc')->limit(1)->first();
|
||||
$lastId = $lastOrder ? $lastOrder->id : 0;
|
||||
|
||||
if ($invoiceNumberLength && ($invoiceNumberPrefix || $invoiceNumberSuffix)) {
|
||||
$invoiceNumber = ($invoiceNumberPrefix) . sprintf("%0{$invoiceNumberLength}d",
|
||||
0) . ($lastId + 1) . ($invoiceNumberSuffix);
|
||||
} else {
|
||||
$invoiceNumber = $lastId + 1;
|
||||
}
|
||||
|
||||
return $invoiceNumber;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Webkul\Shop\Generators;
|
||||
|
||||
|
||||
interface Sequencer
|
||||
{
|
||||
/**
|
||||
* create and return the next sequence number for e.g. an order
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function generate(): string;
|
||||
}
|
||||
|
|
@ -129,9 +129,9 @@
|
|||
<h1 class="text-center">{{ __('admin::app.sales.invoices.invoice') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
@if (core()->getConfigData('sales.orderSettings.invoice_slip_design.logo'))
|
||||
@if (core()->getConfigData('sales.invoice_setttings.invoice_slip_design.logo'))
|
||||
<div class="image">
|
||||
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.orderSettings.invoice_slip_design.logo')) }}" alt=""/>
|
||||
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.invoice_setttings.invoice_slip_design.logo')) }}" alt=""/>
|
||||
</div>
|
||||
@endif
|
||||
<div class="merchant-details">
|
||||
|
|
@ -160,7 +160,7 @@
|
|||
|
||||
<div class="row">
|
||||
<span class="label">{{ __('shop::app.customer.account.order.view.invoice-id') }} -</span>
|
||||
<span class="value">#{{ $invoice->id }}</span>
|
||||
<span class="value">#{{ $invoice->increment_id ?? $invoice->id }}</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@
|
|||
|
||||
<tr class="bold">
|
||||
<td>{{ __('shop::app.customer.account.order.view.total-due') }}</td>
|
||||
|
||||
|
||||
<td>-</td>
|
||||
|
||||
@if($order->status !== 'canceled')
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
|
||||
<div class="sale-section">
|
||||
<div class="secton-title">
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-invoice', ['invoice_id' => $invoice->id]) }}</span>
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-invoice', ['invoice_id' => $invoice->increment_id ?? $invoice->id]) }}</span>
|
||||
|
||||
<a href="{{ route('customer.orders.print', $invoice->id) }}" class="pull-right">
|
||||
{{ __('shop::app.customer.account.order.view.print') }}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div style="padding: 30px;">
|
||||
<div style="font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 34px;">
|
||||
<span style="font-weight: bold;">
|
||||
{{ __('shop::app.mail.invoice.heading', ['order_id' => $order->increment_id, 'invoice_id' => $invoice->id]) }}
|
||||
{{ __('shop::app.mail.invoice.heading', ['order_id' => $order->increment_id, 'invoice_id' => $invoice->increment_id ?? $invoice->id]) }}
|
||||
</span> <br>
|
||||
|
||||
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
|
||||
|
|
@ -49,15 +49,15 @@
|
|||
<div>
|
||||
{{ $order->shipping_address->address1 }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ $order->shipping_address->postcode . " " . $order->shipping_address->city }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ $order->shipping_address->state }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ core()->country_name($order->shipping_address->country) }}
|
||||
</div>
|
||||
|
|
@ -94,15 +94,15 @@
|
|||
<div>
|
||||
{{ $order->billing_address->address1 }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ $order->billing_address->postcode . " " . $order->billing_address->city }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ $order->billing_address->state }}
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
{{ core()->country_name($order->billing_address->country) }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@
|
|||
|
||||
<div class="sale-section">
|
||||
<div class="section-title">
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-invoice', ['invoice_id' => $invoice->id]) }}</span>
|
||||
<span>{{ __('shop::app.customer.account.order.view.individual-invoice', ['invoice_id' => $invoice->increment_id ?? $invoice->id]) }}</span>
|
||||
|
||||
<a href="{{ route('customer.orders.print', $invoice->id) }}" class="float-right">
|
||||
{{ __('shop::app.customer.account.order.view.print') }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue