diff --git a/app/Export/CSV/InvoiceItemExport.php b/app/Export/CSV/InvoiceItemExport.php index b2b13b523acf..ef372c83752f 100644 --- a/app/Export/CSV/InvoiceItemExport.php +++ b/app/Export/CSV/InvoiceItemExport.php @@ -229,10 +229,6 @@ class InvoiceItemExport extends BaseExport // $entity['currency'] = $invoice->client->currency() ? $invoice->client->currency()->code : $invoice->company->currency()->code; // } - // if(array_key_exists('type', $entity)) { - // $entity['type'] = $invoice->typeIdString($entity['type']); - // } - // if(array_key_exists('tax_category', $entity)) { // $entity['tax_category'] = $invoice->taxTypeString($entity['tax_category']); // } diff --git a/app/Export/CSV/PurchaseOrderItemExport.php b/app/Export/CSV/PurchaseOrderItemExport.php index 4892436a6015..bbbcc62dc52c 100644 --- a/app/Export/CSV/PurchaseOrderItemExport.php +++ b/app/Export/CSV/PurchaseOrderItemExport.php @@ -213,10 +213,6 @@ class PurchaseOrderItemExport extends BaseExport // $entity['currency'] = $purchase_order->vendor->currency() ? $purchase_order->vendor->currency()->code : $purchase_order->company->currency()->code; // } - // if(array_key_exists('type', $entity)) { - // $entity['type'] = $purchase_order->typeIdString($entity['type']); - // } - // if(array_key_exists('tax_category', $entity)) { // $entity['tax_category'] = $purchase_order->taxTypeString($entity['tax_category']); // } diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 4b98faa0c6c6..cc81e6b440fe 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -714,22 +714,22 @@ class Invoice extends BaseModel return $tax_type; } - public function typeIdString($id) - { - $type = ''; - match($id) { - '1' => $type = ctrans('texts.product'), - '2' => $type = ctrans('texts.service'), - '3' => $type = ctrans('texts.gateway_fees'), - '4' => $type = ctrans('texts.gateway_fees'), - '5' => $type = ctrans('texts.late_fees'), - '6' => $type = ctrans('texts.expense'), - default => $type = ctrans('texts.product'), - }; + // public function typeIdString($id) + // { + // $type = ''; + // match($id) { + // '1' => $type = ctrans('texts.product'), + // '2' => $type = ctrans('texts.service'), + // '3' => $type = ctrans('texts.gateway_fees'), + // '4' => $type = ctrans('texts.gateway_fees'), + // '5' => $type = ctrans('texts.late_fees'), + // '6' => $type = ctrans('texts.expense'), + // default => $type = ctrans('texts.product'), + // }; - return $type; + // return $type; - } + // } public function reminderSchedule(): string { diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index d536310fd881..3d20ae4275e3 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -353,22 +353,22 @@ class PurchaseOrder extends BaseModel return ctrans('texts.purchase_order'); } - public function typeIdString($id): string - { - $type = ''; - match($id) { - '1' => $type = ctrans('texts.product'), - '2' => $type = ctrans('texts.service'), - '3' => $type = ctrans('texts.gateway_fees'), - '4' => $type = ctrans('texts.gateway_fees'), - '5' => $type = ctrans('texts.late_fees'), - '6' => $type = ctrans('texts.expense'), - default => $type = ctrans('texts.product'), - }; + // public function typeIdString($id): string + // { + // $type = ''; + // match($id) { + // '1' => $type = ctrans('texts.product'), + // '2' => $type = ctrans('texts.service'), + // '3' => $type = ctrans('texts.gateway_fees'), + // '4' => $type = ctrans('texts.gateway_fees'), + // '5' => $type = ctrans('texts.late_fees'), + // '6' => $type = ctrans('texts.expense'), + // default => $type = ctrans('texts.product'), + // }; - return $type; + // return $type; - } + // } public function taxTypeString($id): string { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 6421b53ca446..09250b10dcfa 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -65,7 +65,7 @@ class RouteServiceProvider extends ServiceProvider if (Ninja::isSelfHost()) { return Limit::none(); } else { - return Limit::perMinute(500)->by($request->ip()); + return Limit::perMinute(800)->by($request->ip()); } }); diff --git a/app/Services/Client/Merge.php b/app/Services/Client/Merge.php index b88fe879eb9f..46e01704b16a 100644 --- a/app/Services/Client/Merge.php +++ b/app/Services/Client/Merge.php @@ -31,9 +31,16 @@ class Merge extends AbstractService public function run() { + nlog("merging {$this->mergable_client->id} into {$this->client->id}"); + nlog("balance pre {$this->client->balance}"); + nlog("paid_to_date pre {$this->client->paid_to_date}"); + $this->client->balance += $this->mergable_client->balance; $this->client->paid_to_date += $this->mergable_client->paid_to_date; $this->client->save(); + + nlog("balance post {$this->client->balance}"); + nlog("paid_to_date post {$this->client->paid_to_date}"); $this->updateLedger($this->mergable_client->balance);