mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:07:33 -05:00 
			
		
		
		
	Static Analysis
This commit is contained in:
		
							parent
							
								
									cf35c30bfc
								
							
						
					
					
						commit
						f7bd62d84a
					
				@ -412,6 +412,7 @@ class Client extends BaseModel implements HasLocalePreference
 | 
			
		||||
 | 
			
		||||
    public function date_format()
 | 
			
		||||
    {
 | 
			
		||||
        /** @var \Illuminate\Support\Collection $date_formats */
 | 
			
		||||
        $date_formats = app('date_formats');
 | 
			
		||||
        // $date_formats = Cache::get('date_formats');
 | 
			
		||||
 | 
			
		||||
@ -428,6 +429,8 @@ class Client extends BaseModel implements HasLocalePreference
 | 
			
		||||
 | 
			
		||||
    public function currency()
 | 
			
		||||
    {
 | 
			
		||||
        
 | 
			
		||||
        /** @var \Illuminate\Support\Collection $currencies */
 | 
			
		||||
        $currencies = app('currencies');
 | 
			
		||||
        // $currencies = Cache::get('currencies');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -319,6 +319,7 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver
 | 
			
		||||
     */
 | 
			
		||||
    public function processTokenPayment($request, array $response) {
 | 
			
		||||
 | 
			
		||||
        /** @var \App\Models\ClientGatewayToken $cgt */
 | 
			
		||||
        $cgt = ClientGatewayToken::where('client_id', $this->client->id)
 | 
			
		||||
                                 ->where('token', $request['token'])
 | 
			
		||||
                                 ->firstOrFail();
 | 
			
		||||
 | 
			
		||||
@ -295,7 +295,7 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver
 | 
			
		||||
     */
 | 
			
		||||
    public function processTokenPayment($request, array $response) {
 | 
			
		||||
 | 
			
		||||
        /** @car \App\Models\ClientGatwayToken $cgt */
 | 
			
		||||
        /** @var \App\Models\ClientGatewayToken $cgt */
 | 
			
		||||
        $cgt = ClientGatewayToken::where('client_id', $this->client->id)
 | 
			
		||||
                                 ->where('token', $request['token'])
 | 
			
		||||
                                 ->firstOrFail();
 | 
			
		||||
 | 
			
		||||
@ -75,7 +75,7 @@ class WePayPaymentDriver extends BaseDriver
 | 
			
		||||
     * Setup the gateway
 | 
			
		||||
     *
 | 
			
		||||
     * @param  array $data user_id + company
 | 
			
		||||
     * @return \Illuminate\View\View
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function setup(array $data)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
@ -26,9 +26,15 @@ class OrderXDocument extends AbstractService
 | 
			
		||||
{
 | 
			
		||||
    public OrderDocumentBuilder $orderxdocument;
 | 
			
		||||
        
 | 
			
		||||
    /** @var \App\Models\Invoice | \App\Models\Quote | \App\Models\PurchaseOrder | \App\Models\Credit $document */
 | 
			
		||||
    
 | 
			
		||||
    public function __construct(public mixed $document, private readonly bool $returnObject = false, private array $tax_map = [])
 | 
			
		||||
    /**
 | 
			
		||||
     * __construct
 | 
			
		||||
     *
 | 
			
		||||
     * @param  \App\Models\Invoice | \App\Models\Quote | \App\Models\PurchaseOrder | \App\Models\Credit $document
 | 
			
		||||
     * @param  bool $returnObject
 | 
			
		||||
     * @param  array $tax_map
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function __construct(public \App\Models\Invoice | \App\Models\Quote | \App\Models\PurchaseOrder | \App\Models\Credit  $document, private readonly bool $returnObject = false, private array $tax_map = [])
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -36,7 +42,6 @@ class OrderXDocument extends AbstractService
 | 
			
		||||
    {
 | 
			
		||||
        
 | 
			
		||||
        $company = $this->document->company;
 | 
			
		||||
        /** @var \App\Models\Client | \App\Models\Vendor $settings_entity */
 | 
			
		||||
        $settings_entity = ($this->document instanceof PurchaseOrder) ? $this->document->vendor : $this->document->client;
 | 
			
		||||
        $profile = $settings_entity->getSetting('e_quote_type') ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended";
 | 
			
		||||
 | 
			
		||||
@ -176,7 +181,17 @@ class OrderXDocument extends AbstractService
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->orderxdocument->setDocumentSummation($this->document->amount, $this->document->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), 0.0, $this->document->amount - $this->document->balance);
 | 
			
		||||
        $this->orderxdocument->setDocumentSummation(
 | 
			
		||||
        $this->document->amount, 
 | 
			
		||||
        $this->document->balance, 
 | 
			
		||||
        $invoicing_data->getSubTotal(), 
 | 
			
		||||
        $invoicing_data->getTotalSurcharges(), 
 | 
			
		||||
        // $invoicing_data->getTotalDiscount(), 
 | 
			
		||||
        $invoicing_data->getSubTotal(), 
 | 
			
		||||
        $invoicing_data->getItemTotalTaxes(), 
 | 
			
		||||
        // 0.0, 
 | 
			
		||||
        // ($this->document->amount - $this->document->balance)
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        foreach ($this->tax_map as $item) {
 | 
			
		||||
            $this->orderxdocument->addDocumentTax($item["tax_type"], "VAT", $item["net_amount"], $item["tax_rate"] * $item["net_amount"], $item["tax_rate"] * 100);
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,16 @@ class ZugferdEDokument extends AbstractService
 | 
			
		||||
{
 | 
			
		||||
    public ZugferdDocumentBuilder $xdocument;
 | 
			
		||||
 | 
			
		||||
    public function __construct(public object $document, private readonly bool $returnObject = false, private array $tax_map = [])
 | 
			
		||||
        
 | 
			
		||||
    /**
 | 
			
		||||
     * __construct
 | 
			
		||||
     *
 | 
			
		||||
     * \App\Models\Invoice | \App\Models\Quote | \App\Models\PurchaseOrder | \App\Models\Credit $document
 | 
			
		||||
     * @param  bool $returnObject
 | 
			
		||||
     * @param  array $tax_map
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function __construct(public \App\Models\Invoice | \App\Models\Quote | \App\Models\PurchaseOrder | \App\Models\Credit $document, private readonly bool $returnObject = false, private array $tax_map = [])
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user