This commit is contained in:
Mohit Panjwani
2022-03-06 12:25:44 +05:30
30 changed files with 209 additions and 117 deletions

View File

@ -6,6 +6,7 @@ use Crater\Http\Controllers\Controller;
use Crater\Http\Requests\UpdateSettingsRequest; use Crater\Http\Requests\UpdateSettingsRequest;
use Crater\Models\Company; use Crater\Models\Company;
use Crater\Models\CompanySetting; use Crater\Models\CompanySetting;
use Illuminate\Support\Arr;
class UpdateCompanySettingsController extends Controller class UpdateCompanySettingsController extends Controller
{ {
@ -20,10 +21,13 @@ class UpdateCompanySettingsController extends Controller
$company = Company::find($request->header('company')); $company = Company::find($request->header('company'));
$this->authorize('manage company', $company); $this->authorize('manage company', $company);
$companyCurrency = CompanySetting::getSetting('currency', $request->header('company'));
$data = $request->settings; $data = $request->settings;
if ($companyCurrency !== $data['currency'] && $company->hasTransactions()) { if (
Arr::exists($data, 'currency') &&
(CompanySetting::getSetting('currency', $company->id) !== $data['currency']) &&
$company->hasTransactions()
) {
return response()->json([ return response()->json([
'success' => false, 'success' => false,
'message' => 'Cannot update company currency after transactions are created.' 'message' => 'Cannot update company currency after transactions are created.'

View File

@ -83,7 +83,7 @@
? notification.message ? notification.message
: success : success
? 'Successful' ? 'Successful'
: 'Somthing went wrong' : 'Something went wrong'
}} }}
</p> </p>
</div> </div>

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Opakující se faktura úspěšně naklonována", "cloned_successfully": "Opakující se faktura úspěšně naklonována",
"clone_invoice": "Naklonovat opakující se fakturu", "clone_invoice": "Naklonovat opakující se fakturu",
"confirm_clone": "Tato opakující se faktura bude naklonována do nové opakující se faktury", "confirm_clone": "Tato opakující se faktura bude naklonována do nové opakující se faktury",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Název položky", "title": "Název položky",
"description": "Popis", "description": "Popis",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Serienrechnung erfolgreich kopiert", "cloned_successfully": "Serienrechnung erfolgreich kopiert",
"clone_invoice": "Serienrechnung kopieren", "clone_invoice": "Serienrechnung kopieren",
"confirm_clone": "Diese Serienrechnung wird in eine neue Serienrechnung kopiert", "confirm_clone": "Diese Serienrechnung wird in eine neue Serienrechnung kopiert",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Titel des Artikels", "title": "Titel des Artikels",
"description": "Beschreibung", "description": "Beschreibung",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Επαναλαμβανόμενο τιμολόγιο κλωνοποιήθηκε επιτυχής", "cloned_successfully": "Επαναλαμβανόμενο τιμολόγιο κλωνοποιήθηκε επιτυχής",
"clone_invoice": "Δημιουργία Επαναλαμβανόμενου Τιμολογίου", "clone_invoice": "Δημιουργία Επαναλαμβανόμενου Τιμολογίου",
"confirm_clone": "Αυτό το επαναλαμβανόμενο τιμολόγιο θα κλωνοποιηθεί σε ένα νέο επαναλαμβανόμενο τιμολόγιο", "confirm_clone": "Αυτό το επαναλαμβανόμενο τιμολόγιο θα κλωνοποιηθεί σε ένα νέο επαναλαμβανόμενο τιμολόγιο",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Τίτλος Προϊόντος", "title": "Τίτλος Προϊόντος",
"description": "Περιγραφή", "description": "Περιγραφή",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Factura recurrente clonada con éxito", "cloned_successfully": "Factura recurrente clonada con éxito",
"clone_invoice": "Clonar factura recurrente", "clone_invoice": "Clonar factura recurrente",
"confirm_clone": "Esta factura recurrente será clonada en una nueva factura recurrente", "confirm_clone": "Esta factura recurrente será clonada en una nueva factura recurrente",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Título del artículo", "title": "Título del artículo",
"description": "Descripción", "description": "Descripción",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -4,7 +4,7 @@
"customers": "Asiakkaat", "customers": "Asiakkaat",
"items": "Tuotteet", "items": "Tuotteet",
"invoices": "Laskut", "invoices": "Laskut",
"recurring-invoices": "Recurring Invoices", "recurring-invoices": "Toistuvat laskut",
"expenses": "Kulut", "expenses": "Kulut",
"estimates": "Tarjoukset", "estimates": "Tarjoukset",
"payments": "Maksut", "payments": "Maksut",
@ -12,7 +12,7 @@
"settings": "Asetukset", "settings": "Asetukset",
"logout": "Kirjaudu ulos", "logout": "Kirjaudu ulos",
"users": "Käyttäjät", "users": "Käyttäjät",
"modules": "Modules" "modules": "Moduulit"
}, },
"general": { "general": {
"add_company": "Lisää Yritys", "add_company": "Lisää Yritys",
@ -29,9 +29,9 @@
"to_date": "Päivään", "to_date": "Päivään",
"from": "Lähettäjä", "from": "Lähettäjä",
"to": "Vastaanottaja", "to": "Vastaanottaja",
"ok": "Ok", "ok": "OK",
"yes": "Yes", "yes": "Kyllä",
"no": "No", "no": "Ei",
"sort_by": "Järjestä", "sort_by": "Järjestä",
"ascending": "Nouseva", "ascending": "Nouseva",
"descending": "Laskeva", "descending": "Laskeva",
@ -39,7 +39,7 @@
"body": "Sisältö", "body": "Sisältö",
"message": "Viesti", "message": "Viesti",
"send": "Lähetä", "send": "Lähetä",
"preview": "Preview", "preview": "Esikatselu",
"go_back": "Palaa takaisin", "go_back": "Palaa takaisin",
"back_to_login": "Takaisin sisäänkirjautumiseen?", "back_to_login": "Takaisin sisäänkirjautumiseen?",
"home": "Koti", "home": "Koti",
@ -65,7 +65,7 @@
"sent": "Lähetetty", "sent": "Lähetetty",
"all": "Kaikki", "all": "Kaikki",
"select_all": "Valitse kaikki", "select_all": "Valitse kaikki",
"select_template": "Select Template", "select_template": "Valitse Malli",
"choose_file": "Klikkaa tästä valitaksesi tiedoston", "choose_file": "Klikkaa tästä valitaksesi tiedoston",
"choose_template": "Valitse pohja", "choose_template": "Valitse pohja",
"choose": "Valitse", "choose": "Valitse",
@ -76,7 +76,7 @@
"are_you_sure": "Oletko varma?", "are_you_sure": "Oletko varma?",
"list_is_empty": "Lista on tyhjä.", "list_is_empty": "Lista on tyhjä.",
"no_tax_found": "Verokantoja ei löytynyt!", "no_tax_found": "Verokantoja ei löytynyt!",
"four_zero_four": "404", "four_zero_four": "404 - Sivua ei löydy",
"you_got_lost": "Oho! Taisit eksyä!", "you_got_lost": "Oho! Taisit eksyä!",
"go_home": "Palaa kotisivulle", "go_home": "Palaa kotisivulle",
"test_mail_conf": "Testi sähköposti asetukset", "test_mail_conf": "Testi sähköposti asetukset",
@ -92,12 +92,12 @@
"choose_note": "Valitse viesti", "choose_note": "Valitse viesti",
"no_note_found": "Viestejä ei löytynyt", "no_note_found": "Viestejä ei löytynyt",
"insert_note": "Lisää viesti", "insert_note": "Lisää viesti",
"copied_pdf_url_clipboard": "Copied PDF url to clipboard!", "copied_pdf_url_clipboard": "Kopioitu PDF url leikepöydälle!",
"copied_url_clipboard": "Copied url to clipboard!", "copied_url_clipboard": "URL-osoite kopioitu leikepöydälle!",
"docs": "Docs", "docs": "Asiakirjat",
"do_you_wish_to_continue": "Do you wish to continue?", "do_you_wish_to_continue": "Haluatko jatkaa?",
"note": "Note", "note": "Viesti",
"pay_invoice": "Pay Invoice", "pay_invoice": "Maksa Lasku",
"login_successfully": "Logged in successfully!", "login_successfully": "Logged in successfully!",
"logged_out_successfully": "Logged out successfully", "logged_out_successfully": "Logged out successfully",
"mark_as_default": "Mark as default" "mark_as_default": "Mark as default"
@ -421,7 +421,7 @@
"select_invoice": "Valitse lasku", "select_invoice": "Valitse lasku",
"no_matching_invoices": "Vastaavia laskuja ei ole!", "no_matching_invoices": "Vastaavia laskuja ei ole!",
"mark_as_sent_successfully": "Lasku merkitty lähetetyksi onnistuneesti", "mark_as_sent_successfully": "Lasku merkitty lähetetyksi onnistuneesti",
"invoice_sent_successfully": "Invoice sent successfully", "invoice_sent_successfully": "Lasku lähetettiin onnistuneesti",
"cloned_successfully": "Lasku kopioitu onnistuneesti", "cloned_successfully": "Lasku kopioitu onnistuneesti",
"clone_invoice": "Kopioi lasku", "clone_invoice": "Kopioi lasku",
"confirm_clone": "Tämä lasku kopioidaan uudeksi laskuksi", "confirm_clone": "Tämä lasku kopioidaan uudeksi laskuksi",
@ -447,57 +447,57 @@
"marked_as_sent_message": "Lasku merkittiin lähetetyksi onnistuneesti", "marked_as_sent_message": "Lasku merkittiin lähetetyksi onnistuneesti",
"something_went_wrong": "jotain meni vikaan", "something_went_wrong": "jotain meni vikaan",
"invalid_due_amount_message": "Laskun summa ei voi olla pienempi kuin maksettu summa laskusta. Päivitä lasku tai poista linkitetty maksusuoritus jatkaaksesi.", "invalid_due_amount_message": "Laskun summa ei voi olla pienempi kuin maksettu summa laskusta. Päivitä lasku tai poista linkitetty maksusuoritus jatkaaksesi.",
"mark_as_default_invoice_template_description": "If enabled, the selected template will be automatically selected for new invoices." "mark_as_default_invoice_template_description": "Jos käytössä, valittu malli valitaan automaattisesti uusille laskuille."
}, },
"recurring_invoices": { "recurring_invoices": {
"title": "Recurring Invoices", "title": "Toistuvat laskut",
"invoices_list": "Recurring Invoices List", "invoices_list": "Toistuvien laskujen luettelo",
"days": "{days} Days", "days": "{days} Päivät",
"months": "{months} Month", "months": "{months} Kuukaudet",
"years": "{years} Year", "years": "{years} Vuodet",
"all": "All", "all": "Kaikki",
"paid": "Paid", "paid": "Maksettu",
"unpaid": "Unpaid", "unpaid": "Maksamattomat",
"viewed": "Viewed", "viewed": "Katsottu",
"overdue": "Overdue", "overdue": "Erääntyneet",
"active": "Active", "active": "Aktiivinen",
"completed": "Completed", "completed": "Valmis",
"customer": "CUSTOMER", "customer": "Asiakas",
"paid_status": "PAID STATUS", "paid_status": "MAKSUN TILA",
"ref_no": "REF NO.", "ref_no": "Viitteemme",
"number": "NUMBER", "number": "NUMERO",
"amount_due": "AMOUNT DUE", "amount_due": "AVOIN SAATAVA",
"partially_paid": "Partially Paid", "partially_paid": "Osittain maksettu",
"total": "Total", "total": "Yhteensä",
"discount": "Discount", "discount": "Alennus",
"sub_total": "Sub Total", "sub_total": "Välisumma",
"invoice": "Recurring Invoice | Recurring Invoices", "invoice": "Toistuva Lasku - Toistuvat Laskut",
"invoice_number": "Recurring Invoice Number", "invoice_number": "Toistuva Laskun Numero",
"next_invoice_date": "Next Invoice Date", "next_invoice_date": "Seuraava Laskun Päivämäärä",
"ref_number": "Ref Number", "ref_number": "Asiakkaan viite",
"contact": "Contact", "contact": "Yhteyshenkilö",
"add_item": "Add an Item", "add_item": "Lisää tuote",
"date": "Date", "date": "Päiväys",
"limit_by": "Limit by", "limit_by": "Rajoita",
"limit_date": "Limit Date", "limit_date": "Rajoita Päivämäärä",
"limit_count": "Limit Count", "limit_count": "Rajoita määrää",
"count": "Count", "count": "Määrä",
"status": "Status", "status": "Tila",
"select_a_status": "Select a status", "select_a_status": "Valitse tila",
"working": "Working", "working": "Käynnissä",
"on_hold": "On Hold", "on_hold": "Pidossa",
"complete": "Completed", "complete": "Valmis",
"add_tax": "Add Tax", "add_tax": "Lisää Verokanta",
"amount": "Amount", "amount": "Määrä",
"action": "Action", "action": "Toiminta",
"notes": "Notes", "notes": "Viesti",
"view": "View", "view": "Katsele",
"basic_info": "Basic Info", "basic_info": "Perustiedot",
"send_invoice": "Send Recurring Invoice", "send_invoice": "Lähetä Toistuva Lasku",
"auto_send": "Auto Send", "auto_send": "Automaattinen Lähetys",
"resend_invoice": "Resend Recurring Invoice", "resend_invoice": "Lähetä Uudelleen Toistuva Lasku",
"invoice_template": "Recurring Invoice Template", "invoice_template": "Toistuva Laskun Malli",
"conversion_message": "Recurring Invoice cloned successful", "conversion_message": "Toistuva lasku kopioitu onnistuneesti",
"template": "Template", "template": "Template",
"mark_as_sent": "Mark as sent", "mark_as_sent": "Mark as sent",
"confirm_send_invoice": "This recurring invoice will be sent via email to the customer", "confirm_send_invoice": "This recurring invoice will be sent via email to the customer",
@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Ole hyvä ja lisää sähköpostiosoite tälle asiakkaalle voidaksesi lähettää laskut automaattisesti.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",
@ -552,11 +553,11 @@
"confirm_delete": "You will not be able to recover this Invoice | You will not be able to recover these Invoices", "confirm_delete": "You will not be able to recover this Invoice | You will not be able to recover these Invoices",
"created_message": "Recurring Invoice created successfully", "created_message": "Recurring Invoice created successfully",
"updated_message": "Recurring Invoice updated successfully", "updated_message": "Recurring Invoice updated successfully",
"deleted_message": "Recurring Invoice deleted successfully | Recurring Invoices deleted successfully", "deleted_message": "Toistuva lasku poistettiin onnistuneesti. Toistuvien laskujen poistaminen onnistui",
"marked_as_sent_message": "Recurring Invoice marked as sent successfully", "marked_as_sent_message": "Toistuva lasku merkitty lähetetyksi onnistuneesti",
"user_email_does_not_exist": "User email does not exist", "user_email_does_not_exist": "Käyttäjän sähköposti ei ole määritetty",
"something_went_wrong": "something went wrong", "something_went_wrong": "jotain meni vikaan",
"invalid_due_amount_message": "Total Recurring Invoice amount cannot be less than total paid amount for this Recurring Invoice. Please update the invoice or delete the associated payments to continue." "invalid_due_amount_message": "Toistuvan laskun kokonaissumma ei voi olla pienempi kuin tälle toistuvalle laskulle maksettu summa. Päivitä lasku tai poista niihin liittyvät maksut jatkaaksesi."
}, },
"payments": { "payments": {
"title": "Maksut", "title": "Maksut",
@ -581,8 +582,8 @@
"update_payment": "Päivitä maksu", "update_payment": "Päivitä maksu",
"payment": "Maksu | Maksut", "payment": "Maksu | Maksut",
"no_payments": "Ei tallennettuja maksuja!", "no_payments": "Ei tallennettuja maksuja!",
"not_selected": "Not selected", "not_selected": "Ei valittu",
"no_invoice": "No invoice", "no_invoice": "Ei laskua",
"no_matching_payments": "Vastaavia maksuja ei ole!", "no_matching_payments": "Vastaavia maksuja ei ole!",
"list_of_payments": "Tämä osio sisältää luettelon maksuista.", "list_of_payments": "Tämä osio sisältää luettelon maksuista.",
"select_payment_mode": "Valitse maksutapa", "select_payment_mode": "Valitse maksutapa",
@ -602,7 +603,7 @@
"select_a_customer": "Valitse asiakas", "select_a_customer": "Valitse asiakas",
"expense_title": "Otsikko", "expense_title": "Otsikko",
"customer": "Asiakas", "customer": "Asiakas",
"currency": "Currency", "currency": "Valuutta",
"contact": "Yhteyshenkilö", "contact": "Yhteyshenkilö",
"category": "Luokka", "category": "Luokka",
"from_date": "Päivästä", "from_date": "Päivästä",
@ -612,7 +613,7 @@
"receipt": "Kuitti", "receipt": "Kuitti",
"amount": "Summa", "amount": "Summa",
"action": "Toiminta", "action": "Toiminta",
"not_selected": "Not selected", "not_selected": "Ei valittu",
"note": "viesti", "note": "viesti",
"category_id": "Luokan tunnus", "category_id": "Luokan tunnus",
"date": "Päivämäärä", "date": "Päivämäärä",
@ -657,48 +658,48 @@
"retype_password": "Kirjoita salasana uudelleen" "retype_password": "Kirjoita salasana uudelleen"
}, },
"modules": { "modules": {
"buy_now": "Buy Now", "buy_now": "Osta Nyt",
"install": "Install", "install": "Asenna",
"price": "Price", "price": "Hinta",
"download_zip_file": "Download ZIP file", "download_zip_file": "Lataa ZIP tiedosto",
"unzipping_package": "Unzipping Package", "unzipping_package": "Puretaan pakettia",
"copying_files": "Copying Files", "copying_files": "Kopioidaan tiedostoja",
"deleting_files": "Deleting Unused files", "deleting_files": "Käyttämättömiä tiedostoja poistetaan",
"completing_installation": "Completing Installation", "completing_installation": "Viimeistellään Asennusta",
"update_failed": "Update Failed", "update_failed": "Päivitys epäonnistui",
"install_success": "Module has been installed successfully!", "install_success": "Moduuli on asennettu onnistuneesti!",
"customer_reviews": "Reviews", "customer_reviews": "Arvostelut",
"license": "License", "license": "Lisenssi",
"faq": "FAQ", "faq": "UKK",
"monthly": "Monthly", "monthly": "Kuukausittain",
"yearly": "Yearly", "yearly": "Vuosittain",
"updated": "Updated", "updated": "Päivitetty",
"version": "Version", "version": "Versio",
"disable": "Disable", "disable": "Poista käytöstä",
"module_disabled": "Module Disabled", "module_disabled": "Moduuli poistettu käytöstä",
"enable": "Enable", "enable": "Ota käyttöön",
"module_enabled": "Module Enabled", "module_enabled": "Moduuli on käytössä",
"update_to": "Update To", "update_to": "Päivitä ohjelma",
"module_updated": "Module Updated Successfully!", "module_updated": "Moduulin päivitys onnistui!",
"title": "Modules", "title": "Moduulit",
"module": "Module | Modules", "module": "Moduuli · Moduulit",
"api_token": "API token", "api_token": "API tunnus",
"invalid_api_token": "Invalid API Token.", "invalid_api_token": "Virheellinen API-tunnus.",
"other_modules": "Other Modules", "other_modules": "Muut Moduulit",
"view_all": "View All", "view_all": "Näytä kaikki",
"no_reviews_found": "There are no reviews for this module yet!", "no_reviews_found": "Tällä modulilla ei ole vielä arvosteluita!",
"module_not_purchased": "Module Not Purchased", "module_not_purchased": "Moduulia ei ostettu",
"module_not_found": "Module Not Found", "module_not_found": "Moduulia ei löydy",
"version_not_supported": "This module version doesn't support the current version of Crater", "version_not_supported": "This module version doesn't support the current version of Crater",
"last_updated": "Last Updated On", "last_updated": "Viimeksi päivitetty",
"connect_installation": "Connect your installation", "connect_installation": "Yhdistä asennuksesi",
"api_token_description": "Login to {url} and connect this installation by entering the API Token. Your purchased modules will show up here after the connection is established.", "api_token_description": "Kirjaudu sisään {url} ja yhdistä tämä asennus syöttämällä API tunnus. Ostetut moduulit näkyvät täällä kun yhteys on luotu.",
"view_module": "View Module", "view_module": "Näytä Moduuli",
"update_available": "Update Available", "update_available": "Päivitys saatavilla",
"purchased": "Purchased", "purchased": "Ostetut",
"installed": "Installed", "installed": "Asennetut",
"no_modules_installed": "No Modules Installed Yet!", "no_modules_installed": "Ei Asennettuja Moduuleja!",
"disable_warning": "All the settings for this particular will be reverted.", "disable_warning": "Kaikki tämän nimenomaisen asetuksen tiedot peruutetaan.",
"what_you_get": "What you get" "what_you_get": "What you get"
}, },
"users": { "users": {

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Facture récurrente clonée", "cloned_successfully": "Facture récurrente clonée",
"clone_invoice": "Dupliquer", "clone_invoice": "Dupliquer",
"confirm_clone": "Cette facture récurrente sera clonée dans une nouvelle facture récurrente", "confirm_clone": "Cette facture récurrente sera clonée dans une nouvelle facture récurrente",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Nom", "title": "Nom",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Faktur Berulang berhasil digandakan", "cloned_successfully": "Faktur Berulang berhasil digandakan",
"clone_invoice": "Gandakan Faktur Berulang", "clone_invoice": "Gandakan Faktur Berulang",
"confirm_clone": "Faktur Berulang ini akan digandakan menjadi Faktur Berulang yang baru", "confirm_clone": "Faktur Berulang ini akan digandakan menjadi Faktur Berulang yang baru",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Judul item", "title": "Judul item",
"description": "Deskripsi", "description": "Deskripsi",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Fattura copiata con successo", "cloned_successfully": "Fattura copiata con successo",
"clone_invoice": "Duplica Fattura Ricorrente", "clone_invoice": "Duplica Fattura Ricorrente",
"confirm_clone": "Questa fattura ricorrente verrà clonata in una nuova fattura ricorrente", "confirm_clone": "Questa fattura ricorrente verrà clonata in una nuova fattura ricorrente",
"add_customer_email": "Inserisci una E-Mail per inviare automaticamente fatture al cliente.",
"item": { "item": {
"title": "Titolo Articolo", "title": "Titolo Articolo",
"description": "Descrizione", "description": "Descrizione",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Terugkerende factuur succesvol gekopieerd", "cloned_successfully": "Terugkerende factuur succesvol gekopieerd",
"clone_invoice": "Kopieer periodieke factuur", "clone_invoice": "Kopieer periodieke factuur",
"confirm_clone": "Deze periodieke factuur wordt gekopieerd naar een nieuwe periodieke factuur", "confirm_clone": "Deze periodieke factuur wordt gekopieerd naar een nieuwe periodieke factuur",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item titel", "title": "Item titel",
"description": "Beschrijving", "description": "Beschrijving",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Faktura Cykliczna sklonowana pomyślnie", "cloned_successfully": "Faktura Cykliczna sklonowana pomyślnie",
"clone_invoice": "Klonuj Fakturę Cykliczną", "clone_invoice": "Klonuj Fakturę Cykliczną",
"confirm_clone": "Ta faktura cykliczna zostanie sklonowana do nowej faktury cyklicznej", "confirm_clone": "Ta faktura cykliczna zostanie sklonowana do nowej faktury cyklicznej",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Tytuł pozycji", "title": "Tytuł pozycji",
"description": "Opis", "description": "Opis",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Thêm một địa chỉ email cho khách hàng này để gửi hóa đơn tự động.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -526,6 +526,7 @@
"cloned_successfully": "Recurring Invoice cloned successfully", "cloned_successfully": "Recurring Invoice cloned successfully",
"clone_invoice": "Clone Recurring Invoice", "clone_invoice": "Clone Recurring Invoice",
"confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice", "confirm_clone": "This recurring invoice will be cloned into a new Recurring Invoice",
"add_customer_email": "Please add an email address for this customer to send invoices automatically.",
"item": { "item": {
"title": "Item Title", "title": "Item Title",
"description": "Description", "description": "Description",

View File

@ -3,6 +3,9 @@
use Crater\Http\Controllers\V1\Admin\Settings\CompanyController; use Crater\Http\Controllers\V1\Admin\Settings\CompanyController;
use Crater\Http\Requests\CompanyRequest; use Crater\Http\Requests\CompanyRequest;
use Crater\Http\Requests\ProfileRequest; use Crater\Http\Requests\ProfileRequest;
use Crater\Models\Invoice;
use Crater\Models\InvoiceItem;
use Crater\Models\Tax;
use Crater\Models\User; use Crater\Models\User;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Laravel\Sanctum\Sanctum; use Laravel\Sanctum\Sanctum;
@ -120,6 +123,64 @@ test('update settings', function () {
} }
}); });
test('update settings without currency setting', function () {
$settings = [
'notification_email' => 'noreply@crater.in',
];
$response = postJson('/api/v1/company/settings', ['settings' => $settings]);
$response->assertOk()
->assertJson([
'success' => true,
]);
foreach ($settings as $key => $value) {
$this->assertDatabaseHas('company_settings', [
'option' => $key,
'value' => $value,
]);
}
});
test('update currency settings after company has currency and transactions is not allowed', function () {
$settings = [
'currency' => 1,
];
$response = postJson('/api/v1/company/settings', ['settings' => $settings]);
$response->assertOk()
->assertJson([
'success' => true,
]);
Invoice::factory()
->raw([
'taxes' => [Tax::factory()->raw()],
'items' => [InvoiceItem::factory()->raw()],
]);
$settings = [
'currency' => 2,
];
$response = postJson('/api/v1/company/settings', ['settings' => $settings]);
$response->assertOK()
->assertJson([
'success' => false,
'message' => 'Cannot update company currency after transactions are created.'
]);
$this->assertDatabaseHas('company_settings', [
'option' => 'currency',
'value' => 1,
]);
});
test('get notification email settings', function () { test('get notification email settings', function () {
$data['settings'] = [ $data['settings'] = [
'currency', 'currency',