Skip to content

Commit

Permalink
Merge pull request #2 from tomplus/feat/longer-address
Browse files Browse the repository at this point in the history
feat: six lines for address in client and profile records
  • Loading branch information
tomplus authored Feb 1, 2018
2 parents a2ae288 + dcdc79b commit b49eead
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ To sposób dla programistów, którzy chcą zmodyfikować serwis.

### Wymagania

* PHP 5.1 lub wyższy
* PHP 5.4 lub nowszy
* Pakiety dodatkowe (przykład dla Ubuntu):
```apt-get install php-mbstring php-bcmath php-xml php-pgsql php-mysql php-sqlite3```
```apt-get install sqlite3 php-mbstring php-bcmath php-xml php-pgsql php-mysql php-sqlite3```
* PHP Composer (https://getcomposer.org/download/)

### Instalacja
Expand Down
3 changes: 3 additions & 0 deletions db/db.mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE IF NOT EXISTS profiles (
pfl_name_3 VARCHAR(128),
pfl_name_4 VARCHAR(128),
pfl_name_5 VARCHAR(128),
pfl_name_6 VARCHAR(128),
PRIMARY KEY (pfl_id)
) ENGINE = InnoDB;

Expand All @@ -16,6 +17,8 @@ CREATE TABLE IF NOT EXISTS clients (
cln_name_2 VARCHAR(128) NOT NULL,
cln_name_3 VARCHAR(128) NOT NULL,
cln_name_4 VARCHAR(128) NOT NULL,
cln_name_5 VARCHAR(128) NOT NULL,
cln_name_6 VARCHAR(128) NOT NULL,
PRIMARY KEY (cln_id)
) ENGINE = InnoDB;

Expand Down
7 changes: 5 additions & 2 deletions db/db.postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ CREATE TABLE IF NOT EXISTS profiles (
pfl_name_2 VARCHAR(128),
pfl_name_3 VARCHAR(128),
pfl_name_4 VARCHAR(128),
pfl_name_5 VARCHAR(128)
pfl_name_5 VARCHAR(128),
pfl_name_6 VARCHAR(128)
);

CREATE INDEX profiles_name_idx ON profiles(pfl_name_1);
Expand All @@ -14,7 +15,9 @@ CREATE TABLE IF NOT EXISTS clients (
cln_name_1 VARCHAR(128) NOT NULL,
cln_name_2 VARCHAR(128) NOT NULL,
cln_name_3 VARCHAR(128) NOT NULL,
cln_name_4 VARCHAR(128) NOT NULL
cln_name_4 VARCHAR(128) NOT NULL,
cln_name_5 VARCHAR(128) NOT NULL,
cln_name_6 VARCHAR(128) NOT NULL
);

CREATE INDEX clients_name_idx ON clients(cln_name_1);
Expand Down
7 changes: 5 additions & 2 deletions db/db.sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ CREATE TABLE IF NOT EXISTS profiles (
pfl_name_2 VARCHAR(128),
pfl_name_3 VARCHAR(128),
pfl_name_4 VARCHAR(128),
pfl_name_5 VARCHAR(128)
pfl_name_5 VARCHAR(128),
pfl_name_6 VARCHAR(128)
);

CREATE INDEX profiles_name_idx ON profiles(pfl_name_1);
Expand All @@ -14,7 +15,9 @@ CREATE TABLE IF NOT EXISTS clients (
cln_name_1 VARCHAR(128) NOT NULL,
cln_name_2 VARCHAR(128) NOT NULL,
cln_name_3 VARCHAR(128) NOT NULL,
cln_name_4 VARCHAR(128) NOT NULL
cln_name_4 VARCHAR(128) NOT NULL,
cln_name_5 VARCHAR(128) NOT NULL,
cln_name_6 VARCHAR(128) NOT NULL
);

CREATE INDEX clients_name_idx ON clients(cln_name_1);
Expand Down
Binary file modified src/db/ufaktura.db
Binary file not shown.
6 changes: 5 additions & 1 deletion src/models/Clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @property string $cln_name_2
* @property string $cln_name_3
* @property string $cln_name_4
* @property string $cln_name_5
* @property string $cln_name_6
*
* @property Invoices[] $invoices
*/
Expand All @@ -33,7 +35,7 @@ public function rules()
{
return [
[['cln_name_1', 'cln_name_2', 'cln_name_3'], 'required'],
[['cln_name_1', 'cln_name_2', 'cln_name_3', 'cln_name_4'], 'string', 'max' => 128],
[['cln_name_1', 'cln_name_2', 'cln_name_3', 'cln_name_4', 'cln_name_5', 'cln_name_6'], 'string', 'max' => 128],
];
}

Expand All @@ -48,6 +50,8 @@ public function attributeLabels()
'cln_name_2' => 'Ulica',
'cln_name_3' => 'Miasto',
'cln_name_4' => 'NIP',
'cln_name_5' => 'Dodatkowa linia 1',
'cln_name_6' => 'Dodatkowa linia 2',
];
}

Expand Down
16 changes: 9 additions & 7 deletions src/models/Profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @property string $pfl_name_3
* @property string $pfl_name_4
* @property string $pfl_name_5
* @property string $pfl_name_6
*
* @property Invoices[] $invoices
*/
Expand All @@ -34,7 +35,7 @@ public function rules()
{
return [
[['pfl_name_1'], 'required'],
[['pfl_name_1', 'pfl_name_2', 'pfl_name_3', 'pfl_name_4', 'pfl_name_5'], 'string', 'max' => 128],
[['pfl_name_1', 'pfl_name_2', 'pfl_name_3', 'pfl_name_4', 'pfl_name_5', 'pfl_name_6'], 'string', 'max' => 128],
];
}

Expand All @@ -45,12 +46,13 @@ public function attributeLabels()
{
return [
'pfl_id' => 'ID',
'pfl_name_1' => 'Sprzedawca - tytuł',
'pfl_name_2' => 'Sprzedawca - ulica',
'pfl_name_3' => 'Sprzedawca - miasto',
'pfl_name_4' => 'Sprzedawca - nip',
'pfl_name_5' => 'Sprzedawca - numer konta',
];
'pfl_name_1' => 'Sprzedawca - nazwa',
'pfl_name_2' => 'Sprzedawca - linia 2',
'pfl_name_3' => 'Sprzedawca - linia 3',
'pfl_name_4' => 'Sprzedawca - linia 4',
'pfl_name_5' => 'Sprzedawca - linia 5',
'pfl_name_6' => 'Sprzedawca - linia 6',
];
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/views/clients/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

<?= $form->field($model, 'cln_name_4')->textInput(['maxlength' => true]) ?>

<?= $form->field($model, 'cln_name_5')->textInput(['maxlength' => true]) ?>

<?= $form->field($model, 'cln_name_6')->textInput(['maxlength' => true]) ?>

<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/views/clients/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
'cln_name_2',
'cln_name_3',
'cln_name_4',
'cln_name_5',
'cln_name_6',
],
]) ?>

Expand Down
15 changes: 8 additions & 7 deletions src/views/invoices/print.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
$pdf->SetFont('DejaVu','',14);

$pdf->SetFontSize(10);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_1 , 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_2 , 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_3 , 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_4 , 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_5 , 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_1, 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_2, 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_3, 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_4, 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_5, 0, 1);
$pdf->Cell(4,6, $model->ivcPfl->pfl_name_6, 0, 1);

$pdf->Ln(10);
$pdf->SetFontSize(20);
Expand Down Expand Up @@ -49,8 +50,8 @@
$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_2, 0, 0); $pdf->Cell(105,5,$model->ivcCln->cln_name_2, 0, 1);
$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_3, 0, 0); $pdf->Cell(105,5,$model->ivcCln->cln_name_3, 0, 1);
$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_4, 0, 0); $pdf->Cell(105,5,$cln_nip, 0, 1);
$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_5, 0, 0); $pdf->Cell(105,5,'', 0, 1);

$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_5, 0, 0); $pdf->Cell(105,5,$model->ivcCln->cln_name_5, 0, 1);
$pdf->Cell(95, 5, $model->ivcPfl->pfl_name_6, 0, 0); $pdf->Cell(105,5,$model->ivcCln->cln_name_6, 0, 1);

$pdf->Ln(15);
$pdf->Cell(10,6,"Lp.", 1, 0);
Expand Down
2 changes: 2 additions & 0 deletions src/views/profiles/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

<?= $form->field($model, 'pfl_name_5')->textInput(['maxlength' => true]) ?>

<?= $form->field($model, 'pfl_name_6')->textInput(['maxlength' => true]) ?>

<div class="form-group">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/views/profiles/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
'pfl_name_3',
'pfl_name_4',
'pfl_name_5',
],
'pfl_name_6',
],
]) ?>

</div>

0 comments on commit b49eead

Please # to comment.