TransactionHeads
Returns a list of transaction headers for sales transactions.
テーブル固有の情報
SELECT
connector は Smaregi API を使用してWHERE 句条件を処理します。すべてのカラムは=、!=、>、<、>=、<= 演算子によるサーバー側フィルタリングをサポートし、文字列型のカラムはLIKE もサポートします。IN 演算子、およびdate/datetime 型のカラムに対するLIKE 演算子は、クライアント側で処理されます。
Note:リクエストには、次のフィルタ条件のうち1 つ以上を指定する必要があります。デフォルトのフィルタ条件は、過去30 日間のUpdDateTime に設定されています。
- 取引ID [TransactionHeadId]:ID 指定、From-To(From-To は100,000 件以内で指定可能)。
- 取引日時 [TransactionDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
- 端末取引日時 [TerminalTranDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
- 調整日時 [AdjustmentDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
- 集計日時 [SumDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
- 取消日時 [CancelDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
- 更新日時 [UpdDateTime]:From-To(期間は1 ヶ月ではなく31 日間)。
例えば、次のクエリはサーバー側で処理されます:
SELECT * FROM TransactionHeads WHERE TransactionHeadId >= 1 AND TransactionHeadId <= 100000
SELECT * FROM TransactionHeads WHERE TransactionDateTime >= '2021/03/01 00:00:00' AND TransactionDateTime <= '2021/03/31 00:00:00'
SELECT * FROM TransactionHeads WHERE TerminalTranDateTime >= '2021/03/01 00:00:00' AND TerminalTranDateTime <= '2021/03/31 00:00:00'
SELECT * FROM TransactionHeads WHERE SumDateTime >= '2021/03/01 00:00:00' AND SumDateTime <= '2021/03/31 00:00:00'
SELECT * FROM TransactionHeads WHERE UpdDateTime >= '2021/03/01 00:00:00' AND UpdDateTime <= '2021/03/31 00:00:00'
INSERT
TransactionHeads を追加するには、SumDivision、SumDateTime、StoreId、TerminalId、TerminalTranId、CancelDivision、TransactionDateTime、TerminalTranDateTime、TransactionHeadDivision、Subtotal、Total およびDetailAggregate フィールドを指定します。
一時テーブルを使用する場合:
INSERT INTO TransactionDetails#TEMP (TransactionDetailId, ParentTransactionDetailId, TransactionDetailDivision, SalesPrice, Quantity) VALUES (1, 1, 2, 400, 4)
INSERT INTO TransactionHeads (SumDivision, SumDateTime, StoreId, TerminalId, TerminalTranId, CancelDivision, TransactionDateTime, TerminalTranDateTime, TransactionHeadDivision, Subtotal, Total, DetailAggregate) VALUES (2, '2019/08/06 00:00:00', 1, 23, 6, 0, '2019/08/21', '2019-08-11', '1',-1600,-1600, 'TransactionDetails#TEMP')
集計を使用する場合:
INSERT INTO TransactionHeads (SumDivision, SumDateTime, StoreId, TerminalId, TerminalTranId, CancelDivision, TransactionDateTime, TerminalTranDateTime, TransactionHeadDivision, Subtotal, Total, DetailAggregate) VALUES (2, '2019/08/06 00:00:00', 1, 23, 6, 0, '2019/08/21', '2019-08-14', '1', 159, 159, ' {
"table_name": "TransactionDetail",
"rows": [
{
"parentTransactionDetailId": "1",
"transactionDetailDivision": "1",
"salesPrice": "159",
"quantity": "1"
}
]
}
')
Note: 同じキーを持つレコードが既に存在する場合、挿入は失敗し、ドライバーは影響を受けた行数として0 を返します。
UPSERT
このテーブルでは、UPSERT はサポートされていません。
UPDATE
このテーブルでは、UPDATE はサポートされていません。
DELETE
このテーブルでは、DELETE はサポートされていません。
Columns
| Name | Type | ReadOnly | References | Description |
| TransactionHeadId | Long | True | ||
| TransactionDateTime | Datetime | True | ||
| TransactionHeadDivision | String | False | ||
| CancelDivision | Integer | False | ||
| UnitNonDiscountsubtotal | Decimal | True | ||
| UnitDiscountsubtotal | Decimal | True | ||
| Subtotal | Decimal | False | ||
| SubtotalDiscountPrice | Decimal | False | ||
| SubtotalDiscountRate | Decimal | False | ||
| SubtotalDiscountDivision | Integer | True | ||
| PointDiscount | Decimal | False | ||
| Total | Decimal | False | ||
| TaxExclude | Decimal | False | ||
| TaxInclude | Decimal | False | ||
| RoundingDivision | String | True | ||
| RoundingPrice | Decimal | True | ||
| CashTotal | Decimal | True | ||
| CreditTotal | Decimal | True | ||
| Deposit | Decimal | False | ||
| DepositCash | Decimal | False | ||
| DepositCredit | Decimal | False | ||
| Charge | Decimal | False | ||
| ChangeDifference | Decimal | True | ||
| Amount | Integer | True | ||
| ReturnAmount | Integer | True | ||
| CostTotal | Decimal | True | ||
| SalesHeadDivision | Integer | True | ||
| InTaxSalesTotal | Decimal | True | ||
| OutTaxSalesTotal | Decimal | True | ||
| NonTaxSalesTotal | Decimal | True | ||
| NonSalesTargetTotal | Decimal | True | ||
| NonSalesTargetOutTaxTotal | Decimal | True | ||
| NonSalesTargetInTaxTotal | Decimal | True | ||
| NonSalesTargetTaxFreeTotal | Decimal | True | ||
| NonSalesTargetCostTotal | Decimal | True | ||
| NonSalesTargetAmount | Integer | True | ||
| NonSalesTargetReturnAmount | Integer | True | ||
| NewPoint | Decimal | False | ||
| SpendPoint | Decimal | False | ||
| Point | Decimal | False | ||
| TotalPoint | Decimal | False | ||
| CurrentMile | Decimal | False | ||
| EarnMile | Decimal | False | ||
| TotalMile | Decimal | False | ||
| AdjustmentMile | Decimal | False | ||
| AdjustmentMileDivision | Integer | False | ||
| AdjustmentMileValue | Integer | False | ||
| StoreId [KEY] | Integer | False | ||
| StoreCode | String | True | ||
| TerminalId [KEY] | Integer | False | ||
| CustomerId | Long | False | ||
| CustomerCode | String | True | ||
| TerminalTranId [KEY] | String | False | ||
| TerminalTranDateTime [KEY] | Datetime | False | ||
| SumDivision | Integer | False | ||
| AdjustmentDateTime | Datetime | True | ||
| SumDateTime | Datetime | False | ||
| CustomerRank | String | False | ||
| CustomerGroupId | Integer | False | ||
| CustomerGroupId2 | Integer | False | ||
| CustomerGroupId3 | Integer | False | ||
| CustomerGroupId4 | Integer | False | ||
| CustomerGroupId5 | Integer | False | ||
| StaffId | Integer | False | ||
| StaffName | String | True | ||
| StaffCode | String | True | ||
| PaymentCount | String | True | ||
| SlipNumber | String | True | ||
| CancelSlipNumber | String | True | ||
| AuthNumber | String | True | ||
| AuthDate | String | True | ||
| CardCompany | String | True | ||
| Memo | String | False | ||
| ReceiptMemo | String | False | ||
| PaymentMethodId1 | Integer | False | ||
| PaymentMethodName1 | String | True | ||
| DepositOthers1 | Decimal | False | ||
| PaymentMethodId2 | Integer | False | ||
| PaymentMethodName2 | String | True | ||
| DepositOthers2 | Decimal | False | ||
| PaymentMethodId3 | Integer | False | ||
| PaymentMethodName3 | String | True | ||
| DepositOthers3 | Decimal | False | ||
| Carriage | Decimal | False | ||
| Commission | Decimal | False | ||
| GuestNumbers | Integer | False | ||
| TaxFreeSalesDivision | Integer | False | ||
| NetTaxFreeGeneralTaxInclude | Decimal | False | ||
| NetTaxFreeGeneralTaxExclude | Decimal | False | ||
| NetTaxFreeConsumableTaxInclude | Decimal | False | ||
| NetTaxFreeConsumableTaxExclude | Decimal | False | ||
| Tags | String | False | ||
| PointGivingDivision | Integer | False | ||
| PointGivingUnitPrice | Integer | False | ||
| PointGivingUnit | Decimal | False | ||
| PointSpendDivision | Integer | False | ||
| MileageDivision | Integer | False | ||
| MileageLabel | String | False | ||
| CustomerPinCode | String | False | ||
| DisposeDivision | Integer | False | ||
| DisposeServerTransactionHeadId | Long | False | ||
| CancelDateTime | Datetime | True | ||
| SellDivision | Integer | False | ||
| TaxRate | Decimal | False | ||
| TaxRounding | Integer | False | ||
| DiscountRoundingDivision | Integer | True | ||
| TransactionUuid | String | False | ||
| GiftReceiptValidDays | Integer | False | ||
| ReceiptIssueNumberOfTimes | Integer | True | ||
| PickUpDate | Date | False | ||
| PartPayment | Decimal | False | ||
| PartPaymentClass | Integer | True | ||
| LayawayServerTransactionHeadId | Long | False | ||
| DisabledEdit | Integer | False | ||
| UpdDateTime | Datetime | True | ||
| PickupTransactionHeadId | Long | True | ||
| DetailAggregate | String | False |
A JSON aggregate of details associated with the transaction head. | |
| CouponDiscount | Decimal | False |
The total discount amount of each coupon used in the transaction |