本文整理汇总了PHP中Receipt::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Receipt::create方法的具体用法?PHP Receipt::create怎么用?PHP Receipt::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Receipt
的用法示例。
在下文中一共展示了Receipt::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
/* Users table
$usersData = array(
array(
"username" => "administrator", "password" => Hash::make("password"), "email" => "admin@kblis.org",
"name" => "kBLIS Administrator", "designation" => "Programmer"
),
);
foreach ($usersData as $user)
{
$users[] = User::create($user);
}
$this->command->info('users seeded');
//Seed for suppliers
$supplier = Supplier::create(
array(
"name" => "UNICEF",
"phone_no" => "0775112233",
"email" => "uni@unice.org",
"physical_address" => "un-hqtr"
)
);
$this->command->info('Suppliers table seeded');
*/
//Seed for metrics
$metric = Metric::create(array("name" => "mg", "description" => "milligram"));
$this->command->info('Metrics table seeded');
//Seed for commodities
$commodity = Commodity::create(array("name" => "Ampicillin", "description" => "Capsule 250mg", "metric_id" => $metric->id, "unit_price" => "500", "item_code" => "no clue", "storage_req" => "no clue", "min_level" => "100000", "max_level" => "400000"));
$this->command->info('Commodities table seeded');
//Seed for receipts
$receipt = Receipt::create(array("commodity_id" => $commodity->id, "supplier_id" => $supplier->id, "quantity" => "130000", "batch_no" => "002720", "expiry_date" => "2018-10-14", "user_id" => "1"));
$this->command->info('Receipts table seeded');
//Seed for Top Up Request
$topUpRequest = TopupRequest::create(array("commodity_id" => $commodity->id, "test_category_id" => 1, "order_quantity" => "1500", "user_id" => 1, "remarks" => "-"));
$this->command->info('Top Up Requests table seeded');
//Seed for Issues
Issue::create(array("receipt_id" => $receipt->id, "topup_request_id" => $topUpRequest->id, "quantity_issued" => "1700", "issued_to" => 1, "user_id" => 1, "remarks" => "-"));
$this->command->info('Issues table seeded');
//Seed for diseases
$malaria = Disease::create(array('name' => "Malaria"));
$typhoid = Disease::create(array('name' => "Typhoid"));
$dysentry = Disease::create(array('name' => "Shigella Dysentry"));
$this->command->info("Dieases table seeded");
$reportDiseases = array(array("test_type_id" => $testTypeBS->id, "disease_id" => $malaria->id), array("test_type_id" => $test_types_salmonella->id, "disease_id" => $typhoid->id), array("test_type_id" => $testTypeStoolCS->id, "disease_id" => $dysentry->id));
foreach ($reportDiseases as $reportDisease) {
ReportDisease::create($reportDisease);
}
$this->command->info("Report Disease table seeded");
//Seeding for QC
$lots = array(array('number' => '0001', 'description' => 'First lot', 'expiry' => date('Y-m-d H:i:s', strtotime("+6 months")), 'instrument_id' => 1), array('number' => '0002', 'description' => 'Second lot', 'expiry' => date('Y-m-d H:i:s', strtotime("+7 months")), 'instrument_id' => 1));
foreach ($lots as $lot) {
$lot = Lot::create($lot);
}
$this->command->info("Lot table seeded");
}
示例2: run
public function run()
{
/* Users table */
$usersData = array(array("username" => "administrator", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "kBLIS Administrator", "designation" => "Programmer"), array("username" => "external", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "External System User", "designation" => "Administrator", "image" => "/i/users/user-2.jpg"), array("username" => "lmorena", "password" => Hash::make("password"), "email" => "lmorena@kblis.org", "name" => "L. Morena", "designation" => "Lab Technologist", "image" => "/i/users/user-3.png"), array("username" => "abumeyang", "password" => Hash::make("password"), "email" => "abumeyang@kblis.org", "name" => "A. Abumeyang", "designation" => "Doctor"));
foreach ($usersData as $user) {
$users[] = User::create($user);
}
$this->command->info('users seeded');
/* Specimen Types table */
$specTypesData = array(array("name" => "Ascitic Tap"), array("name" => "Aspirate"), array("name" => "CSF"), array("name" => "Dried Blood Spot"), array("name" => "High Vaginal Swab"), array("name" => "Nasal Swab"), array("name" => "Plasma"), array("name" => "Plasma EDTA"), array("name" => "Pleural Tap"), array("name" => "Pus Swab"), array("name" => "Rectal Swab"), array("name" => "Semen"), array("name" => "Serum"), array("name" => "Skin"), array("name" => "Sputum"), array("name" => "Stool"), array("name" => "Synovial Fluid"), array("name" => "Throat Swab"), array("name" => "Urethral Smear"), array("name" => "Urine"), array("name" => "Vaginal Smear"), array("name" => "Water"), array("name" => "Whole Blood"));
foreach ($specTypesData as $specimenType) {
$specTypes[] = SpecimenType::create($specimenType);
}
$this->command->info('specimen_types seeded');
/* Test Categories table - These map on to the lab sections */
$test_categories = TestCategory::create(array("name" => "PARASITOLOGY", "description" => ""));
$lab_section_microbiology = TestCategory::create(array("name" => "MICROBIOLOGY", "description" => ""));
$this->command->info('test_categories seeded');
/* Measure Types */
$measureTypes = array(array("id" => "1", "name" => "Numeric Range"), array("id" => "2", "name" => "Alphanumeric Values"), array("id" => "3", "name" => "Autocomplete"), array("id" => "4", "name" => "Free Text"));
foreach ($measureTypes as $measureType) {
MeasureType::create($measureType);
}
$this->command->info('measure_types seeded');
/* Measures table */
$measureBSforMPS = Measure::create(array("measure_type_id" => "2", "name" => "BS for mps", "unit" => ""));
$measure1 = Measure::create(array("measure_type_id" => "2", "name" => "Grams stain", "unit" => ""));
$measure2 = Measure::create(array("measure_type_id" => "2", "name" => "SERUM AMYLASE", "unit" => ""));
$measure3 = Measure::create(array("measure_type_id" => "2", "name" => "calcium", "unit" => ""));
$measure4 = Measure::create(array("measure_type_id" => "2", "name" => "SGOT", "unit" => ""));
$measure5 = Measure::create(array("measure_type_id" => "2", "name" => "Indirect COOMBS test", "unit" => ""));
$measure6 = Measure::create(array("measure_type_id" => "2", "name" => "Direct COOMBS test", "unit" => ""));
$measure7 = Measure::create(array("measure_type_id" => "2", "name" => "Du test", "unit" => ""));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "No mps seen", "interpretation" => "Negative"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "++", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+++", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Negative"));
$measures = array(array("measure_type_id" => "1", "name" => "URIC ACID", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "CSF for biochemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "PSA", "unit" => ""), array("measure_type_id" => "1", "name" => "Total", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Alkaline Phosphate", "unit" => "u/l"), array("measure_type_id" => "1", "name" => "Direct", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Total Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "LFTS", "unit" => "NULL"), array("measure_type_id" => "1", "name" => "Chloride", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Potassium", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Sodium", "unit" => "mmol/l"), array("measure_type_id" => "4", "name" => "Electrolytes", "unit" => ""), array("measure_type_id" => "1", "name" => "Creatinine", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Urea", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "RFTS", "unit" => ""), array("measure_type_id" => "4", "name" => "TFT", "unit" => ""));
foreach ($measures as $measure) {
Measure::create($measure);
}
$measureGXM = Measure::create(array("measure_type_id" => "4", "name" => "GXM", "unit" => ""));
$measureBG = Measure::create(array("measure_type_id" => "2", "name" => "Blood Grouping", "unit" => ""));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB+"));
$measureHB = Measure::create(array("measure_type_id" => Measure::NUMERIC, "name" => "HB", "unit" => "g/dL"));
$measuresUrinalysisData = array(array("measure_type_id" => "4", "name" => "Urine microscopy", "unit" => ""), array("measure_type_id" => "4", "name" => "Pus cells", "unit" => ""), array("measure_type_id" => "4", "name" => "S. haematobium", "unit" => ""), array("measure_type_id" => "4", "name" => "T. vaginalis", "unit" => ""), array("measure_type_id" => "4", "name" => "Yeast cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Red blood cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Bacteria", "unit" => ""), array("measure_type_id" => "4", "name" => "Spermatozoa", "unit" => ""), array("measure_type_id" => "4", "name" => "Epithelial cells", "unit" => ""), array("measure_type_id" => "4", "name" => "ph", "unit" => ""), array("measure_type_id" => "4", "name" => "Urine chemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "Glucose", "unit" => ""), array("measure_type_id" => "4", "name" => "Ketones", "unit" => ""), array("measure_type_id" => "4", "name" => "Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "Blood", "unit" => ""), array("measure_type_id" => "4", "name" => "Bilirubin", "unit" => ""), array("measure_type_id" => "4", "name" => "Urobilinogen Phenlpyruvic acid", "unit" => ""), array("measure_type_id" => "4", "name" => "pH", "unit" => ""));
foreach ($measuresUrinalysisData as $measureU) {
$measuresUrinalysis[] = Measure::create($measureU);
}
$measuresWBCData = array(array("measure_type_id" => Measure::NUMERIC, "name" => "WBC", "unit" => "x10³/µL"), array("measure_type_id" => Measure::NUMERIC, "name" => "Lym", "unit" => "L"), array("measure_type_id" => Measure::NUMERIC, "name" => "Mon", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Neu", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Eos", "unit" => ""), array("measure_type_id" => Measure::NUMERIC, "name" => "Baso", "unit" => ""));
foreach ($measuresWBCData as $value) {
$measuresWBC[] = Measure::create($value);
}
$measureRangesWBC = array(array("measure_id" => $measuresWBC[0]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 4, "range_upper" => 11), array("measure_id" => $measuresWBC[1]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 1.5, "range_upper" => 4), array("measure_id" => $measuresWBC[2]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0.1, "range_upper" => 9), array("measure_id" => $measuresWBC[3]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 2.5, "range_upper" => 7), array("measure_id" => $measuresWBC[4]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 6), array("measure_id" => $measuresWBC[5]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 2));
foreach ($measureRangesWBC as $value) {
MeasureRange::create($value);
}
$this->command->info('measures seeded');
/* Test Types table */
$testTypeBS = TestType::create(array("name" => "BS for mps", "test_category_id" => $test_categories->id, "orderable_test" => 1));
$testTypeStoolCS = TestType::create(array("name" => "Stool for C/S", "test_category_id" => $lab_section_microbiology->id));
$testTypeGXM = TestType::create(array("name" => "GXM", "test_category_id" => $test_categories->id));
$testTypeHB = TestType::create(array("name" => "HB", "test_category_id" => $test_categories->id, "orderable_test" => 1));
$testTypeUrinalysis = TestType::create(array("name" => "Urinalysis", "test_category_id" => $test_categories->id));
$testTypeWBC = TestType::create(array("name" => "WBC", "test_category_id" => $test_categories->id));
$this->command->info('test_types seeded');
/* TestType Measure table */
TestTypeMeasure::create(array("test_type_id" => $testTypeBS->id, "measure_id" => $measureBSforMPS->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureGXM->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureBG->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeHB->id, "measure_id" => $measureHB->id));
foreach ($measuresUrinalysis as $value) {
TestTypeMeasure::create(array("test_type_id" => $testTypeUrinalysis->id, "measure_id" => $value->id));
}
foreach ($measuresWBC as $value) {
TestTypeMeasure::create(array("test_type_id" => $testTypeWBC->id, "measure_id" => $value->id));
//.........这里部分代码省略.........
示例3: saveReceiptToTable
private function saveReceiptToTable($data, $customer_id)
{
$data['receipt_number'] = Receipt::current();
// We generate Receipt Number on fly
$receiptID = Receipt::create(array('customer_id' => $customer_id, 'user_id' => Auth::user()->id, 'receipt_worth' => $data['totalamount'], 'receipt_subtotalamount' => $data['subtotalamount'], 'vat' => $data['vat'], 'vat_worth' => $data['vat_price'], 'amount_tendered' => $data['amount_tendered'], 'change' => $data['change']));
//We set the receipt inserted ID
$this->receiptID = $receiptID->id;
//We set the receipt created_at datetime
$this->receipt_created_at = $receiptID->created_at;
//Save the current Sale activity
$this->saveActivity($data['totalamount'], $customer_id);
}