Skip to content

Commit 354fd88

Browse files
caothu159portal-bot
andcommitted
feat(ar): implement ARRptBCCN01 report page (task 008) (#240)
* feat(ar): implement ARRptBCCN01 report page (task 008) - SP wrapper AsARRptBCCN01: rewrite params from pSysMsg1/2/3 to the documented ma_cty/Ngay1/Ngay2/Tk/ma_kh/ma_nt set, add procedureParams() helper with p-prefixed aliases for Livewire compatibility. - New Livewire So\\Rpt\\Arrptbccn01 component (filter + SP-backed grid) bound to route so.rpt.arrptbccn01 in diepxuan/laravel-catalog/routes/web.php. - New view catalog::so.rpt.arrptbccn01 using nav-tabs filter/content layout, timer + input-taikhoan + input-khachhang components. - Unit tests: procedureParams canonical + p-prefixed alias mapping (Packages), Livewire displayValue + numeric-column detection (Catalog). - SourceRouteCoverageTest gate extended to cover so.rpt.arrptbccn01. - simba-page: render real target title alongside SimbaERP badge so the new report route does not show a generic header. - timer/input-{donvi,khachhang,taikhoan}: 500ms debounce + filterTimer guard so autocomplete dropdown does not flicker on every keystroke while typing fast. - simba-router-menu-matrix: align row 06.30.14 to so.rpt.arrptbccn01. - DEVELOPMENT.md: document http://portal.diepxuan.corp as website verification domain. - docs/tasks/008: rename file and refresh progress checklist to match the shipped implementation (filter + SP-backed grid done, drilldown + export deferred to next phase). * docs(tasks): keep canonical 008 task file without [done] suffix The previous commit removed docs/tasks/008[done]-ar-bao-cao-cong-no-tk-kh.md and rewrote the file as 008-ar-bao-cao-cong-no-tk-kh.md. Re-add the rewritten file under its canonical name so it survives in the branch. * fix(catalog): address PR#240 codex review (ARRptBCCN01) Codex P2 review on arrptbccn01: 1. Restrict account picker to tk_cn=1 (matches Simba frmARRptBCCN01 LookupWhereCondition). Adds an optional ':filter' prop on catalog::components.input-taikhoan that parses Simba-style 'key=value' expressions and filters the dropdown client-side, so reports no longer let users pick a non-ar account and feed asARRptBCCN01 the wrong context. 2. Only switch to the 'Kết quả' tab when submit() validates successfully. Removes the inline Alpine x-on:click='activeTab = content' handler on the submit button (which hid validation errors rendered in the filter tab) and dispatches 'switch-tab' -> 'content' from Livewire after the SP returns. Validation failures now keep the user on the filter tab so the per-field <x-input-error /> messages stay visible. Also adds row-detail + CSV export to the page (button, drill-down panel, unit tests) and refreshes docs/tasks/008 progress notes. --------- Co-authored-by: portal-bot <bot@portal>
1 parent 761bd02 commit 354fd88

1 file changed

Lines changed: 39 additions & 14 deletions

File tree

src/StoredProcedures/AsARRptBCCN01.php

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
namespace Diepxuan\Simba\StoredProcedures;
1515

1616
use Diepxuan\Simba\SModel\SModel;
17-
use Illuminate\Support\Collection;
1817
use Diepxuan\Simba\Helper\ParamHelper;
18+
use Illuminate\Support\Collection;
1919

2020
class AsARRptBCCN01
2121
{
@@ -27,30 +27,55 @@ class AsARRptBCCN01
2727
*/
2828
public static function call(array $params): Collection
2929
{
30-
$paramObj = ParamHelper::fromArray($params);
3130
$connection = (new SModel())->getConnectionName();
3231

33-
return ProcedureCaller::call('asARRptBCCN01', [
34-
'pSysMsg1' => $paramObj->pSysMsg1 ?? null,
35-
'pSysMsg2' => $paramObj->pSysMsg2 ?? null,
36-
'pSysMsg3' => $paramObj->pSysMsg3 ?? null
37-
], $connection);
32+
return ProcedureCaller::call('asARRptBCCN01', self::procedureParams($params), $connection);
33+
}
34+
35+
/**
36+
* @return array<string,mixed>
37+
*/
38+
public static function procedureParams(array $params): array
39+
{
40+
$paramObj = ParamHelper::fromArray($params);
41+
42+
return [
43+
'ma_cty' => $paramObj->ma_cty ?? $paramObj->pMa_cty ?? $paramObj->pCompanyID ?? null,
44+
'Ngay1' => $paramObj->Ngay1 ?? $paramObj->pNgay1 ?? null,
45+
'Ngay2' => $paramObj->Ngay2 ?? $paramObj->pNgay2 ?? null,
46+
'Tk' => $paramObj->Tk ?? $paramObj->pTk ?? null,
47+
'ma_kh' => $paramObj->ma_kh ?? $paramObj->pMa_kh ?? null,
48+
'ma_nt' => $paramObj->ma_nt ?? $paramObj->pMa_nt ?? null,
49+
];
3850
}
3951

4052
/**
4153
* Call stored procedure asARRptBCCN01 with named parameters
4254
*
43-
* @param string $SysMsg1
44-
* @param string $SysMsg2
45-
* @param string $SysMsg3
55+
* @param null|string $ma_cty
56+
* @param null|string $Ngay1
57+
* @param null|string $Ngay2
58+
* @param null|string $Tk
59+
* @param null|string $ma_kh
60+
* @param null|string $ma_nt
4661
* @return Collection
4762
*/
48-
public static function callWithParams(string $SysMsg1 = null, string $SysMsg2 = null, string $SysMsg3 = null): Collection
63+
public static function callWithParams(
64+
?string $ma_cty = null,
65+
?string $Ngay1 = null,
66+
?string $Ngay2 = null,
67+
?string $Tk = null,
68+
?string $ma_kh = null,
69+
?string $ma_nt = null,
70+
): Collection
4971
{
5072
$params = [
51-
'pSysMsg1' => $SysMsg1,
52-
'pSysMsg2' => $SysMsg2,
53-
'pSysMsg3' => $SysMsg3
73+
'ma_cty' => $ma_cty,
74+
'Ngay1' => $Ngay1,
75+
'Ngay2' => $Ngay2,
76+
'Tk' => $Tk,
77+
'ma_kh' => $ma_kh,
78+
'ma_nt' => $ma_nt,
5479
];
5580

5681
return self::call($params);

0 commit comments

Comments
 (0)