更新行政收款

This commit is contained in:
yaooo 2023-12-19 14:38:46 +08:00
parent a27254e08c
commit bc90e84749
3 changed files with 61 additions and 59 deletions

View File

@ -38,7 +38,7 @@ class AdministrativeTicketCollectionLists extends BaseAdminDataLists implements
public function setSearch(): array
{
return [
'=' => ['org_id', 'dept_id', 'administrative_contract_id', 'invoice_type', 'invoice_sn', 'invoice_amount'],
'=' => ['atc.org_id', 'atc.dept_id', 'atc.administrative_contract_id', 'atc.invoice_type', 'atc.invoice_sn'],
];
}
@ -59,7 +59,7 @@ class AdministrativeTicketCollectionLists extends BaseAdminDataLists implements
->whereNull('atc.delete_time')
->leftJoin('orgs o','o.id = atc.org_id')
->leftJoin('dept d','d.id = atc.dept_id')
->leftJoin('administrative_contract ac','ac.id = er.administrative_contract_id')
->leftJoin('administrative_contract ac','ac.id = atc.administrative_contract_id')
->field('atc.*, d.name as dept_name, o.name as org_name, ac.supplier_id, ac.contract_no, ac.contract_name')
->limit($this->limitOffset, $this->limitLength)
->order(['atc.id' => 'desc'])
@ -85,7 +85,7 @@ class AdministrativeTicketCollectionLists extends BaseAdminDataLists implements
->whereNull('atc.delete_time')
->leftJoin('orgs o','o.id = atc.org_id')
->leftJoin('dept d','d.id = atc.dept_id')
->leftJoin('administrative_contract ac','ac.id = er.administrative_contract_id')->count();
->leftJoin('administrative_contract ac','ac.id = atc.administrative_contract_id')->count();
}
}

View File

@ -41,20 +41,20 @@ class AdministrativeTicketCollectionLogic extends BaseLogic
Db::startTrans();
try {
AdministrativeTicketCollection::create([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'administrative_contract_id' => $params['administrative_contract_id'],
'invoicing_date' => $params['invoicing_date'],
'commitor' => $params['commitor'],
'invoice_type' => $params['invoice_type'],
'invoice_sn' => $params['invoice_sn'],
'invoice_amount' => $params['invoice_amount'],
'invoice_tax_rate' => $params['invoice_tax_rate'],
'tax' => $params['tax'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'receipt_date' => $params['receipt_date'],
'remark' => $params['remark'],
'annex' => $params['annex'],
'org_id' => $params['org_id'] ?? 0,
'dept_id' => $params['dept_id'] ?? 0,
'administrative_contract_id' => $params['administrative_contract_id'] ?? 0,
'invoicing_date' => $params['invoicing_date'] ?? '',
'commitor' => $params['commitor'] ?? '',
'invoice_type' => $params['invoice_type'] ?? 0,
'invoice_sn' => $params['invoice_sn'] ?? '',
'invoice_amount' => $params['invoice_amount'] ?? 0,
'invoice_tax_rate' => $params['invoice_tax_rate'] ?? 0,
'tax' => $params['tax'] ?? 0,
'amount_excluding_tax' => $params['amount_excluding_tax'] ?? 0,
'receipt_date' => $params['receipt_date'] ?? '',
'remark' => $params['remark'] ?? '',
'annex' => $params['annex'] ?? '',
]);
Db::commit();
@ -79,19 +79,19 @@ class AdministrativeTicketCollectionLogic extends BaseLogic
Db::startTrans();
try {
AdministrativeTicketCollection::where('id', $params['id'])->update([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'administrative_contract_id' => $params['administrative_contract_id'],
'invoicing_date' => $params['invoicing_date'],
'commitor' => $params['commitor'],
'invoice_type' => $params['invoice_type'],
'invoice_sn' => $params['invoice_sn'],
'invoice_amount' => $params['invoice_amount'],
'invoice_tax_rate' => $params['invoice_tax_rate'],
'tax' => $params['tax'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'receipt_date' => $params['receipt_date'],
'remark' => $params['remark'],
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'administrative_contract_id' => $params['administrative_contract_id'],
'invoicing_date' => $params['invoicing_date'],
'commitor' => $params['commitor'],
'invoice_type' => $params['invoice_type'],
'invoice_sn' => $params['invoice_sn'],
'invoice_amount' => $params['invoice_amount'],
'invoice_tax_rate' => $params['invoice_tax_rate'],
'tax' => $params['tax'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'receipt_date' => $params['receipt_date'],
'remark' => $params['remark'],
'annex' => $params['annex'],
]);
@ -127,6 +127,8 @@ class AdministrativeTicketCollectionLogic extends BaseLogic
*/
public static function detail($params): array
{
return AdministrativeTicketCollection::findOrEmpty($params['id'])->toArray();
$administrativeTicketCollection = AdministrativeTicketCollection::findOrEmpty($params['id']);
$administrativeTicketCollection->contract;
return $administrativeTicketCollection->toArray();
}
}

View File

@ -43,20 +43,20 @@ class ExpenseReimbursementLogic extends BaseLogic
Db::startTrans();
try {
$expenseReimbursement = ExpenseReimbursement::create([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'approve_id' => $params['approve_id'],
'reimburser' => $params['reimburser'],
'reimbursement_date' => $params['reimbursement_date'],
'customer_id' => $params['customer_id'],
'pay_type' => $params['pay_type'],
'reimbursement_amount' => $params['reimbursement_amount'],
'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'],
'payee_name' => $params['payee_name'],
'payee_bank' => $params['payee_bank'],
'payee_account' => $params['payee_account'],
'remark' => $params['remark'],
'annex' => $params['annex'],
'org_id' => $params['org_id'] ?? 0,
'dept_id' => $params['dept_id'] ?? 0,
'approve_id' => $params['approve_id'] ?? 0,
'reimburser' => $params['reimburser'] ?? '',
'reimbursement_date' => $params['reimbursement_date'] ?? '',
'customer_id' => $params['customer_id'] ?? 0,
'pay_type' => $params['pay_type'] ?? 0,
'reimbursement_amount' => $params['reimbursement_amount'] ?? 0,
'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'] ?? '',
'payee_name' => $params['payee_name'] ?? '',
'payee_bank' => $params['payee_bank'] ?? '',
'payee_account' => $params['payee_account'] ?? '',
'remark' => $params['remark'] ?? '',
'annex' => $params['annex'] ?? '',
]);
foreach ($params['detail'] ?? [] as $item)
@ -107,20 +107,20 @@ class ExpenseReimbursementLogic extends BaseLogic
Db::startTrans();
try {
ExpenseReimbursement::where('id', $params['id'])->update([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'approve_id' => $params['approve_id'],
'reimburser' => $params['reimburser'],
'reimbursement_date' => $params['reimbursement_date'],
'customer_id' => $params['customer_id'],
'pay_type' => $params['pay_type'],
'reimbursement_amount' => $params['reimbursement_amount'],
'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'],
'payee_name' => $params['payee_name'],
'payee_bank' => $params['payee_bank'],
'payee_account' => $params['payee_account'],
'remark' => $params['remark'],
'annex' => $params['annex'],
'org_id' => $params['org_id'] ?? 0,
'dept_id' => $params['dept_id'] ?? 0,
'approve_id' => $params['approve_id'] ?? 0,
'reimburser' => $params['reimburser'] ?? '',
'reimbursement_date' => $params['reimbursement_date'] ?? '',
'customer_id' => $params['customer_id'] ?? 0,
'pay_type' => $params['pay_type'] ?? 0,
'reimbursement_amount' => $params['reimbursement_amount'] ?? 0,
'reimbursement_amount_daxie' => $params['reimbursement_amount_daxie'] ?? '',
'payee_name' => $params['payee_name'] ?? '',
'payee_bank' => $params['payee_bank'] ?? '',
'payee_account' => $params['payee_account'] ?? '',
'remark' => $params['remark'] ?? '',
'annex' => $params['annex'] ?? '',
]);
ExpenseReimbursementDetailLogic::where('expense_id', $params['id'])->update(['delete_time' => time()]);
ExpenseReimbursementInvoiceDetailLogic::where('expense_id', $params['id'])->update(['delete_time' => time()]);