add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 297dcc62d2
commit 39c80ce6d1
459 changed files with 6219 additions and 5416 deletions

View File

@@ -3,9 +3,9 @@
namespace App\Repositories\Core;
use Barryvdh\DomPDF\Facade\Pdf as DomPDF;
use Barryvdh\Snappy\Facades\SnappyPdf;
use GravityMedia\Ghostscript\Ghostscript;
use Mpdf\Mpdf;
use Barryvdh\Snappy\Facades\SnappyPdf;
use Symfony\Component\Process\Process;
class PDF
@@ -18,15 +18,13 @@ class PDF
->waitUntilNetworkIdle()
->format('A4')
->showBackground()
->savePdf("temp.pdf");
->savePdf('temp.pdf');
$postRoute = URL::signedRoute('orderinvoices.store', ['order' => $this->order]);
Http::attach('invoice', file_get_contents('temp.pdf'), $filename)
->post($postRoute)
->throw();
}
catch (\Exception $exception )
{
} catch (\Exception $exception) {
Log::error($exception);
}
}
@@ -35,6 +33,7 @@ class PDF
{
\Debugbar::disable();
$pdf = DomPDF::loadView($view, $data);
return $pdf->download($filename);
}
@@ -42,12 +41,14 @@ class PDF
{
$mpdf = new Mpdf();
$mpdf->WriteHTML($html);
return $mpdf->Output();
}
public static function convertURL($url)
{
$pdf = SnappyPdf::loadFile($url);
return $pdf->download('invoice.pdf');
}