Improvements for paytrace required fields capture

This commit is contained in:
David Bomba 2024-03-21 09:40:19 +11:00
parent f5f972ad6a
commit dfb59a0d28
6 changed files with 22 additions and 5 deletions

View File

@ -479,6 +479,8 @@ class CompanySettings extends BaseSettings
public $e_invoice_type = 'EN16931'; public $e_invoice_type = 'EN16931';
public $e_quote_type = 'OrderX_Comfort';
public $default_expense_payment_type_id = '0'; public $default_expense_payment_type_id = '0';
public $enable_e_invoice = false; public $enable_e_invoice = false;
@ -502,6 +504,7 @@ class CompanySettings extends BaseSettings
public $enable_rappen_rounding = false; public $enable_rappen_rounding = false;
public static $casts = [ public static $casts = [
'e_quote_type' => 'string',
'enable_rappen_rounding' => 'bool', 'enable_rappen_rounding' => 'bool',
'use_unapplied_payment' => 'string', 'use_unapplied_payment' => 'string',
'show_pdfhtml_on_mobile' => 'bool', 'show_pdfhtml_on_mobile' => 'bool',

View File

@ -59,8 +59,9 @@ class CreateEDocument implements ShouldQueue
/* Set customized translations _NOW_ */ /* Set customized translations _NOW_ */
$t->replace(Ninja::transformTranslations($this->document->client->getMergedSettings())); $t->replace(Ninja::transformTranslations($this->document->client->getMergedSettings()));
$e_document_type = $settings_entity->getSetting('e_invoice_type') ? $settings_entity->getSetting('e_invoice_type') : "XInvoice_3_0"; $e_document_type = strlen($settings_entity->getSetting('e_invoice_type')) > 2 ? $settings_entity->getSetting('e_invoice_type') : "XInvoice_3_0";
$e_quote_type = $settings_entity->getSetting('e_quote_type') ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended"; $e_quote_type = strlen($settings_entity->getSetting('e_quote_type')) > 2 ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended";
if ($this->document instanceof Invoice){ if ($this->document instanceof Invoice){
switch ($e_document_type) { switch ($e_document_type) {
case "EN16931": case "EN16931":

View File

@ -262,6 +262,7 @@ class PaytracePaymentDriver extends BaseDriver
$fields[] = ['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_city', 'label' => ctrans('texts.city'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_city', 'label' => ctrans('texts.city'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_postal_code', 'label' => ctrans('texts.postal_code'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_state', 'label' => ctrans('texts.state'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_state', 'label' => ctrans('texts.state'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'text', 'validation' => 'required']; $fields[] = ['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'text', 'validation' => 'required'];

View File

@ -105,6 +105,7 @@ class VendorTransformer extends EntityTransformer
'language_id' => (string) $vendor->language_id ?: '', 'language_id' => (string) $vendor->language_id ?: '',
'classification' => (string) $vendor->classification ?: '', 'classification' => (string) $vendor->classification ?: '',
'display_name' => (string) $vendor->present()->name(), 'display_name' => (string) $vendor->present()->name(),
'routing_id' => (string) $vendor->routing_id ?: '',
]; ];
} }
} }

View File

@ -14,11 +14,20 @@ return new class extends Migration {
{ {
Schema::table('vendors', function (Blueprint $table) { Schema::table('vendors', function (Blueprint $table) {
$table->string('routing_id')->default(null)->nullable(); $table->string('routing_id')->nullable();
}); });
Schema::table('companies', function (Blueprint $table) {
$table->string('e_quote_type')->default("OrderX_Comfort"); \App\Models\Company::query()
->cursor()
->each(function ($c){
$settings = $c->settings;
$settings->e_quote_type = 'OrderX_Comfort';
$settings->enable_rappen_rounding = false;
$c->settings = $settings;
$c->save();
}); });
} }
/** /**

View File

@ -5264,6 +5264,8 @@ $lang = array(
'accept_payments_online' => 'Accept Payments Online', 'accept_payments_online' => 'Accept Payments Online',
'all_payment_gateways' => 'View all payment gateways', 'all_payment_gateways' => 'View all payment gateways',
'product_cost' => 'Product cost', 'product_cost' => 'Product cost',
'enable_rappen_roudning' => 'Enable Rappen Rounding',
'enable_rappen_rounding_help' => 'Rounds totals to nearest 5',
); );
return $lang; return $lang;