prompt > Please create a step-by-step user manual in html format for this purchasecontroller.php, including the related database tables, models, views, and controller details. prompt > Please mention the table name where data is saved or stored by this ProductionController.php controller. Table: Table Name: (1) purchases (2)purchase_details (3)purchase_accounts (4) accounts (5)item_inventories (6)product_price_lists (7) purchase_barcodes Controller Name: (1) PurchaseController.php Model: 1. Primary Model Views Path below resources/views/backend/purchase/ index.blade.php: The main list view for all purchase records. Print and Template Views: print.blade.php, print_1.blade.php, print_2.blade.php,
purchases: This table stores the master information such as the invoice number, date, ledger ID, total amount, and branch details.
Additionally, the following related tables are used to store data during a purchase transaction:
purchase_details: Stores individual item data like item IDs, quantities, rates, and store locations.
purchase_accounts: Stores specific accounting ledger entries related to the purchase.
accounts: Stores general ledger transactions (saved via the account_data_save helper function).
item_inventories: Tracks inventory movement (stock in) for each item.
product_price_lists: Handles price tracking and stock balance updates at a granular level.
purchase_barcodes and barcode_details: Store individual barcode information if the items are barcode-enabled.
In summary, while purchases is the main table for the controller, the complete transaction is distributed across the tables mentioned above to maintain consistency between inventory and accounts.
The primary model for this controller is:Purchase
(located at app/Models/Purchase.php)
Other Significant Related Models:
PurchaseDetail : Handles the individual items within a purchase.
PurchaseAccount: Manages accounting entries related to the purchase.
PurchaseFormSettings: Controls the configuration and display settings for purchase forms.
PurchaseBarcode : Manages barcode data for purchased items.
create.blade.php: The form used to create a new purchase entry.
edit.blade.php: The form used to modify an existing purchase.
detail.blade.php: Shows specific details/preview of a single purchase.
form_setting_modal.blade.php: The modal for updating production-specific settings (like default accounts).
money_receipt.blade.php: Generates a receipt for the payment made during the purchase.
search.blade.php: Contains the logic/UI for filtering purchase records.
print_3.blade.php: Different invoice templates.
master_print.blade.php: For printing summary reports.
details_print.blade.php: For printing detailed reports.