mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-13 06:48:40 +00:00
Automated formatting changes
This commit is contained in:
parent
ec8b455bdd
commit
8216ff988b
|
|
@ -5,11 +5,13 @@ declare(strict_types=1);
|
||||||
class MYPDF extends TCPDF
|
class MYPDF extends TCPDF
|
||||||
{
|
{
|
||||||
public string $fontName = '';
|
public string $fontName = '';
|
||||||
|
|
||||||
public int $fontSize = 8;
|
public int $fontSize = 8;
|
||||||
|
|
||||||
public int $sideMargin = 15;
|
public int $sideMargin = 15;
|
||||||
|
|
||||||
//Page header
|
//Page header
|
||||||
public function Header() {
|
public function Header() : void {
|
||||||
if ($this->header_xobjid === false) {
|
if ($this->header_xobjid === false) {
|
||||||
$this->header_xobjid = $this->startTemplate($this->w, 0);
|
$this->header_xobjid = $this->startTemplate($this->w, 0);
|
||||||
|
|
||||||
|
|
@ -32,7 +34,7 @@ class MYPDF extends TCPDF
|
||||||
$x = 0;
|
$x = 0;
|
||||||
$dx = 0;
|
$dx = 0;
|
||||||
|
|
||||||
if (!$this->header_xobj_autoreset AND $this->booklet AND (($this->page % 2) == 0)) {
|
if (!$this->header_xobj_autoreset && $this->booklet && (($this->page % 2) == 0)) {
|
||||||
// adjust margins for booklet mode
|
// adjust margins for booklet mode
|
||||||
$dx = ($this->original_lMargin - $this->original_rMargin);
|
$dx = ($this->original_lMargin - $this->original_rMargin);
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +53,7 @@ class MYPDF extends TCPDF
|
||||||
}
|
}
|
||||||
|
|
||||||
// Page footer
|
// Page footer
|
||||||
public function Footer() {
|
public function Footer() : void {
|
||||||
$this->SetY(-25);
|
$this->SetY(-25);
|
||||||
|
|
||||||
$this->SetFont('helvetica', 'I', 7);
|
$this->SetFont('helvetica', 'I', 7);
|
||||||
|
|
@ -121,7 +123,7 @@ $lineHeight = ($lineHeight - $pdf->getY()) / 3;
|
||||||
|
|
||||||
// Document head
|
// Document head
|
||||||
$pdf->SetFont('helvetica', 'B', 20);
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
$title = 'INVOICE';
|
$title = 'INVOICE';
|
||||||
$titleWidth = $pdf->GetStringWidth($title, 'helvetica', 'B', 20);
|
$titleWidth = $pdf->GetStringWidth($title, 'helvetica', 'B', 20);
|
||||||
|
|
||||||
$pdf->SetXY(
|
$pdf->SetXY(
|
||||||
|
|
@ -158,7 +160,7 @@ $pdf->Ln();
|
||||||
$pdf->SetY($pdf->GetY() + 5);
|
$pdf->SetY($pdf->GetY() + 5);
|
||||||
|
|
||||||
$header = ['Item', 'Quantity', 'Rate', 'Total'];
|
$header = ['Item', 'Quantity', 'Rate', 'Total'];
|
||||||
$data = [
|
$data = [
|
||||||
['ASDF', 2.0, 199.90, 399.80],
|
['ASDF', 2.0, 199.90, 399.80],
|
||||||
["123-456-789<br><strong>This is a item name</strong><br><span style=\"color: #444;\">This is the item description in more detail for the customer so he knows what this content actually contains.</span>", 2.0, 199.90, 399.80],
|
["123-456-789<br><strong>This is a item name</strong><br><span style=\"color: #444;\">This is the item description in more detail for the customer so he knows what this content actually contains.</span>", 2.0, 199.90, 399.80],
|
||||||
["123-456-789<br><strong>This is a item name</strong><br><span style=\"color: #444;\">This is the item description in more detail for the customer.</span>", 2.0, "199.90\n-10 %", "150.399.80\n-15.039"],
|
["123-456-789<br><strong>This is a item name</strong><br><span style=\"color: #444;\">This is the item description in more detail for the customer.</span>", 2.0, "199.90\n-10 %", "150.399.80\n-15.039"],
|
||||||
|
|
@ -178,8 +180,8 @@ $data = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
$w = array($pdf->getPageWidth() - 20 - 20 - 20 - 2*15, 20, 20, 20);
|
$w = [$pdf->getPageWidth() - 20 - 20 - 20 - 2 * 15, 20, 20, 20];
|
||||||
$num_headers = count($header);
|
$num_headers = \count($header);
|
||||||
|
|
||||||
$pdf->setCellPadding(1, 1, 1, 1);
|
$pdf->setCellPadding(1, 1, 1, 1);
|
||||||
|
|
||||||
|
|
@ -300,4 +302,4 @@ $pdf->writeHTMLCell(
|
||||||
$pdf->Ln();
|
$pdf->Ln();
|
||||||
|
|
||||||
//Close and output PDF document
|
//Close and output PDF document
|
||||||
$pdf->Output('example_048.pdf', 'I');
|
$pdf->Output('example_048.pdf', 'I');
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,12 @@ declare(strict_types=1);
|
||||||
namespace Modules\Billing\Admin;
|
namespace Modules\Billing\Admin;
|
||||||
|
|
||||||
use Modules\Billing\Models\BillTransferType;
|
use Modules\Billing\Models\BillTransferType;
|
||||||
use Modules\Media\Models\NullCollection;
|
|
||||||
use phpOMS\Application\ApplicationAbstract;
|
use phpOMS\Application\ApplicationAbstract;
|
||||||
use phpOMS\Config\SettingsInterface;
|
use phpOMS\Config\SettingsInterface;
|
||||||
use phpOMS\Localization\ISO639x1Enum;
|
|
||||||
use phpOMS\Module\InstallerAbstract;
|
|
||||||
use phpOMS\Module\ModuleInfo;
|
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
|
use phpOMS\Module\InstallerAbstract;
|
||||||
|
use phpOMS\Module\ModuleInfo;
|
||||||
use phpOMS\Uri\HttpUri;
|
use phpOMS\Uri\HttpUri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@ use Modules\Billing\Models\BillMapper;
|
||||||
use Modules\Billing\Models\BillStatus;
|
use Modules\Billing\Models\BillStatus;
|
||||||
use Modules\Billing\Models\BillTransferType;
|
use Modules\Billing\Models\BillTransferType;
|
||||||
use Modules\Billing\Models\BillType;
|
use Modules\Billing\Models\BillType;
|
||||||
use phpOMS\Localization\BaseStringL11n;
|
|
||||||
use Modules\Billing\Models\BillTypeMapper;
|
|
||||||
use Modules\Billing\Models\BillTypeL11nMapper;
|
use Modules\Billing\Models\BillTypeL11nMapper;
|
||||||
|
use Modules\Billing\Models\BillTypeMapper;
|
||||||
use Modules\Billing\Models\SettingsEnum;
|
use Modules\Billing\Models\SettingsEnum;
|
||||||
use Modules\ClientManagement\Models\ClientMapper;
|
use Modules\ClientManagement\Models\ClientMapper;
|
||||||
use Modules\ItemManagement\Models\ItemMapper;
|
use Modules\ItemManagement\Models\ItemMapper;
|
||||||
|
|
@ -38,6 +37,7 @@ use Modules\Media\Models\UploadStatus;
|
||||||
use Modules\SupplierManagement\Models\NullSupplier;
|
use Modules\SupplierManagement\Models\NullSupplier;
|
||||||
use Modules\SupplierManagement\Models\SupplierMapper;
|
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||||
use phpOMS\Autoloader;
|
use phpOMS\Autoloader;
|
||||||
|
use phpOMS\Localization\BaseStringL11n;
|
||||||
use phpOMS\Localization\Money;
|
use phpOMS\Localization\Money;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
|
|
@ -781,10 +781,10 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$billType = new BillType($request->getData('name') ?? '');
|
$billType = new BillType($request->getData('name') ?? '');
|
||||||
$billType->setL11n((string) ($request->getData('title') ?? ''), $request->getData('language') ?? ISO639x1Enum::_EN);
|
$billType->setL11n((string) ($request->getData('title') ?? ''), $request->getData('language') ?? ISO639x1Enum::_EN);
|
||||||
$billType->template = new NullCollection((int) ($request->getData('template') ?? 0));
|
$billType->template = new NullCollection((int) ($request->getData('template') ?? 0));
|
||||||
$billType->numberFormat = (string) ($request->getData('number_format') ?? '{id}');
|
$billType->numberFormat = (string) ($request->getData('number_format') ?? '{id}');
|
||||||
$billType->transferStock = (bool) ($request->getData('transfer_stock') ?? false);
|
$billType->transferStock = (bool) ($request->getData('transfer_stock') ?? false);
|
||||||
$billType->transferType = (int) ($request->getData('transfer_type') ?? BillTransferType::SALES);
|
$billType->transferType = (int) ($request->getData('transfer_type') ?? BillTransferType::SALES);
|
||||||
|
|
||||||
return $billType;
|
return $billType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ namespace Modules\Billing\Models;
|
||||||
|
|
||||||
use Modules\Media\Models\Collection;
|
use Modules\Media\Models\Collection;
|
||||||
use Modules\Media\Models\NullCollection;
|
use Modules\Media\Models\NullCollection;
|
||||||
use phpOMS\Localization\ISO639x1Enum;
|
|
||||||
use phpOMS\Localization\BaseStringL11n;
|
use phpOMS\Localization\BaseStringL11n;
|
||||||
|
use phpOMS\Localization\ISO639x1Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill type enum.
|
* Bill type enum.
|
||||||
|
|
@ -83,7 +83,7 @@ class BillType implements \JsonSerializable
|
||||||
* Set l11n
|
* Set l11n
|
||||||
*
|
*
|
||||||
* @param string|BaseStringL11n $l11n Tag article l11n
|
* @param string|BaseStringL11n $l11n Tag article l11n
|
||||||
* @param string $lang Language
|
* @param string $lang Language
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
@ -96,9 +96,9 @@ class BillType implements \JsonSerializable
|
||||||
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
|
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
|
||||||
$this->l11n->content = $l11n;
|
$this->l11n->content = $l11n;
|
||||||
} else {
|
} else {
|
||||||
$this->l11n = new BaseStringL11n();
|
$this->l11n = new BaseStringL11n();
|
||||||
$this->l11n->content = $l11n;
|
$this->l11n->content = $l11n;
|
||||||
$this->l11n->ref = $this->id;
|
$this->l11n->ref = $this->id;
|
||||||
$this->l11n->setLanguage($lang);
|
$this->l11n->setLanguage($lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ final class BillTypeMapper extends DataMapperFactory
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'billing_type_id' => ['name' => 'billing_type_id', 'type' => 'int', 'internal' => 'id'],
|
'billing_type_id' => ['name' => 'billing_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'billing_type_name' => ['name' => 'billing_type_name', 'type' => 'string', 'internal' => 'name'],
|
'billing_type_name' => ['name' => 'billing_type_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
'billing_type_number_format' => ['name' => 'billing_type_number_format', 'type' => 'string', 'internal' => 'numberFormat'],
|
'billing_type_number_format' => ['name' => 'billing_type_number_format', 'type' => 'string', 'internal' => 'numberFormat'],
|
||||||
'billing_type_template' => ['name' => 'billing_type_template', 'type' => 'int', 'internal' => 'template'],
|
'billing_type_template' => ['name' => 'billing_type_template', 'type' => 'int', 'internal' => 'template'],
|
||||||
'billing_type_transfer_type' => ['name' => 'billing_type_transfer_type', 'type' => 'int', 'internal' => 'transferType'],
|
'billing_type_transfer_type' => ['name' => 'billing_type_transfer_type', 'type' => 'int', 'internal' => 'transferType'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user