mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-24 19:38:26 +02:00
Small update on invoices
This commit is contained in:
parent
54c84943a0
commit
5c767e7982
1 changed files with 7 additions and 1 deletions
|
@ -65,8 +65,14 @@ try {
|
|||
$insertStmt->execute();
|
||||
|
||||
$invoiceNumber = $pdo->lastInsertId();
|
||||
$currentDateFormatted = date("Ymd"); // This will format the date as 'YYYYMMDD'
|
||||
$currentDateFormatted = date("Ymd");
|
||||
$invoiceIdFormatted = "I" . $invoiceNumber . "-" . $currentDateFormatted;
|
||||
|
||||
$updateQuery = "UPDATE invoices SET invoice_number = :invoiceIdFormatted WHERE id = :invoiceNumber";
|
||||
$stmt = $pdo->prepare($updateQuery);
|
||||
$stmt->bindParam(':invoiceIdFormatted', $invoiceIdFormatted, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':invoiceNumber', $invoiceNumber, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
|
||||
$issueDate = date("Y-m-d");
|
||||
$dueDate = date("Y-m-d", strtotime("+30 days"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue